ts-7000
[Top] [All Lists]

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

To:
Subject: Re: [ts-7000] Re: TS-7350: SD Flash resize partitions
From: Mark Featherston <>
Date: Wed, 23 Nov 2011 11:11:20 -0700


Rod,

>So, to rephrase your explanation of the boot process, with some context that may be more familiar to some who might see this later: the FPGA performs the function analogous to the BIOS of a conventional x86 box, by loading the first stage boot loader from the MBR. It sounds like the FPGA also does more at that point, by also loading the kernel, and only then transferring control to the second stage of the bootloader. Do I have that right?

You have the first part right, but after it loads the MBR and has the CPU execute code from there the FPGA is no longer involved in the boot process.  The kernel and initrd are loaded and executed from the MBR code.

>The reason I ask, is that my long term goal would be to use a more flexible bootloader; something grub-like or isolinux-like (PXE-Linux actually). My present theory is that I could substitute my own second-stage bootloader in the MBR, and let it load subsequent bootloader stages, ignoring the already loaded kernel, but loading a runtime-specified kernel and kernel commandline. Does this sound realistic/possible?

We have never investigated this on the newer boards.  On earlier products we have used redboot.  We've investigated other bootloaders as well, but what most of our customers seem most concerned about is boot speed for their end product.  Redboot and uboot are essentially small operating systems so by using one of those you are booting an operating system to boot an operating system which adds unnecessary complexity and boot time.  We implemented the TS-BOOTROM specifically to only do just what is necessary to get Linux up and running as fast and with as little complexity as possible.

You may be able to implement redboot, uboot, or possibly the experimental ARM-GRUB on this board but there will be some complexity and development required.  You would need to be able to at very least talk to the SD card, or if you want PXE booting then also the network.  If you go with redboot, ethernet drivers will already exist from our previous products that used redboot with the EP9302.  This might be a good starting point for PXE booting at very least.
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7250-linux/sources/ecos-redboot-src.tar.gz

However I believe you would still have to write an SD driver as I'm not sure one currently exists in the bootloader.  The only other requirement is that whichever bootloader you chose is okay with being located where our bootrom puts it (they may just be position independant).  Keep in mind if this boot process takes too long you will have to edit the source for one of the bootloaders and either feed or disable the watchdog.  You would have to load the boot loader as you currently do the kernel (with the first 0xda partition).

I'm not sure of the maturity of this in the ARM world, but another possibility to explore to the same end would be kexec.  You could boot the first kernel and kexec to another kernel with specified arguments.  You could even request a dhcp address and pull down the new kernel specified in the DHCP options with curl/wget to implement PXE.

>I believe I recall seeing published assembler source code for the MBR, but I can't seem to locate it any more. Is that still available?
Unfortunately the bootloader source is one of the few things we do not release.
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/23/2011 09:00 AM, Rod wrote:
 

Thanks, Mark.

That information is exactly what I needed. I've now got a SD flash with a larger initrd partiton that boots.I must have been close all along, as I did get the three progress dots, just no further boot. I simply repeated the whole process, paying close attention to every detail, and it worked. I must have initially done overlooked some detail.

So, to rephrase your explanation of the boot process, with some context that may be more familiar to some who might see this later: the FPGA performs the function analogous to the BIOS of a conventional x86 box, by loading the first stage boot loader from the MBR. It sounds like the FPGA also does more at that point, by also loading the kernel, and only then transferring control to the second stage of the bootloader. Do I have that right?

The reason I ask, is that my long term goal would be to use a more flexible bootloader; something grub-like or isolinux-like (PXE-Linux actually). My present theory is that I could substitute my own second-stage bootloader in the MBR, and let it load subsequent bootloader stages, ignoring the already loaded kernel, but loading a runtime-specified kernel and kernel commandline. Does this sound realistic/possible?

I believe I recall seeing published assembler source code for the MBR, but I can't seem to locate it any more. Is that still available?

Thanks for the help.

--- rod.

--- In , Mark Featherston m("...","mark");"><> wrote:
>
> 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
>
>



__._,_.___


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