A simple kernel. Porting to Zig 0.14 in progress.
Find a file
DrDeano 4afecd6508
See description
Added finding the next free cluster
Added name to long name
Added long name to short name
Added tests for above

Added createLongNameEntry + tests

Moved tests to bottom

Added createShortNameEntry + test

Used the RTC for the date and time for the created short entry

Tidied createEntries


A bit of refactor

No symlinks for FAT32

findNextFreeCluster updates FAT

Reordered tests to better follow the FAT32FS code
FAT32 has no support for symlinks, so removed code around this.
Removed open_args from createNode as it doesn't need it

Added writeEntries + tests

Write the short and long entries to disk
findNextFreeCluster update cluster chain with parent cluster

Added FAT32 write + tests

This Added the ability to create files and directories and write to files.
Added location of the short dir entry for the file so can update the size of the file on disk
Added folders to the test FAT32 directory.
Also fixed minor bug in mkfat32

Added check for destroying the filesystem


Fixed error message for cluster size


Simpler if condition


0x0FFFFFFF => 0xFFFFFFFF


Spelling


Fixed test
2021-01-04 08:50:20 +00:00
.github/workflows Fixed FAT32 tests 2020-12-27 13:31:07 +00:00
grub Created ramdisk build step 2020-07-25 11:18:19 +01:00
src See description 2021-01-04 08:50:20 +00:00
test See description 2021-01-04 08:50:20 +00:00
.gitignore See description 2021-01-04 08:50:20 +00:00
build.zig Added read functionality to FAT32 2020-12-12 22:31:42 +00:00
fat32_cp.sh Fixed FAT32 tests 2020-12-27 13:31:07 +00:00
hello.jpg Improve readme 2019-09-08 16:26:24 +01:00
makeiso.sh Created ramdisk build step 2020-07-25 11:18:19 +01:00
mkfat32.zig See description 2021-01-04 08:50:20 +00:00
README.md Use the standardTargetOptions for built targets 2020-06-23 12:49:40 +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 qemu-system binary compatible with your chosen target is required to run the kernel (e.g. qemu-system-i386).

zig build

Run

zig build run

or if you want to wait for a gdb connection:

zig build debug-run

Debug

Launch a gdb-multiarch instance and connect to qemu.

zig build debug

Unit testing

Run the unit tests.

zig build test

Runtime testing

Run the runtime tests.

zig build rt-test -Dtest-mode=<MODE>

Available test modes:

  • None: This is the default, this will run the OS normally.
  • Initialisation: Run the OS's initialisation runtime tests to ensure the OS is properly set up.
  • Panic: Run the panic runtime test.

Options

  • -D[build-mode]=: Boolean (default false).
    • build: Build a certain build mode (release-safe, release-fast, release-small). Don't set in order to use the debug build mode.
    • test: Test a certain build mode (release-safe, release-fast, release-small). Don't set in order to use the debug build mode.
  • -Dtarget=: String (default i386-freestanding). The standard target options for building with zig. Currently supported targets:
    • i386-freestanding
  • -Ddisable-display: Boolean (default false)
    • This disables the display output of QEMU.

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

More styling information is available on the wiki