Readit News logoReadit News
hexagonal-sun commented on Moss: a Rust Linux-compatible kernel in 26,000 lines of code   github.com/hexagonal-sun/... · Posted by u/hexagonal-sun
andrewl-hn · 22 days ago
> no networking support

Would something like Smoltcp be of help here? https://github.com/smoltcp-rs/smoltcp

Great project either way!

How do you decide which sys calls to work on? Is is based on what the user space binaries demand?

hexagonal-sun · 22 days ago
Yip, I panic whenever I encounter a syscall that I can't handle and that prompts me to implement it.

Yeah, I was thinking of integrating that at some point. They've done a really nice job of keeping it no_std-friendly.

hexagonal-sun commented on Moss: a Rust Linux-compatible kernel in 26,000 lines of code   github.com/hexagonal-sun/... · Posted by u/hexagonal-sun
meisel · 22 days ago
Really neat. Do you have any specific long term goals for it? Eg, provide an OS distro (using Linux drivers?) to provide memory safety for security-critical contexts?

Also, are there any opportunities to make this kernel significantly faster than Linux’s?

hexagonal-sun · 22 days ago
Eventually, It'd be amazing to use Moss as my daily driver OS. That means targeting the specific hardware that I have, but in doing so, I hope to build up enough of the abstractions to allow easier porting of hardware.

A more concrete mid-term goal is for it to be 'self-hosting'. By that I mean you could edit the code, download dependencies and compile the kernel from within Moss.

hexagonal-sun commented on Moss: a Rust Linux-compatible kernel in 26,000 lines of code   github.com/hexagonal-sun/... · Posted by u/hexagonal-sun
nikanj · 22 days ago
Just a hobby, won’t be big and professional like Linux?
hexagonal-sun · 22 days ago
;-)
hexagonal-sun commented on Moss: a Rust Linux-compatible kernel in 26,000 lines of code   github.com/hexagonal-sun/... · Posted by u/hexagonal-sun
Rochus · 22 days ago
Cool project, congrats. I like the idea with libkernel which makes debugging easier before going to "hardware". It's like the advantages of a microkernel achievable in a monolithic kernel, without the huge size of LKL, UML or rump kernels. Isn't Rust async/awat depending on runtime and OS features? Using it in the kernel sounds like an complex bootstrap challenge.
hexagonal-sun · 22 days ago
This has been a real help! The ability to easily verify the behavior of certain pieces of code (especially mem management code) must have saved me hours of debugging.

Regarding the async code, sibling posts have addressed this. However, if you want to get a taste of how this is implemented in Moss look at src/sched/waker.rs, src/sched/mod.rs, src/sched/uspc_ret.rs. These files cover the majority of the executor implementation.

hexagonal-sun commented on Moss: a Rust Linux-compatible kernel in 26,000 lines of code   github.com/hexagonal-sun/... · Posted by u/hexagonal-sun
hexagonal-sun · a month ago
Hello!

For the past 8 months, or so, I've been working on a project to create a Linux-compatible kernel in nothing but Rust and assembly. I finally feel as though I have enough written that I'd like to share it with the community!

I'm currently targeting the ARM64 arch, as that's what I know best. It runs on qemu as well as various dev boards that I've got lying around (pi4, jetson nano, AMD Kria, imx8, etc). It has enough implemented to run most BusyBox commands on the console.

Major things that are missing at the moment: decent FS driver (only fat32 RO at the moment), and no networking support.

More info is on the github readme.

https://github.com/hexagonal-sun/moss

Comments & contributions welcome!

hexagonal-sun commented on Trale (Tiny Rust Async Linux Executor) v0.3. For Rust Released   github.com/hexagonal-sun/... · Posted by u/hexagonal-sun
hexagonal-sun · 8 months ago
Hello!

I've just released trale v0.3.0 — my attempt at building a small, simple, but fully-featured async runtime for Rust.

Trale is Linux-only by design to keep abstraction levels low. It uses io_uring for I/O, and provides futures for both sockets and file operations.

The big feature in this release is multishot I/O, implemented via async streams. Right now, only TcpListener supports it — letting you accept multiple incoming connections with a single I/O submission to the kernel.

You can find it on GitHub: https://github.com/hexagonal-sun/trale And on crates.io: https://crates.io/crates/trale

Would love to hear your thoughts or feedback!

hexagonal-sun commented on Trale v0.2.0 – rust async runtime using io_uring   github.com/hexagonal-sun/... · Posted by u/hexagonal-sun
hexagonal-sun · 10 months ago
Announcing trale v0.2.0!

I'm excited to announce the release of trale v0.2.0! This release brings several important updates that will improve the overall performance and usability of the project.

Key Features:

- Reactor port: Successful port of the reactor from using epoll-based IO to *io\_uring*. This change should result in improved performance and scalability for IO operations.

- New futures module: The switch to `io_uring` allows file-system based futures to be written. To that end, a new `fs` module that provides asynchronous methods for file system operations has been added. This includes async file reading, writing, opening, and creating directories.

- New webserver example: This release includes a new web server example demonstrating the new `fs` futures module! While it's a basic HTTP server implementation, it demonstrates some impressive performance benchmarks. On localhost, it can achieve up to 25,000 requests per second (or 399,385 KB/sec) on a single thread, though keep in mind it's unoptimized for production use.

Check it out:

GitHub: https://github.com/hexagonal-sun/trale Crates.io: https://crates.io/crates/trale

Feedback appreciated!

u/hexagonal-sun

KarmaCake day339September 12, 2019View Original