Skip to content
Snippets Groups Projects
Commit cdc19181 authored by Jakob Kirsch's avatar Jakob Kirsch
Browse files

add serial

parent a69445f3
No related branches found
No related tags found
No related merge requests found
......@@ -72,7 +72,8 @@ cdimg: os.img
genisoimage -pad -b os.img -R -o cd.img os.img
.PHONY: strip
strip: os.img
python3 strip.py
sed '$ s/\x00*$//' < os.img > tmp.img
mv tmp.img os.img
.PHONY: runkvm
runkvm: os.img
qemu-system-x86_64 -drive file=$<,format=raw --enable-kvm
qemu-system-x86_64 -drive file=$<,format=raw --enable-kvm -serial stdio
org 0x7c00
bits 16
print: mov si, msg
mov ah, 0x0e
mov bx, 0x0007
loop: lodsb
test al, al
je init
int 0x10
jmp loop
init: mov ax, 0b0000000011100011
mov dx, 0x0000
main: call send
call recv
jmp short main
send: pusha
mov ah, 0x01
int 0x16
jnz send2
jmp short send3
send2: xor ax, ax
int 0x16
mov ah, 0x01
int 0x14
cmp al, 0x0d
je send4
send5: int 0x22
cmp al, 0x08
jne send3
mov al, 0x20
int 0x22
mov al, 0x08
int 0x22
send3: popa
ret
send4: push ax
mov al, 0x0d
int 0x14
pop ax
jmp short send5
recv: pusha
mov ah, 0x02
and ah, 0b01000000
je recv2
mov ah, 0x0e
mov bx, 0x0007
int 0x10
recv2: popa
ret
msg: db "Serial client by Jakob Kirsch", 0x0a, 0x0d, 0x00
times 512 - ($ - $$) nop
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment