OpenWrt Forum Archive

Topic: Booting a WHR-HP-AG108 / vmlinuz entry point

The content of this topic has been archived on 5 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Sorry to ask but I seem at a lost on this one. I can compile kamikaze, but have been unable to load it on a a WHR-HP-AG108, or at least I cannot find the way to do it.

The flash table on the router was originally like this:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xBE000000  0xBE000000  0x00050000  0x00000000
RedBoot config    0xBE3DF000  0xBE3DF000  0x00001000  0x00000000
FIS directory     0xBE3D0000  0xBE3D0000  0x0000F000  0x00000000
vmlinux.bin.gz    0xBE050000  0x80002000  0x000B4B98  0x80182398
rootfs            0xBE120000  0xBE120000  0x0029C000  0x00000000
user.property     0xBE3E0000  0xBE3E0000  0x00010000  0x00000000
Radio.Config      0xBE3F0000  0xBE3F0000  0x00010000  0x00000000
RedBoot>

And I modified it to this:

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xBE000000  0xBE000000  0x00050000  0x00000000
RedBoot config    0xBE3DF000  0xBE3DF000  0x00001000  0x00000000
FIS directory     0xBE3D0000  0xBE3D0000  0x0000F000  0x00000000
rootfs            0xBE050000  0xBE050000  0x002A0000  0x00000000
linux             0xBE2F0000  0x80100000  0x000C0000  0x80100000
nvram             0xBE3B0000  0xBE3B0000  0x00010000  0x00000000

Here's the redboot version:

RedBoot(tm) bootstrap and debug environment [ROM]
Non-certified release, version v2_0 - built 17:04:25, Jan 13 2006
Buffalo Version: 1.00.1.00

Copyright (C) 2000, 2001, 2002, Red Hat, Inc.

RAM: 0x80000400-0x81000000, 0x80000400-0x80fe1000 available
FLASH: 0xbe000000 - 0xbe3f0000, 63 blocks of 0x00010000 bytes each.

And here's what I did:

RedBoot> ip -l 192.168.1.4 -h 192.168.1.88
IP: 192.168.3.4/255.255.255.0, Gateway: 192.168.1.1
Default server: 192.168.1.88, DNS server IP: 192.168.1.1
RedBoot> load -r -v -b 0x80041000 openwrt-atheros-2.6-root.squashfs
-
Raw file loaded 0x80041000-0x80160fff, assumed entry at 0x80041000
RedBoot> load -r -v -b 0x80100000 openwrt-atheros-2.6-vmlinux.lzma
-
Raw file loaded 0x80100000-0x801affff, assumed entry at 0x80100000
RedBoot> exec
Now booting linux kernel:
 Base address 0x80080000 Entry 0x80100000
 Cmdline :
*** Exception error!! -> vecter (2), error (12)

Any hints where to look and what to do? How do I get the correct entry point of the vmlinuz image?

Thank you.

do it this way:

delete the old partitions:

fis delete vmlinux.bin.gz
fis delete rootfs
fis delete nvram

then load the firmware and create the new partitions:

load -r -b %{FREEMEMLO} openwrt-atheros-2.6-vmlinux.gz
fis create -r 0x80041000 -e 0x80041000 vmlinux.bin.gz
load -r -b %{FREEMEMLO} openwrt-atheros-2.6-root.squashfs

check the size of the free flash space, and use it as a parameter for the rootfs partitioning, eg. if it's 0x300000 then

fis create -l 0x300000 rootfs

I did load the flash as suggested. Here's the flash directory after the load operation

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xBE000000  0xBE000000  0x00050000  0x00000000
RedBoot config    0xBE3DF000  0xBE3DF000  0x00001000  0x00000000
FIS directory     0xBE3D0000  0xBE3D0000  0x0000F000  0x00000000
vmlinux.bin.gz    0xBE050000  0x80041000  0x000F0000  0x80041000
rootfs            0xBE140000  0x80000400  0x00290000  0x80000400

RedBoot> fis free
  0xBE260000 .. 0xBE3D0000
  0xBE3E0000 .. 0xBE3F0000

RedBoot> fis load vmlinux.bin.gz
RedBoot> exec
Now booting linux kernel:
 Base address 0x80080000 Entry 0x80041000
 Cmdline :
*** Exception error!! -> vecter (10), error (20)

The kernel won't boot. I tried with the lzma kernel too and it won't boot either. I tried downloading the daily atheros build from http://downloads.openwrt.org/snapshots/atheros-2.6/ and it won't boot either.

What am I missing?

maybe "fis load -d vmlinux.bin.gz"... Please read the output of "help" in RedBoot smile

Kaloz wrote:

maybe "fis load -d vmlinux.bin.gz"... Please read the output of "help" in RedBoot smile

That worked!

Ouch... help lists only the -d option without explaining. I found the redboot docs here: http://ecos.sourceware.org/docs-latest/ … guide.html

Now... why i cannot pass the "root=...." option to the kernel?

RedBoot> exec -c "root=/dev/mtdblock4" boots the kernel... but:

RedBoot> exec -c root=/dev/mtdblock4
Now booting linux kernel:
Base address 0x80080000 Entry 0x80041000
Cmdline : root=/dev/mtdblock4
Linux version 2.6.19.2 (pg@etchdev) (gcc version 4.1.2) #1 Thu Mar 22 08:54:46 E
DT 2007
CPU revision is: 00018009
Determined physical RAM map:
memory: 02000000 @ 00000000 (usable)
Initrd not found or empty - disabling initrd
Built 1 zonelists.  Total pages: 8128
Kernel command line: console=ttyS0,9600 rootfstype=squashfs,jffs2 init=/etc/prei
nit

...
...
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)

The "prom.c" file from the atheros source seems to overwrite it (or is it just a default and the problem is with redboot that doesn't pass it):

strcpy(arcs_cmdline, "console=ttyS0,9600 rootfstype=squashfs,jffs2 init=/etc/preinit");

(Last edited by mesher on 22 Mar 2007, 23:30)

Actually the kernel does not see any mtd devices. Here's the error:

...
physmap platform flash device: 00400000 at 1e000000
physmap-flash physmap-flash.0: map_probe failed
...

Seems physmap is not recognizing the table. Perhaps the redboot loaded is not the correct one: I'm using the original redboot from the firmware.

What to do now? Debug "physmap.c" ? Any pointers where to look?

Thank you.

(Last edited by mesher on 23 Mar 2007, 01:22)

The discussion might have continued from here.