Efficient DEBUG logging system with __FILE__ and fctprintf
This commit is contained in:
@@ -36,7 +36,7 @@ int serial_init()
|
||||
// Set normal operation mode
|
||||
outb(PORT + 4, 0x0F);
|
||||
|
||||
serial_kputs("\n\nkernel: serial: Serial initialization OK!\n");
|
||||
DEBUG("serial initialized");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -45,18 +45,20 @@ static int is_transmit_empty()
|
||||
return inb(PORT + 5) & 0x20;
|
||||
}
|
||||
|
||||
void write_serial(char c)
|
||||
// Serial kernel putchar
|
||||
void skputc(char c)
|
||||
{
|
||||
while (!is_transmit_empty()); // wait for free spot
|
||||
outb(PORT, c);
|
||||
}
|
||||
|
||||
void serial_kputs(const char* str)
|
||||
// Serial kernel putstring
|
||||
void skputs(const char* str)
|
||||
{
|
||||
unsigned int i=0;
|
||||
while (str[i])
|
||||
{
|
||||
write_serial(str[i]);
|
||||
skputc(str[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user