1 // Intel 8250 serial port (UART).
16 static int uart
; // is there a uart?
26 // 9600 baud, 8 data bits, 1 stop bit, parity off.
27 outb(COM1
+3, 0x80); // Unlock divisor
28 outb(COM1
+0, 115200/9600);
30 outb(COM1
+3, 0x03); // Lock divisor, 8 data bits.
32 outb(COM1
+1, 0x01); // Enable receive interrupts.
34 // If status is 0xFF, no serial port.
35 if(inb(COM1
+5) == 0xFF)
39 // Acknowledge pre-existing interrupt conditions;
44 ioapicenable(IRQ_COM1
, 0);
46 // Announce that we're here.
47 for(p
="xv6...\n"; *p
; p
++)
58 for(i
= 0; i
< 128 && !(inb(COM1
+5) & 0x20); i
++)
68 if(!(inb(COM1
+5) & 0x01))
76 consoleintr(uartgetc
);