fab372a6cf
Include code page 437 This is now moved to a better location Fixed initrd doc for allocator Added test files Plus minor extras Created initial FAT32 filesystem This initial FAT32 filesystem will parse a stream, which could be a HDD or a in memory filesystem and produce a FAT32 filesystem. This will check if the raw bytes is a valid FAT32 filesystem as descibed in the spec. This is only a skeleton with no open, read or write functionality. Part of #216 logger -> log Fmt Removed 'zero_' from struct fields number_free_cluster -> number_free_clusters Return non allocated FAT32FS prefix test_ Added doc comment for boot sector arrays Moved code_page.zig info -> debug for init FAT32 Abstracted getting code page table |
||
---|---|---|
.github/workflows | ||
grub | ||
src | ||
test | ||
.gitignore | ||
build.zig | ||
hello.jpg | ||
makeiso.sh | ||
mkfat32.zig | ||
README.md |
Pluto
Pluto is a kernel written almost entirely in Zig and supports x86, with aarch64 and x64 backends being planned.
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 (defaultfalse
).- 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 (defaulti386-freestanding
). The standard target options for building with zig. Currently supported targets:i386-freestanding
-Ddisable-display
: Boolean (defaultfalse
)- 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):
- imports
- type definitions
- constants
- variables
- inline functions
- functions
- entry point/init function
More styling information is available on the wiki