6 ms·
What is the use-case in real life ? Is it to run special lab/factory equipment ? Anyone here who develops for bare metal - can you share any details?
by cyrusmg 8y ago
What is the use-case in real life ?
Is it to run special lab/factory equipment ? Anyone here who develops for bare metal - can you share any details?
- choeger 8y agoThe use case is to break some layers of abstraction. If no one would write such a guide, who would create the next OS? We would all be dammed to copy existing codes and pray they work. I applaude the author for the effort, in particular using images that can be booted should make it feasible to use these techniques for teaching!!
- z3t4 8y agoA dream I've had for a long time is to make an application that you boot into, which is the only application on the computer, for maximum optimization. Upgrades would be easy, just reboot the computer and load the new software. Wouln't write everything in assembly though.
- cirosantilli 8y agoYes, the ASM overkill was a mistake of my youth :-) https://github.com/cirosantilli/x86-bare-metal-examples/tree/85931f4e4a9551470a712f15421c69ee5204cfdc#to-c-or-not-to-c https://github.com/cirosantilli/x86-bare-metal-examples/tree...
- teddyh 8y agoWhat you describe used to be very common: https://en.wikipedia.org/wiki/PC_booter https://en.wikipedia.org/wiki/PC_booter
- adrianN 8y agoSo a Unikernel with your program?
- rramadass 8y agoThis is standard "embedded" system programming for lower-end MCUs. "Unikernels" use the same concept to create standalone bootable binaries(linked with reqd. OS modules) to run directly either on HW or on a VM Hypervisor. See "IncludeOS" for one representative example.
- Taniwha 8y agoyou're describing any number of embedded systems, including the Arduino runtime - load up an Arduino app and you have your dream come true :-)
- OskarS 8y agoThe problem comes when you need to use any kind of hardware, all the drivers would have to be part of your app. The "unikernel" concept however does some version of this: loads a kernel which only supports the minimal amount of functionality and drivers needed and with only a single address space for a single app.
- 0xcde4c3db 8y agoHistorically this was more tractable because driver code was much simpler and there was a lot of cloning/emulation of "legacy" hardware interfaces (a lot of this is still present on PC, despite vendors' desire to get rid of it). Typically either the hardware capabilities were fundamentally narrower in scope than modern hardware or the hardware had its own controller (sometimes with more raw power than the host CPU...) that implemented an abstract interface. A bare-metal VGA driver for a single mode is no more than a few dozen lines of code, whereas a modern GPU driver stack literally has an optimizing compiler built into it.
- pjmlp 8y agoBesides what everyone is commenting on, this is how Amiga, Atari ST and most console games used to be done.
- cirosantilli 8y agoThis repo is mostly just educative as a helper to understand Linux kernel x86 / Linux kernel drivers In e.g. ARM, baremetal is potentially more useful due to embedded. But even in ARM you should just use Linux kernel / some RTOS if you can get away with it :-)