Rustboot: a 32 bit kernel written in Rust
github.com
github.com
Well, in any case, great work! (Perhaps I'll use yours as a starting point.)
EDIT: One question. When I try to compile it, rustc gives me these errors:
error: no item found for `modulo`
error: no item found for `durable`
error: aborting due to 2 previous errors
If I had to guess, it would be due to the fact that I'm trying to compile it on OS X but have i386-intel-linux set as the target, but your screenshot shows (at least it being emulated) on OS X. Did you have to build a special cross compiler version of rustc?Maybe try updating your version of Rust. I had trouble using zero.rs on 0.6, but the latest from Git works well.
Make sure you're using git/incoming, that's the latest and most stable version usually.
No idea whether this is actually correct, but it does run in qemu. It doesn't however boot on my laptop from a USB drive though... not sure how actual hardware is different from qemu.
I've dreamed of a checkpointed VM which could be used to press a key and fork the running system, or instantly reboot to a usable state when a fault occured, but was small enough to fit in a flash ROM and boot in milliseconds.
The last attempt was linux+QEMU and was to large for most boards supported by coreboot.
Recently, zero.rs was released, which allows you to write some Rust programs without the runtime. This is because Rust basically expects certain functions to exist, so they have to be defined somewhere. That said, things like 'a GC' aren't implementd, they just throw an error. Please see: https://news.ycombinator.com/item?id=5771173
This is just one step further in demonstrating that these things work.
Of course it's hard to pass off these ~200 lines of code as an attempt at writing an OS kernel, but it could be a spark, everything starts somewhere.
It's not a goal of rust, but that doesn't mean rust can't be used for it (and the ability to run without a runtime if desired — at the loss of functionalities for which a runtime support is necessary — has been a goal of the project for as long as I've known about it)
At first I was most interested in Go: But now it seems that Rust is much more close to the metal than Go is, which I find more interesting.
Well, it's a start, I guess. :) (The project is literally only half an hour old.)
That's one of the funny things about starting your own operating system; it's not some sort of herculean task. Especially once you've done it once or twice.
While you're right that this isn't particularly feature-rich at this point, it does get the annoying bits out of the way. It's a starting point that anyone doing this task would have to do, and do in the same way.
It's also a proof of concept that this kind of thing does actually work; see the other thread on zero.rs where people were speculating if this is possible. Now we know.
http://picpaste.com/pics/21616b59902f2992e1e488af35acba20.13...
The Process class is just a dummy at the moment, it doesn't do anything.
There's no reason for an internal compiler error, especially in a language with safety as its focus.
https://github.com/mozilla/rust/issues/6699 https://github.com/mozilla/rust/issues/6698
Don't get me wrong. I'm super excited to learn rust once it stabilizes. But right now I don't spend enough time on fun programming to deal with a language that has this many errors.
Are there any technical reasons for this?
One request, Can you detail out the steps, for noobies to be able to re-produce this effort? Thanks!
If it's the first, OSDev has a great community, and some decent tutorials: http://wiki.osdev.org/Bare_Bones
If it's the second, the answer is 'have edge Rust installed, have qemu installed, then run `make`.'
Now, it's not a _useful_ kernel, but it is one.
In fact it does one thing and does it well. It's an exemplar of the UNIX philosophy! ;)
I seem to remember some old 5 1/4 inch disks that contained both an OS and an app. That's approximately what this is in its current state.
That said, "is it really a kernel as per Wikipedia" is not particularly interesting. It's a damn cool hack that could be the starting point for something interesting and useful, that's all I care about.