Skip to content

About

uh just a bootstrap ykwim

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

x64-bootstrap

A small, custom x86-64 UEFI bootstrap and freestanding kernel. It uses the Microsoft x64 C/assembly toolchain already included with Visual Studio and has no runtime library dependency.

What is implemented

  • Native BOOTX64.EFI firmware entry point
  • FAT filesystem access through UEFI protocols
  • PE32+ kernel validation, section loading, zero-fill, and base relocations
  • GOP framebuffer discovery
  • ACPI 1.0/2.0 RSDP discovery
  • Stable UEFI memory-map handoff and ExitBootServices retry
  • Private 64 KiB kernel stack
  • COM1 serial driver
  • IDT and assembly interrupt/exception stubs
  • 8259 PIC remap, PIT timer at 100 Hz, and PS/2 keyboard IRQ input
  • CPUID CPU vendor reporting
  • Legacy PCI configuration-space enumeration
  • Simple physical-page allocator initialized from conventional UEFI memory

This is a complete bootable hardware bring-up baseline, not a complete general-purpose operating system. USB/xHCI, NVMe/AHCI, networking, SMP, processes, filesystems, and userspace are later kernel subsystems.

Build

From a Developer PowerShell or ordinary PowerShell:

.\build.ps1 -Clean

The bootable EFI tree is written to build\esp. On a physical USB drive, format a GPT/UEFI-readable FAT32 partition and copy the contents of that directory to its root. Disable Secure Boot because this EFI executable is unsigned.

Run in QEMU

Install QEMU with x64 OVMF/EDK2 firmware, then:

.\run.ps1

If paths are not detected:

.\run.ps1 -Qemu C:\path\qemu-system-x86_64.exe -Firmware C:\path\OVMF_CODE.fd -VarsFirmware C:\path\OVMF_VARS.fd

The launcher attaches EDK2 as pflash and makes a writable copy of its variables template under build; the firmware code installed with current Windows QEMU packages cannot be used through the older -bios option.

The kernel prints its bring-up log to QEMU's serial console. Press keys to see PS/2 IRQ input echoed. Stop QEMU with Ctrl+C.

Hardware warning

Test in QEMU first. The current PIC/PIT/PS2 and PCI configuration mechanisms target conventional PC-compatible hardware. Modern physical systems may route interrupts through APIC, expose keyboards only through USB/xHCI, and use ECAM for PCIe; those require additional drivers before relying on them outside a VM.

About

uh just a bootstrap ykwim

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages