[BOOT] Print functions for debugging
This commit is contained in:
23
kernel/drivers/serial.c
Normal file
23
kernel/drivers/serial.c
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user