Skip to content

About

Experimental 64-bit x86 bare-metal kernel with an AMD SVM hypervisor. Built for one specific machine. No support.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Bare-Metal x86-64 Kernel

Experimental 64-bit x86 bare-metal kernel in C. It boots on the machine by itself, with no operating system under it.

What is in it

  • Round-robin scheduler, paging, heap, ring 3 task, SYSCALL/SYSRET
  • AMD SVM hypervisor with nested paging; can run Linux as a guest
  • SMP start-up (ACPI MADT, INIT-SIPI-SIPI)
  • ATA/PIO and NVMe drivers
  • AVX-512 co-processor routines
  • Text HUD and a small shell

See 00_Kernel_Contents.txt for every file and what each part does.

Files

00_Kernel_Contents.txt   file-by-file description
build/kernel_image.bin   prebuilt bootable image
src/make_boot.py         build script + boot loader source
src/kernel.ld            linker script
src/kernel.c             the kernel
src/cop.c                AVX-512 co-processor routines
src/font8x16.h           screen font

Build

Needs python3, gcc, as, ld.

python3 src/make_boot.py

This writes build/kernel_image.bin and a 512 MB disk/DiskImage.img.

Run in QEMU

qemu-system-x86_64 -cpu EPYC -smp 4 -m 1G -snapshot -drive file=build/kernel_image.bin,format=raw

With KVM on an AMD host, use -enable-kvm -cpu host in place of -cpu EPYC.

Hardware notes

  • Built for one specific AMD machine.
  • The hypervisor needs AMD SVM. The co-processor needs AVX-512 and turns itself off without it.
  • The NVMe write window in src/kernel.c (NVME_WR_LBA_LO, NVME_WR_LBA_HI) is set for the original disk. Change it before using nvme wr or cop wr on another machine.

Terms

  • Author: anonymous.
  • No license. Do what you want with it.
  • Provided as is. No warranty. No support.
  • src/font8x16.h is derived from the Terminus font, which has its own license.

About

Experimental 64-bit x86 bare-metal kernel with an AMD SVM hypervisor. Built for one specific machine. No support.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages