Kernel: Fix segmenting bugs

This commit is contained in:
Nero 2021-04-20 16:27:10 +00:00
parent 39a1ed085c
commit d9affa3cae
3 changed files with 23 additions and 2 deletions

View File

@ -23,15 +23,20 @@ init: call rstseg
call rstseg call rstseg
mov dx, testdta mov dx, testdta
push ds
call norm
call setdta call setdta
pop ds
mov dx, testfcb mov dx, testfcb
call norm
call open call open
int 3
call read call read
mov ax, [cs:testdta]
mov cx, [cs:testdta+2]
int 3 int 3
hlt: hlt hlt: hlt

View File

@ -32,3 +32,15 @@ xchgdes push ds
pop ds pop ds
pop es pop es
ret ret
; normalize ptr in ds:dx
norm mov ax, ds
mov cl, 4
push dx
ror dx, cl
and dh, 0xF
add ax, dx
mov ds, ax
pop dx
and dx, 0xF
ret

View File

@ -77,6 +77,10 @@ init push ax
mov al, 8 mov al, 8
out dx, al out dx, al
; DS = interrupt table
xor ax, ax
mov ds, ax
; hook video services ; hook video services
; keep original ptr in intvec 47h for chaining ; keep original ptr in intvec 47h for chaining
mov ax, int10 mov ax, int10