First your must know exactly how linux boot (not at source code level).
Most recent linux distributions boot as
grub —> kernel —> initramfs’ /init executable
All the userspace affair is started by initramfs’ /init. Kernel no longer join the boot process.
>From you description, I think you were blocked by the initramfs concept. Initramfs is the first root filesystem and reside in memeory.
It’s loaded by grub, and the kernel automatically mount it, execute the /init. The /init executable can do some extra initialisation
and switch to the real root filesystem on disk.
for detail /Documentaion/filesystems/ramfs-rootfs-initramfs
Hope that would be useful to your.
(commands in fdisk)
> n (new partition)
> p (primary partition)
> 1 (partition number)
> (default start and end for partition)
> t (change type of partition)
> b (change type of partition to FAT32)
> a (set boot flag)
> 1 (set boot flag for first partition)
> w (write changes)
Disk /dev/loop0
: 1048 MB, 1048576000 bytes123 heads, 59 sectors/track, 282 cylinders, total 2048000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x7b9351bfDevice Boot Start End Blocks Id System/dev/loop0p1 * 2048 2047999 1022976 b W95 FAT32
Disk /dev/loop0: 1048 MB, 1048576000 bytes255 heads, 63 sectors/track, 127 cylinders, total 2048000 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Device Boot Start End Blocks Id System