Skip to content

managarm/mlibc-demo-os

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mlibc-demo-os

This is a toy kernel intended to demonstrate how to port mlibc to a new operating system. It is written in Rust and runs on a 64-bit RISC-V target.

For pedagogical purposes we cut some corners. For example we do not implement a scheduler (only a single hardcoded task may run). There are no external interrupts, meaning no pre-emption. Only a single hart is supported.

Currently this kernel can run a statically linked hello world program. We plan to support a dynamically linked hello world in future.

To build the userspace, switch to the user directory and run ./make_user.sh. This will build the toolchain, mlibc and the hello world program.

# Build userland
$ cd user
$ ./make_user.sh
# Build kernel
$ cd ..
$ cargo build

Example output

$ cargo run
[INFO ] Booting mlibc-demo-os...
[INFO ] Loading userspace program...
[INFO ] Jumping to userspace entrypoint at 0x10158
Hello world!
[INFO ] Userspace program exited with status code 0

About

Demo OS for the mlibc porting guide.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •