6 ms·
This is going to end up somewhat specific, as most low-level initialization routines are. ARM vs x86 vs RISC-V vs MIPS vs a BASIC stamp or propeller etc... I w
by justaaron 7y ago
This is going to end up somewhat specific, as most low-level initialization routines are.
ARM vs x86 vs RISC-V vs MIPS vs a BASIC stamp or propeller etc...
I will suggest studying some general Assembly language concepts, memory locations, how to set-up RAM timings and bring offchip RAM into an address space, etc.
This stuff is used daily in the world of microcontrollers,
I'm a huge fan of the Parallax propeller, in which the Spin interpreter in ROM launches Assembly routines on individual cores in about the simplest fashion possible...
Some things you may find interesting:
https://github.com/dwelch67/raspberrypi https://github.com/dwelch67/raspberrypi
https://github.com/rsta2/circle https://github.com/rsta2/circle
https://ultibo.org/ https://ultibo.org/
Think of the latter 2 as "HAL plus some primitives" rather than RTOS...
- justaaron 7y agoGo is garbage collected, and thus not remotely suitable for bare-metal work. C, C++, Rust, possibly Ocaml, FORTH, FreePascal, etc... or else you are actually on about a virtual machine, not bare metal. Learning how to create your own heap. Make your own malloc/free on a baremetal device and that will be a huge boost for you, confidence wise...
- pjmlp 7y ago> Go is garbage collected, and thus not remotely suitable for bare-metal work. Others beg to differ, selling GC enabled development environments from small PICs to grown up ARM deployments. http://www.astrobe.com/default.htm http://www.astrobe.com/default.htm http://www.microej.com/ http://www.microej.com/ https://www.aicas.com/cms/ https://www.aicas.com/cms/ https://www.ptc.com/en/products/developer-tools/perc https://www.ptc.com/en/products/developer-tools/perc https://www.microdoc.com/ibm-websphere-everyplace-custom-environment-wece_ https://www.microdoc.com/ibm-websphere-everyplace-custom-env... Some solutions even considered suitable for bare metal work by the US and French military. And speaking of Go on bare metal, https://tinygo.org/ https://tinygo.org/
- justaaron 7y agoWell, is any of this actual bare-metal environments for coding? It's more of a HAL meets RTOS, and it's certainly not self-bootstrapping in Go, which is impossible on real hardware, or?
- pjmlp 7y agoAstrobe is certainly bare metal, just like some of the Java deployment options, with AOT compilation to target boards, like Aicas and PTC are capable of.
- justaaron 7y agoThanks, that's interesting and very new to me. I appreciate the links
- pjmlp 7y agoIf you want an example of GC in bare bones all the way from building your own FPGA up to the graphics display, check the 2013 update from Project Oberon. http://www.projectoberon.com/ http://www.projectoberon.com/ https://inf.ethz.ch/personal/wirth/ProjectOberon/index.html https://inf.ethz.ch/personal/wirth/ProjectOberon/index.html Sadly the ready made OberonStation boards are no longer on sale.
- sansnomme 7y agoTo be fair, you will learn a lot more getting a garbage collected language to run bare metal runtime and all.
- justaaron 7y agoimplementing in a non-garbage collected lower-level language, of course. Even FORTH's stack requires some ASM words to set it up... or am I missing something here?
- snaky 7y ago"Steel Bank Common Lisp: because sometimes C abstracts away too much" https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembl...