How can i switch from Protected Mode to V8086 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.
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

How can i switch from Protected Mode to V8086 mode?

Post 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
?
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

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

Post by iansjack »

This is covered in Vol. 3, Chapter 20 of the Intel® 64 and IA-32 Architectures Software Developer’s Manual.
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

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

Post 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?
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

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

Post by iansjack »

NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

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

Post 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).
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
Mikumiku747
Member
Member
Posts: 64
Joined: Thu Apr 16, 2015 7:37 am

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

Post 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
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

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

Post 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.)
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

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

Post 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
Last edited by NunoLava1998 on Wed Nov 16, 2016 3:39 am, edited 2 times in total.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
mikegonta
Member
Member
Posts: 229
Joined: Thu May 19, 2011 5:13 am
Contact:

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

Post 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
Mike Gonta
look and see - many look but few see

https://mikegonta.com
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

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

Post 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?
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

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

Post 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.
Developer of tyndur - community OS of Lowlevel (German)
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

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

Post by osdever »

Why do you want to use BIOS calls in PM? If you want dirty but working BIOS-less implementation, try polling method.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

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

Post 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.
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
NunoLava1998
Member
Member
Posts: 273
Joined: Sun Oct 09, 2016 4:38 am
Libera.chat IRC: NunoLava1998

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

Post 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
Developing TRIODIUM OS. Or call it Dixium if you want. It doesn't matter.

https://github.com/NunoLava1998/DixiumOS
User avatar
osdever
Member
Member
Posts: 492
Joined: Fri Apr 03, 2015 9:41 am
Contact:

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

Post 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.
Developing U365.
Source:
only testing: http://gitlab.com/bps-projs/U365/tree/testing

OSDev newbies can copy any code from my repositories, just leave a notice that this code was written by U365 development team, not by you.
Post Reply