Protected Mode Vs Real Mode

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Protected Mode Vs Real Mode

Post by Chandra »

It seems as if Real mode is no more obsolete to me. Last day, I wanted to include remote session in my kernel for which I needed to switch to Real mode(and not VM86 mode). For that, I needed to restore the Interrupt Vector Table as well as load real mode segments as it was in protected mode. This almost cracked my head.
I read many tutorials about switching to real mode from protected mode but none of them seems to work for me(or at most I am not getting them). Any try ends up losing the interrupt vector table (which is a must for the remote session). So I ended up with a conclusion.
Switching to real mode from protected mode is tougher than switching to protected mode from real mode. What do you guys think?
Any suggestion to switch back and forth??
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Protected Mode Vs Real Mode

Post by JamesM »

I use a real-mode emulator (x86emu) from protected mode.

Works a charm!
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Re: Protected Mode Vs Real Mode

Post by Ready4Dis »

Well, a real mode emulator is the suggested way to go, however, I had no issues going from pmode to real mode... just remember you don't have paging anymore, and real mode is limited to < 1mb... so make sure you put your real mode code under 1mb. Make sure to disable interrupts and verify you're running correctly before re-enabling interrupts. When my OS boots, it sets the first block as used, so saving the IVT is very simple in my case, and I never have to worry about someone else using it.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Protected Mode Vs Real Mode

Post by Love4Boobies »

Do you have an actual question or do you just like wasting our time? This is a "HEPL! I HAZ A PROBLEM HOW FIX.???? ??" type of question. Maybe you should explain what you're having problem with or post some code that we can help you debug...

What do we think? You didn't read the manuals.
What are the suggestions? Read the manuals.

:wink:
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Post Reply