Source Code Overview

The KUDOS source code is split into two main subdirectories:

  1. kudos – operating system proper, and
  2. userland – containing userland programs.

The KUDOS source code also contains a subdirectory called tools, containing useful tools for running KUDOS (see Using KUDOS for an overview), and docs, containing the source code for this documentation. You should not need to touch either of these subdirectories.

kudos

The kernel source code is split into subsystems stored in subdirectories. A subsystem typically consists of some C-files and a subsys.mk. To add a new subsystem, list it in the MODULES variables in kudos/Makefile. To add new C-files to a subsystem, list them in the FILES variable of the subsys.mk. A subsystem may also contain architecture-specific implementations in designated sub-subdirectories, such as mips32 and x86-64.

Currently, the kernel contains the following subsystems:

kudos/init/

Kernel initialization and entry point. This directory contains the functions that KUDOS will execute to bootstrap itself. See bootstrapping-kudos for documentation of this subsystem.

kudos/kernel/

Thread handling, context switching, scheduling and synchronization. Also various core functions used in the KUDOS kernel reside here (e.g. panic and kmalloc). Documentation coming soon.

kudos/proc

Userland processes. Starting of new userland processes, loading userland binaries and handling exceptions and system calls from userland. See System Calls for documentation about the system call interface. Documentation about the rest of this subsystem is coming soon.

kudos/vm

Virtual memory subsystem. Managing the available physical memory and page tables. Documentation coming soon.

kudos/fs

Filesystem abstractions and the Trivial Filesystem (TFS). Documentation coming soon.

kudos/drivers

Low level device drivers and their interfaces. See Device Drivers and Built-in Drivers for documentation of this subsystem.

kudos/lib

Miscellaneous library code (kwrite, kprintf, various string-handling functions, a random number generator, etc.). Documentation coming soon.

kudos/util

Utilities for using KUDOS (e.g. tfstool used for writing the Trivial Filesystem disk files). See Appendix for more information about tfstool.

userland

Userland programs. These are not part of the kernel. They can be used to test the userland implementation of KUDOS by saving them to a Trivial Filesystem disk file and booting KUDOS with that. See Using KUDOS for information on how to do that.