diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | doxy.cfg | 4 | ||||
| -rw-r--r-- | driver/serial.c | 6 | ||||
| -rw-r--r-- | driver/serial.h | 25 | ||||
| -rw-r--r-- | kernel/kernel.c | 2 | ||||
| -rw-r--r-- | kernel/kernel.h | 2 | ||||
| -rw-r--r-- | lib/logger/log.c | 5 |
7 files changed, 27 insertions, 19 deletions
@@ -205,5 +205,5 @@ gitweb_readme: markdown README.md | ssh git readme miguel/fool-os set ### DOC ### -doxygen: +doxygen: clean doxygen doxy.cfg @@ -873,7 +873,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = ./xxx +EXCLUDE = xxx userspace # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -982,7 +982,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = README.md #--------------------------------------------------------------------------- # Configuration options related to source browsing diff --git a/driver/serial.c b/driver/serial.c index f402d0c..1a36bf5 100644 --- a/driver/serial.c +++ b/driver/serial.c @@ -1,9 +1,7 @@ #define FOOLOS_MODULE_NAME "serial" -// https://wiki.osdev.org/Serial_Ports +#include "serial.h" #define PORT 0x3f8 /* COM1 */ - -#include "lib/logger/log.h" void serial_init() { @@ -15,7 +13,7 @@ void serial_init() { x86_outb(PORT + 2, 0xC7); // Enable FIFO, clear them, with 14-byte threshold x86_outb(PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set - log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"COM 1 - initialized"); +// log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"COM 1 - initialized"); } int serial_received() { diff --git a/driver/serial.h b/driver/serial.h index 2f287e6..2e10af8 100644 --- a/driver/serial.h +++ b/driver/serial.h @@ -1,11 +1,18 @@ -void serial_init() +/** + * @file + * Serial Port Driver for COM1 + * + * https://wiki.osdev.org/Serial_Ports + * + * Call serial_init() once before reading and writing with serial_read() + * and serial_write(). Note that reading and writing might block. + */ -char serial_read() { -int is_transmit_empty() { - return x86_inb(PORT + 5) & 0x20; -} +/** Initialize COM1 **/ +void serial_init(); + +/** read one byte from COM1 (blocking) **/ +char serial_read(); -void serial_write(char a) { - while (is_transmit_empty() == 0); - x86_outb(PORT,a); -} +/** write one byte from COM1 (blocking) **/ +void serial_write(char a); diff --git a/kernel/kernel.c b/kernel/kernel.c index e52c490..03862a9 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -43,7 +43,7 @@ void kernel_main(uint32_t eax,uint32_t ebx) keyboard_init(sstdin); // MOUSE DRIVER - mouse_init(sstdin); + //mouse_init(sstdin); // GDT gdt_setup(); diff --git a/kernel/kernel.h b/kernel/kernel.h index 7dcb4e8..1880045 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -22,7 +22,7 @@ #define FOOLSOS_SHOW_VESAMODES #define MEM_PRINT_MEMORYMAP #define LOG_BUF_SIZE 4069 -#define LOG_SYSCALLS +//#define LOG_SYSCALLS #define BIN_INIT "/bin/init" diff --git a/lib/logger/log.c b/lib/logger/log.c index 3b175c0..d76174b 100644 --- a/lib/logger/log.c +++ b/lib/logger/log.c @@ -12,10 +12,13 @@ static void log_string(char *str) { + if(get_max_fd()>=2) syscall_write(2,str,strlen(str)); + while(*str!=0) { serial_write(*str++); } + } void log(char *module_name, int log_level, char *format_string, ...) @@ -49,7 +52,7 @@ void log(char *module_name, int log_level, char *format_string, ...) void panic(char *module_name, char *message) { char buf_log[256]; - tfp_sprintf(buf_log,"\033[41;37m\n !! KERNEL PANIC !! %s: %s\n\n",module_name,message); + tfp_sprintf(buf_log,"\033[41;37m\n !! KERNEL PANIC !! %s: %s\n\n\033[37;40m",module_name,message); //PANIC DIRECTLY TO STDOUT// syscall_write(1,buf_log,strlen(buf_log)); |
