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…
Get used to the idea that embedded is 15 years behind PC. Which is initially frustrating but if you step back is kind of a good thing. I’d also like to see Rust make it’s way into embedded. C support for things like data serialization or RPC for interfacing to web stuff is limited, people just don’t port it to C. And C++ doesn’t thrill me in terms of its non-deterministic garbage handling and difficult to debug natur…
Writing an OS in Rust: Introduction to Paging
61–70 of 81 posts
Re: Writing an OS in Rust: Introduction to Paging
#62Why not join Redox?
Re: Writing an OS in Rust: Introduction to Paging
#63Re: Writing an OS in Rust: Introduction to Paging
#64Re: Writing an OS in Rust: Introduction to Paging
#65Earlier quoted context omitted.
It's been a while since I've looked into it so I hope I won't be too far off the mark: - Regarding high impedance it might be relevant if you want to explain how the controller and memory card interface works, and why you read full 1s when nothing is connected (high impedance line with a pull-up resistor). More generally the issue will crop up every time you have an interface that might be floating, I think people wh…
It's conceivable that metastability issues could be used as a part of copy protection. Well, protection against emulation more like. Of course it's not the smartest choice for that purpose, because there might be chip-to-chip differences. And environmental factors like temperature could affect it as well. But who knows what people wrote after Bleem PS1 emulator was public? So have metastability issues (or other HW bu…
Re: Writing an OS in Rust: Introduction to Paging
#66Off topic: can we please get support for storing arbitrary data structures inside mmapped files (with nonfixed base address)?
That's not possible to do safely for arbitrary data structures because they can contain pointers or references. If you reload to a different address then the pointers, even within the allocated chunk, would be invalid and require fixup. And if you require fixup then you might as well do (de)serialization for your data structures. Just allocating into such a memory region (essentially custom page swapping) will eventu…
I found an old discussion on this topic here: https://news.ycombinator.com/item?id=13890011
Note that the Microsoft C++ compiler implements based pointers, using the __based keyword.
Re: Writing an OS in Rust: Introduction to Paging
#67I'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 think it's one of these things that's more approachable if you start by working on specific subsystems of an existing OS. This way you don't have to figure everything out at once. At least that's how I did it. I think writing an OS from scratch is discouraging and not very accessible because... writing an OS is discouraging and not very accessible. It's a bit as if a painter was saying "It tried looking up guides o…
The trouble is, you get yet another UNIX clone that way.
Re: Writing an OS in Rust: Introduction to Paging
#68Re: Writing an OS in Rust: Introduction to Paging
#69With memory growing arguably beyond what most application workloads really require anyways, and possibly hardware such as Intel Optane, do we still need things like VM, paging, and segmentation?
Yes. To begin with, on modern processors, paging is tied with the memory protection system. Memory is protected on a per-page basis. Memory mapped files are implemented through paging. There's also backwards compatibility. Virtual memory allows 32-bit applications to have their physical memory located anywhere. Without that, we'd have to ensure that they reside below 4GB. Programs would start up slower as the executable would have to be relocated every time. Additionally, it's hard to imagine a hypervisor that doesn't use virtual memory. Virtual memory allows hypervisors to present a unified address space to their guests; no matter how fragmented physical memory gets.
Re: Writing an OS in Rust: Introduction to Paging
#70Earlier quoted context omitted.
I think it's one of these things that's more approachable if you start by working on specific subsystems of an existing OS. This way you don't have to figure everything out at once. At least that's how I did it. I think writing an OS from scratch is discouraging and not very accessible because... writing an OS is discouraging and not very accessible. It's a bit as if a painter was saying "It tried looking up guides o…
I fully agree, but I think it's good to have options on how to approach the issue. Generally, I've referred to OSDev when I need more real-world information on how things tend to work in practice and resources like Phil's when writing a toy operating system. I wouldn't consider Phil's blog a good resource for, e.g., gaining particular insight into how something like the Linux kernel works, but I also don't think Phil…
Have you tried reading any book?