Sending data (debug printing) to serial port
This commit is contained in:
1 parent
d05ddfeab4
commit
034a870ac7
6 files changed
+58
-4
No files matched your search
@@ -0,0 +1,19 @@
|
||||
#include <serial.h>
|
||||
#include <ports.h>
|
||||
|
||||
void serial_init(uint16_t port)
|
||||
{
|
||||
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