Trouble With Loading Memory in Protected Mode
Posted: Mon Sep 19, 2011 6:46 pm
Hello. After some work, I managed to get into 32-bit protected mode. I can access some memory correctly, but not all.
I would expect this to write 'A' at the top left corner. It does not. However, if I replace "[tmpvar2]" with "0", it does write 'A'. So it seems like I can get to tmpvar, but not tmpvar2. Can anyone shed some light?
Code: Select all
[bits 16]
[org 0x8000] ; stage1 loads me at 0x0000:0x8000
...
set video mode, disable interrupts, enable A20, load gdt, set cr0 LSB
jmp 0x8:pmode_start
...
pmode_start:
[bits 32]
mov al,[tmpvar]
mov ebx,[tmpvar2]
mov [0xb8000+ebx],al
mov byte [0xb8000+ebx+1],0x7
jmp hang
tmpvar db 'A'
tmpvar2 dw 0