[TUHS] Help with a Unix-ish project?

Dan Cross crossd at gmail.com
Mon Aug 7 23:26:33 AEST 2023


On Mon, Aug 7, 2023 at 1:30 AM steve jenkin <sjenkin at canb.auug.org.au> wrote:
> six years later…
>
> A note for the list:
>
> Warren (in. IMHO, a stroke of genius) changed the Repo from xv6-minix to xv6-freebsd.
>
>         <https://github.com/DoctorWkt/xv6-freebsd>

Cool.

xv6 came up again last week with a Hacker News posted, followed by an
article in the Register, about another xv6 clone written in Rust:
octox (https://www.theregister.com/2023/07/28/octox_v6_unix_in_rust/).
Octox bills itself as being written entirely in Rust, including the
userspace utilities.

In the Register article, author Liam Proven (who I believe is on this
list, Cc'ed here) mentioned my own rxv64, but seems to have missed
part of the point when talking about language statistics (rxv64 left
much of the userspace code written in C, except for the parts of the C
library I wrote, which are Rust...I do provide header files, though).
The point, of course, is that the implementation language used by the
kernel need not be the same as that used by userspace code; the
interface is instead through a contract with the kernel. What better
way to demonstrate this than write some of the userspace code in a
language that isn't Rust? In this case, the utilities were already
more or less written in C. Bakul pointed this out on the Hacker News
story about octox, but it didn't make it to the Register article and
of course was largely missed by the crowd on the Orange Site. Octox
looks like it would be pretty hard to use from a language other than
Rust, honestly; at least, one would likely have to provide a wrapper
library in another language (it appears that all of the names in the
octox userspace library are mangled).

And of course, octox is not 100% Rust, as the Register article
claimed; it has some assembly language bits, but those are hidden
inside of Rust source files (e.g.,
https://github.com/o8vm/octox/blob/main/src/kernel/swtch.rs), and it
generates system call stubs at build time that expand to inline
`ecall` instructions (octox target RISC-V, whereas rxv64 targets
x86_64).

I've avoided commenting publicly on the octox code, but I will say
that it has a much better README file than rxv64!

        - Dan C.


More information about the TUHS mailing list