Help in 32bit 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
BuriedCoder

Help in 32bit mode

Post by BuriedCoder »

The intel documentation says to switch to Prot. Mode we've goto to modify the CR0 bit, which is inacessible by 16 bit code. Then how to switch to p. Mode at all?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Help in 32bit mode

Post by Pype.Clicker »

probably you should re-read the docs calmly ...
you *do* have access to CR0 register (as well as the full 32 bits eax,ebx,ecx etc.) in real mode on a 386+ ... However, there's no such register on earlier 16 bits machines.

Real mode on a 386 is *more* than backward-compatibility with 8086.

I suggest you get a look at the pmode tutorials on OSRC (see .:QuickLinkz:.)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:Help in 32bit mode

Post by Solar »

...or use a ready-made bootloader that does the switch to protected mode for you, like GRUB.

(Standard advice when people ask for the basics of RMode vs. PMode...)
Every good solution is obvious once you've found it.
BI lazy

Re:Help in 32bit mode

Post by BI lazy »

... thus spake Tim.bot.II *lol*


Honestly, the both of you two are cool timbots 8)
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Help in 32bit mode

Post by Candy »

as for the more useful answer:

you can use all 32-bit registers in real mode too.

BUT, since the 286 also knew protected mode, but no 32-bit, it had a different method, which is STILL VALID. Using SMSW and LMSW for the low 16 bits of CR0 still works, and that's still where the P bit is.

HTH & C&CW
Tim

Re:Help in 32bit mode

Post by Tim »

BI lazy wrote: Honestly, the both of you two are cool timbots 8)
ERROR! SHARING VIOLATION!
Post Reply