3 ms·
In QEMU it's dead simple, you have control of everything; I believe that it boots into https://github.com/qemu/qemu/tree/master/pc-bios https://github.com/qemu/
by pjc50 7y ago
In QEMU it's dead simple, you have control of everything; I believe that it boots into https://github.com/qemu/qemu/tree/master/pc-bios https://github.com/qemu/qemu/tree/master/pc-bios
A physical machine will still, despite everything, start executing at FFFF:0000 in "real mode", and the code run there will be found in a physical EEPROM. Some of these are socketed (although this is less common these days). So you can get in there and fiddle with the pre-boot code.
See https://www.drdobbs.com/parallel/booting-an-intel-architecture-system-par/232300699 https://www.drdobbs.com/parallel/booting-an-intel-architectu...
There is no way round the Management Engine, a source of distress to some. Oh, and you won't have any DRAM until you've run the DRAM training and turned that on, the early BIOS gets to use the cache as a scratchpad instead. See https://blog.asset-intertech.com/test_data_out/2014/11/memory-training-testing-and-margining.html https://blog.asset-intertech.com/test_data_out/2014/11/memor...
If you like bare metal work with decent processing power ARM is probably the place to start.
- saagarjha 7y agoDoesn't every ARM machine have its own initialization sequence?
- XMPPwocky 7y agoYes, but if you can find a chip with public documentation, it's a well-defined initialization sequence. I learned assembly on TI's AM335x "Sitara" series and it was great, mostly because of the BeagleBone- it has onboard JTAG-over-USB, meaning you can single-step your way through your bare-metal code, set breakpoints, etc.
- Gibbon1 7y agoUnsure about the high end ARM machines. But an ARM Cortex boot consists of loading the program counter and stack pointer from ROM and go.
- monocasa 7y agoThey're all cortex cores these days, you mean the Cortex-M series.
- pjc50 7y agoYes, that gets the CPU running - but for practical work you usually need to do some board-specific setup like configuring clocks and turning on the DRAM.
- Gibbon1 7y agoFor an Cortex M0 the clocks default to something sane. And RAM is static. One of my projects the reset vector is just the address of init function written in C. That does nothing more than copy the data section from flash to ram and call _start() There is a bunch of peripheral set up but it can be done from C.
- yjftsjthsd-h 7y ago> In QEMU it's dead simple, you have control of everything; I believe that it boots into https://github.com/qemu/qemu/tree/master/pc-bios https://github.com/qemu/qemu/tree/master/pc-bios Manpage currently claims, "QEMU uses the PC BIOS from the Seabios project and the Plex86/Bochs LGPL VGA BIOS." But it also looks like that's as easy to replace as passing `-bios` to qemu-system-
- heinrichhartman 7y agoThat looks exactly what I was looking for. Thanks!