Risc-V C3 Bare Metal Hello World!
HTML-код
- Опубликовано: 10 сен 2024
- I walk through creating a bare metal hello world C3 program for the Risc-V architecture and test it using QEMU.
I forked the C3 repo and added this little test to the maintainer's CI workflow to prove that C3 could actually build a working Risc-V ELF.
Resources
Code for this project: github.com/chu...
The C3 repo: github.com/c3l...
I used elements from my prior video here: • Risc-V Bare Metal C He...
in C, volatile and const are called qualifiers.
As for the order during link time, it is important (at least for gcc). I've been bitten by it several times with libraries, if libA uses a symbol defined in libB you need to do -lB -lA.
But I wonder why we don't have that issue with basic C code, since multiple .o files can cross-reference symbols and you never get linker errors. (or is it just main that has the "issue"?)
Qualifiers...thanks. I'm edge of genx, so recall is fading ;-)
I think this is related to optimization, but, full disclosure...I used chatgpt to help me figure out a solution. Re your C code comment...yeah. This is why I was confused in the first place.
I did enjoy playing around with C3...
chatgpt.com/share/2c82d6fe-913e-4bca-9819-e28dfaf57788
@@chuckbenedict7235 i love that u used gpt, idk why but i love it