The "ax" code I was using for the A20 gate stuff was obviously wrong; but

both Bochs and my real computer seem to know it anyway, so it's untested.
The real mode segment descriptors now start at 0x10000, because the code
is loaded there. Added an additional stack segment descriptor to be able
to use a stack below 0x10000.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7232 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-04-18 22:07:41 +00:00
parent e09429df45
commit 1e56fb4aeb

View File

@ -85,12 +85,12 @@ _protected_code_segment:
*/
enable_a20:
movw $0x2402, %ax // first, query the a20 status
movw $2402, %ax // first, query the a20 status
int $0x15
jc _a20_old_method // if that fails, use the old AT method
test $0x1, %al
jnz _a20_done // Is a20 gate already enabled?
movw $0x2401, %ax
movw $2401, %ax
int $0x15
jnc _a20_done
_a20_old_method:
@ -128,14 +128,17 @@ gdt:
.long 0x00cf9200 // type: 32 bit, data read/write, privilege 0
// real mode 16 bit code segment
.long 0x0000ffff // base: 0, limit: 4 GB
.long 0x00009e00
.long 0x0000ffff // base: 0x10000, limit: 64 kB
.long 0x00009e01
// real mode 16 bit data and stack segment
.long 0x0000ffff // base: 0, limit: 4 GB
.long 0x0000ffff // base: 0x10000, limit: 64 kB
.long 0x00009201
// real mode 16 bit stack segment
.long 0x0000ffff // base: 0, limit: 64 kB
.long 0x00009200
gdt_descriptor:
.word 0x27 // 5 entries in the GDT (8 bytes each)
.word 0x2f // 6 entries in the GDT (8 bytes each)
.long gdt
.org 1024