Live data from Hacker News

Writing an OS in Rust: Introduction to Paging

os.phil-opp.com

1–10 of 81 posts

Re: Writing an OS in Rust: Introduction to Paging

#2
I've followed Phil's site on making an operating system. Ever since having worked on PintOS in college, operating systems and their internals have fascinated me. I've tried learning more about writing operating systems via resources like the OSdev wiki, but much of its material almost seems to discourage working on an OS of any kind unless you're already sure of what you're doing. Phil's articles seems so much more accessible for someone just wanting to dip their toes in the water.

Re: Writing an OS in Rust: Introduction to Paging

#3
I've never programmed in Rust because I still have trouble seeing the point. It seems overly restrictive. A copy of any data has nearly zero marginal cost (and you can pay the cost by doing the work yourself), so in a free machine, it would have nearly zero price. If widely useful data is protected by the borrow checker, far fewer people will use it.

It is easy to show that the total utility of a piece of data to the rest of the program is reduced by assigning an owner to it. Each potential user of the data, faced with the need to mess with the borrow checker to use it, may choose to mess, or may forego use of the data and write a complicated workaround instead.

To counter the borrow checker, I'm currently designing a programming language featuring a mechanism that grants free access to data structures, with the restriction that copiers must grant the same rights to anyone else:

    0. the freedom to use the data for any purpose,
    1. the freedom to change the data to suit your needs,
    2. the freedom to share the data with your friends and neighbors, and
    3. the freedom to share the changes you make.

Re: Writing an OS in Rust: Introduction to Paging

#4
As a side note: I wish Rust would come to embedded development ASAP running a real time OS written in Rust. You can use massive Boost libraries and Qt frameworks on non-embedded systems with C/C++, but in embedded, there is no such luxury. I am new to it but it is painful and I wish to see a day where we have a complete LLVM based ARM compiler toolchain with Rust sitting on top. I think there were some blog posts about running Rust on STM32 but it is still very early.

Re: Writing an OS in Rust: Introduction to Paging

#5

As a side note: I wish Rust would come to embedded development ASAP running a real time OS written in Rust. You can use massive Boost libraries and Qt frameworks on non-embedded systems with C/C++, but in embedded, there is no such luxury. I am new to it but it is painful and I wish to see a day where we have a complete LLVM based ARM compiler toolchain with Rust sitting on top. I think there were some blog posts abo…

It is still pretty early, but if there's been quite a bit of progress this year. This is probably the closest to what you are looking for that exists at the moment: https://github.com/japaric/cortex-m-rtfm

You can also follow the Rust Embedded Working Group blog if you wish: https://rust-embedded.github.io/blog/

Re: Writing an OS in Rust: Introduction to Paging

#6

As a side note: I wish Rust would come to embedded development ASAP running a real time OS written in Rust. You can use massive Boost libraries and Qt frameworks on non-embedded systems with C/C++, but in embedded, there is no such luxury. I am new to it but it is painful and I wish to see a day where we have a complete LLVM based ARM compiler toolchain with Rust sitting on top. I think there were some blog posts abo…

Have you looked at TockOS? https://www.tockos.org

I took a class in it about 2 years ago now, it was really cool. I’m not an embedded developer though, so not sure of your needs here.

Re: Writing an OS in Rust: Introduction to Paging

#7

I've followed Phil's site on making an operating system. Ever since having worked on PintOS in college, operating systems and their internals have fascinated me. I've tried learning more about writing operating systems via resources like the OSdev wiki, but much of its material almost seems to discourage working on an OS of any kind unless you're already sure of what you're doing. Phil's articles seems so much more a…

I agree. Wouldn't it be amazing to have a "Handmade Hero" series but for OS development in Rust? That would be incredible.

A lot of the OS development, especially esoteric subjects are behind walls of IP control barring Linux kernel. Even then, just reading the source code is different than having access to the knowledge base that enables you to write such a code. I am new to all of this but like you, I am fascinated.

Re: Writing an OS in Rust: Introduction to Paging

#8

I've never programmed in Rust because I still have trouble seeing the point. It seems overly restrictive. A copy of any data has nearly zero marginal cost (and you can pay the cost by doing the work yourself), so in a free machine, it would have nearly zero price. If widely useful data is protected by the borrow checker, far fewer people will use it. It is easy to show that the total utility of a piece of data to the…

> A copy of any data has nearly zero marginal cost

I don't think this is true at all. Reducing copies and allocations in my programs is one of the things which has speeded them up the most.

> If widely useful data is protected by the borrow checker, far fewer people will use it.

Are you also against private struct/class fields? Because they also restrict access to useful data.

For me, the need for Rust is as a language that gives me maximum possible performance, while giving me safety guards that C and C++ do not. This makes Rust much easier to use than those languages for me.

Re: Writing an OS in Rust: Introduction to Paging

#9

As a side note: I wish Rust would come to embedded development ASAP running a real time OS written in Rust. You can use massive Boost libraries and Qt frameworks on non-embedded systems with C/C++, but in embedded, there is no such luxury. I am new to it but it is painful and I wish to see a day where we have a complete LLVM based ARM compiler toolchain with Rust sitting on top. I think there were some blog posts abo…

It is still pretty early, but if there's been quite a bit of progress this year. This is probably the closest to what you are looking for that exists at the moment: https://github.com/japaric/cortex-m-rtfm You can also follow the Rust Embedded Working Group blog if you wish: https://rust-embedded.github.io/blog/

Thank you for sharing, subscribed. As I read through the Rust Embedded Work Group manifesto, it is comforting to see the level of organizational skills, planning and vision of the team involved. Bravo. https://github.com/rust-embedded/wg

Re: Writing an OS in Rust: Introduction to Paging

#10

I've followed Phil's site on making an operating system. Ever since having worked on PintOS in college, operating systems and their internals have fascinated me. I've tried learning more about writing operating systems via resources like the OSdev wiki, but much of its material almost seems to discourage working on an OS of any kind unless you're already sure of what you're doing. Phil's articles seems so much more a…

I agree. Wouldn't it be amazing to have a "Handmade Hero" series but for OS development in Rust? That would be incredible. A lot of the OS development, especially esoteric subjects are behind walls of IP control barring Linux kernel. Even then, just reading the source code is different than having access to the knowledge base that enables you to write such a code. I am new to all of this but like you, I am fascinated…

Just found "Handmade Hero" last weekend and now this. Programmer's dream
Post reply on HN