ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: Building a TS7300 file system from scratch

To:
Subject: Re: [ts-7000] Re: Building a TS7300 file system from scratch
From: Eddie Dawydiuk <>
Date: Tue, 22 May 2007 09:21:25 -0700 (MST)
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/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU