So years back my high school computer science teacher was going on about that games from the early days could "now" be fitted on a bios chip. Later decided to study engineering thanks to that guy. A bunch of years passed, bios flash chips got bigger and now I decided to take on the challenge. I dug up a small kernel and user space image from a class and decided to use it as a base. It's a small multi threaded network game, a couple of MBs in size. I still have the source code but as university projects went, we didn't use version control and it might take quite sometime to get it working again. I still have the working images though. Note, the kernel is responsible for the switch to long mode.
kernel-x86_64-pc99: ELF 32-bit LSB executable, Intel 80386
module: ELF 64-bit LSB executable, x86-64
Of course I could use some UEFI and embed the images together with grub but that's just overkill and not the point of the exercise as I kinda want to explore the bare metal x86 area.
I don't need a huge setup, basically just a PCI net device and serial for debugging. So I decided to modify a small bios i.e. qboot to my needs. Everything runs with qemu (+ kernel + initrd option) but qboot loads the kernel+module from the qemu fw_cfg. Now I am trying to get rid of all the qemu stuff and there is still things to do.
And here is my question, how do I add the images to the bios binary?
Can I somehow add the images (as a section) to my bios elf before dumping it as a binary? And how would I later in my bios code find the address and size of my images?
Currently I am testing everything on qemu to not burn my flat but later I intend to flash it onto an old Gigabyte Mobo.