35 lines
545 B
ArmAsm
35 lines
545 B
ArmAsm
; Helpers for frame buffer which pretty much have to to be
|
|
; written in asm
|
|
|
|
global serial_control
|
|
global serial_read_buffer
|
|
|
|
serial_control:
|
|
;push ebp
|
|
;mov ebp, esp
|
|
;add esp, 0xc ; ebp + 2 local vars (32-bit kernel)
|
|
|
|
mov al, [esp+8]
|
|
mov dx, [esp+4]
|
|
out dx, al
|
|
|
|
;mov esp, ebp
|
|
;pop ebp
|
|
ret
|
|
|
|
; Read byte from serial port
|
|
serial_read_buffer:
|
|
;push ebp
|
|
;mov ebp, esp
|
|
;push ebx
|
|
|
|
xor eax, eax
|
|
mov dx, [esp + 4] ; grab the address of the targeted port
|
|
in al, dx ; read byte from the port
|
|
|
|
;mov esp, ebp
|
|
;pop ebx
|
|
;pop ebp
|
|
ret
|
|
|