A minimal operating system kernel with bootloader written from scratch in x86 Assembly and C.
- Multiboot-compliant bootloader written in x86 Assembly
- 32-bit protected mode kernel written in C
- Memory management system with heap allocation
- Interactive CLI shell with keyboard input
- VGA text mode display with colored output
- Interrupt system with IDT and ISR handlers
- Cooperative multitasking with task scheduling
- Read-only file system with preloaded demo files
- Built-in commands for system control and debugging
- File system commands:
ls
(list files) andcat
(display file contents) - Debug commands for memory inspection
- GRUB2 bootloader support for easy testing
- QEMU integration for development and testing
-
Cross-compiler toolchain:
i686-elf-gcc
(C compiler for i686 target)i686-elf-binutils
(Linker and other tools)
-
Assembler:
nasm
(Netwide Assembler)
-
Bootloader utilities:
grub-mkrescue
(GRUB rescue disk creator)xorriso
(ISO 9660 filesystem utility)
-
Testing (optional):
qemu-system-i386
(x86 emulator)
# Install available packages
sudo apt-get update
sudo apt-get install build-essential nasm qemu-system-x86 grub-pc-bin grub-common xorriso mtools
# Note: i686-elf-gcc must be built from source or installed separately
# Install from official repos
sudo pacman -S base-devel nasm qemu grub xorriso libisoburn mtools
# Install cross-compiler from AUR
yay -S i686-elf-gcc i686-elf-binutils
Follow the guide at: https://wiki.osdev.org/GCC_Cross-Compiler
# Check dependencies
make check-deps
# Build the OS
make
# Run in QEMU
make run
make
ormake all
- Build the complete bootable ISOmake iso
- Build the ISO file onlymake run
- Build and run the OS in QEMUmake debug
- Run with QEMU debugging enabledmake test-kernel
- Analyze the kernel binarymake clean
- Clean all build artifactsmake help
- Show all available targets
The OS includes a read-only in-memory file system with preloaded demo files:
ls
- List all files in the file systemcat <filename>
- Display the contents of a file
welcome.txt
- Introduction to MiniCore-OSsystem.txt
- System information and specificationsreadme.txt
- File system documentationhello.c
- Sample C codelicense.txt
- License information
minicore> ls
=== File System Contents ===
Name Size Type
------------------------ ------ --------
welcome.txt 387 TEXT
system.txt 245 TEXT
readme.txt 312 TEXT
hello.c 89 TEXT
license.txt 156 TEXT
Total files: 5 / 16
minicore> cat welcome.txt
=== Contents of welcome.txt ===
Welcome to MiniCore-OS!
This is a simple read-only file system.
Try 'ls' to list files and 'cat <filename>' to read them.
...
=== End of file ===
- GRUB Stage 1/2: GRUB loads our kernel from the ISO
- Multiboot Header: GRUB finds our multiboot header in
boot.asm
- Protected Mode: CPU is already in 32-bit protected mode
- Stack Setup: Assembly code sets up a 16KB stack
- Kernel Entry: Control transfers to
kernel_main()
in C
- 0x00100000 (1MB): Kernel load address
- Stack: 16KB stack space in BSS section
- VGA Buffer: 0xB8000 (text mode video memory)
The kernel includes a basic VGA text mode driver supporting:
- 80x25 character display
- 16 foreground colors
- 16 background colors
- Basic string output functions
The read-only file system implementation provides:
- In-memory storage: Files preloaded at boot time
- Fixed allocation: Maximum 16 files, 4KB each
- Directory abstraction: Flat namespace with filename lookup
- Type support: Text and binary file types
- Integration: Shell commands
ls
andcat
Architecture:
fs_t
structure holds filesystem metadatafs_file_t
entries contain file information- Static memory allocation for file data
- String-based filename matching
- Read-only permissions enforced
# Basic run
make run
# With debugging
make debug
# Manual QEMU command
qemu-system-i386 -cdrom os.iso
The generated os.iso
can be written to a USB drive or CD and booted on real hardware:
# Write to USB (replace /dev/sdX with your USB device)
sudo dd if=os.iso of=/dev/sdX bs=4M status=progress
When the OS boots successfully, you should see:
Welcome to MiniCore-OS!
Kernel successfully loaded and running in protected mode.
Bootloader Phase 1 Complete!
System Information:
- Architecture: x86 (32-bit)
- Mode: Protected Mode
- Memory Management: Basic
- Display: VGA Text Mode (80x25)
-
"i686-elf-gcc not found"
- Install the cross-compiler toolchain
- Ensure it's in your PATH
-
"grub-mkrescue not found"
- Install GRUB utilities for your distribution
-
ISO won't boot
- Verify GRUB configuration
- Check kernel binary with
make test-kernel
-
Black screen in QEMU
- Try different QEMU options
- Check kernel for infinite loops
- Use
make debug
for QEMU debugging - Check kernel size with
make test-kernel
- Examine assembly output with
objdump -d kernel.bin
This project has completed Phase 5 of the OS development:
Completed Phases:
- ✅ Phase 1: Basic bootloader and kernel
- ✅ Phase 2: Memory management (heap allocation)
- ✅ Phase 3: Interactive CLI shell
- ✅ Phase 4: Interrupt handling (IDT/ISR)
- ✅ Phase 5: Read-only file system
Future phases might include:
- Process management and user mode
- Writable file system
- Device drivers (keyboard, timer, disk)
- Network stack
- Graphics mode support
- System calls and user programs
For guidelines on contributing, please see the CONTRIBUTING.md file. By participating in this project, you are expected to adhere to our Code of Conduct.