Protected Mode:



Hi all,

I am trying to run some code to switch the processor from real mode to
protected mode. I am using an ICE to debug and have been able to trace
the execution.

I have a valid gdt and idt setup, however when I try to execute my
C-code after switching the 32-bit protected code, it looks like the CPU
is still trying to execute the instructions as 16-bit instructions.
The 16-bit execution causes some side effects which I can track, a ram
location is changed. The ICE's trace is based on an option (i.e
dissassembles in real or protected mode), so it is no help. Only the
side effect clues me into what could be going on wrong.

The BIOS initial comes up and sets a gdt but only for 16-bit
instructions, so I have to recreate the gdt I would like to use.

The code I am using is very similar to many of the example found on the
web. I just modified existing code from:
http://my.execpc.com/~geezer/os/

Any suggestion on what I can try?

Chris

.



Relevant Pages

  • Re: basic architecture question
    ... support any more - like robertwessel said. ... mode, 16 bit protected mode, 32 bit protected mode, and 64 bit ... The processor itself runs in either real mode, ... which could not switch back into real ...
    (comp.lang.asm.x86)
  • Re: DPMI raw mode switch
    ... I've just entered protected mode for the first time, ... How can I save real mode registers when ... Simulate DPMI real mode interrupt. ... (get raw mode switch address). ...
    (alt.lang.asm)
  • Re: booting from a usb device
    ... I don't know precisely when Minix switches to protected mode. ... I can recommend "Das PC Hardwarebuch", ... The real mode was the mode in which the first x86-processor ran. ... You have to switch ...
    (comp.os.minix)
  • Re: Problem switching to protected mode
    ... I am writing a small toy "OS" which I want to run in protected mode ... but initially switch back to real mode to use the BIOS for I/O, ... to switch into protected mode. ... descriptor table is wrong, or that the global descriptor table is ...
    (comp.lang.asm.x86)
  • Re: Option ROM - Real Mode - PCI BAR
    ... you switch to the protected mode and then back to the ... After the switch to the real mode your ... set up a so-called BIOS extender, a stub to intercept interrupts and ...
    (comp.lang.asm.x86)