DSM-G600, DNS-323 and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#26 2009-03-03 21:59:52

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 690
Website

Re: Fonz' reloaded.ko on an NSA-220

I think you can use whatever address is free, important is that you jump the same address which you used to load your kernel.


DSM-G600 - Gentoo embedded 2006.1 hdd-boot - 80GB Samsung SP0802N
NSA-220 - Genlink 1.1_rc3-20080923 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#27 2009-03-06 23:18:56

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

I exchanged proc-arm926.S and proc-macros.S, and changed 0x800000 in 0x02000000 in main.c and reboot.S. The linker complained:

WARNING: "v4wbi_tlb_fns" [/home/mijzelf/dns323-reloaded-0.7.167/reloaded.ko] undefined!
WARNING: "v4wb_user_fns" [/home/mijzelf/dns323-reloaded-0.7.167/reloaded.ko] undefined!
WARNING: "v5tj_early_abort" [/home/mijzelf/dns323-reloaded-0.7.167/reloaded.ko] undefined!
WARNING: "support_wait_for_interrupt" [/home/mijzelf/dns323-reloaded-0.7.167/reloaded.ko] undefined!
WARNING: "mv_orion_ver" [/home/mijzelf/dns323-reloaded-0.7.167/reloaded.ko] undefined!

and I couldn't load the module

insmod: cannot insert `reloaded.ko': Unknown symbol in module (-1): No such file or directory

I suppose one of the exchanged .S files contained those symbols. Will look at it later.

Last edited by Mijzelf (2009-03-09 17:56:52)

Offline

 

#28 2009-03-14 22:50:43

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

According to grep the missing symbol *strings* are in reloaded.o, reloaded.ko and proc-arm926.o. The linker complains they are not available, so I suppose proc-arm926.o wants to import them either. This is strange, since proc-arm926.S doesn't mention them, and doesn't include any sourcefiles either, only .h files.

to be continued

Offline

 

#29 2009-10-04 20:55:58

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

Finally it worked! Starting with Fonz' original sources, I exchanged proc-arm926.S and proc-macros.S. The were some missing functionpointers in  proc-arm926.S, and I just skipped them. There were 2 variables needed, mv_orion_ver and support_wait_for_interrupt, and I added them to main.c, loaded with the right values.

Sala's kernel seemed not to use a rdinit, so I didn't use one either. I created a 0 byte file, and the command

Code:

/sbin/insmod reloaded.ko kernel=zImage initrd=0_byte_file cmdline="rootfstype=squashfs root=/dev/mtdblock1 ro mtdparts=physmap-flash.0:2432k(kernel),12928k(initrd),896k(etc),-(bootbase) console=ttyS0,115200n8 mem=128M init=/linuxrc"

rebooted the box with the new kernel. For the moment I used the standard kernel, with only /proc/config.gz added. And after rebooting the file was there!

Sources and kernelmodule here

I think I can simply change rootfstype and root in cmdline, to boot a different system, but I'll try that later.

Offline

 

#30 2009-10-06 23:11:52

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

It's not that simple. I copied the contents of /dev/mtdblock1 to /dev/sdc1, and changed the commandline to

rootfstype=ext3 root=/dev/sdc1 rw mtdparts=physmap-flash.0:2432k(kernel),12928k(initrd),896k(etc),-(bootbase) console=ttyS0,115200n8 mem=128M init=/linuxrc

but alas the system didn't boot anymore.

Offline

 

#31 2009-10-07 13:26:12

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 690
Website

Re: Fonz' reloaded.ko on an NSA-220

If you are using my precompiled kernel then you cant change or pass cmdline to kernel because of nature of hdd boot patch. Even if you can then its not going to booting original firmware because I did made this image minimal as possible, so it misses some features needed by firmware.

If you like I can send you my configured genlink tarball which you can extract to resierfs formated sda3.


DSM-G600 - Gentoo embedded 2006.1 hdd-boot - 80GB Samsung SP0802N
NSA-220 - Genlink 1.1_rc3-20080923 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#32 2009-10-07 14:12:43

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

No, I just used the stock (2.10) kernel, where I added a /proc/config.gz, to be able to recognize the new kernel.

Would it be hard to change the kernel and tarball to boot from sdc1 instead? In that case it would be nice trying, I'd like not to touch the original firmware and harddisks.

I did made this image minimal as possible

Is this for any special reason?

Offline

 

#33 2009-10-07 14:45:49

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 690
Website

Re: Fonz' reloaded.ko on an NSA-220

Mijzelf wrote:

Would it be hard to change the kernel and tarball to boot from sdc1 instead? In that case it would be nice trying, I'd like not to touch the original firmware and harddisks.

Well, you can compile hddboot kernel with # CONFIG_CMDLINE_OVERRIDE is not set


Mijzelf wrote:

I did made this image minimal as possible

Is this for any special reason?

Yes, since kernel image will be un-compressed into memory, its just takes up space for no reason. Instead I just compile in features which are really needed to boot and for rest you can use modules.


DSM-G600 - Gentoo embedded 2006.1 hdd-boot - 80GB Samsung SP0802N
NSA-220 - Genlink 1.1_rc3-20080923 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#34 2009-10-07 15:15:08

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

sala wrote:

Mijzelf wrote:

Would it be hard to change the kernel and tarball to boot from sdc1 instead? In that case it would be nice trying, I'd like not to touch the original firmware and harddisks.

Well, you can compile hddboot kernel with # CONFIG_CMDLINE_OVERRIDE is not set

This will revert the boot process to the old situation, I suppose? Do you have a reason to presume that this kernel will boot from sdc1, where the stock kernel doesn't?

Offline

 

#35 2009-10-09 16:24:55

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 690
Website

Re: Fonz' reloaded.ko on an NSA-220

Mijzelf wrote:

sala wrote:

Mijzelf wrote:

Would it be hard to change the kernel and tarball to boot from sdc1 instead? In that case it would be nice trying, I'd like not to touch the original firmware and harddisks.

Well, you can compile hddboot kernel with # CONFIG_CMDLINE_OVERRIDE is not set

This will revert the boot process to the old situation, I suppose? Do you have a reason to presume that this kernel will boot from sdc1, where the stock kernel doesn't?

Ah, I did misunderstand you. Stock should read passed cmdline parameter correctly. CONFIG_CMDLINE_OVERRIDE in my patch is used to force kernel to ignore all passed cmdline parameters (from bootloader or from any other loader).
I think that module is not passing cmdline correctly to kernel. For DSM-G600 kernel did need some extra patching in order to read passed custom cmdline root device http://dsmg600.info/howto:loader_o#prep … or_loading


DSM-G600 - Gentoo embedded 2006.1 hdd-boot - 80GB Samsung SP0802N
NSA-220 - Genlink 1.1_rc3-20080923 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#36 2009-10-10 20:26:12

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

I think that module is not passing cmdline correctly to kernel.

Wouldn't that be reflected in the contents of /proc/cmdline? I added some bogusvalues in front and behind the actual commandline, and found them back in /proc/cmdline.

I'm trying to find the actual place where '/dev/sdc1' should be decoded to major and minor. The function name_to_dev_t() in linux/init/do_mounts.c looks most promising, but I can't figure out how it should decode any sdx value. I saw a device can also be addressed with major and minor, but 'root=8:33' didn't work either.
I suppose I'll have to hook up a serial port to get further.

Offline

 

#37 2009-10-16 21:26:54

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

So I bought a TTL-232R-3v3 and hooked it up. When trying to boot the last lines are:

Code:

md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "sdc1" or unknown-block(2,0)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

In order to find out if my kernel can boot from partitions at all, I copied the firmwaretree to sdb2, an ordinary ext3 volume. This worked.
So why doesn't it boot from usb stick? sdc1 is a valid ext3 partition. The reload script and zImage are on it. The only kernelmodules which are loaded before the script is executed are:

Code:

##### SATA modules
insmod /lib/modules/libata.ko
insmod /lib/modules/ahci.ko

###### file system modules
insmod /lib/modules/reiserfs.ko
insmod /lib/modules/fat.ko
insmod /lib/modules/msdos.ko
insmod /lib/modules/vfat.ko
insmod /lib/modules/ntfs.ko
insmod /lib/modules/udf.ko
insmod /lib/modules/isofs.ko
modprobe fuse

#### lm85 module
insmod /lib/modules/hwmon-vid.ko
insmod /lib/modules/lm85.ko

None of these have anything to do with USB, I thought

Offline

 

#38 2009-10-17 13:18:14

Mijzelf
Member
Registered: 2008-07-05
Posts: 231

Re: Fonz' reloaded.ko on an NSA-220

Sorted it. I had to add a rootdelay=10 to the commandline, and it worked.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB