4 ms·
What if I don't know any C (and not interested in learning)? Should I still choose C over Rust then, provided I do want to learn Rust?
by endorphine 4y ago
What if I don't know any C (and not interested in learning)? Should I still choose C over Rust then, provided I do want to learn Rust?
- junon 4y agoYes. If you want to learn rust, then learn rust. It's a fun language. But kernel concepts are a different beast, and C is better suited for learning them.
- endorphine 4y agoI see, makes sense - I'll stick to C then. Thanks.
- abudabi123 4y agoHave a look at the boundary layer at the top or bottom end of seL4 microkernel. I never knew embedded seL4 is in under iOS. There is a diagram in chapter 2 of the seL4 whitepaper comparing with traditional monolith the microkernel has fewer lines of code, in the ballpark of tens of millions vs tens of thousands.
- junon 4y agoseL4 is not what I'd recommend a newbie to kernel dev look at. It's a very complex project.
- toast0 4y agoYou're going to find more resources to get started on this in C. You might want to start by following guides etc in C until you can get a decent Hello World, maybe SMP (maybe not), and then see if you can do it again in Rust. I'm going to offer some slight differences to junon's advice. x86-32 is an ok target, and may be more approachable (more examples); do your best to get into 32-bit protected mode as soon as possible. You'll need to do that anyway for SMP, unless your chosen bootloader does it for you (most don't, but some do). I personally would skip building a gcc cross compiler; I did it 20 years ago for Dreamcast hobby work, and llvm includes it out of the box. Save your frustration for other things. Try to get a physical test box and use it frequently; I boot mine with PXE. Make sure you have a serial port between the test box and your dev box, because serial is a lot easier than VGA text or UEFI graphics. Be aware that QEMU doesn't apply segment limits by default. This usually doesn't matter as you'll switch to protected mode and have unlimited segments most of the time... But it makes a difference in early boot and starting the non-boot processors.