A custom operating system built from scratch with a text editor, keyboard input handling, and basic filesystem support.
- Custom bootloader using GRUB
- Text editor with basic editing capabilities
- Keyboard input handling with special key support
- Basic filesystem operations
- Memory management system
- Interrupt handling
- Text-mode display output
- NASM (Netwide Assembler)
- LLVM/Clang compiler
- CMake (3.12 or higher)
- QEMU for testing
- GRUB bootloader tools
- GDB (optional, for debugging)
-
Clone the repository:
git clone https://github.com/Anon23261/First-OS-Build.git cd First-OS-Build
-
Build the project:
# Make scripts executable chmod +x scripts/*.sh # Build everything (kernel + ISO) ./scripts/build.sh
-
Run in QEMU:
./scripts/run.sh
- GDB debugging is supported
- Connect to QEMU using GDB on port 1234
- Debug symbols are included in the build
The following tools are required to build the OS:
- clang++ (for C++ compilation)
- nasm (for assembly)
- lld (for linking)
- xorriso (for ISO creation)
- GRUB (for bootloader)
- CMake (for build system)
- Make (for build automation)
- QEMU (for testing, optional)
On Ubuntu/Debian:
sudo apt-get update
sudo apt-get install clang lld nasm xorriso grub-pc-bin grub-common cmake make qemu-system-x86
On Arch Linux:
sudo pacman -S clang lld nasm xorriso grub cmake make qemu
On Fedora:
sudo dnf install clang lld nasm xorriso grub2 cmake make qemu-system-x86
To run the OS in QEMU:
./scripts/run.sh
Or manually:
qemu-system-i386 -cdrom build/os.iso
- Write the ISO to a USB drive (replace
/dev/sdX
with your USB device):
sudo dd if=build/os.iso of=/dev/sdX bs=4M status=progress
- Boot your computer from the USB drive.
Warning: Be very careful with the dd
command and make sure you specify the correct device!
boot/
: Bootloader and assembly codekernel/
: Core kernel componentskernel.cpp/h
: Main kernel codekeyboard.cpp/h
: Keyboard input handlingeditor.cpp/h
: Text editor implementationfilesystem.cpp/h
: Basic filesystem operationsmemory.cpp/h
: Memory managementinterrupts.cpp/h
: Interrupt handling
scripts/
: Build and utility scriptstests/
: Test filesbuild/
: Build output (created during build)
- Start QEMU with GDB server:
./scripts/run.sh debug
- In another terminal, connect GDB:
gdb
(gdb) target remote localhost:1234
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Limited filesystem support
- No process management yet
- Basic text editor functionality
- Implement process management
- Add more filesystem operations
- Enhance text editor features
- Add networking support
- Implement a basic shell
This project is licensed under the MIT License - see the LICENSE file for details.
Current version: 2.0.1