Evening!
I'm running through the amazing Baking Pi tutorials, which actually convinced me to buy an rPi in the first place. I realize I (obviously) can't emulate the "status" light, but I read all of those documents and think I have a good idea of what's happening.
Now that I've gotten to the "screen" portions, I should be able to emulate those programs with qemu, right? I realize that I need to already have something like Raspbian (which according to the tutorial should be on an SD card), but how should I best expand the img file to replace the kernel.img file with my own?
Obviously, I've already tried something along the lines of qemu -kernel kernel.img -cpu arm1176 -m 256 -M versatilepb -serial stdio
with no luck because it's obviously missing the bootloader.
Any ideas? Suggestions? I really appreciate the help!
If anyone was curious without wanting to dig through the lessons, here's the relevant excerpt: "To install your operating system, first of all get a Raspberry PI SD card which has an operating system installed already. If you browse the files in the SD card, you should see one called kernel.img. Rename this file to something else, such as kernel_linux.img. Then, copy the file kernel.img that make generated onto the SD Card. You've just replaced the existing operating system with your own. To switch back, simply delete your kernel.img file, and rename the other one back to kernel.img. I find it is always helpful to keep a backup of you original Raspberry Pi operating system, in case you need it again." src
UPDATE I think I'm getting a little closer, but still with no luck. I had to mount the raspbian image in two phases, one for the main partition, and once for the boot partition (mount -o loop,offset=$((122880 * 512)) rasbian.img /mnt/img && mount -o loop,offset=$((8192 * 512)) rasbian.img /mnt/img/boot
).
I then went to /mnt/img/boot
renamed kernel.img, and cp'd my own kernel.img to the dir. It took me a while to realize that when I unmounted /mnt/img
it wasn't saving my files back to the img (duh).
My next course of action was to repack the mount with mkisofs -o test.img /mnt/img
which took quite a bit of time only to result in qemu crashing when running the command aforementioned. Any other suggestions?