# CubeCactusCpp

A multi-component C++ project featuring:
- **Database Layer Module** - Comprehensive database abstraction layer
- **CubeCactusOS** - Custom operating system based on MINIX3 microkernel architecture

## Project Structure

```
CubeCactusCpp/
├── src/              # Application source files
│   ├── main.cpp      # Main application with database demo
│   └── Database.cpp  # Database module implementation
├── include/          # Header files
│   └── Database.h    # Database module interface
├── os/               # Operating System development
│   ├── kernel/       # Microkernel core
│   ├── servers/      # System servers (PM, VFS)
│   ├── drivers/      # Device drivers (TTY)
│   ├── userland/     # User-space programs
│   ├── boot/         # Boot loader
│   ├── lib/          # System libraries
│   ├── README.md     # OS architecture documentation
│   └── SETUP.md      # OS build instructions
├── build/            # Application build output
├── Makefile          # Application build configuration
└── Makefile.os       # OS build configuration
```

## Database Module

A comprehensive database abstraction layer with:
- Connection management
- CRUD operations (insert, update, delete, select)
- Transaction support (begin, commit, rollback)
- Error handling

### Building the Application

```bash
make              # Build the application
make run          # Build and run
make clean        # Clean build artifacts
```

## CubeCactusOS

A microkernel-based operating system inspired by MINIX3, featuring:
- Microkernel architecture with message-passing IPC
- Process Manager (PM) server
- Virtual File System (VFS) server
- TTY driver for terminal I/O
- Modular, fault-isolated design

### OS Development

```bash
# View OS documentation
cat os/README.md
cat os/SETUP.md

# Run setup script
./os/setup.sh

# Build OS components (development)
make -f Makefile.os os-build

# For complete bootable OS, follow os/SETUP.md
```

### OS Architecture

CubeCactusOS follows MINIX3's microkernel design:
- **Microkernel**: Minimal kernel (IPC, scheduling, low-level operations)
- **System Servers**: User-space processes (PM, VFS, etc.)
- **Device Drivers**: Isolated driver processes
- **Message Passing**: IPC-based communication

## Prerequisites

### For Application Development
- g++ compiler (C++17 or later)
- make

### For OS Development
- GCC/Clang toolchain
- QEMU (for testing)
- GRUB (for bootable images)
- Git (to clone MINIX3 source)

See `os/SETUP.md` for detailed OS build prerequisites.

## Quick Start

### Application
```bash
make run
```

### Operating System
```bash
./os/setup.sh          # Check prerequisites
cat os/SETUP.md        # Read complete guide
```

## Resources

### Database Module
- See `include/Database.h` for API documentation
- Example usage in `src/main.cpp`

### CubeCactusOS
- [MINIX3 Official Website](https://www.minix3.org/)
- [MINIX3 GitHub](https://github.com/Stichting-MINIX-Research-Foundation/minix)
- [OSDev Wiki](https://wiki.osdev.org/)
- Tanenbaum's "Operating Systems Design and Implementation"

## License

- Application code: Your chosen license
- OS code: Based on MINIX3 (BSD-style license)

## Contributing

Contributions welcome for both the application and OS development!
