Version 0.5.0 (DRAFT), 14 February 2011 – Return Infinity
This documentation details how to build the OS and applications from source and also how to install the OS and applications on a Virtual or Phyisical computer.
Building the OS
Building the BareMetal OS kernel only requires one program to be installed: NASM. NASM will compile the Assembly source files into a executable binary file. NASM is also used to compile any applications that are writtin in Assembly.
Download and extract the BareMetal OS source files to your harddrive. A link to the latest source files is always at the bottom of the BareMetal OS webpage.
nasm kernel64.asm -o kernel64.sys
yasm kernel64.asm -o kernel64.sys
Creating a bootable drive
Get an old IDE hard drive (or a compact flash to IDE adapter with a compact flash card).
Partition the drive in MBR format with a primary partition. The primary partition needs to be FAT16 (2GiB in size or less). Format the partition with FAT16 and set it as active.
Open the hard drive with a hex editor. By default it should load the first sector on the drive (Sector 0).
The infomation for the first partition starts at 0x1BE and the LBA start of the partition is a 32-bit value at 0x1C6. 0×80000000 is actually 0×00000008 as it needs to be converted to Big-endian. In the example screenshot the first sector of the first partition is 128 (0×80). More information on MBR can be found here: MBR layout
Using the hex editor go to the first sector of the first partition. Overwrite bytes 0x3E – 0x1FD of the boot sector with the boot sector from Pure64′s FAT16 boot sector (boot16b.bin).
Copy pure64.sys and kernel64.sys to the hard drive.
Install the hard drive into the computer making sure the hard drive is on the primary IDE channel and that the drive is set to master.
The PC should be bootable now. Pure64 will display debug information in the top right corner of the screen during bootup. If you have any issues please email us at firstname.lastname@example.org. Writing the disk image to a drive Linux uses dd Windows users can use dd for windows
BareMetal OS is open source and released under the 3-clause “New BSD License” (see docs/LICENSE.TXT in the BareMetal OS distribution). Essentially, it means you can do anything you like with the code, including basing your own project on it, providing you retain the license file and give credit to Return Infinity and the BareMetal OS developers for their work.