About CottonOS
CottonOS is a hobby operating system kernel meticulously crafted in Rust for the x86_64 architecture. It provides a foundational platform for exploring the intricacies of operating systems, featuring a custom filesystem named CottonFS, a graphical desktop environment complete with window management capabilities, and robust full preemptive multitasking. This project was initiated as a learning endeavor to understand the inner workings of operating systems, evolving from basic text output to a functional environment capable of browsing the web over HTTPS.
- Core Functionality: Boots via GRUB (Multiboot2) into a 64-bit kernel.
- Graphical Environment: Features a framebuffer desktop with draggable windows, including essential applications like a terminal, file manager, text editor, system information viewer, and a web browser.
- Networking: Supports web browsing over HTTP and HTTPS, with TLS 1.3 implemented in-kernel using embedded-tls. Network protocols like DNS, DHCP, TCP, UDP, and ICMP are managed by smoltcp, leveraging an RTL8139 driver.
- Storage: Offers persistent storage through a custom filesystem, CottonFS, designed for ATA disks, ensuring that created files are retained across reboots.
- Multitasking: Employs a preemptive round-robin scheduler operating at 1000Hz, complemented by a cooperative side task to maintain GUI responsiveness during operations like page downloads.
- Input/Output: Includes support for PS/2 keyboard and mouse (with scroll wheel functionality) and serial debug output.
- Shell: Provides an interactive shell with commands for filesystem operations, network management, and system monitoring.
- Development Tools: Built using a nightly Rust toolchain, NASM, QEMU, and GRUB tools, with build scripts managed by a Makefile.
The project is not intended for production use and has several limitations, including the absence of certificate validation for HTTPS, a single TCP connection limit, no support for CSS or JavaScript in the browser, and userspace applications currently running in ring 0. It is primarily tested on x86_64 with QEMU.