Skip to content

Fingel/aeros-v

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

                ▗▄▖  ▗▄▖
                █▀█ ▗▛▀▜
 ▟██▖ ▟█▙  █▟█▌▐▌ ▐▌▐▙
 ▘▄▟▌▐▙▄▟▌ █▘  ▐▌ ▐▌ ▜█▙
▗█▀▜▌▐▛▀▀▘ █   ▐▌ ▐▌   ▜▌
▐▙▄█▌▝█▄▄▌ █    █▄█ ▐▄▄▟▘
 ▀▀▝▘ ▝▀▀  ▀    ▝▀▘  ▀▀▘

A minimal operating system for the Risc-V architecture written in Zig. It can handle simple processes multitasking, memory management with a 2 level page table and provides a simple shell which can spawn processes.

Modules

  • kernel.zig is the main entrypoint for the kernel. It defines a panic handler, some assembly required for the bootloader, and definitions for processes. Processes can spawned after the proc.initialize call in the main function. Most importantly, it prints the welcome banner.
  • riscv.zig contains the actual Risc-V instructions for syscalls and other architecture specific routines.
  • memory.zig defines an alloc implementation and a 2 level page that that utilizes Risc-V's virtual memory facilities.
  • proc.zig defines routines for creating processes and mapping memory to them, as well as multitasking.
  • shell.zig and common.zig define various routines to input and output text from the operating system.

Running

You will need qemu with the risc-v plugins installed. The Zig build script should handle building the kernel, linking (including linker scripts) and lauching the VM:

zig build run

About

A small operating system written in Zig for Risc-V

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors