[OLPC-devel] just verified: 2306 + olpc + linux kernel works.

Marcelo Tosatti marcelo at kvack.org
Thu May 25 19:00:06 EDT 2006


On Tue, May 23, 2006 at 10:59:09AM -0300, Marcelo Tosatti wrote:
> On Mon, May 22, 2006 at 03:12:20PM -0300, Marcelo Tosatti wrote:
> > On Thu, May 18, 2006 at 09:03:08PM -0600, Ronald G Minnich wrote:
> > > 	version 2306 will boot a linux kernel.
> > > 
> > > What would help is if one of you wants to build the absolute minimum 
> > > kernel and initrd and send me a source tree pointer and .config. I'm 
> > > using 2.6.14 with tiny linux patches right now.
> > 
> > Ron,
> > 
> > FYI:
> > 
> > I'm writing a small program to mount the flash partition with JFFS2,
> > read the kernel from there, and sys_kexec() it.
> 
> Ok, not so easy. Latest versions of kexec-tools include a "purgatory"
> stage which contains ~= 40k of code (intermediate state between two
> running kernels).
> 
> Will need to come up with a slim version of the userspace kexec
> procedure, shouldnt be very hard either.

Ron, 

I've uploaded a tarball with code to load a kernel from flash and boot
it via the kexec() system call (ripped from kexec-tools 1.98).

http://hera.kernel.org/~marcelo/olpc/olpc-boot-loader-idea.tar.gz

Inside it you can find:

- the uClibc .config file used
- the kernel .config file used 
- three kernel patches: small kexec issue, module to enable NAND via MSRs,
usage of ld's -gc-sections.

The statically linked program results in 37112 bytes, and compressed
ext2 rootfs used as RAMDISK (olpc-boot-loader + necessary /dev files)
results in 19458 bytes.

bzImage (no PCI, no USB, no networking) is about 380k in size,
compressed.

I'm using David's tree at git://git.infradead.org/mtd-2.6.git/

Its pretty damn fast to boot (no tuning at all), mounting JFFS2 and
reading the kernel from flash takes the longest time.

Note: the program assumes that the kernel image in NAND is named
"bzImage" residing at the top of the tree. It allows you to change the
command line passed to the kernel.

I'm trying to mount JFFS2 as root at the moment...

Ah, to disable PCI you want to comment this code in drivers/mtd/nand/cs553x.c:

static int __init cs553x_init(void)
{
        /* Check whether we actually have a CS5535 or CS5536 */
#if 0
        if (!pci_find_device(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CS5536_ISA, NULL) &&
            !pci_find_device(PCI_VENDOR_ID_NS,  PCI_DEVICE_ID_NS_CS5535_ISA, NULL))
                return -ENXIO;
#endif




More information about the Devel mailing list