Switching to Virtual 8086 Mode
-
- Member
- Posts: 32
- Joined: Fri Jan 31, 2014 8:21 am
Switching to Virtual 8086 Mode
So far I have been displaying text using the default VGA text-mode. How would I switch to Virtual 8086 mode so I can make the video change and return back to Protected mode?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Switching to Virtual 8086 Mode
If you haven't read the processor manual, now would be a good time to do that.
- Bender
- Member
- Posts: 449
- Joined: Wed Aug 21, 2013 3:53 am
- Libera.chat IRC: bender|
- Location: Asia, Singapore
Re: Switching to Virtual 8086 Mode
Has been discussed n number of times (where n > 50). Also, virtual 8086 isn't supported in Long Mode, and I doubt if Intel bothers to improve it. V8086 is used mainly for running 16-bit programs, It is preferable to use an existing 80(3)86 emulator. It's easier than using v86 as emulators don't require user mode and can run in any sort of environment. Just re quoting myself:
If you ever wish to support x64 (or get bored with v86) just grab a copy of Real-Mode Emulator or x86emu, for mode-switching I just wrote a simple program that captures arguments and switches to relevant video mode and is linked against Real Mode Emulator. Whenever I want to switch I just execute that program with arguments. IIRC both RME and x86emu don't require any sort of library unless you wan't to debug in which both will require a fairly standard printf.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
(R3X Runtime VM)(CHIP8 Interpreter OS)
Re: Switching to Virtual 8086 Mode
Well in this situation, he could in "theory" do what a lot of people suggest, which is fairly reasonable. Just while your in 32bit protected mode, set the highest video mode you want, since you probably won't ever change it anyways. I mean I don't, and even if you did.. Just program your Os to reboot and then set the new mode on next boot. Just an idea, although emulating can work. I wouldn't write your own emulator though, I attempted it, learned a lot but it was a very complex process and in the end I decided to just use V8086.Bender wrote:Has been discussed n number of times (where n > 50). Also, virtual 8086 isn't supported in Long Mode, and I doubt if Intel bothers to improve it. V8086 is used mainly for running 16-bit programs, It is preferable to use an existing 80(3)86 emulator. It's easier than using v86 as emulators don't require user mode and can run in any sort of environment. Just re quoting myself:If you ever wish to support x64 (or get bored with v86) just grab a copy of Real-Mode Emulator or x86emu, for mode-switching I just wrote a simple program that captures arguments and switches to relevant video mode and is linked against Real Mode Emulator. Whenever I want to switch I just execute that program with arguments. IIRC both RME and x86emu don't require any sort of library unless you wan't to debug in which both will require a fairly standard printf.
Good luck!
- Matt