diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-12 23:43:22 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-04-12 23:43:22 +0000 |
commit | 09f65c50f8ce0498724e3af3c3d09a4b0b032c7b (patch) | |
tree | 73131aa821a5330019eff4e728fab25f84dab071 | |
parent | 68a2c676b5852ade4f3bf48b6f33d093278153c2 (diff) | |
download | plan9front-09f65c50f8ce0498724e3af3c3d09a4b0b032c7b.tar.xz |
9boot a20 gate
-rw-r--r-- | sys/src/boot/pc/a20.s | 67 | ||||
-rw-r--r-- | sys/src/boot/pc/l.s | 7 | ||||
-rw-r--r-- | sys/src/boot/pc/mkfile | 4 |
3 files changed, 69 insertions, 9 deletions
diff --git a/sys/src/boot/pc/a20.s b/sys/src/boot/pc/a20.s new file mode 100644 index 000000000..9c4bc7730 --- /dev/null +++ b/sys/src/boot/pc/a20.s @@ -0,0 +1,67 @@ +#include "x16.h" + +#undef ORB + +TEXT a20(SB), $0 + CALL rmode16(SB) + STI + LWI(0x2401, rAX) + BIOSCALL(0x15) + JC _biosfail + CLI + CALL16(pmode32(SB)) + RET + +_biosfail: + LWI((0x0E00|'!'), rAX) + BIOSCALL(0x10); + + CLI + CALL16(pmode32(SB)) + + CALL a20wait(SB) + MOVL $0x64, DX + MOVB $0xAD, AL + OUTB + + CALL a20wait(SB) + MOVL $0x64, DX + MOVB $0xD0, AL + OUTB + + CALL a20wait2(SB) + MOVL $0x60, DX + INB + PUSHL AX + + CALL a20wait(SB) + MOVL $0x64, DX + MOVB $0xD1, AL + OUTB + + CALL a20wait(SB) + MOVL $0x60, DX + POPL AX + ORB $2, AL + OUTB + + CALL a20wait(SB) + MOVL $0x64, DX + MOVB $0xAE, AL + OUTB + +TEXT a20wait(SB), $0 +_a20wait: + MOVL $0x64, DX + INB + TESTB $1, AL + JZ _a20wait2 + RET + +TEXT a20wait2(SB), $0 +_a20wait2: + MOVL $0x64, DX + INB + TESTB $2, AL + JNZ _a20wait + RET diff --git a/sys/src/boot/pc/l.s b/sys/src/boot/pc/l.s index 8691a210a..ecc9d9e57 100644 --- a/sys/src/boot/pc/l.s +++ b/sys/src/boot/pc/l.s @@ -111,13 +111,6 @@ _pret32: ANDL $0xFFFF, AX RET -TEXT a20(SB), $0 - CALL rmode16(SB) - STI - LWI(0x2401, rAX) - BIOSCALL(0x15) - JMP _pret32 - #ifdef PXE TEXT pxecallret(SB), $0 diff --git a/sys/src/boot/pc/mkfile b/sys/src/boot/pc/mkfile index 2d23d9481..25b1d3838 100644 --- a/sys/src/boot/pc/mkfile +++ b/sys/src/boot/pc/mkfile @@ -36,7 +36,7 @@ pbs: pbs.$O $LD -o $target -H3 -T0x0600 -l $prereq ls -l $target -9boot&: l%.$O %.$O sub.$O +9boot&: l%.$O %.$O sub.$O a20.$O $LD -o $target -H3 -T0x7c00 -l $prereq ls -l $target @@ -59,7 +59,7 @@ test.iso: 9bootiso touch tmp/baz touch tmp/386aaa mkdir tmp/386 - cp /386/9bootiso tmp/386 + cp 386/9bootiso tmp/386 cp /386/9pc tmp/386 cp /386/9pcload tmp/386 cp /386/9pcf tmp/386 |