indicogniBuild a VMM

Lab

cpio inspector

Used in chapter 13, the cpio-initramfs primer.

Drop an initramfs (or pick a sample) and walk it the way Linux does: every member, every newc header field and padding byte, which later entries overwrite earlier ones, the boot-log lines that follow, and what a host cpio tool shows instead.

Runs in browser
cpio inspector: both.cpio, as the kernel and a host tool read it both.cpio is 1,024 bytes: two newc archives of one 512-byte block each. Archive 1 holds init (21 bytes, echo hello): a 110-byte header at 0, the name init and its NUL at 110 to 114, one padding byte, the data at 116 to 136, three padding bytes, then TRAILER!!! at 140, whose next header would start at 264, and zeros to 512. Archive 2 at 512 holds init again (22 bytes, echo second) and its own trailer. A host cpio tool stops at the first TRAILER!!! and lists one init of 21 bytes. The kernel treats each trailer as the end of one member, keeps reading, and the second init replaces the first. both.cpio (1,024 bytes) member 1 at 0: init (21) + TRAILER!!! member 2 at 512: init (22) + TRAILER!!! one entry: header, name, pad, data, pad 0 header (110) 110 init\0 116 data (21 bytes) 140 next host cpio -itv: stops at the first TRAILER!!!, lists one init (21 bytes) kernel: reads both members; /init is member 2's (echo second)

All labs