How do I get in and out of protected mode? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How do I get in and out of protected mode?

Is there any tutorials about how to get into protected mode. Those I have seen does'nt really explain a lot.

Hope you can help me...



Jesper


Comments

  • I haven't had the time to do change from real mode though.


    URL:http://www.tmbproductions.com

  • The code to get into it is simple.



    mov eax, cr0

    or al, 1

    mov cr0, eax



    tada, you're in protected mode, and you are probably locked up.



    While that IS the code to get you into protected mode, you need to do some setting up before you enter it, and you need to do some other stuff afterwards as well.



    But really, there is no point in getting into protected mode this way unless you are making an OS or you're just crazy like that.



    Either use DPMI or program in Windows/Linux.



    However, there is something that isn't too annoying to setup that you could use. One of it's names is UnReal mode. It is real-mode with the segment limits set to 4GB. IE you have complete access to memory while still having code act like it is in real-mode... to a degree, and you aren't in protected mode.



    Just, do a search for UnReal mode and you should come up with something. I'll post the code later if I remember and after I've messed with it again, I think there were some minor bugs in my code that I'll have to check about.


Sign In or Register to comment.