using Rust for OS development
Rust for OS dev

Currently reading:
using Rust for OS development
Rust for OS dev

piezo

New member
comfy friend
Joined
Jul 1, 2024
Messages
4
Reaction score
3
comfy coins
💠4,563
Rust is a fairly new but good language, and I'm thinking of using it to create an Operating system, Kind of a replacement to C and Assembly,
https://os.phil-opp.com/
This guy made a great tutorial for it, and I would like your opinion on this language
 
Description
Rust for OS dev
So the way I'm looking at this is kinda like this. Imagine you're a chef, used to cooking with a classic set of kitchen tools--knife, pan, stove, etc. Those tools are straightforward, give you direct control, and have been used forever. There's countless recipes, tips, and communities built around these traditional tools.

Now, suppose you're given a high-tech, modern cooking gadget like an InstantPot or some shit that promises to make cooking safer and more efficient. This gadget has features to prevent common kitchen accidents and ensures your food is cooked perfectly every time. However, learning to use this gadget is like learning to cook all over again. It's complex, has many rules, and you can't just jump in and start cooking the way you're used to. Moreover, the new gadget might not yet have all the attachments you need for every recipe, and there aren't as many cooking guides or experienced chefs who can help you troubleshoot when something goes wrong. Some cooking techniques that are easy with your traditional tools become cumbersome or less intuitive with the new gadget. Idk, probably a shitty analogy, but my point still stands.

Rust has a steep learning curve due to its strict ownership model, lifetimes, and borrowing rules, so that makes it difficult for new developers or those transitioning from other languages like C to pick up and use effectively in OS development, IMO. While Rust is rapidly growing, the reality is that the ecosystem is still relatively young when compared to more established languages like C and ASM. Some OSDev tools, libraries, resources, etc might be lacking/less mature. Another thing to note is that while Rust provides a lot of safety features, it can sometimes abstract away low-level control that's crucial for something like OSDev. Certain operations may be more cumbersome or less intuitive when compared to C, where the dev has more direct control over the hardware. The other main consideration is the the OSDev community has a long history with languages like C and ASM, so there's wayyyyyy more resources, examples/code snippets, helpful forum posts, etc. Using Rust you'll absolutely encounter way fewer examples and less OSDev community expertise. Idk, all in all, while there are successful projects, Rust just isn't battle-tested for OSDev yet and you'll probably run into a lot of issues and/or limitations. I'd say just know what you're getting yourself into, really.

All that being said, Rust does of course offer a lot of nice perks, like memory safety, concurrency safety, and modern tooling. I'd say if you're willing to stick it out and inevitably deal with some really annoying shit, then go for it. Just my two cents.
 
So the way I'm looking at this is kinda like this. Imagine you're a chef, used to cooking with a classic set of kitchen tools--knife, pan, stove, etc. Those tools are straightforward, give you direct control, and have been used forever. There's countless recipes, tips, and communities built around these traditional tools.

Now, suppose you're given a high-tech, modern cooking gadget like an InstantPot or some shit that promises to make cooking safer and more efficient. This gadget has features to prevent common kitchen accidents and ensures your food is cooked perfectly every time. However, learning to use this gadget is like learning to cook all over again. It's complex, has many rules, and you can't just jump in and start cooking the way you're used to. Moreover, the new gadget might not yet have all the attachments you need for every recipe, and there aren't as many cooking guides or experienced chefs who can help you troubleshoot when something goes wrong. Some cooking techniques that are easy with your traditional tools become cumbersome or less intuitive with the new gadget. Idk, probably a shitty analogy, but my point still stands.

Rust has a steep learning curve due to its strict ownership model, lifetimes, and borrowing rules, so that makes it difficult for new developers or those transitioning from other languages like C to pick up and use effectively in OS development, IMO. While Rust is rapidly growing, the reality is that the ecosystem is still relatively young when compared to more established languages like C and ASM. Some OSDev tools, libraries, resources, etc might be lacking/less mature. Another thing to note is that while Rust provides a lot of safety features, it can sometimes abstract away low-level control that's crucial for something like OSDev. Certain operations may be more cumbersome or less intuitive when compared to C, where the dev has more direct control over the hardware. The other main consideration is the the OSDev community has a long history with languages like C and ASM, so there's wayyyyyy more resources, examples/code snippets, helpful forum posts, etc. Using Rust you'll absolutely encounter way fewer examples and less OSDev community expertise. Idk, all in all, while there are successful projects, Rust just isn't battle-tested for OSDev yet and you'll probably run into a lot of issues and/or limitations. I'd say just know what you're getting yourself into, really.

All that being said, Rust does of course offer a lot of nice perks, like memory safety, concurrency safety, and modern tooling. I'd say if you're willing to stick it out and inevitably deal with some really annoying shit, then go for it. Just my two cents.
Best analogy and explanation i read, I'm thinking of sticking to C and ASM, due to their already established position in the OSdev field, and to avoid dealing with useless time-consuming issues, although it would be nice to carve a road for others to follow, Thank you!
 
There are already several operating systems widely available that run Rust in some capacity and a few more that are completely written in it.
Ubuntu is planned to replace its coreutils with coreutils written in Rust instead. Yiffos is another example that uses Rust extensively, however it wasn't written from the ground up with Rust, I think there are some C bindings.
 
/pub/ ~ public channel
Help Users
  • 7EVEN @ 7EVEN:
    time fur some samples here on this coolass forumz
    Quote Link
  • 7EVEN @ 7EVEN:
    i wish i could just like... have a remote controller from that one movie where guy just stops the people and time whenever he felt like it
    Quote Link
  • 7EVEN @ 7EVEN:
    and do that to my father when he has his psychopath tantrum and threatens me or my brothers
    Quote Link
  • 7EVEN @ 7EVEN:
    but like, maybe tune the settings a bit so he could watch me stop him but couldn't do absolutely nothing
    Quote Link
  • 7EVEN @ 7EVEN:
    no mouth and must scream
    Quote Link
  • N Chat Bot:
    Guest newfag88 has joined the room.
  • N (Guest) newfag88:
    Oneohtrix announced a new record and reading the news cycle: "...The album was sparked by Lopatin's discovery that a vast archive of 90s sample CDs had vanished from the Internet Archive, a moment that left Lopatin creatively charged..." lol
    Quote Link
  • O Chat Bot:
    Guest o2mamming has joined the room.
  • O (Guest) o2mamming:
    o2mamming
    Quote Link
  • T Chat Bot:
    Guest Tamux has joined the room.
  • T (Guest) Tamux:
    Quote Link
  • S Chat Bot:
    Guest Scrapguy has joined the room.
  • S (Guest) Scrapguy:
    Oh hey it's back
    Quote Link
  • S (Guest) Scrapguy:
    Hey Ninty guy, if you read this thank you
    Quote Link
  • nyawo @ nyawo:
    helooooo
    Quote Link
  • E Chat Bot:
    Guest end has joined the room.
  • S Chat Bot:
    Guest slam has joined the room.
  • S (Guest) slam:
    hi
    Quote Link
  • S (Guest) slam:
    is any one here
    Quote Link
  • Xeraser @ Xeraser:
    yeah
    Quote Link
  • Ogyn @ Ogyn:
    are admins ever online or is this place abandoned?
    Quote Link
  • ninturez0 @ ninturez0ninturez0's icon:
    Ogyn said:
    are admins ever online or is this place abandoned?
    hi!!
    • Love
    Reactions: Ogyn
    Quote Link
  • bananalizard @ bananalizard:
    omg its nint.....
    Quote Link
  • SonarRonar @ SonarRonar:
    huzzah
    Quote Link
  • Xeraser @ Xeraser:
    aaaaiiiiieeee
    Quote Link
      Xeraser @ Xeraser: aaaaiiiiieeee
      Back
      Top