Hello,
>> The first 446 bytes is the bootcode. The partition table resides in
> bytes
>> 447-512.
>>
>>> The second partition contains the kernel. How should I prepare the
>>> kernel and partition? Do I just dd vmlinuz to the partition after
>>> setting up the partition table? Or do I use some sort file system?
>>
>> The kernel resides on the first patition, you don't need to do any
>> setup. That is you don't want to use a file system, simply dd your
>> kernel to the first partition after the partition table has been setup.
>>
>>> The third partition contains the file system which I assume is just a
>>> generic ext2.
>>
>> The second partition contains an initial ramdisk, this is the fastboot
>> environment. No setup needs to happen on this partition, just dd your
>> initial ramdisk to this partition. The third partition contains an ext2
>> file system...
>
> One more question: How do I get the bootcode and the partition table
> into the right place?
You can use the dd command, I would copy the first 512 bytes and then
use fdisk to modify the partition table as you need.
e.g.
Clone the MBR
dd if=/dev/sda of=mbr.dd bs=512 count=1
You can also download our default shipping MBR here
ftp://oz.embeddedarm.com/images/mbr/mbr-sd-1.00
You'll notice our default shipping MBR is 16K as apposed to 512 bytes.
The reason for this is the first sector is guarenteed good from the
factory. Also the erase size is 16K. If the first partition started at
byte 512 then the first sector would be rewritten when cetain data on
the first partition was modified. This could lead to the first sector
wearing out and being marked bad. If the first sector was marked bad
we could no longer boot the SD card... As a result we place the MBR in
the first sector and start the first partition on the second sector.
> I know very little about the low-level structure of various storage
> devices. AFAIK, dd and fdisk won't give me control to that level....
>
> So what can I do?
The location of the partition table in bytes 447-511 is pretty standard,
this is where fdisk expects to find the partition table. You can use
fdisk to modify the partition table as you need.
> Can I just copy the first 512 byte block from a good SD card, dd it to
> the new (blank) card, and then edit the partition table?
Exactly ;) Although you may want to copy the first 16k as mentioned
above.
--
Best Regards,
______________________________________________________________
Eddie Dawydiuk, Technologic Systems | voice: (480) 837-5200
16610 East Laser Drive Suite 10 | fax: (480) 837-5300
Fountain Hills, AZ 85268 | web: www.embeddedARM.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|