Crusader-OS-v02 wiki

Download branch MAIN from github servers

Get newest version from git using SSH:

git clone git@github.com:Daja201/Crusader-OS-v02.git


Basic info:

Crusader OS is a hobby DIY operating system using GRUB legacy as bootloader and homemade kernel. It is written in C and assembly. It is 32-bit (atp), runs well in qemu-i386, hasn't been tested on real HW yet, and runs in ring0. With v18, VESA graphics mode also came and it works perfectly.

Some Inspiration:

Special thanks to my friend L.M. <3 for some special ideas.


How it works

BIOS → GRUB → kernel.elf


Filesystem

It uses IDE disks. Maximum file size is currently 6kB.

Offset Component Description
LBA0 Superblock Filesystem metadata: 0x5A4C534A, total block count, starting location of other zones
LBA1 Block Bitmap Bits representing blocks
LBA2 Inode Bitmap Free/full inodes
LBA3 Inode Table Every file has inode_t structure here
LBA4 Data Blocks Actual file data

Use make dd32 for recleaning drive
and make hd for seeing inside content.


Dependencies

Linux Debian:

sudo apt install make gcc-multilib binutils nasm grub-pc-bin xorriso qemu-system-i386 genisoimage


How to run it inside QEMU

You can either download iso of some precompiled version and run in virtual machine or compile it yourself. Compiling and running can be made by running these commands:

Run in debugging mode:

make d


Commands inside OS

lib - runs commands list and shows whole system info

help - welcomes you and shows basic source info

clear - clears display

cow - makes an animated cow jump through your window

cat - prints cute cat ASCII art

ld - detects and prints info about all active drives

fd - find file by tag, use fd *tag*

read - reads from file, use read *file*

ls - reads all files from root directory

wr - writes into file, use wr *file* *content*

dl - deletes file, use dl *file*

time - shows time from RealTimeClock (RTC)

format - formats the current filesystem

note - manage notes, use note c *name* *content* (create) or note d *name* (delete)

use - switch drive, use use *drive_index* or use *port* *0|1*

mem - prints free memory in KB and MB

reboot - reboots using triple fault

shutdown - prepares FS, saves bitmaps, and safely turns off computer (just stops CPU)


Also check osdev wiki cause COS is here (: