polio: add paracomm i05 recv and i06 send

This commit is contained in:
2025-10-01 14:46:56 +02:00
parent 6a69215c90
commit 0c0133b3c1
3 changed files with 121 additions and 40 deletions

58
polio.s
View File

@@ -5,6 +5,10 @@
.section .init
.global _start
_start:
cli
mov ax, 0x2000 # stack address
mov sp, ax # ss should already be 0
sti
jmp main
@@ -12,7 +16,7 @@ diskpointer = 0x1e*4
dbtbase = 0x0500
.section .text.dosdbt
.local dosdbt
.global dosdbt
dosdbt: # assumes es=0
push si
push di
@@ -103,51 +107,27 @@ formattrack:
int 0x13
ret
readfile:
mov ax, [bp+0]
mov dx, [bp+2]
call fat12_readfile
ret
sendpara:
mov ax, [bp+0]
mov dx, [bp+2]
call parasend
ret
.section .rodata.polmon_str
polmon_str: .ascii "POLMON COM"
polmon_addr = 0x1000
.section .text.main
.global main
main:
cli
mov ax, 0x2000 # stack address
mov sp, ax # ss should already be 0
sti
call dosdbt
mov ax, 0x1a00 # first sector of first fat
mov dx, 0x1c00 # first sector of root dir
call fat12_init
mov si, 0x80*4
movw [si], offset int80h
movw [si+2], 0
mov ax, offset polmon_str
mov dx, polmon_addr
call fat12_readfile
test ax, ax
jnz 0f
jmp polmon_addr
0:
mov ax, 0x0e42
mov bh, 0
int 0x10
cli
hlt
recvpara:
mov ax, [bp+0]
mov dx, [bp+2]
call pararecv
ret
.section .text.int80h
.global int80h
int80h:
push bx
push si
push di
push bp
@@ -163,7 +143,7 @@ int80h:
xor ah, ah
mov si, ax
mov bp, sp
lea bp, [bp + 18] # 12 for us, 6 for the interrupt
lea bp, [bp + 16] # 10 for us, 6 for the interrupt
call [int80h_table+si]
jmp 1f
0:
@@ -174,10 +154,8 @@ int80h:
pop bp
pop di
pop si
pop bx
iret
.section .rodata.int80h
int80h_table:
.word offset copy # 0x00
@@ -185,5 +163,7 @@ int80h_table:
.word offset writesector # 0x02
.word offset formattrack # 0x03
.word offset readfile # 0x04
.word offset recvpara # 0x05
.word offset sendpara # 0x06
int80h_entries = . - int80h_table