[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using kernels bigger than 1966080 bytes on the nslug with slugimage



On Tue, Feb 10, 2009, Marc Singer wrote:
> I responded to L. Minier with the suggestion that you move the load
> address for the kernel to something after APEX.  Try 0x01000000.  You
> could also change the VMA address for APEX to be 3MiB from the base of
> RAM instead of 2MiB.

 It was an excellent suggestion, it worked just fine; thanks!

 I'm attaching your message here (I hope that's ok with you, don't think
 anything was private) since it has helpful information and Oliver
 brought up the problem here as well, so I can as well attach the
 solution.

 I think Oliver tried our various ramdisk sizes and started seeing
 issues with ramdisks of size 5636080 and above; I didn't research what
 these issues are as I don't have access to a NSLU2 myself, but I guess
 it might be interesting to someone to look into making the APEX default
 config accept any theoritical kernel and initrd size in the 0 - 8M
 range (since that's the size of the flash).

 Oliver, if you think the APEX changes wouldn't harm on Debian could you
 please share them here as to allow Marc (who's also Debian maintainer
 of APEX I believe) to perhaps merge them?  I don't think official
 Debian builds need them right now, but it could help users building
 custom larger kernels or in the future if the kernel size grows as
 Ubuntu's did.

   Thanks again for your help Marc,
-- 
Loïc Minier
--- Begin Message ---
On Tue, Feb 10, 2009 at 06:21:44PM +0100, Loïc Minier wrote:
>         Hi
> 
>  We're trying to enable NSLU2 images on Ubuntu, but our kernels are
>  larger.  If we build debian-installer with Debian's kernel and flash
>  the resulting image, the Debian kernel fires okay.  However as soon as
>  we change the number of blocks the kernel is using (and compensate the
>  number of blocks used by the initrd by the same amount), APEX hangs
>  when loading the kernel.  So any large kernel seems to trigger the
>  issue.
> 
>  The symptom is as follows:
> ...
> # copy -s $kernelsrc $bootaddr
> # copy -s fis://kernel 0x00008000
>  /
> 
>  You can see the animation running shortly, then hanging.

If I read your output correctly, the kernel went from 11 blocks to 16
blocks.  If a block is 128KiB--which I suspect from the way that NSLU2
flash is organized, you've got a kernel that is 2MiB.  I would further
suspect that what is happening is the kernel is clobbering APEX as it
is read.  APEX does nothing to protect itself from such behavior.  If
this is what is happening, you only need to move the $bootaddr address
to free space beyond APEX.  It doesn't really matter where since the
kernel will relocate to 0x8000 while it unpacks.

Try setting bootaddr to 0x01000000.  I recall that this is where
RedBoot loads the kernel.

Cheers.


--- End Message ---
--- Begin Message ---
        Hi

 We're trying to enable NSLU2 images on Ubuntu, but our kernels are
 larger.  If we build debian-installer with Debian's kernel and flash
 the resulting image, the Debian kernel fires okay.  However as soon as
 we change the number of blocks the kernel is using (and compensate the
 number of blocks used by the initrd by the same amount), APEX hangs
 when loading the kernel.  So any large kernel seems to trigger the
 issue.

 The symptom is as follows:
...
# copy -s $kernelsrc $bootaddr
# copy -s fis://kernel 0x00008000
 /

 You can see the animation running shortly, then hanging.

 We checked the resulting APEX-aware partition tables in both cases, and
 they seem to match the changes and have the necessary number of blocks.

 I'm attaching the slugimage debug runs with normal and large kernel
 sizes (the vmlinuz file is the same, but padded by debian-installer
 to 16 blocks in the large case instead of 11 in the normal case).

 Any idea of where to look next?  The "skips" seem to be inserted at the
 right places (at the beginning of each APEX partition, and at the place
 where the NSLU2's RedBoot expects one -- kernel + 0xE0000).

   Thanks!
-- 
Loïc Minier
ogra@babbage:~/d-i/ixp4xx_netboot-new$ slugimage -d -p -L ./apex.flash.swapped -r ./initrd.gz.swapped -k ./vmlinuz-2.6.26-1-ixp4xx.swapped -o di-nslu2-test.bin
Initial partition map:
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          (undefined)	(undefined)
Kernel          (undefined)	(undefined)
Ramdisk         (undefined)	(undefined)
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0
Trailer         0x007FFFF0	0x00000010
Read 0x00040000 bytes from "/tmp/file74m5H3" into <RedBoot> (2 blocks / 2 blocks)
Read 0x00020000 bytes from "/tmp/fileKLzr3V" into <SysConf> (1 blocks / 1 blocks)
Read 0x0001FFE0 bytes from "./apex.flash.swapped" into <Loader> (1 blocks / 1 blocks)
Read 0x0015FFE0 bytes from "./vmlinuz-2.6.26-1-ixp4xx.swapped" into <Kernel> (11 blocks / 11 blocks)
Read 0x005FFFF0 bytes from "./initrd.gz.swapped" into <Ramdisk> (48 blocks / 48 blocks)
Read 0x00000010 bytes from "/tmp/filexRMMIR" into <Trailer> (0x00010 bytes / 0x00010 bytes)
after readInFirmwareParts():
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          (undefined)	0x00020000
Kernel          (undefined)	0x00160000
Ramdisk         (undefined)	0x00600000
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0
Trailer         0x007FFFF0	0x00000010
Last variable size partition is <Ramdisk>
Pointer is 0x50000000
Allocated <RedBoot> from 0x50000000 to 0x50040000 (2 blocks / 2 blocks)
Moving pointer from 0x50000000 to 0x50040000 (0x50000000 + 0x00040000)
Pointer is 0x50040000
Allocated <EthAddr> from 0x5003FFB0 to 0x5003FFB6 (0x00000 bytes / 0x00006 bytes)
Moving pointer from 0x50040000 to 0x50040000 (0x5003FFB0 + 0x00000006)
Pointer is 0x50040000
Allocated <SysConf> from 0x50040000 to 0x50060000 (1 blocks / 1 blocks)
Moving pointer from 0x50040000 to 0x50060000 (0x50040000 + 0x00020000)
Pointer is 0x50060000
Allocated <Loader> from 0x50060000 to 0x50080000 (0x1FFF0 bytes / 1 blocks)
Moving pointer from 0x50060000 to 0x50080000 (0x50060000 + 0x00020000)
Pointer is 0x50080000
Allocated <Kernel> from 0x50080000 to 0x501E0000 (11 blocks / 11 blocks)
Moving pointer from 0x50080000 to 0x501E0000 (0x50080000 + 0x00160000)
Pointer is 0x501E0000
Padding last variable partition <Ramdisk> to 0x00600000 bytes
Allocated <Ramdisk> from 0x501E0000 to 0x507E0000 (48 blocks / 48 blocks)
Moving pointer from 0x501E0000 to 0x507E0000 (0x501E0000 + 0x00600000)
Pointer is 0x507E0000
Allocated <FIS directory> from 0x507E0000 to 0x50800000 (0x00000 bytes / 1 blocks)
Moving pointer from 0x507E0000 to 0x50800000 (0x507E0000 + 0x00020000)
Pointer is 0x50800000
Allocated <Loader config> from 0x507F8000 to 0x507FC000 (0x00000 bytes / 0x04000 bytes)
Moving pointer from 0x50800000 to 0x50800000 (0x507F8000 + 0x00004000)
Pointer is 0x50800000
Allocated <Microcode> from 0x507FC000 to 0x507FFFE0 (0x00010 bytes / 0x03FE0 bytes)
Moving pointer from 0x50800000 to 0x50800000 (0x507FC000 + 0x00003FE0)
Pointer is 0x50800000
Allocated <Trailer> from 0x507FFFF0 to 0x50800000 (0x00010 bytes / 0x00010 bytes)
Moving pointer from 0x50800000 to 0x50800000 (0x507FFFF0 + 0x00000010)
after layoutPartitions():
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          0x00060000	0x00020000	[0x00000/0x00010]
Kernel          0x00080000	0x00160000	[0x00000/0x00010, 0xE0000/0x00010]
Ramdisk         0x001E0000	0x00600000	[0x00000/0x00010]
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0	[0x00000/0x00010]
Trailer         0x007FFFF0	0x00000010
Table entry <RedBoot> from 0x50000000 to 0x50040000 (2 blocks / 2 blocks)
No table entry required for <EthAddr>
Table entry <SysConf> from 0x50040000 to 0x50060000 (1 blocks / 1 blocks)
Table entry <Loader> from 0x50060000 to 0x50080000 (0x1FFE0 bytes / 1 blocks)
Table entry <Loader> skip 0x00000000 to 0x0000000F
Table entry <Kernel> from 0x50080000 to 0x501E0000 (11 blocks / 11 blocks)
Table entry <Kernel> skip 0x00000000 to 0x0000000F, 0x000E0000 to 0x000E000F
Table entry <Ramdisk> from 0x501E0000 to 0x507E0000 (48 blocks / 48 blocks)
Table entry <Ramdisk> skip 0x00000000 to 0x0000000F
Table entry <FIS directory> from 0x507E0000 to 0x50800000 (1 blocks / 1 blocks)
No table entry required for <Loader config>
No table entry required for <Microcode>
No table entry required for <Trailer>
after buildPartitionTable():
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          0x00060000	0x00020000	[0x00000/0x00010]
Kernel          0x00080000	0x00160000	[0x00000/0x00010, 0xE0000/0x00010]
Ramdisk         0x001E0000	0x00600000	[0x00000/0x00010]
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0	[0x00000/0x00010]
Trailer         0x007FFFF0	0x00000010
Wrote  2 blocks (0x00000000 to 0x00040000) from <RedBoot> into "di-nslu2-test.bin"
Skipping <EthAddr> (no data available)
Wrote  1 blocks (0x00040000 to 0x00060000) from <SysConf> into "di-nslu2-test.bin"
Wrote  1 blocks (0x00060000 to 0x00080000) from <Loader> into "di-nslu2-test.bin"
Inserted 0x00010 bytes (at offset 0xE0000) into <Kernel>
Wrote 11 blocks (0x00080000 to 0x001E0000) from <Kernel> into "di-nslu2-test.bin"
Wrote 48 blocks (0x001E0000 to 0x007E0000) from <Ramdisk> into "di-nslu2-test.bin"
Wrote  1 blocks (0x007E0000 to 0x00800000) from <FIS directory> into "di-nslu2-test.bin"
Skipping <Loader config> (no data available)
Skipping <Microcode> (no data available)
Rewound 0x00010 bytes before <Trailer> in "di-nslu2-test.bin"
Wrote 0x00010 bytes (0x007FFFF0 to 0x00800000) from <Trailer> into "di-nslu2-test.bin"
ogra@babbage:~/d-i/ixp4xx_netboot-new$ slugimage -d -p -L ./apex.flash.swapped -r ./initrd.gz.swapped -k ./vmlinuz-2.6.26-1-ixp4xx.swapped -o di-nslu2-test.bin
Initial partition map:
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          (undefined)	(undefined)
Kernel          (undefined)	(undefined)
Ramdisk         (undefined)	(undefined)
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0
Trailer         0x007FFFF0	0x00000010
Read 0x00040000 bytes from "/tmp/fileBNAfs7" into <RedBoot> (2 blocks / 2 blocks)
Read 0x00020000 bytes from "/tmp/file2GlHu8" into <SysConf> (1 blocks / 1 blocks)
Read 0x0001FFE0 bytes from "./apex.flash.swapped" into <Loader> (1 blocks / 1 blocks)
Read 0x001FFFE0 bytes from "./vmlinuz-2.6.26-1-ixp4xx.swapped" into <Kernel> (16 blocks / 16 blocks)
Read 0x0055FFF0 bytes from "./initrd.gz.swapped" into <Ramdisk> (43 blocks / 43 blocks)
Read 0x00000010 bytes from "/tmp/fileRUmhg8" into <Trailer> (0x00010 bytes / 0x00010 bytes)
after readInFirmwareParts():
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          (undefined)	0x00020000
Kernel          (undefined)	0x00200000
Ramdisk         (undefined)	0x00560000
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0
Trailer         0x007FFFF0	0x00000010
Last variable size partition is <Ramdisk>
Pointer is 0x50000000
Allocated <RedBoot> from 0x50000000 to 0x50040000 (2 blocks / 2 blocks)
Moving pointer from 0x50000000 to 0x50040000 (0x50000000 + 0x00040000)
Pointer is 0x50040000
Allocated <EthAddr> from 0x5003FFB0 to 0x5003FFB6 (0x00000 bytes / 0x00006 bytes)
Moving pointer from 0x50040000 to 0x50040000 (0x5003FFB0 + 0x00000006)
Pointer is 0x50040000
Allocated <SysConf> from 0x50040000 to 0x50060000 (1 blocks / 1 blocks)
Moving pointer from 0x50040000 to 0x50060000 (0x50040000 + 0x00020000)
Pointer is 0x50060000
Allocated <Loader> from 0x50060000 to 0x50080000 (0x1FFF0 bytes / 1 blocks)
Moving pointer from 0x50060000 to 0x50080000 (0x50060000 + 0x00020000)
Pointer is 0x50080000
Allocated <Kernel> from 0x50080000 to 0x50280000 (16 blocks / 16 blocks)
Moving pointer from 0x50080000 to 0x50280000 (0x50080000 + 0x00200000)
Pointer is 0x50280000
Padding last variable partition <Ramdisk> to 0x00560000 bytes
Allocated <Ramdisk> from 0x50280000 to 0x507E0000 (43 blocks / 43 blocks)
Moving pointer from 0x50280000 to 0x507E0000 (0x50280000 + 0x00560000)
Pointer is 0x507E0000
Allocated <FIS directory> from 0x507E0000 to 0x50800000 (0x00000 bytes / 1 blocks)
Moving pointer from 0x507E0000 to 0x50800000 (0x507E0000 + 0x00020000)
Pointer is 0x50800000
Allocated <Loader config> from 0x507F8000 to 0x507FC000 (0x00000 bytes / 0x04000 bytes)
Moving pointer from 0x50800000 to 0x50800000 (0x507F8000 + 0x00004000)
Pointer is 0x50800000
Allocated <Microcode> from 0x507FC000 to 0x507FFFE0 (0x00010 bytes / 0x03FE0 bytes)
Moving pointer from 0x50800000 to 0x50800000 (0x507FC000 + 0x00003FE0)
Pointer is 0x50800000
Allocated <Trailer> from 0x507FFFF0 to 0x50800000 (0x00010 bytes / 0x00010 bytes)
Moving pointer from 0x50800000 to 0x50800000 (0x507FFFF0 + 0x00000010)
after layoutPartitions():
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          0x00060000	0x00020000	[0x00000/0x00010]
Kernel          0x00080000	0x00200000	[0x00000/0x00010, 0xE0000/0x00010]
Ramdisk         0x00280000	0x00560000	[0x00000/0x00010]
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0	[0x00000/0x00010]
Trailer         0x007FFFF0	0x00000010
Table entry <RedBoot> from 0x50000000 to 0x50040000 (2 blocks / 2 blocks)
No table entry required for <EthAddr>
Table entry <SysConf> from 0x50040000 to 0x50060000 (1 blocks / 1 blocks)
Table entry <Loader> from 0x50060000 to 0x50080000 (0x1FFE0 bytes / 1 blocks)
Table entry <Loader> skip 0x00000000 to 0x0000000F
Table entry <Kernel> from 0x50080000 to 0x50280000 (16 blocks / 16 blocks)
Table entry <Kernel> skip 0x00000000 to 0x0000000F, 0x000E0000 to 0x000E000F
Table entry <Ramdisk> from 0x50280000 to 0x507E0000 (43 blocks / 43 blocks)
Table entry <Ramdisk> skip 0x00000000 to 0x0000000F
Table entry <FIS directory> from 0x507E0000 to 0x50800000 (1 blocks / 1 blocks)
No table entry required for <Loader config>
No table entry required for <Microcode>
No table entry required for <Trailer>
after buildPartitionTable():
RedBoot         0x00000000	0x00040000
EthAddr         0x0003FFB0	0x00000006
SysConf         0x00040000	0x00020000
Loader          0x00060000	0x00020000	[0x00000/0x00010]
Kernel          0x00080000	0x00200000	[0x00000/0x00010, 0xE0000/0x00010]
Ramdisk         0x00280000	0x00560000	[0x00000/0x00010]
FIS directory   0x007E0000	0x00020000
Loader config   0x007F8000	0x00004000
Microcode       0x007FC000	0x00003FE0	[0x00000/0x00010]
Trailer         0x007FFFF0	0x00000010
Wrote  2 blocks (0x00000000 to 0x00040000) from <RedBoot> into "di-nslu2-test.bin"
Skipping <EthAddr> (no data available)
Wrote  1 blocks (0x00040000 to 0x00060000) from <SysConf> into "di-nslu2-test.bin"
Wrote  1 blocks (0x00060000 to 0x00080000) from <Loader> into "di-nslu2-test.bin"
Inserted 0x00010 bytes (at offset 0xE0000) into <Kernel>
Wrote 16 blocks (0x00080000 to 0x00280000) from <Kernel> into "di-nslu2-test.bin"
Wrote 43 blocks (0x00280000 to 0x007E0000) from <Ramdisk> into "di-nslu2-test.bin"
Wrote  1 blocks (0x007E0000 to 0x00800000) from <FIS directory> into "di-nslu2-test.bin"
Skipping <Loader config> (no data available)
Skipping <Microcode> (no data available)
Rewound 0x00010 bytes before <Trailer> in "di-nslu2-test.bin"
Wrote 0x00010 bytes (0x007FFFF0 to 0x00800000) from <Trailer> into "di-nslu2-test.bin"

--- End Message ---

Reply to: