3.2 KiB
ShardOS
ShardOS is a simple operating system developed as a learning project. It includes a basic bootloader and kernel written in assembly and C.
Screenshot
Table of Contents
Introduction
ShardOS is a minimal operating system project designed to understand the fundamentals of OS development. It consists of a bootloader and a basic kernel that prints a "Hello World" message to the screen. Alternatively, it can run a standalone ASM kernel that prints "Hello, ShardOS!".
Features
- Basic bootloader written in assembly
- Simple kernel written in C
- Option to run a standalone bootloader with an integrated ASM kernel
- "Hello World" message display
Requirements
To build and run ShardOS, you need the following tools installed on your system:
- NASM (Netwide Assembler)
- GCC (GNU Compiler Collection) with MinGW for cross-compilation
- QEMU (Quick Emulator) for testing
Installation
Windows
-
Install Chocolatey: If you don't have Chocolatey installed, open PowerShell as Administrator and run:
Set-ExecutionPolicy Bypass -Scope Process -Force; ` [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; ` iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) -
Install required packages:
choco install nasm mingw qemu
Linux
- Install required packages (Debian-based systems):
sudo apt update sudo apt install nasm gcc qemu
Building and Running
Bootloader with C Kernel
-
Clone the repository:
git clone https://github.com/apfelteesaft/Shard.git cd Shard -
Assemble the bootloader:
nasm -f elf32 boot.asm -o boot.o -
Compile the kernel:
gcc -m32 -ffreestanding -c kernel.c -o kernel.o -
Link the object files:
ld -m i386pe -T link.ld -o ShardOS.bin boot.o kernel.o -
Create a bootable disk image:
fsutil file createnew boot.img 1474560 copy /b boot.bin+boot.img boot.img -
Run ShardOS using QEMU:
qemu-system-i386 -fda boot.img
Standalone ASM Kernel
-
Assemble the standalone bootloader:
nasm -f bin standalone.asm -o standalone.bin -
Create a bootable disk image:
fsutil file createnew boot.img 1474560 copy /b standalone.bin+boot.img boot.img -
Run ShardOS using QEMU:
qemu-system-i386 -fda boot.img
License
This project is licensed under the MIT License. See the LICENSE file for details.