Nyanix

Bootloader
Log | Files | Refs | LICENSE

commit 4ee3fb892c021da9fb299e789a5e2f10dbdad277
parent de5ef81843e0c1655b3957bf52164a937abd2014
Author: Dani Frisk <dani@silverskin.fi>
Date:   Sun,  2 Dec 2018 21:39:46 +0200

Update.

Diffstat:
src/boot_early/a20gate.s | 33+++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/src/boot_early/a20gate.s b/src/boot_early/a20gate.s @@ -13,7 +13,17 @@ %ifndef __a20_gate_h__ %define __a20_gate_h__ 1 - +a20wait: + in al, 0x64 + cmp bl, 1 + jne .a20wait2 + test al, 2 + jnz a20wait + ret + .a20wait2: + test al, 1 + jz a20wait + ret ; Check A20 line ; Returns to caller if A20 gate is cleared. @@ -41,45 +51,40 @@ check_a20gate: toggle_a20_status: cli + mov bl, 1 call a20wait mov al,0xAD out 0x64,al + mov bl, 1 call a20wait mov al,0xD0 out 0x64,al - call a20wait2 + mov bl, 2 + call a20wait in al,0x60 push eax + mov bl, 1 call a20wait mov al,0xD1 out 0x64,al + mov bl, 1 call a20wait pop eax or al,2 out 0x60,al + mov bl, 1 call a20wait mov al,0xAE out 0x64,al + mov bl, 1 call a20wait sti ret -a20wait: - in al,0x64 - test al,2 - jnz a20wait - ret - - -a20wait2: - in al,0x64 - test al,1 - jz a20wait2 - ret %endif