Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
phil-opp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
phil-opp
10y ago
I definitely plan to integrate the futures library in the kernel somehow. We just need some asynchronous things and threads first :).
32.
▲
by
phil-opp
10y ago
> STI; LRET works too, and it's faster for stupid reasons. Interesting, didn't know that. > This is an entirely ordinary sequence of events. [...] It turns out that this actually causes a problem on AMD CPUs Sometimes I thin
33.
▲
by
phil-opp
10y ago
Thank you so much!
34.
▲
Writing an OS in Rust: Returning from Exceptions
(os.phil-opp.com)
175 points
by
phil-opp
10y ago
|
54 comments
35.
▲
by
phil-opp
10y ago
> What you probably do not want to do is old-fashioned swap space on disk Yeah, that's what I meant. I definitely plan to use the various lazy loading tricks for mmaped files, loading executables, etc. But first we need a disk drive
36.
▲
by
phil-opp
10y ago
Thanks so much!
37.
▲
by
phil-opp
10y ago
> This is the easy part - capturing exceptions. Handling them, and returning control with the machine state intact, is the messy part. Yeah, I plan to tackle this in the next post: Compiling without red zone, saving/restoring all re
38.
▲
by
phil-opp
10y ago
See https://doc.rust-lang.org/book/functions.html#diverging-func... and https://doc.rust-lang.org/reference.html#diverging-functions
39.
▲
by
phil-opp
10y ago
Thanks :)
40.
▲
by
phil-opp
10y ago
As others have mentioned, you need assembly operations to access hardware specific control registers. However, most system languages have some kind of inline assembly, which can be used to encapsulate those operations into e.g. a C or Rust
41.
▲
by
phil-opp
10y ago
Yeah, it depends on personal taste. However, Ranges [1][2] are a core type of Rust and used pretty frequently, so it shouldn't be completely alien to Rust users… [1]: https://doc.rust-lang.org/book/iterators.html
42.
▲
Writing an OS in Rust: Catching CPU Exceptions
(os.phil-opp.com)
171 points
by
phil-opp
10y ago
|
41 comments
43.
▲
by
phil-opp
11y ago
I don't have much experience with ARM… I'm trying my hands on a stm32 board at the moment and things are very different from x86 so far. If someone has ideas or suggestions, I would appreciate a comment at [1]. [1]: https:/&
44.
▲
Writing an OS in Rust: Kernel Heap
(os.phil-opp.com)
156 points
by
phil-opp
11y ago
|
8 comments
45.
▲
This Week in Redox OS
(redox-os.org)
2 points
by
phil-opp
11y ago
|
0 comments
46.
▲
by
phil-opp
11y ago
Thanks! Glad you enjoyed it :)
47.
▲
by
phil-opp
11y ago
Thanks :) Yes, Rust is a great language for kernel development. I can really recommend learning it this way (I've done the same).
48.
▲
by
phil-opp
11y ago
I will! Thanks for the kind words :)
49.
▲
by
phil-opp
11y ago
Glad you like it :)
50.
▲
by
phil-opp
11y ago
I think Steve's goal is it to make OS development more accessible to newcomers. Even people from dynamic languages who never heard of stack/heap should be able to follow it. It's a really great project that dispels the myth t
51.
▲
by
phil-opp
11y ago
Yes, you need to manually manage memory. But you can't do it wrong in Rust¹. It's an error at compile time . No use after free, no double free, and no dangling pointers are possible. The same applies to iterator invalidation and
52.
▲
by
phil-opp
11y ago
Maybe it's a good time to say a little bit about this project. I started it because I was unhappy with the existing documentation. Most resources were mainly for 32-bit and there was hardly any documentation about Rust OS development.
53.
▲
Writing an OS in Rust: Remap the Kernel
(os.phil-opp.com)
179 points
by
phil-opp
11y ago
|
25 comments
54.
▲
by
phil-opp
11y ago
Besides not liking UEFI, I'm open to support it as well. Do you know some good resources?
55.
▲
by
phil-opp
11y ago
Yeah, thepowersgang's kernel is severely underrated.
56.
▲
by
phil-opp
11y ago
Thanks a lot! New stuff is in the making :)
57.
▲
by
phil-opp
11y ago
It's a bit more complicated for real hardware. I think it could be done by using the serial port and hardware breakpoint registers.
58.
▲
by
phil-opp
11y ago
QEMU supports gdb out of the box. Unfortunately gdb has some problems with the transition to 64 bit, but fixing it is relatively easy (you need to build gdb from source though). I just wrote a guide that should make it straightforward: htt
59.
▲
by
phil-opp
11y ago
The quick guide seems really great! Thanks for the link
60.
▲
by
phil-opp
11y ago
Note that this post continues the Writing an OS in Rust series [1] and assumes some familiarity with the existing system and Rust. [1]: http://os.phil-opp.com
More ›