On Fri, 1 Mar 2002, Ketan Mukadam wrote: >> Actually what you have written, that stuff i already know, but what >> i wanted to know is that where the real-mode is used except >> bootstrapping. Once ur OS gets booted the processor is switched in >> protected mode.[ This is true of Linux ] Now in which situations it >> returns to real-mode or is it that it never goes into real-mode >> after booting?? On Fri, Mar 01, 2002 at 10:00:54AM +0200, Zwane Mwaikambo wrote: > mmm it would be possible, but you'd have a hell of a time getting things > back to a sane state if you really go down to real mode and switch back to > pmode, essentially you'd have to reload your OS. AFAIK no OS does this. If > you wanna see a real mode transition in Linux, check out: > > linux/arch/i386/kernel/process.c:machine_real_restart() It's obvious from reading this that a considerably greater amount of state can be saved during this transition. What documentation I've seen on this seems to indicate that it is painful and slow, but not truly that far out. (I'm thinking of that "Triple Fault Club" website.) Since the contents of memory itself should not vanish, reloading the OS seems to be: (1) switch to 32-bit mode (2) reload GDT (3) reload IDT (4) reload page tables (5) turn paging back on not necessarily in that order. Of course, how this interacts with interrupts should prove to be a real nightmare, though it's not entirely clear what would go wrong with just masking interrupts throughout the entire process (if possible). Of course, this all begs the question of "Why would one bother doing this?" and "What do you really think you can do with the CPU in a crippled state like this?" Cheers, Bill -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/