5 ms·
Using BIOS calls doesn't seem to be really "bare metal". One could use bios interrupt to read data from a disk, or also one could use memory mapping with a targ
by self_awareness 8y ago
Using BIOS calls doesn't seem to be really "bare metal". One could use bios interrupt to read data from a disk, or also one could use memory mapping with a target device to write a device driver that could request the file. I find the second case a "bare metal" approach.
Fortunately most of the bios examples are using bios_* filenames. Rest of the files are very nice.
- cirosantilli 8y agoYes, here we go again: https://news.ycombinator.com/item?id=18532102 https://news.ycombinator.com/item?id=18532102 :-) I wonder how much lower level you can go with QEMU / how much it can match real hardware. Pull requests / links welcome ;-)
- deleted 8y ago[deleted]
- pm215 8y agoQEMU runs the 'seabios' bios image in the guest, so you could certainly run a 'bare metal' custom image instead of the default BIOS blob if you wanted. At the basic level of "prod the UART, prod the timers" we should be a reasonable match to real hardware. Running on real hardware without the BIOS would be trickier as you start to need to do things like set up memory controllers, which you can get away without on QEMU.
- self_awareness 8y agoOkay I've sent you a pull request with a bare metal hello world example ;)
- snaky 8y agoOne could follow this "toward the bare metal" way as long as he wish. E.g. in Silego GreenPAK chips a CPU is considered unneeded abstraction and you program the raw state machine.