Skip to content

kanajakala/cacos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

169 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CaCOS

*Coherent and Cohesive Operating System*

CaCOS (k-a-k-o-s) is a simple hobby operating system. It's goal is to be functional and have a clean and elegant codebase, as much as possible. In the current rewrite there is a text console, a basic file system, and userland applications. You can see how the operating system is designed in the docs


The Plan

Here are all the steps of the development of the os.

Boot loader

  • implement the bootboot boot protocol

  • automate bootboot installation and image creation

Core functionality

  • frame-buffer

    • basic functions
    • text display
  • memory

    • page allocation and tracking
    • memory freeing
  • system

    • interrupt descriptor table (IDT) setup
    • global descriptor table (GDT) setup
    • interrupt service routine (ISR) setup

advanced functionality

  • Keyboard driver

  • Filesystem

    • basic ramfs and file structures
    • basic filesystem functions (create, delete, read, ...)
    • path handling
    • filesystem on disk
  • Elf file loading

    • parse elf file
    • load and execute elf file
  • system calls

    • call kernel code from apps
    • pass arguments and return errors
  • error marshalling, through kernel and apps

  • console

    • execute commands
    • standard text streams

apps

  • write simple apps leveraging elf loading and system calls

  • write a standard library providing basic functionality (memory, filesystem, ...)

  • build a complete set of utils, akin to busybox (filesystem utils, text manipulation, ...)

Beyond

  • threads and multi tasking

    • write a scheduler
    • context switches and multitasking
    • multi threading
  • PCI driver

  • support for hardware accelerated graphics

  • mouse driver and support

  • complete graphical interface

  • networking

  • porting linux binaries and utils

Running the OS

NOTE: the OS is currently in heavy development and the process to run the OS is not streamlined yet

NOTE: running on macos or windows has never been tested, though it should work fine

To run the CacOS you have to download the most recent image from the releases tab, and then run the following command: qemu-system-x86_64 -drive format=raw,file=kernel/img/cacos.img

Alternatively, you can clone the git directory (git clone https://github.com/kanajakala/cacos.git CaCOS), cd into it (cd CaCOS) and then run (zig build run --release=small)

currently there is not much you can do, you can type motd to show the motd, or ls <dir> to show the files in the provided directory

Building the OS

you will need the following dependencies:

  • zig 15 for compiling the project
  • qemu-system-x86_6 to run the os
  • git to clone the git repository
  • zip for building bootboot (done automatically)

running the following command will download and compile bootboot, and it's image utility "mkbootimg", compile the OS code for you and run it in qemu:
zig build run

you can customize the build process by running specific steps:

  • zig build compile generate an elf executable of the kernel
  • zig build compile-apps generate executables for the kernel apps
  • zig build setup dowloads and build mkbootimg, bootboots utility program to generate bootable images
  • zig build gen create a bootable image using mkbootimg
  • zig build run run the all the previous steps, and run the image in qemu

About

A simple OS written in zig

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages