Heres the simple code...
mov ax, 0x7000
mov
Can't access real mode memory after pmode?
Oops, forget that last post... read this...
The code is:
mov ax, 0x7000
mov es, ax
mov bx, 0x0000
mov dword [es:bx], [code]
mov bx, 0x0004
mov dword [es:bx], [code + 4]
jmp short aftercode
code:
mov byte [gs:0xB8002], 'C' ; this ends up compiled as 8 bytes
aftercode:
;code to switch to pmode, then...
jmp 0x70000
jmp short $
; gdt, idt, etc...
when it jumps to the code (in pmode), it should print the letter C as the second character on screen... but it just triple-faults... Got any ideas?
Anon
mov ax, 0x7000
mov es, ax
mov bx, 0x0000
mov dword [es:bx], [code]
mov bx, 0x0004
mov dword [es:bx], [code + 4]
jmp short aftercode
code:
mov byte [gs:0xB8002], 'C' ; this ends up compiled as 8 bytes
aftercode:
;code to switch to pmode, then...
jmp 0x70000
jmp short $
; gdt, idt, etc...
when it jumps to the code (in pmode), it should print the letter C as the second character on screen... but it just triple-faults... Got any ideas?
Anon
RE:Oops, forget that last post... read this...
First, did you set up GDT or LDT.
Second, where does gs poit to.
Third, (if you did set up GDT or LDT and gs is valid data segment), is the code "mov byte..."
compiled correctly for the setted up descriptor(16 or 32 bit).
PS you should also put a loop after "mov byte ...",or it is probobly triple-faults after "mov ..."
Second, where does gs poit to.
Third, (if you did set up GDT or LDT and gs is valid data segment), is the code "mov byte..."
compiled correctly for the setted up descriptor(16 or 32 bit).
PS you should also put a loop after "mov byte ...",or it is probobly triple-faults after "mov ..."
RE:Oops, forget that last post... read this...
GDT, IDT are set up. First part is [BITS 16], after pmode is [BITS 32] gs is LINEAR_SEL, which has base 0. It doesn't seem that 0x70000 is the correct mem for 0x7000:0x0000.
Anon
Anon
RE:Oops, forget that last post... read this...
jmp 0x70000 should be 16 bit if there was no change of controll before it(jmp or call) after setting
the pmode bit.
the pmode bit.
RE:Oops, forget that last post... read this...
It goes to full pmode and resets the registers.
Anon
Anon
RE:FIXED IT
Huh!? Last I checked, there was no "executable" bit in a descriptor...?
Anyway, glad to hear all's fixed! Believe me, dude, those kinda tiny mistakes are the basis of OS Development, I swear! Makes it all the more interesting, though, eh?
Jeff
Anyway, glad to hear all's fixed! Believe me, dude, those kinda tiny mistakes are the basis of OS Development, I swear! Makes it all the more interesting, though, eh?
Jeff