Skip to content

AGF-B/BadLands

Repository files navigation

BadLands Operating System

This is an experimental operating system I am currently working on. It is written in C++ with some C and x86-64 assembly code. The operating system targets UEFI-compatible x86-64 platforms.

Made in Switzerland 🇨🇭

Dependencies

The listed versions are the ones I am currently using, feel free to use older or newer versions if they work.

To build from source

  • cmake version 3.30+
  • x86_64-w64-mingw32-gcc and x86_64-w64-mingw32-g++ version "13-win32" for the bootloader
  • NASM for assembly code
  • gcc and g++ version 14 or 15 for the kernel
  • ld for linking
  • strip to make executables smaller

To run the QEMU simulation

  • qemu-system-x86_64 | tested on version 10.1.93 (v10.2.0-rc3)
  • parted : parted (GNU parted) 3.6
  • mkdosfs : mkfs.fat 4.2 (2021-01-31)
  • mmd, mcopy : Mtools version 4.0.48
  • OVMF UEFI Firmware. Prebuilt release binaries for x64 (CODE and VARS) can be found here.

Compilation

The build scripts must be executed from the root of the repository, they will create the output directories automatically.

To compile the entire system, it is enough to run the following command:

./build.sh

If it fails, first check the file has execute permissions and add them if necessary before trying again.

If you only desire to compile the kernel without its bootloader, pass the --kernel flag to the build script:

./build.sh --kernel

If you want to clean up the build directory, pass the --clean flag to the build script:

./build.sh --clean

Running the QEMU simulation

To run the QEMU simulation, you first need to build the system disk image. In order to do so, place yourself at the root of the repository and run the following command:

./simbuild.sh

If it fails, check again that the script has execute permissions

To run QEMU with the disk image, simply go to the simulation directory that was just created by the previous command and run:

./qemusim.sh

Again, check it has execute permissions in case of failure. If any other error appears, check that you have an adequate QEMU version. If it still does not work, do not hesitate to build QEMU from source (which is what has been done for the development of this project).

Features

  • Linear Framebuffer (UEFI - GOP)
  • Execute Disable Protection
  • Huge Pages
  • Caching Strategies
  • Runtime Interrupt Mapping
  • IO Heap
  • UEFI
    • GOP Framebuffer
    • Runtime Services Remapping
    • Power Reset
    • Time Services
  • ACPI
    • ACPI Table Memory Mapping
    • MADT Parsing
    • MCFG Parsing
    • Locating all PCIe regions
    • AML Parsing
  • APIC / IOxAPIC
    • APIC Timer
    • Logical Processor Addressing
    • IOxAPIC Interface
    • IOxAPIC Interrupt Overrides
  • PCIe
    • Generic PCIe Interfaces
    • PCIe MSI Support
    • PCIe Bus Enumeration
  • xHCI Controller
    • xHCI detection through PCIe enumeration
    • xHCI Initialization
    • xHCI Port Update Events
    • xHCI Devices Driver Events
    • Generic xHCI Device Driver
  • USB - xHCI
    • Device Initialization
    • Device Addressing
    • Device Descriptor Parsing
    • Device Configuration Descriptors Parsing
  • HID
    • HID Report Parsing
    • HID Report Events
    • Better handling of usages as per the HUT
  • Keyboard
    • PS/2 Keyboard (all scan code sets)
    • USB Keyboard
      • Basic support
      • Vendor-defined collections skipping
      • N-key rollover
      • Modifier keys
      • LEDs
    • Keyboard Multiplexer
      • Key Events
      • LEDs Dispatch
  • Generic USB Devices
    • Mass Storage
    • Hubs
    • Ethernet Modules
  • Non-USB Storage Drivers
    • ATA/IDE
    • ATA/SATA
    • NVMe
  • File Systems
    • Virtual File System
    • Non-Persistent FS (NPFS)
    • FAT12 / FAT16 / FAT32
    • NTFS
    • Ext2
  • Scheduling
    • Task Scheduling
    • Task Contexts
    • Task Blocking/Unblocking
    • Processes
  • User Space
    • Switching to ring 3
    • Syscalls
    • Executable Loading
    • Process Spawning From User Space

About

Experimental operating system, built from scratch with custom interfaces

Topics

Resources

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Packages

 
 
 

Contributors