[BOOT] Print functions for debugging

This commit is contained in:
2016-07-29 23:07:29 +02:00
parent df86be2973
commit d149d4d20a
17 changed files with 450 additions and 31 deletions

23
kernel/drivers/serial.c Normal file
View File

@@ -0,0 +1,23 @@
#include <serial.h>
#include <ports.h>
void serial_init(uint16_t port)
{
// Serial port initialization according to
// http://wiki.osdev.org/Serial_Ports
outb(port + 1, 0x00);
outb(port+ 3, 0x80);
outb(port+ 0, 0x03);
outb(port+ 1, 0x00);
outb(port+ 3, 0x03);
outb(port+ 2, 0xC7);
outb(port+ 4, 0x0B);
}
void serial_write(uint16_t port, uint8_t c)
{
while(!(inb(port+ 5)&0x20));
outb(port, c);
}