Efficient DEBUG logging system with __FILE__ and fctprintf

This commit is contained in:
2025-12-28 12:15:32 +01:00
parent ead0ed6ae1
commit 3853a1ace3
9 changed files with 55 additions and 40 deletions

View File

@@ -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++;
}
}