A simple kernel. Porting to Zig 0.14 in progress.
Find a file
ED 42bdbf6b7f Added unit and runtime tests
Also fixed some typos
Also changed the panic a bit
Removed changed to unnecessary files


Fixed merge


Feedback


Fixed tests
2019-10-05 20:46:31 +01:00
.github/workflows Migrate to github actions for CI 2019-09-18 20:47:59 +01:00
grub Start using the zig build system 2019-05-03 23:35:00 +01:00
src Added unit and runtime tests 2019-10-05 20:46:31 +01:00
test Added unit and runtime tests 2019-10-05 20:46:31 +01:00
.gitignore Add runtime testing harness 2019-07-09 23:25:52 +01:00
build.zig Remove debug option 2019-10-03 17:15:05 +01:00
hello.jpg Improve readme 2019-09-08 16:26:24 +01:00
link.ld Add x86 paging 2019-06-29 12:02:42 +01:00
README.md Migrate to github actions for CI 2019-09-18 20:47:59 +01:00

Pluto

Build Status

Pluto is a kernel written almost entirely in Zig and supports x86, with aarch64 and x64 backends being planned.

Hello image

Goals

  • Should be written in Zig as much as possible. Assembly should only be used where required for functionality or performance reasons.
  • Light and performant. The kernel should be usable both on embedded and desktop class CPUs, made possible by it being lightweight and modular.
  • Basic utilities will be written in Zig. This includes a basic text editor and shell, and will be part of the filesystem external to the kernel itself.
  • Easy to port. The kernel is oblivious to the underlying architecture, meaning that ports only need to implement the defined interface and they should work without a hitch.

All of these goals will benefit from the features of Zig.

Build

Requires a master build of Zig (downloaded or built from source) xorriso and the grub tools (such as grub-mkrescue). A gdb binary compatible with your chosen target is required to run the kernel (e.g. qemu-system-i386).

zig build

Run

zig build run

Debug

Launch a gdb instance and connect to qemu.

zig build debug

Test

Run the unit tests or runtime tests.

zig build test

Options

  • -Ddebug=: Boolean (default false).
    • build: Build with debug info included or stripped (see #70 for planned changes).
    • run: Wait for a gdb connection before executing.
  • -Drt-test=: Boolean (default false).
    • build: Build with runtime testing enabled. Makes the kernel bigger and slower but tests important functionality.
    • test: Run the runtime testing script instead of the unittests. Checks for the expected log statements and fails if any are missing.

Contribution

We welcome all contributions, be it bug reports, feature suggestions or pull requests. We follow the style mandated by zig fmt so make sure you've run zig fmt on your code before submitting it.

We also like to order a file's members (public after non-public):

  1. imports
  2. type definitions
  3. constants
  4. variables
  5. inline functions
  6. functions
  7. entry point/init function