macsat.com OpenWrt and ASUS WL Forum
January 08, 2009, 13:37:46 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?
Login with username, password and session length
News: Back to macsat.com
 
   Home   Help Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: Booting a new kernel with 'monte'  (Read 17682 times)
0 Members and 1 Guest are viewing this topic.
sanecyclist
Newbie
*
Offline Offline

Posts: 45


View Profile
« on: April 19, 2007, 00:46:57 AM »

I've managed to recompile the 'monte' kernel loading program that jamon had found with the MGB100 tools and header files. The 'kmonte.o' kernel module loads fine (although insmod complains about tainting the kernel). The 'monte' executable runs, and I've briefly tried to boot a Debian 2.6 kernel, but without success, i.e. the telnet session just shuts down and the device doesn't appear to be doing anything.

Attached are the recompiled binaries in case anyone else wants to give it a try. I suppose a serial console connection would be useful for that. Is that available? Pagano, how do you debug your modified firmwares?

* monte-0.3.0-2.4.x-MGB100.tar.gz (53.34 KB - downloaded 143 times.)
Logged
jamon
Newbie
*
Offline Offline

Posts: 16


View Profile
« Reply #1 on: April 19, 2007, 11:14:04 AM »

Hi sanecyclist,

I found quite old the version monte-0.3-2.4 you used! The CVS version from sourceforge compiles without problems in 2.4.x (tested only with Xbox). Please, try it with MFB100 tools (you only need to read http://sourceforge.net/cvs/?group_id=34118 to get read access to CVS server; mondulename is "monte").
Logged
sanecyclist
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #2 on: April 20, 2007, 00:01:19 AM »

Thanks jamon, I've downloaded and compiled the CVS version, see the attachment. I added '-static' to the compiler options in the Makefile, because otherwise 'monte' would complain about a missing libz.1.so. It works, including initrd, or at least it prints details about the kernel and then reboots. But I haven't yet managed to connect to the device afterwards, so that'll need further investigation.

* monte-cvs-MGB100.tar.gz (234.44 KB - downloaded 134 times.)
Logged
jamon
Newbie
*
Offline Offline

Posts: 16


View Profile
« Reply #3 on: April 20, 2007, 08:41:39 AM »

Hi,

First step is test if new kernel loads. I think that we need to recompile new kernel with several debug enabled options and one output console. The MFB100 has a Serial Console connector?
Logged
tcc1000
Newbie
*
Offline Offline

Posts: 20


View Profile
« Reply #4 on: April 20, 2007, 09:59:59 AM »

Of sorts. If you solder on some connections and use a voltage level shifter, you can get on via serial console - to the OS not the bootloader. It does print out kernel messages though. Have a look at this thread: http://www.routertech.org/viewtopic.php?t=210&start=19 to see how to do it.
Logged
sanecyclist
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #5 on: April 20, 2007, 10:02:59 AM »

My Safecom SWSAPUR-5400 doesn't have a serial connector, not on the outside anyway.

But I found this thread on the unofficial Safecom forum where 'biro' posted a picture of the circuit board and a pinout.

Not sure I fancy opening it up and fiddling with MAX232s though. I might first try making a very simple root filesystem on a USB stick that doesn't do more than enabling eth1, so I can try pinging it.
Logged
sanecyclist
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #6 on: April 20, 2007, 10:12:31 AM »

Hi tcc1000, you got in just before me there. Smiley

Does the console really require soldering on the board though? On the picture it looks like you could just stick wires into that connector.

By printing out kernel messages you mean all the kernel booting stuff you usually get right after grub, right?

And do you know what and where the bootloader is on this thing?
Logged
pagano
Jr. Member
**
Offline Offline

Posts: 61


View Profile
« Reply #7 on: April 20, 2007, 15:11:23 PM »

Pagano, how do you debug your modified firmwares?
I put the firmware in the web and if nobody complains... Grin
Seriously, checking twoice before flash. Recovery system is embedded* in the kernel and if it does not boot... it's bricked.
Make a greep -ir lily linux_src/* ...
A easy method to read serial port without a max232 is crossing wired with another TTL port as a linksys wrt54. (no tested yet)

Monte is a very good feature. I will try this weekend. Very good work.
Logged
tcc1000
Newbie
*
Offline Offline

Posts: 20


View Profile
« Reply #8 on: April 21, 2007, 15:53:23 PM »

The "connector" for the serial port in the photo is soldered on, it's really just a set of 10 pads on the board. After the first couple of times, matrixchanger/pagano came up with a means of flashing the firmware, so I haven't been back on again. You do need something to do the voltage conversion (I used a couple of transistors, 6 resistors a capacitor and a diode from some website that I can't remember now) at least for desktop computers (usually have the RS232 at 12V). Often laptops have lower voltages (5V), so might work - you'd have to ask someone who knows what they are doing for a definitive answer. If you have a look on the openwrt forum you can see the sort of output you would
get (http://forum.openwrt.org/viewtopic.php?id=6827&p=1)
Logged
pagano
Jr. Member
**
Offline Offline

Posts: 61


View Profile
« Reply #9 on: April 22, 2007, 02:11:58 AM »

I have a firmware builded with kexec patch, it replaces some original firmware patch (by Lily)
It boots and recovery system is working but modules (included st2500 for wireless) must be builded again.

Kexec is not tested yet... reading howtos Smiley

--edit--
First test freezes device... Second test freezes device... Reading more howtos  Grin
« Last Edit: April 22, 2007, 12:25:14 PM by pagano » Logged
sanecyclist
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #10 on: April 22, 2007, 06:49:21 AM »

Yay, that sounds very promising. Looking forward to V5! Smiley
Logged
pagano
Jr. Member
**
Offline Offline

Posts: 61


View Profile
« Reply #11 on: April 23, 2007, 00:44:52 AM »

Same v4 version with patched kernel for monte.
Module not included (error)

root@WHD:/root/monte1# insmod kmonte.o
insmod: unresolved symbol remap_page_range
insmod: unresolved symbol __generic_copy_from_user
... edited...
make mrproper!!!
  Lips Sealed
or Segmentation fault Undecided

Monte binary in CVS works ok. (but does not reboot the device)
root@WHD:/root/monte# ./monte bzImage
monte: kernel setup   :     3072 bytes at 0x90000
monte: kernel code    :   995961 bytes at 0x100000
monte: command line   : ""
monte: region:      1 pages at 0x90000
monte: region:    244 pages at 0x100000
monte: region:      1 pages at 0x9c000
monte:            246 pages to be relocated.
monte: entry point (real mode): 9020:0000
monte: Socket operation on non-socket
root@WHD:/root/monte#


Do your monte.o module works?  Huh

* upgrade.monte.img.gz (3390.64 KB - downloaded 245 times.)
« Last Edit: April 25, 2007, 18:45:54 PM by pagano » Logged
sanecyclist
Newbie
*
Offline Offline

Posts: 45


View Profile
« Reply #12 on: April 23, 2007, 07:21:07 AM »

Here's what I get running the monte-CVS I had attached earlier in this thread on your firmware V4.

Code:
# insmod kmonte.o
Using kmonte.o
Warning: loading kmonte will taint the kernel: no license
  See http://www.tux.org/lkml/#export-tainted for information about tainted modules
# lsmod
Module                  Size  Used by    Tainted: P
kmonte                  3512   0 (unused)
rt2500                166720   0 (unused)
# ./monte vmlinuz root=/dev/sda1
monte: kernel setup   :     3072 bytes at 0x90000
monte: kernel code    :    42768 bytes at 0x100000
monte: command line   : "root=/dev/sda1"
monte: region:      1 pages at 0x90000
monte: region:     11 pages at 0x100000
monte: region:      1 pages at 0x9c000
monte:             13 pages to be relocated.
monte: entry point (real mode): 9020:0000

A little while later the telnet session times out. So it appears to be loading the kernel fine, but nothing else seems to be happening after that.

ps: Hmm, just noticed that the kernel code is rather small, even though vmlinuz is about 1MB.
« Last Edit: April 23, 2007, 07:29:42 AM by sanecyclist » Logged
pagano
Jr. Member
**
Offline Offline

Posts: 61


View Profile
« Reply #13 on: April 23, 2007, 20:07:41 PM »

After monte reboot in PC with 2.4.28 patched for monte.
Uncompressing linux......
invalid compressed format (err=2)

I think monte get bad start address (I only thing it)

With kexec, the problem is MGB100 has not reboot like PC has.
This function in arch/i386/kernel/process.c
void machine_restart(char * __unused)
{
        machine_shutdown();
        if(!reboot_thru_bios) { ...

is changed by MGB100 developer with a hard reboot.
void machine_restart(char * __unused)
{
        asm volatile (
        "       movw    $0xcf8, %%dx;\n"
        "       movl    $0x80003840, %%eax;\n" ...

and kexec needs some levels for reboot. I will give a try to kexec reboot.
Logged
pagano
Jr. Member
**
Offline Offline

Posts: 61


View Profile
« Reply #14 on: April 25, 2007, 19:04:22 PM »

I've briefly tried to boot a Debian 2.6 kernel, but without success, i.e. the telnet session just shuts down and the device doesn't appear to be doing anything.

Remenber. Network interfaces does not respond if they are not bridged.

does not work
ifconfig eth1 xxx.xxx.xxx.xxx up

working br0
brctrl addbr br0
brctrl addif br0 eth1
ifconfig br0 xxx.xxx.xxx.xxx up

Now I have a serial port in the whd  Smiley
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

English Steel 1.6 © Saxon North Technologies
Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.874 seconds with 24 queries.