Root on Disk

From Digisaster
Jump to: navigation, search


An embedded system may not have a disk, an IDE interface, or even a PCI bus. Even if it does, during development it may be too unstable to use the disk, and a ramdisk may be too small to include all of the necessary utilities or too large (as a part of the kernel image) to allow for rapid turnaround during testing and development.

The idea behind this is to create another partition on the hard disk, format it with ext2 and use it as root file system. Modification to the player's firmware can now be done on the hard disk. No more flash cycles necessary. Switching the player off and on again will activate the changes.

All code examples on this page assume that you are doing this on a system running Linux. Use VmWare Player to run Linux as a guest inside a Windows system.

Preparing KiSS Firmware

KiSS players use the ROMFS filesystem for their flash memory. The boot loader reads and starts the Linux kernel from it. The Linux kernel initiializes the hardware and than mounts the ROMFS as its root filesystem and starts /sbin/init from it. On KiSS players the Linux kernel starts the main DVD player application (we call it kissapp).

Since the boot loader is not able to load the Linux kernel from hard disk, it has to remain in flash.

First step is to configure the Linux kernel to mount its root filesystem from a hard disk. The following options are required to be set

CONFIG_CMDLINE="root=/dev/discs/disc0/part3 rootfstype=ext2 panic=5"

Next step is to rebuild the kernel, copy the resulting linux.bin.gz to the ROMFS, rebuild and flash firmware.

For those who want to keep Stage2 in flash memory can boot the new kernel from a bootable CD. See download section.

Preparing Harddisk

/ # fdisk -l /dev/discs/disc0/disc

Disk /dev/discs/disc0/disc: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                Device Boot    Start       End    Blocks   Id  System
/dev/discs/disc0/part1               1        1000     8032468+  83  Linux
/dev/discs/disc0/part2            1001        9733    70147822+  83  Linux
/dev/discs/disc0/part3               1           1           0    0  Empty
Partition 3 does not end on cylinder boundary.
/ # mount
/dev/discs/disc0/part1 on /systempart type ext2 (rw)
/dev/discs/disc0/part2 on /hdd type ext2 (rw)



Here you will find firmware ISO images with HDD pre-configured. Report any problem with it in Stage2 bug reporting thread at the Stage2 forum.

Firmware ISO images
Player Comment Download
DP508 based on original stage2 1.0 work in progress