Operating System Development Tutorials in Rust on the Raspberry Pi
github.com
github.com
I love the idea of doing more operating system experiments on RPIs just because of the availability & consistency of the platform. You don't have to worry about thousands of drivers for the most part, plus if you're using the RPI 400[1], basically everything is included in the keyboard!
Rust seems like a good way to get people involved as well, because of it's innate following. Excited to give this tutorial a try.
[0] https://github.com/SerenityOS/serenity [1] https://www.raspberrypi.org/products/raspberry-pi-400/
I think the standard PC is a far better platform for OS development --- decades of backwards compatibility mean documentation is plentiful, and so is sample code.
And x86-64 really is a really complex platform to develop from scratch for. Have you seen the C ABI specification for it?
Your strong opinions on the matter may be warranted from your personal experience, but there is nothing wrong with doing such, there is zero track to you that someone somewhere on this planet is tinkering with an operating system you do not agree with the design decisions of.
> The POSIX API is outdated and broken in a lot of ways.
Curious if you could elaborate your claims. Is it a case of the old APIs must stand (and the baggage therein), or were there some fatal flaws other OS APIs avoided?
I don't understand why you're saying this or what this has to do with my comment at all. I'm a random person on the internet commenting on what I would like to see. You don't have to agree, it's fine for us to feel differently.
>Is it a case of the old APIs must stand (and the baggage therein), or were there some fatal flaws other OS APIs avoided?
I can't really name any POSIX APIs that I think are actually good. In my experience, any real programming for Linux and BSD requires a ton of non-standard non-POSIX APIs anyway. One major problem is: almost all of the core POSIX syscalls are blocking which IMO is really useless for modern programming. Since the past 10 years I haven't used any language runtime that focuses on single-threaded blocking tasks. Everything is about concurrency and async now. Also see this thread for various other problems with it: https://news.ycombinator.com/item?id=27183784
I understand that you or others may want to tinker with this stuff but please consider that an OS designer can be missing some valuable information that could be learned from people with decades of experience deploying these APIs on Linux and BSD and the various other UNIXes. That's the stuff that could save a lot of development time. In my opinion POSIX is really a red herring for OS designers, now the big thing people talk about is "Linux compatibility" which includes a significant number of other things besides POSIX.
> we have enough of those to deal
Thanks for sharing some context on why it's bad though. Cheers.
https://www.arm.com/resources/education/books/operating-syst...
Some things are baked into the kernel and are tricky to work around. Like the execute bit. If you wanted to make a Linux distro that can run arbitrary binaries downloaded from the internet (like Windows) you'll have to contend with the kernel refusing to execute a binary that doesn't have the x bit set at the filesystem level. (Can you even execute files from fat32 or NTFS? Hmmm...)
Another example is the Unix file system layout. If you wanted to show the user a DOS-style drive-based layout (I.E. no /mnt or /bin or /etc, but instead C:\ and D:\) then you have to fork GTK and GNOME to know how to obfuscate the file system like that.
I actually don't think you can do this, or would even want to. Systemd doesn't really do anything special beyond putting some tooling around various Linux features. I've seen a lot of other Linux inits and all of them have to conform to those expectations because that is how Unix and Linux are supposed to function, if the init doesn't do those jobs then the system doesn't work.
>You could write your own X11/wayland-like display server thing (like Android does)
Conceptually the Android window system is not really that different from Wayland. X11 is more the outlier. If you're building a new window system, you probably want to do things with a very similar approach to how Wayland and SurfaceFlinger work. No matter what you do there you're going to be constrained by the requirements of getting OpenGL and Vulkan apps to work.
I like to compare it to webpage load time. In the beginning of the web, 5 seconds used to be ok, but nowadays the user wants sub-second load times or they literally walk away. Similarly, devices that don't turn on instantly lose points on UX as well.
Even the 4 seconds mentioned by the sibling commenter would be too much (e.g. if a page load of 4 seconds is considered "long", then turning on a device should be shorter as well).
There are plenty of guides for speeding up Raspberry Pi Linux boot: http://himeshp.blogspot.com/2018/08/fast-boot-with-raspberry...
If you're developing a true embedded product then you'll be making a customized Linux distribution anyway, which will only include the minimum features needed during boot for your application.