Skip to content

About

From-scratch OS wittten with custom BRC language

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Repository files navigation

Bits Runner

A from-scratch x86 OS written in BRC and assembly

         

Bits Runner is a from-scratch, fully custom x86 operating system, written in Bits Runner Code language, which has been created specifically for this project.

It's preemptive, multi tasking, with user mode and high resolution graphics. It runs on real hardware and provides native drivers for numerous devices. It's primarily a fun challenge and a learning opportunity, but a lot of the implementation details are fully applicable to the mainstream operating systems.

Bits.Runner.mov

🧵 In this readme

🧩 Features

Already working

  • Boots on real hardware both from a floppy or a hard disk
  • Paged, per process virtual memory
  • Preemptive multi-tasking
  • User mode processes and resources
  • FAT 12/16
  • PS/2 mouse & keyboard input
  • VGA/VESA support
  • Timer, PC speaker

Planned

  • FAT 32
  • Hardware acceleration for simple graphics cards (S3 Virge, Intel Extreme Graphics, etc)
  • Sound (AC97, Sound Blaster)
  • Networking
  • USB
  • CD support
  • Loadable drivers
  • ELF
  • Maybe 64 bit CPU support?

💾 How to run

Latest floppy and disk images are available from the releases page.

qemu

To run using qemu you can use the following commands:

  • From floppy image: qemu-system-i386 -drive file=fdd.img,if=floppy,format=raw
  • From hard disk image: qemu-system-i386 -drive file=hdd.img,if=ide,format=raw

To make the window stretchable, you can append -display cocoa,zoom-to-fit=on for macOS or -display gtk,zoom-to-fit=on for Linux.

Real hardware

First you need to prepare a bootable medium. You can either put fdd.img on a floppy, hdd.img on a hard disk, or either one on a USB drive with appropriately set emulation mode in your computer's BIOS settings.

On macOS or Linux use the dd command to prepare a disk. For example on macOS sudo dd if=fdd.img of=/dev/disk<NUMBER> status=progress will copy the image to a specified floppy drive.

🛠️ How to build

Building works on macOS. Support for Linux may be added at a later point.

Make sure you have nasm and BRC installed and in your run path. Execute ./make.sh, which will produce fdd.img and hdd.img, which are correspondigly FAT12 formatted floppy disk image and a hard drive image with two partitions, one FAT12 and one FAT16. ./create_images.sh will in addition convert the hdd.img into formats that can be used by different virual machines.

🔗 More info

Unique thing about OS development is that it touches almost every topic related to software (or even hardware) engineering. Every feature requires you to learn and understand many different topics such as how CPUs work (virtual memory, interrupts, registers, etc), protocols used by various devices (PS/2 mice, PCI devices, video buffers), algorithms (you need to implement everything, sorting, allocators, hash maps, etc), or even how data is stored (file systems, file formats). Basically, it's a never ending learning process. I'm trying to (a bit chaotically) record my findings, catalog information sources or just keep track of things for further use. Maybe you'll find it useful either for your own projects or just out of curiousity. All the various documents are under docs/ folder.

Notes

The HDD image uses MBiRa as the MBR boot manager.

About

From-scratch OS wittten with custom BRC language

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages