Rewrite Linux Kernel in Rust?
dominuscarnufex.github.io
Rewrite Linux Kernel in Rust?
1–10 of 133 posts
Re: Rewrite Linux Kernel in Rust?
#2Re: Rewrite Linux Kernel in Rust?
#3Re: Rewrite Linux Kernel in Rust?
#4Most of the headache was build toolchain integration stuff. I did manage to get a few simple things slotted in that appear to work transparently, which made me hopeful for future more complicated things to play with like new process mailbox implementations, etc.
Anyway, great write up and a cool project!
Re: Rewrite Linux Kernel in Rust?
#5I wonder what makes AT&T assembly syntax "objectively crap".
Intel: mov eax, 5
AT&T: movl $5, %eax
In basically every C-like programming language, you assign 5 to eax with `eax=5` not `5=eax`. I can also tell that I'm working with the `long` variant of `mov` just by looking at the types involved.Intel's syntax for memory access seems more natural. If I don't want to add `ebx` to the address, I can leave it out; I can't in AT&T; I have to have this seemingly random comma. Plus, what's with the format?
Intel: mov eax, [ds:eax*4+16]
AT&T: movl ds:16(,%eax,4)Re: Rewrite Linux Kernel in Rust?
#6I wonder what makes AT&T assembly syntax "objectively crap".
Re: Rewrite Linux Kernel in Rust?
#7Re: Rewrite Linux Kernel in Rust?
#8I wonder what makes AT&T assembly syntax "objectively crap".
You need to explicitly specify what the parameter sizes and types are. Plus, the parameters are backwards compared to Intel syntax: Intel: mov eax, 5 AT&T: movl $5, %eax In basically every C-like programming language, you assign 5 to eax with `eax=5` not `5=eax`. I can also tell that I'm working with the `long` variant of `mov` just by looking at the types involved. Intel's syntax for memory access seems more natural…
> you assign 5 to eax
AT&T speaks English, basically. We move A to B. Destination goes last.
Both seem sane enough. And in fact both get really balled up when you have three and four-argument instructions.
Re: Rewrite Linux Kernel in Rust?
#9Discussion about whether this is a good idea or not, and the problems of doing so, can now commence in earnest, and without the pesky problem of it being mostly theoretical.