Ok, been away a while trying to sort this. I have written an image builder and I have built and booted an SD card using QEMU. I can't however get it to boot on the Pi. I
As I understand it, the boot process involves the GPU looking for the first FAT32 partition and loading "bootcode.bin". It does not execute MBR code but looks in the MBR partition table to locate the first FAT32 partition. Partitions don't need to be marked as bootable. Please correct me if I have that wrong.
I believe I have everything in place that the bootloader needs but it doesn't boot.
I have two partitions: partition 1 is "boot": FAT32 (type 0x0C) and partition 2 is "root", formatted ext4:
Code: Select all
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 2048 196607 97280 c W95 FAT32 (LBA)
/dev/mmcblk0p2 196608 4194303 1998848 83 Linux
I have inspected the sector 0 in a stock ArchLinux image (the June 16th one) and there are bytes in there. I have tried copying the first 446 bytes across into my image (just in case the MBR does get executed) but it made no difference. My sector 0 (without those bytes) is shown below:
Code: Select all
$ dd if=/dev/mmcblk0 bs=1 count=512 | hexdump -C
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 00 00 00 19 a9 c2 f3 00 00 00 20 |............... |
000001c0 21 00 0c 3c 30 0c 00 08 00 00 00 f8 02 00 00 3c |!..<0..........<|
000001d0 31 0c 83 15 50 05 00 00 03 00 00 00 3d 00 00 00 |1...P.......=...|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
512+0 records in
512+0 records out
00000200
512 bytes (512 B) copied, 0.00690266 s, 74.2 kB/s
$
So I have a card formatted with 2 partitions. One of those (the first one) is FAT32 and contains the boot files:
Code: Select all
arm128_start.elf bootcode.bin COPYING.linux kernel.img start.elf
arm192_start.elf cmdline.txt kernel_cutdown.img LICENCE.broadcom
arm224_start.elf config.txt kernel_emergency.img loader.bin
What makes this difficult is that there is zero visual feedback on the Pi so I have absolutely no idea where the problem is. Any pointers greatly appreciated.
I have an image builder waiting to be released into the wild just as soon as I have this working
