Skip to content

Commit 125dee4

Browse files
authored
Only enable A20 if needed (#45)
Also avoid writing bit 0. See https://www.win.tue.nl/~aeb/linux/kbd/A20.html
1 parent a95b209 commit 125dee4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/stage_1.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ _start:
2828
enable_a20:
2929
# enable A20-Line via IO-Port 92, might not work on all motherboards
3030
in al, 0x92
31+
test al, 2
32+
jnz enable_a20_after
3133
or al, 2
34+
and al, 0xFE
3235
out 0x92, al
36+
enable_a20_after:
37+
3338

3439
enter_protected_mode:
3540
# clear interrupts

0 commit comments

Comments
 (0)