RADII is an EFI bootloader written in C, and built with CMake.
The vision for RADII involves an easily customizable bootloader, including a boot information structure based on a configuration file. This would allow for the ability to adapt the layout of the information passed to the kernel based on that specific kernel's needs.
The hope of creating this bootloader is to gain understanding of the full framework of an OS, from hardware to userland.
By no means does this bootloader aim to cover the UEFI specification in full, but it does implement enough for necessary and useful functionality.
- COMING SOON - LensorOS
NOTE: Every block of shell commands assumes a starting working directory of this repository, RADII.
Tools required for the build:
- CMake
- Windows: CMake download page
- Debian:
sudo apt install cmake
- a MinGW x86_64 cross-compiler
- Windows: TDM-GCC
- Debian:
sudo apt install binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64
NOTE: Both CMake and the cross compiler must be in the PATH
environment variable.
With the pre-requisite tools installed and added to the PATH
environment variable, we are ready to begin.
CMake is a build-system generator that takes into account the host machine,
and supports lots of different build systems (GNU make
, Ninja
, etc).
In a terminal, enter the following command to generate a GNU Make
build system that uses our cross compiler in the bld
subdirectory:
cmake -G "Unix Makefiles" -S . -B bld
To invoke the generated build system (and actually build the bootloader), use the following command:
cmake --build bld
At this point, bin/main.efi
will have been generated.
This is the executable EFI application that UEFI hardware is able to run.
CMake targets that generate boot media are listed below. Nested underneath each are it's dependencies, or programs it requires to work. If the dependencies are not found on the system at the time of CMake configuration, the targets will not be included in the generated build system.
image_dir
-- Directory structure of a UEFI-compatible boot image.image_raw
-- FAT32 UEFI-compatible boot image.dd
-- Native command on Unix- On Windows, use one of the following options:
- MinGW installer to get MSYS coreutils ext package
- Cygwin
- Windows Subsystem for Linux
- On Windows, use one of the following options:
- GNU mtools -- MS/DOS filesystem manipulation
- Home Page
- Debian distros:
sudo apt install mtools
- Pre-built binaries for Windows
-
Invoke a CMake target to run QEMU, launching the RADII bootloader upon startup:
cmake --build bld -t run_qemu
- Click the
New
button to create a new virtual machine. - In the pop-up window, give the new virtual machine a name and a file path you are comfortable with.
- Select Type of
Other
and Version ofOther/Unknown (64-bit)
. - Leave the memory size how it is; 64MB is plenty at this time.
- Select the
Do not add a virtual hard disk
option. - Click the
Create
button to create the new virtual machine. - Select the new VM in the list on the left, then click the
Settings
button. - Navigate to
System
within the list on the left.- Change Chipset to
ICH9
. - Enable Extended Feature
Enable EFI (special OSes only)
.
- Change Chipset to
- Navigate to
Storage
within the list on the left.- Right click the default controller (
IDE
), and selectRemove Controller
. - Right click the area labeled
Storage Devices
, and selectAHCI (SATA)
. - Right click the new AHCI storage controller, and select either
Optical Drive
orHard Disk
depending on whether you'd like to boot from the.iso
or.bin
, respectively. - Click
Add
in the new Virtual Media Selector window that pops up. - Browse to the
bin
subdirectory and, depending on whetherOptical Drive
orHard Disk
was selected, choose either the.iso
or the.bin
disk image file.
- Right click the default controller (
- Navigate to
Network
within the list on the left.- Disable all network adapters.
- Select
Home
in the list on the left side. ClickCreate a New Virtual Machine
on the right. - Select the
I will install the operating system later.
option. - Select a guest OS of
Other
, and a Version ofOther 64-bit
. - Give the virtual machine a name and path you are comfortable with. Keep note of the path.
- It will ask about a disk, but the disk it's asking about won't be used. Click next.
- The next screen should be an overview of the virtual machine hardware. Click
Customize Hardware...
.- Select
New CD/DVD
on the left, then clickAdvanced...
on the right. - Select
SATA
, then clickOK
. - On the right, select
Use ISO image file
, and then clickBrowse...
. - Select the
.iso
image file located in thebin
subdirectory. - Select the hard drive that we skipped configuring in the list on the left.
- Remove the hard drive using the
Remove
button near the bottom center. - Remove any and all network adapters and sound cards in the same manner.
- Click
Close
in the bottom right to close the hardware configuration window.
- Select
- Click
Finish
. - Navigate to the path specified in step #5, where the virtual machine is located.
- Open the file ending with
.vmx
in a text editor. - Add the following line of text:
firmware="efi"
. - Save the file, then close it.
- Open the file ending with
You will have to select UEFI Shell
once VMware Workstation
boots into LensorOS (even if it says something like "Unsupported").