Specifications
#################################################################
#################################################################
#################################################################
#################################################################
##########################
done
Bytes transferred = 3788800 (39d000 hex)
=> ide part
Partition Map for IDE device 0 -- Partition Type: DOS
Partition Start Sector Num Sectors Type
1 32 500704 6
=> ide write 100000 20 1ce8
IDE write: device 0 block # 32, count 7400 ... 7400 blocks written: OK
Note that the "ide write" command takes parameters as hex numbers, and the write count is in
terms of disk blocks of 512 bytes each. So we have to use 0x20 for the starts sector of the first
partition, and 3788800 / 512 = 7400 = 0x1CE8 for the block count.
We now prepare the Linux boot arguments to take this partition as read-only root device:
=> setenv cf_args setenv bootargs root=/dev/hda1 ro
=> setenv flash_cf 'run cf_args addip;bootm ${kernel_addr}'
=> setenv bootcmd run flash_cf
2.
...and boot the system:
...
Linux version 2.4.25 (wd@xpert) (gcc version 3.3.3 (DENX ELDK 3.1.1 3.3.3-9)) #1 Sun Jun 12 18:32:18 MEST 2005
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/hda1 ro ip=192.168.3.80:192.168.3.1::255.255.255.0:tqm860l:eth1:off panic=1
Decrementer Frequency = 187500000/60
Calibrating delay loop... 49.86 BogoMIPS
...
3.
9.5.6. Root File System in a Read-Only File in a
FAT File System
This is a more complicated example that shows that - depending on project requirements - many other
alternatives for chosing a root file system for your embedded system exist.
The scenario is as follows: on your embedded device you use a cheap and popular storage medium like
CompactFlash, MMC or SD cards or USB memory sticks to store both the Linux kernel and your root file
system. You want to distribute software updates over the internet: your customers can download the file from
your web site, or you sent the images by email. Your customers may use any flash card or memory stick they
happen to find, so you have no information about brand or size of the storage device.
Unfortunately most of your customers use Windows systems. And they don't want to be bothered with long
instructions how to create special partitions on the storage device or how to write binary images or things like
that. A simple "copy file" operation is nearly exhausting their capabilities.
What to do? Well, if copying a file is all your customers can do we should not ask for more. Storage devices
like CompactFlash cards etc. typically come with a single partition on it, which holds a FAT or VFAT file
system. This cannot be used as a Linux root file system directly, so we have to use some trickery.
9.5.6. Root File System in a Read-Only File in a FAT File System 121