Skip to content

SumeyyaAktas/Artorias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

204 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artorias

EHCI (USB 2.0) Controller

Assembly License

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.

Table of Contents

Overview

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

Documentation

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".

Features

  • 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

Requirements

  • NASM
  • QEMU
  • GNU Make
  • i686-elf-gcc cross-compiler
  • i686-elf-ld linker

Building

Basic Boot (USB Storage Device)

make run

Test with USB Mouse

make run-mouse

Test with USB Keyboard

make run-kbd

Test with USB Tablet

make run-tablet

Limitations

  • 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

Resources

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

About

Custom 32-bit x86 Bootloader with EHCI (USB 2.0) Controller

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors