ts-7000
[Top] [All Lists]

Re: [ts-7000] TS-7350: SD Flash resize partitions

To:
Subject: Re: [ts-7000] TS-7350: SD Flash resize partitions
From: Mark Featherston <>
Date: Tue, 22 Nov 2011 17:12:18 -0700


Rod,

The TS-BOOTROM consists of two parts, the code in the FPGA which does low level initialization of the CPU and MMU.  It reads the first 512 bytes of the SD card, and jumps execution to the binary there.  The code in the MBR looks at the partition table for the first partition of type 0xda, and loads this to memory 0x8000.  The second partition of type 0xda is loaded into memory at 0x1000000.  This also sets up the ATAGS which are used by the kernel to identify the hardware, and so it knows where to load the initrd.  After that it jumps into execution at 0x8000 to the kernel.  The kernel will recognize the ATAGS (which are in a standard location for ARM at 0x100) and it will see the initrd as /dev/ram0.  If you look at the default kernel config, we define the cmdline as: "root=/dev/ram0 rw init=/linuxrc lpj=498688 console=null"

If you don't have the MBR, you can take the first 446 bytes of our image and write it to yours (dd if=<ourimage> count=446 bs=1 of=<yourimage>).

>Anyone know how to interpret these?

  >> TS-BOOTROM - built Sep 24 2008
  >> Copyright (c) 2008, Technologic Systems
  >> Booting from SD card...
  . < Loaded the MBR
  . < Loaded the Kernel
  . < Loaded the initrd

>
Some things I've tried have resulted in fewer dots being printed
The last 2 dots are printed out from the MBR.  If this is missing it will not attempt to load the kernel and initrd.

> Is there some special constraints on the partitioning?
Only that the 0xda partitions must be on primary partitions.  After that it is up to Linux to handle any other partitions.

>My Debian 6 host's fdisk can't seem to create partitions that are not aligned on cylinder boundaries. Does this matter?
Try using fdisk with the -uc option which should work on Debian 6.  It should still boot without doing this but we still recommend having your partitions aligned at 512 byte sectors.

>I would like to be able to add a few MB, and load a small number of extra programs to allow me to run the board entirely from ram disk.
A few MB should be fine, but keep in mind the watchdog is armed by default.  If it takes too long to load the kernel and initrd into memory and begin execution, you will trip the watchdog and the board will reboot.  We disable it by default in the linuxrc script. (peekpoke 16 0x600ff0d6 0x3 disables the watchdog).

Try enabling the console so you get more debug output from the kernel.  Rebuild it and set the cmdline to be:
"root=/dev/ram0 rw init=/linuxrc lpj=498688 console=ttyAM0,115200"

If it continues to print absolutely nothing, then it is either being loaded too slowly, there is a bug with any other drivers you may be adding, or the file is somehow corrupt/incomplete.  In that case make sure it fits in the kernel partition, or redownload/rebuild the kernel.  If it does print something, then you will at least have more information to go off of.
Best Regards, 
________________________________________________________________
 Mark Featherston, Technologic Systems | voice: (480) 837-5200
 16525 East Laser Drive                | fax: (480) 837-5300
 Fountain Hills, AZ 85268              | web: www.embeddedARM.com 

On 11/22/2011 11:41 AM, Rod wrote:
 

Hi all.

I have been trying various things to resize the initrd partition on an SD flash card. I would like to be able to add a few MB, and load a small number of extra programs to allow me to run the board entirely from ram disk. Nothing I have been able to do so far has reulted in a bootable flash card. Besides accomplishing the near-term goal, I would also really like to know how things work starting from power-up, and what the expectations are by the TS-BOOTROM code. There are some confusing aspects.

The SD flash card has four partitions:

  •   1. FAT partition, only populated in the 2GB distribution. Windows cross-development tools.
  •   2. Non-filesystem partition, Linux kernel image.
  •   3. Non-filesystem, initrd image (but...)
  •   4. Full Debian JFFS2 filesystem (but I have converted to ext2)

The initrd on partition 3 is mountable as an ext2 filesystem, although it is labled as a type 'da', Non-FS data. This leads to my first question: how does TS=BOOTROM find and load the partition as an initrd? Does it know how to read the partition table on the flash card, or does it 'know' about specific fixed blocks to copy into RAM, or...?
Since TS distributes at least two different flavors of SD Flash images, I assume there must be some run-time detection of the flash partitioning. Is there some special constraints on the partitioning? My Debian 6 host's fdisk can't seem to create partitions that are not aligned on cylinder boundaries. Does this matter?

What I thought should work:
  •   1. burn the image to flash, using dd (works fine)
  •   2. mount the last two partitions on a desktop host
  •   3. tar the contents of each of the partitions to disk files
  •   4. use fdisk to delete and re-create different sized partitions
  •   5. restore the data to the partitions, from the tar files.
When I do this, and try to boot from the flash disk, I get:

  >> TS-BOOTROM - built Sep 24 2008
  >> Copyright (c) 2008, Technologic Systems
  >> Booting from SD card...
  .
  .
  .

The series of dots seems to indicate some form of progress by the bootloader, or other code. Anyone know how to interpret these? Some things I've tried have resulted in fewer dots being printed, so I assume that this indicates even less success. :-(

Ultimately, I would like to be able to compose an image file completely on a (Debian 6) development host, using standard tools, and probably in some scripted way. I just seem to be missing some key piece(s) of information. I would really appreciate any help or pointers to the missing pieces of the puzzle.

   ---  rod.



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<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