# CubeCactusOS

A custom operating system based on MINIX3 microkernel architecture.

## Overview

CubeCactusOS is a microkernel-based operating system inspired by MINIX3, designed for educational purposes and modern system development. It follows the MINIX3 philosophy of modularity and reliability.

## Project Structure

```
os/
├── kernel/         # Microkernel core
├── servers/        # System servers (PM, VFS, etc.)
├── drivers/        # Device drivers
├── userland/       # User-space programs and utilities
├── lib/            # System libraries
└── boot/           # Boot loader and initialization
```

## Architecture

Following MINIX3's microkernel design:
- **Microkernel**: Minimal kernel handling IPC, scheduling, and low-level operations
- **Servers**: System services running as user-space processes (Process Manager, Virtual File System, etc.)
- **Drivers**: Device drivers isolated in separate processes
- **User Programs**: Standard utilities and applications

## Prerequisites

- GCC/Clang compiler toolchain
- GNU Make
- QEMU or VirtualBox (for testing)
- Git (for MINIX3 source)
- Cross-compilation tools (optional for x86 targets)

## Building from MINIX3 Source

### Step 1: Get MINIX3 Source Code

```bash
# Clone MINIX3 repository
git clone https://github.com/Stichting-MINIX-Research-Foundation/minix.git minix3-source
cd minix3-source
```

### Step 2: Build the OS

```bash
# From the project root
make os-build
```

### Step 3: Create Bootable Image

```bash
make os-image
```

### Step 4: Run in QEMU

```bash
make os-run
```

## Development Workflow

1. **Modify Kernel**: Edit files in `os/kernel/`
2. **Add Drivers**: Create new drivers in `os/drivers/`
3. **Build**: Run `make os-build`
4. **Test**: Run `make os-run` to test in QEMU

## Customization

### Adding a New System Call

1. Define the system call in `os/kernel/syscall.h`
2. Implement the handler in `os/kernel/syscall.c`
3. Update the system call table
4. Rebuild the kernel

### Creating a New Driver

1. Create driver directory in `os/drivers/`
2. Implement driver following MINIX3 driver interface
3. Register driver with the system
4. Rebuild and test

## Key Features (Planned)

- [ ] Microkernel architecture based on MINIX3
- [ ] Message-passing IPC mechanism
- [ ] Isolated device drivers
- [ ] Virtual File System (VFS)
- [ ] Process and Memory Management
- [ ] Basic networking stack
- [ ] POSIX compatibility layer
- [ ] Modern hardware support

## Resources

- [MINIX3 Official Website](https://www.minix3.org/)
- [MINIX3 Book: Operating Systems Design and Implementation](https://www.pearson.com/us/higher-education/program/Tanenbaum-Operating-Systems-Design-and-Implementation-3rd-Edition/PGM249977.html)
- [MINIX3 GitHub Repository](https://github.com/Stichting-MINIX-Research-Foundation/minix)
- [OSDev Wiki](https://wiki.osdev.org/)

## Contributing

This is an educational project. Contributions and learning improvements are welcome!

## License

Based on MINIX3 (BSD-style license). Check MINIX3 source for complete license terms.

## Acknowledgments

- Andrew S. Tanenbaum and the MINIX3 team
- The MINIX Research Foundation
- OSDev community

---

**Note**: Building a complete OS is a complex undertaking. Start with understanding MINIX3's architecture before making modifications.
