Added support for setting up a serial port. This first serial driver appears to only work correctly in QEMU.
This commit is contained in:
+10
@@ -9,3 +9,13 @@ outb:
|
||||
mov dx, [esp + 4] ; Move the address of the I/O port into the DX register
|
||||
out dx, al ; Send the data to the I/O port
|
||||
ret ; Return
|
||||
|
||||
global inb
|
||||
|
||||
; inb - Returns a byte from the give I/O port.
|
||||
; stack: [esp + 4] The address of the I/O port
|
||||
; [esp ] The return address
|
||||
inb:
|
||||
mov dx, [esp + 4] ; Move the address of the I/O port to the dx register.
|
||||
in al, dx ; Read a byte from the I/O port and store it in the al register
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user