Code: Select all
/* to enable the A20 address line inorder to address more than 1MB of memory */
call empty_8042
movb $0xd1,%al
out %al,$0x64
call empty_8042
movb $0xdf,%al
out %al,$0x60
call empty_8042
jmp A20ENABLED
/* this function repeatedly checks the keyboard controller 8042 */
empty_8042:
.word 0x00eb,0x00eb
in $0x64,%al
test $0x2,%al
jnz empty_8042
ret
now this is my GDT
Code: Select all
gdtstructure:
.2byte 0x27 /* limit of the gdt */
.4byte gdtstart /* base address of gdt */
gdtstart:
/* null descriptor to ensure that no segment registers get loaded with value 0 */
/* causes "GENERAL PROTECTION FAULT" if we try to access this gdt entry */
.4byte 0
.4byte 0
/* code segment for our bootloader */
.2byte 0xFFFF, 0
.byte 0, 0x9A, 0x4F, 0
/* data segment for our bootloader */
.2byte 0xFFFF, 0
.byte 0, 0x92, 0x4F, 0
/* code segment for our kernel */
.2byte 0xFFFF, 0000
.byte 10, 0x9A, 0x4F, 0
/* data segment for our kernel */
.2byte 0xFFFF, 0
.byte 10, 0x92, 0x4F, 0
Code: Select all
mov $0x20,%eax
mov %ds,%ebx
mov %eax,%ds
movb $'A',0x8000
movb 0x8000,%al
movb %al,0xb8000
movb $0x1e,0xb8001
mov %ebx,%ds
is the problem because A20 was not enabled properly.
should i need to do anything more