Questions about OS [NEWBIE]
Posted: Wed Apr 13, 2005 11:00 pm
Hi,
I'm new to OS-development and I finally write my own PMODE OS. It's very basic with some 80*25 video functions.
I got some questions about the A20 gate:
My question is why does the A20 gate is ORed. I don't get the point why you need to OR to get the A20 bit.
Thanks, Peter
I'm new to OS-development and I finally write my own PMODE OS. It's very basic with some 80*25 video functions.
I got some questions about the A20 gate:
Code: Select all
enable_A20:
[BITS 16]
cli ;; Interrupts uit
call a20wait
mov al, 0xAD ;; Disable keyboard
out 0x64, al
call a20wait
mov al, 0xD0 ;; Read
out 0x64, al
call a20wait2
in al, 0x60 ;; lees status in al
push eax ;; Push naar de stack, bij de volgende call gaat het verloren
call a20wait
mov al,0xD1 ;; Write
out 0x64, al
call a20wait
pop eax ;; status weer van de stack halen
or al, 2 ;; Check of A20 gate aanspreekbaar is
out 0x60, al ;; nieuwe waarde in het keyboard status register plaatsen
call a20wait
mov al, 0xAE
out 0x64, al ;; enable keyboard
call a20wait
sti ;; enable interrupts
ret
a20wait:
.10: mov ecx, 65536 ;; kleine delay
.11: in al, 0x64
test al, 2 ;; testen op bit 2, kijk of de output buffer leeg is
jz .12
loop .11
jmp .10
.12: ret
a20wait2:
.10: mov ecx, 65536 ;; kleine delay
.11: in al, 0x64
test al, 1 ;; testen op bit 1, kijk of de keyboard-controller klaar is
jnz .12
loop .11
jmp .10
.12: ret
Thanks, Peter