Artorias is a bare-metal bootloader written in x86 assembly and C that boots a custom kernel and initializes USB 2.0 devices through an EHCI (Enhanced Host Controller Interface) driver.
This project implements a boot sequence from power-on to USB device enumeration. It consists of:
- Stage 1 (MBR): A 512-byte Master Boot Record that relocates itself and loads stage 2
- Stage 2: Extended bootloader that enables protected mode and loads the kernel
- Kernel: 32-bit kernel with PCI bus enumeration, EHCI driver, and USB device detection
The complete documentation and tutorial for the bootloader code can be found on my Medium page titled "Writing a 32-bit x86 Bootloader from Scratch".
- Two-stage bootloader with MBR self-relocation
- Real mode to 32-bit protected mode transition
- Custom Global Descriptor Table (GDT) with flat memory model
- EHCI USB 2.0 Controller: Full implementation with asynchronous transfer scheduling
- VGA text mode, serial port, and PIT timer drivers
- Support for USB keyboards, mice, tablets, and storage devices
- Extracts manufacturer, product name, and serial number strings
- NASM
- QEMU
- GNU Make
- i686-elf-gcc cross-compiler
- i686-elf-ld linker
make runmake run-mousemake run-kbdmake run-tablet- No interrupts: Polling-based I/O only
- EHCI only: No UHCI/OHCI (USB 1.x) or XHCI (USB 3.x) support
- Read-only USB: Device detection only, no data transfer implementation
- QEMU-focused: Limited testing on real hardware
- Writing a Bootloader from Scratch - Carnegie Mellon University
- Rolling Your Own Bootloader - OSDev Wiki
- EHCI - OSDev Wiki
- EHCI Specification for USB - Intel
This project is licensed under the Apache License 2.0. See the LICENSE file for details.