1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-15 17:58:06 +11:00
collapseos/doc/hw/8086/pcat.txt
Virgil Dupras 7001446212 Complete overhaul of recipes
Recipes contain bits and pieces of hardware-related knowledge, but
these bits feel sparse. I've been wanting to consolidate hardware-
related documentation for a while, but always fell at odds with the
recipes organisation.

We don't have recipes anymore, just a /doc/hw section that contains
hardware-related documentation which often translate to precise
instructions to run Collapse OS on a specific machine.

With this new organisation, I hope to end up with a better, more
solid documentation.
2020-10-30 20:39:39 -04:00

56 lines
1.7 KiB
Plaintext

# PC/AT
PC-compatible machines need no introduction. They are one of the
most popular machines of all time. Collapse OS has a 8086
assembler and has boot code allowing it to run on a
PC/AT-compatible machine, using BIOS interrupts in real mode.
Collapse OS always runs in real mode.
In this recipe, we will compile Collapse OS and write it to a
USB drive that is bootable on a modern PC-compatible machine.
# Gathering parts
* A modern PC-compatible machine that can boot from a USB drive.
* A USB drive
# Build the binary
Running "make" in /arch/8086/pcat will yield:
* mbr.bin: a 512 byte binary that goes at the beginning of the
disk
* os.bin: 8086 Collapse OS binary
* disk.bin: a concatenation of the above, with "blkfs" appended
to it starting at 0x2000.
disk.bin is what goes on the USB drive.
This binary has BLK and AT-XY support, which means you have disk
I/Os and can run VE.
# Emulation
You can run the built binary in Collapse OS' 8086 emulator using
"make emul".
The 8086 emulator is barbone. If you prefer to use it on a more
realistic setting, use QEMU. The command is:
qemu-system-i386 -drive file=disk.bin,if=floppy,format=raw
# Running on a modern PC
First, copy disk.bin onto your USB drive. For example, on an
OpenBSD machine, it could look like:
doas dd if=disk.bin of=/dev/sd1c
Your USB drive is now BIOS-bootable. Boot your computer and
enter your BIOS setup to make sure that "legacy boot" (non-EFI
boot, that is, BIOS boot) is enabled. Configure your boot device
priority to ensure that the USB drive has a chance to boot.
Reboot, you have Collapse OS. Boot is of course instantaneous
(we're not used to this with modern software...).