News for hackers. Stuff that matters.
Re:x86 Bare Metal Examples by self_awareness on Tuesday March 19, 2019 @04:57AM (#19429148)
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.

Re:x86 Bare Metal Examples by cirosantilli on Tuesday March 19, 2019 @05:10AM (#19429197)
Yes, here we go again: 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 ;-)

Re:x86 Bare Metal Examples by pm215 on Tuesday March 19, 2019 @08:02AM (#19429992)
QEMU 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.
Re:x86 Bare Metal Examples by self_awareness on Tuesday March 19, 2019 @08:49AM (#19430233)
Okay I've sent you a pull request with a bare metal hello world example ;)
Re:x86 Bare Metal Examples by snaky on Tuesday March 19, 2019 @05:30AM (#19429282)
One 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.