Pluto – An x86 (Ring 0, Protected Mode) kernel written in Zig

peter_d_sherman1 pts0 comments

GitHub - ZystemOS/pluto: An x86 kernel written in Zig · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

ZystemOS

pluto

Public

Notifications<br>You must be signed in to change notification settings

Fork<br>32

Star<br>729

develop

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>316 Commits<br>316 Commits

.github/workflows

.github/workflows

grub

grub

src

src

test

test

.gitignore

.gitignore

README.md

README.md

build.zig

build.zig

fat32_cp.sh

fat32_cp.sh

hello.jpg

hello.jpg

makeiso.sh

makeiso.sh

mkfat32.zig

mkfat32.zig

View all files

Repository files navigation

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 0.9.1(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):

imports

type definitions

constants

variables

inline functions

functions

entry point/init function

More styling information is available on the wiki

About

An x86 kernel written in Zig

Topics

kernel

zig

operating-system

x86

hacktoberfest

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Custom properties

Stars

729<br>stars

Watchers

15<br>watching

Forks

32<br>forks

Report repository

Releases

tags

Packages

Uh oh!

There was an error while loading. Please reload this page.

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Zig<br>96.0%

Assembly<br>3.8%

Other<br>0.2%

You can’t perform that action at this time.

build kernel mode test reload written

Related Articles