Question

How do we shift from protected mode to real mode in Linux 2.6?

Was it helpful?

Solution

You do not.

The kernel cannot function at all in real mode, nor can bios calls be (sensibly) made, so you wouldn't be able to do anything anyway.

You might look at how DosEMU uses v86 mode to run your "real mode" code, but that's all.

OTHER TIPS

You could also take a look at FreeDOS if you really need real mode on the hardware.

The kernel switches from real mode to protected mode during the very beginning of the boot/start sequence and there is no turning back. See How Boot Loaders Work for more detailed information.

If you have some program that needs real mode, there is v86 mode. Some work is ongoing to add support for this in 64 bit mode.

The ELKS Linux port can do real mode, but its nowhere near 2.6.

We can switch from protected mode to real mode, by writing some lines of code as the part of kernel.

The main thing is after disabled the PE bit on cr0 register, we need to to load the appropriate GDT, LDT, IDT. Just follow this link for more details http://www.sudleyplace.com/pmtorm.html.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top