How to generally enter virtual 8086 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.
rdos
Member
Member
Posts: 3296
Joined: Wed Oct 01, 2008 1:55 pm

Re: How to generally enter virtual 8086 mode?

Post by rdos »

kzinti wrote:
rdos wrote: No, I don't. I boot with a USB floppy containing my OS and then on the command line I write "inithd /i / r 0", then I create a partition with mkpart, and copy the boot image to the root. That's pretty simple.
Both inithd and mkpart are tools...
Maybe. They are part of my command-line application. I can run it without tools too by building an application that loads at boot time from the USB disc and does the same actions without any user intervention. That's how we initiate new computers when installing our terminal software.
kzinti wrote: bootx64.efi is the bootloader... not sure why you need a second stage bootloader (load64.bin) but that's fine, it has nothing to do with UEFI.
It does have to do with UEFI. My OS image is not a linked PE executable, and so cannot be directly loaded neither by 32-bit nor by 64-bit UEFI. Rather, the OS image is built with a tool (or application) from a configuration file that writes a binary that combines a set of device-driver files, settings, application executables, preloaded files and autorun commands. The load64.bin and load32.bin files are executables that can be loaded by UEFI and that sets up an environment so the OS image can be started.
kzinti wrote: I don't know why you have this problem where you need to erase UEFI variables, I have never run into this or heard about it before now.
Typically, I won't have this problem when I reformat the disc (like in the example), only when I try to update an existing Windoows installation for multiboot. It's often easier to add my OS to GRUB, provided you know where the GRUB config file is and can change it. GRUB booting also needs a second stage loader, much for the same reason as UEFI does.

With MBR booting, there are ten or so sectors that have a similar function as the second stage loader. It will read the OS image to a fixed address and start it.
Last edited by rdos on Wed Apr 27, 2022 2:48 pm, edited 2 times in total.
rdos
Member
Member
Posts: 3296
Joined: Wed Oct 01, 2008 1:55 pm

Re: How to generally enter virtual 8086 mode?

Post by rdos »

Ethin wrote:Pretty sure the only reason your able to boot the floppy drive at all is because your doing it over USB. Get with the times and use this thing called a USB flash drive and you might find your life being a bit easier.
I meant an USB flash drive, not an USB floppy. :-)
Ethin
Member
Member
Posts: 625
Joined: Sun Jun 23, 2019 5:36 pm
Location: North Dakota, United States

Re: How to generally enter virtual 8086 mode?

Post by Ethin »

I mean, maybe a USB floppy might work, but it'd need to be UAS compatible, I think. UEFI has tape boot support but I don't think anyone even uses that; I don't even think that there's code for that in EDK II other than the standards definitions...
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: How to generally enter virtual 8086 mode?

Post by Gigasoft »

Don't remove existing boot variables. If you want to dual boot, just add another Boot#### variable containing an EFI_LOAD_OPTION structure that points to your OS.
Post Reply