A dual-mode operating system developed between 1999-2004 as a learning project to understand Intel x86 architecture and operating system internals.
This project was started when I was 16 years old with the goal of learning:
- Intel x86 CPU architecture (386+)
- Operating system design principles
- Low-level hardware programming
- Memory management and virtual memory
- Process scheduling and multitasking
After 27 years, I've updated the build system to work with modern compilers and am now sharing this educational project with the community.
The original code comments are in French, I've kept them in French for historical reasons and added English comments for modernization.
- Dual-mode operation: 16-bit real mode and 32-bit protected mode
- Custom bootloader: FAT12-compatible boot sector
- Memory management: Paging with 4KB pages, custom allocator
- Multitasking: TSS-based hardware task switching
- Interrupt handling: Custom IDT with hardware interrupt support
- Storage: Floppy disk driver with FAT12 filesystem
- Input: PS/2 keyboard with multiple keymaps (French/English)
- Display: VGA text mode, VESA graphics (640x480x256)
- System: Timer, PIC programming, A20 line handling
- Modular shell system: Switchable command interpreters
- Built-in debugger: Memory inspection, GDT analysis
- File operations: Directory listing, file loading
- System utilities: Memory info, hardware detection
Note: The Bootloader loads 32-bit kernel by default, if you want to load 16-bit kernel, you need to edit the bootloader and change the kernel to 16-bit kernel.
The following packages are required to build and run X-OS:
Package | Purpose | Ubuntu Package |
---|---|---|
NASM | Assembly code compilation | nasm |
GCC | C code compilation | gcc |
Make | Build system | make |
dosfstools | FAT12 filesystem creation | dosfstools |
mtools | DOS filesystem manipulation | mtools |
coreutils | Basic utilities (dd, tar, etc.) | coreutils |
Package | Purpose | Ubuntu Package |
---|---|---|
QEMU | x86 emulation for testing | qemu-system-x86 |
Bochs | Alternative x86 emulator | bochs |
# Install required build tools
sudo apt update
sudo apt install -y nasm gcc make dosfstools mtools coreutils
# Install optional emulators for testing
sudo apt install -y qemu-system-x86 bochs
# Verify installation
nasm --version
gcc --version
make --version
mkfs.fat --help | head -1
mcopy --version | head -1
qemu-system-i386 --version | head -1
Fedora/RHEL/CentOS:
sudo dnf install nasm gcc make dosfstools mtools coreutils qemu-system-x86
Arch Linux:
sudo pacman -S nasm gcc make dosfstools mtools coreutils qemu-arch-extra
Alpine Linux:
sudo apk add nasm gcc make dosfstools mtools coreutils qemu-system-i386
# Clone the repository
git clone https://github.com/yourusername/xos.git
cd xos
# Build the entire system
make compil
# Create a floppy disk image
make image
# Run in Bochs emulator
make runimage
# Build and install to floppy disk
make install
- Boot Process - Bootloader and system initialization
- 16-bit Kernel - Real mode kernel documentation
- 32-bit Kernel - Protected mode kernel documentation
- Memory Management - Paging and allocation systems
- Hardware Drivers - Device driver documentation
- Shell System - Command interpreter documentation
- Build System - Compilation and installation guide
xos/
├── boot/ # Bootloader and setup code
├── 16b/ # 16-bit real mode components
│ ├── kernel/ # 16-bit kernel
│ ├── shl16/ # 16-bit shell
│ └── include/ # 16-bit headers
├── 32b/ # 32-bit protected mode components
│ ├── kernel32/ # 32-bit kernel
│ ├── mm/ # Memory management
│ ├── drivers/ # Hardware drivers
│ ├── shl32/ # 32-bit shell
│ ├── lib/ # C library functions
│ └── include/ # 32-bit headers
├── config/ # System configuration files
├── logo/ # Boot logo graphics
└── docs/ # Documentation
See CHANGELOG.md for detailed version history.
This project demonstrates:
- Low-level programming: Direct hardware manipulation
- System architecture: x86 segmentation and paging
- OS design patterns: Layered architecture, modularity
- Development process: Incremental feature development
While this is primarily a historical/educational project, contributions are welcome:
- Documentation improvements
- Build system enhancements
- Code comments and explanations
- Additional features and hardware support
This project is licensed under the MIT License - see the LICENSE file for details.
Note: This project includes some components from the GNU C Library (glibc) which are licensed under LGPL v2.1. See THIRD_PARTY_LICENSES.md for details on third-party licenses and compatibility.
- Intel x86 architecture documentation
- Various OS development tutorials and books from the late 90s/early 2000s
- The hobbyist OS development community from osdev.org and mega-tokyo.com
"The best way to understand how something works is to build it yourself."