Page 1 of 2

How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 2:47 am
by NunoLava1998
I am making a getkey(); function. For this, i need interrupts, which is not available in Protected mode. I am looking to switch to the only and most real-mode and protected-mode compatible mode: V8086. I am currently in C and making my own Meaty Skeleton.

How can i do this?
Can i use

Code: Select all

__asm__ volatile
?

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:04 am
by iansjack
This is covered in Vol. 3, Chapter 20 of the Intel® 64 and IA-32 Architectures Software Developer’s Manual.

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:10 am
by NunoLava1998
iansjack wrote:This is covered in Vol. 3, Chapter 20 of the Intel® 64 and IA-32 Architectures Software Developer’s Manual.
http://www.intel.com/content/dam/www/pu ... 325462.pdf

It's unavailable. Are there any more sources?

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:16 am
by iansjack

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:17 am
by NunoLava1998
iansjack wrote:http://www.intel.co.uk/content/www/uk/en/processors/architectures-software-developer-manuals.html
still not available


Does anyone have a copy of the intel manuals or something? (nope unless you pay or something, nvm then).

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:28 am
by Mikumiku747
Try this, or worst comes to worst, search "Intel® 64 and IA-32 Architectures Software Developer Manuals" and you should be able to find the correct page. It seems that some of their documents have moved, some of my bookmarks are broken, but that could just be me.

- Mikumiku747

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:28 am
by iansjack
Perhaps they are updating them.

Be patient. (But don't imagine it is going to solve your problem. That doesn't matter - you should have a copy of the manual anyway, else you are just working in the dark.)

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:30 am
by NunoLava1998
https://pdos.csail.mit.edu/6.828/2008/r ... A32-3B.pdf

uh...
this doesn't seem to have anything to do with V8086 from protected mode

(20.x)


EDIT: nvm i just read a 2008 manual, found it

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 3:33 am
by mikegonta
NunoLava1998 wrote:
iansjack wrote:This is covered in Vol. 3, Chapter 20 of the Intel® 64 and IA-32 Architectures Software Developer’s Manual.
http://www.intel.com/content/dam/www/pu ... 325462.pdf
It's unavailable. Are there any more sources?
https://www.google.com/search?q=%2264-i ... 462.pdf%22
https://www.google.com/search?q=%2264-i ... ual.pdf%22

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 4:28 am
by NunoLava1998
anyone can show the section number (i mean something like 10.4.2.4 or 10.4.2) where there is how to switch from prot mode to v8086 mode?

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 4:46 am
by Kevin
NunoLava1998 wrote:I am making a getkey(); function. For this, i need interrupts, which is not available in Protected mode.
I'm not sure what you're trying to do, but yes, interrupts are available in Protected Mode. You can't generally call BIOS interrupts in PM, but I hope you're trying to write a keyboard driver rather than calling the BIOS.

In any case, VM86 is a lot more complicated than writing a proper keyboard driver.

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 4:47 am
by osdever
Why do you want to use BIOS calls in PM? If you want dirty but working BIOS-less implementation, try polling method.

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 4:50 am
by NunoLava1998
catnikita255 wrote:Why do you want to use BIOS calls in PM? If you want dirty but working BIOS-less implementation, try polling method.
Polling never worked for me.

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 4:50 am
by NunoLava1998
Kevin wrote:
NunoLava1998 wrote:I am making a getkey(); function. For this, i need interrupts, which is not available in Protected mode.
I'm not sure what you're trying to do, but yes, interrupts are available in Protected Mode. You can't generally call BIOS interrupts in PM, but I hope you're trying to write a keyboard driver rather than calling the BIOS.

In any case, VM86 is a lot more complicated than writing a proper keyboard driver.
oh, it is? okay then

Re: How can i switch from Protected Mode to V8086 mode?

Posted: Wed Nov 16, 2016 1:20 pm
by osdever
NunoLava1998 wrote:
catnikita255 wrote:Why do you want to use BIOS calls in PM? If you want dirty but working BIOS-less implementation, try polling method.
Polling never worked for me.
For me it worked in my worst project named OS365. But better implement the interrupts.