View Single Post
  #9   (View Single Post)  
Old 12th April 2018
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,984
Default

Quote:
Originally Posted by egency View Post
I noticed the two bootloaders in the EFI partition, but nothing on the main partition....Is this because the loader for normal MBR boot is written in the PBR of the main partition? Also incidentally it occurs to me that I'm assuming there is boot code in the MBR /and/ the PBR, is this actually correct?
Yes. On an x86, MBR booting platform:
  1. The BIOS loads and executes the MBR boot program from the MBR sector (LBA 0)
  2. The MBR program loads the PBR boot block from the first sector of the flagged/active partition defined in the MBR partition table.
  3. The MBR program executes the PBR program.
In OpenBSD, thie PBR program is the first stage bootloader, biosboot(8), This first stage is installed into the PBR block via the installboot(8) program, which also links the location of the second stage bootloader boot(8) from the address where it is stored in an FFS filesystem. This second stage program is the one that produces OpenBSD's boot> prompt, and which can accept interactive commands such as kernel selection.
Quote:
Further, does this then mean that the MBR boot code is agnostic of whether the machine is 32bit or 64bit or am I still missing something in this regard?
To my understanding, on OpenBSD, both the i386 and amd64 architectures share the same 32-bit biosboot() and boot() programs.

As I noted above, the i386 install media disk images (*.fs) do not include EFI boot blocks, they are MBR-boot only. My conjecture is that there are no EFI-booting machines which are 32-bit only, so this sort of dual-boot facility is not required.
Quote:
...I'm guessing one writes the MBR bootloader into the MBR and copies the EFI loaders to the EFI partition (I remember something about a "mbec" folder containing these, but I'll have to check to make sure). Is this high level overview reasonable?
I can tell you step-by-step how to install an OpenBSD system onto USB-attached storage with these capabilities. But I have no NetBSD experience, and cannot provide NetBSD-equivalent provisioning commands.
Quote:
I suspect one could pick either MBR or EFI to install during the installation process and then set up the other as a post install step if sysinst cannot do both during the install process which may simplify the process.
On OpenBSD, the amd64 install script will provision a zeroed drive with GPT partitioning if an EFI frame buffer efifb(4) is discovered, otherwise it will provision an MBR. Therefore, the admin configuring an MBR with an EFI boot partition will need to manually provision these prior to running a standard installation.
Reply With Quote