DSM-G600, DNS-3xx 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.

#1 2006-10-16 13:15:39

kevin
Member
Registered: 2006-10-16
Posts: 10

linux kernel

has anyone managed to compile a working linux (or other) kernel for this device?  I tried doing this several months ago and never really got anywhere, probably because I was using too new a toolchain version, or I just suck at this smile.  the furthest I got was a custom initrd image for testing (basic busybox system with networking, serial console, OH, and pivot_root to a partition on the internal drive smile)
I'm going to try again later using the toolchain source provided by sala, maybe that will make a difference, assuming I can find my usb-serial controller (only device I have with 3.3v ttl)

Offline

 

#2 2006-10-16 14:24:22

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

Re: linux kernel

You are trying to compile D-link GPL kernel or kernel from kernel.org?
If you are working with d-link one then I can provide pre-compiled toolchain with uclibc 0.9.24, gcc 2.95.4 and binutils 2.14.90.
With this configuration I was able to compile D-Link GPL kernel.

Also do you mind posting your work that you have done with initrd? tongue


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#3 2006-10-18 07:09:15

kevin
Member
Registered: 2006-10-16
Posts: 10

Re: linux kernel

I will likely start from the d-link kernel, but I would like to move to a more current one once I get it working.  did the kernel you compiled boot properly?

a precompiled toolchain would be appreciated, as would instructions on building one using the same steps you did.  if you want to set up some kind of direct transfer you can find me at various times on irc.freenode.net, as kevin`, in #openwrt. I could provide an ftp or shell account if that would be efficient
I'll post my work with an initrd once I find my serial controller again.. it really needs a bit of tweaking to have any non-testing use smile

do you know where I can get the original source for the (odd, pre release) version of the kernel there's was based on? it would help in generating a patchset of their changes

Offline

 

#4 2006-10-18 09:28:49

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

Re: linux kernel

Here's a link to pre-compiled toolchain: http://the.planet.ee/toolchain.tar.bz2
I just compiled kernel, but I have not tested it.
You probable need to fix some symlinks after you extract the toolchain archive.
Then set a proper CROSS_COMPILE variable to Makefile, execute cv.sh, make menuconfig and make smile
Also look for static file paths at d-link gpl kernel, there are lots of these!

There where never released full sources to any -pre released kernels, only patches are available.
Here is 2.4.20 and patchset for making it to 2.4.21-pre4:
http://kernel.org/pub/linux/kernel/v2.4 … 20.tar.bz2
http://kernel.org/pub/linux/kernel/v2.4 … 1-pre4.bz2


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#5 2006-10-21 10:04:25

kevin
Member
Registered: 2006-10-16
Posts: 10

Re: linux kernel

here's the ramdisk image i'm currently using on my device, for the curious smile (I just copied this from the device itself, and gzipped it, so it's not in u-boot format)
all this will give you is a busybox shell on the serial console, along with a couple of tools. although there is networking support, for the ethernet (if not wireless.. I have the minipci wireless card in my laptop), the interface starts configured down and no daemons are started by default, so don't use this unless you have a serial console smile
http://kwzs.be/~kevin/ram0.img.gz

I couldn't find my usb-serial controller so I built a new one.. soldering wires to smd chips is NOT easy - the hot-glue coating is to prevent the hair-thin wires from shifting out of their intricate placement hmm (on the plus side, I didn't have to order any parts online to make this, I don't like doing that)
http://kwzs.be/~kevin/P1010089.JPG - yay for pictures

http://cgi.ebay.com/DYNEX-DX-UBDB9-USB- … otohosting  (random link that has a picture) - the hot-glue coated device shown in the picture is one of these, if anyone wants to follow my path of darkness (dynex dx-ubdb9 usb serial cable), the main chip inside (which I soldered to) is a pl-2303HX, supported in linux and windows, specs I used available here: http://kwzs.be/~kevin/ds_pl2303_v16.pdf

Offline

 

#6 2006-10-21 21:08:38

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: linux kernel

My little contribution : the u_boot utilities (mkimage img2srec) for i686

But i got problems to compile a new u-boot image :-[
Somebody knows exactly the type of the board ?

Offline

 

#7 2006-11-29 22:53:31

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

Having compiled the toolchain, I'm wondering if anybody here has looked at the kernel sources.

If anybody has, can you tell me how complete the sources are?  If as I assume, the sources are not complete, are there binaries for the missing pieces?  Has anybody built a working kernel image?

Offline

 

#8 2006-11-30 08:25:26

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

Re: linux kernel

Kernel image is compilable, no sources is missing as far as I have seen. Whats missing is ralink wifi drivers, but you don't need them to get kernel compiled.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#9 2006-12-02 11:01:50

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

Ok, I'm confused.  I have built the toolchain and got my serial console working.  Now I'm trying to compile the kernel.

I add the bin directory containing powerpc-linux-gcc to PATH and then as per the README

make menuconfig
make clean;make dep;make pImage

I get a bunch of error messages:

powerpc-linux-gcc -D__KERNEL__ -I/home/beattie/dsmg600_B_GPL/ppclinux/include -W
all -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I/home/beattie/dsmg600_B_GPL/ppclinux/arch/ppc -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring   -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
In file included from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/wait.h:13,
                 from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/fs.h:12,
                 from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/capability.h:17,
                 from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/binfmts.h:5,
                 from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/sched.h:9,
                 from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/mm.h:4,
                 from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/slab.h:14,
                 from /home/beattie/dsmg600_B_GPL/ppclinux/include/linux/proc_fs.h:5,
                 from init/main.c:15:
/home/beattie/dsmg600_B_GPL/ppclinux/include/linux/kernel.h:74: warning: conflicting types for built-in function `vsprintf'
/home/beattie/dsmg600_B_GPL/ppclinux/include/linux/kernel.h:77: warning: conflicting types for built-in function `vsnprintf'
/home/beattie/dsmg600_B_GPL/ppclinux/include/linux/kernel.h:81: warning: conflicting types for built-in function `vsscanf'
/home/beattie/dsmg600_B_GPL/ppclinux/include/asm/unistd.h: In function `init':
/home/beattie/dsmg600_B_GPL/ppclinux/include/asm/unistd.h:439: error: asm-specifier for variable `__sc_4' conflicts with asm clobber list
... etc. etc.

I know there must be a step I'm missing, anybody got a clue

Offline

 

#10 2006-12-02 14:34:19

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

Re: linux kernel

Beattie, did you compile toolchain to have uclibc 0.9.24, gcc 2.95.4 and binutils 2.14.90? If not then you should because if you want to use gcc 3.x you need to do some kernel source patching.


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#11 2006-12-03 00:19:28

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

OK I was following the README, I guess the README is not very accurate, and I've not built a 2.4 kernel in a while.

I tried using the precompiled compiler just to speed thing up, but I guess I need to do so symlinking or more changes to my PATH. 

In the mean time since I really prefer to buld everything from source is there a copy of the makefile you used to build the compiler?  I notice that some changes are required for gcc-2.95.

I have some pictures of the serial port and jtag connector mods if anybody is interested.

Error messages:
powerpc-linux-gcc -D__KERNEL__ -I/home/beattie/dsm-g600/ppclinux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I/home/beattie/dsm-g600/ppclinux/arch/ppc -fsigned-char -msoft-float -pipe -ffixed-r2 -Wno-uninitialized -mmultiple -mstring   -DKBUILD_BASENAME=main -c -o init/main.o init/main.c
powerpc-linux-gcc: installation problem, cannot exec `cpp0': No such file or directory
powerpc-linux-gcc: installation problem, cannot exec `cc1': No such file or directory
as: unrecognized option `-mppc'
make: *** [init/main.o] Error 1

Offline

 

#12 2006-12-03 21:09:38

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

Re: linux kernel

beattie wrote:

In the mean time since I really prefer to buld everything from source is there a copy of the makefile you used to build the compiler?

There is make script for 2.95, but you need to go trough hell to make it compilable. As I remember you need to replace uclibc-snapshot with 0.9.24 + some minor stuff I cant remember right now. You can buzz me if you run into problems.
ftp://ftp.dlink.com/GPL/dsmg600_reB/ucl … 609.tar.gz

As of kernel compiling error message, did you set full path to your cross compiler eg. /home/users/cross/bin/powerpc-linux-uclibc-
And also look for broken symlinks if you use pre-compiled toolchain.

beattie wrote:

I have some pictures of the serial port and jtag connector mods if anybody is interested.

It would be really nice if you fill out wiki page with this information smile
http://dsmg600.info/howto:serial_connector

Last edited by sala (2006-12-04 08:42:55)


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#13 2006-12-04 15:13:57

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

Ok I'm making progress as cronicled on http://www.beattie-home.net/beattie/DSM-G600/ (when I have the kinks worked out I'll add what I've learned to the wiki [I don't know home to add picture to the wiki so I used links to my webpage for the serial stuff]) (don't you just love nested parentheticals?)

One question I have or would solve is how others have handled the compiler problem.  The kernel needs gcc-2.95, the user level stuff from D-Link smmes to be comiled with gcc-3.3.  Now there is no problem with that mixing, but I'm not sure how to mix and match.  I can install both compilers, but one has to be linked to powerpc-linuc-gcc.  I have not looked at the makfiles in detail to see for instance if I can tell the kernel makefiles to use gcc and powerpc-linux-gcc-2.95, for instance.  I could also install the two compilers in different locations and use different $PATH settings (but that is a pain in the a**).

If anybody has a solution they have used or even just thought of, I'd be glad to hear it.

BTW I built gcc-2.95 from scratch with just a few patches, but I need to build makeimage and friends to fully test it out.

Offline

 

#14 2006-12-05 09:19:53

BertrandB
Member
From: Dijon (France)
Registered: 2006-09-16
Posts: 119
Website

Re: linux kernel

beattie wrote:

but I need to build makeimage and friends to fully test it out.

Here there are compiled for i686 (see attachement)
they works but i've got a "no more space left on device" when i use it because of img2srec

Offline

 

#15 2006-12-07 05:17:37

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

Well I've got a kernel, now I need to research on loading a kernel.  Also on extracting the kernel from the firmware incase I need a working kernel to go back to.  Does anybody have experinece with this, or pointers to information that might be useful?

Offline

 

#16 2006-12-07 08:49:21

qn1234
Member
Registered: 2006-08-18
Posts: 94

Re: linux kernel

I don't know about u-boot.  Howver, a few years back when I had a chance to work on a project that used RedBoot.   I suspect u-boot has similar functions to RedBoot.  With RedBoot, you could transfer the image to your PC using zmodem or tftp.

Looks like you should head off to reading the u-boot document. smile

--
Quang

Offline

 

#17 2006-12-07 10:03:54

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

Cute, I had planned to and have, however I also used the resources found through Google and in the posts of others and have discovered information that is not in the u-boot documentation.  I'm not asking to be spoon fed, but it woul dbe stupid and arrogant of me to ignore information other might have.  So next time, if you don't have something helpful to say just ...

Offline

 

#18 2006-12-07 17:24:49

qn1234
Member
Registered: 2006-08-18
Posts: 94

Offline

 

#19 2006-12-09 06:59:26

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

SUCCESS!!!

I have built, uploaded and booted a kernel, and it actually works!

I just need to write up the last steps, and then I'll look into writting a wiki page.

BTW it takes about 20minutes to upload a kernel.

Offline

 

#20 2006-12-09 09:47:08

qn1234
Member
Registered: 2006-08-18
Posts: 94

Re: linux kernel

That's a wonderful news.  I can't wait to check it out.  Good job beattie.

Offline

 

#21 2006-12-10 00:11:04

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

Kernel build http://dsmg600.info/howto:kernel_build

Kernel upload http://dsmg600.info/howto:kernel_upload

Let me know how it works for you.

Offline

 

#22 2006-12-10 03:07:23

qn1234
Member
Registered: 2006-08-18
Posts: 94

Re: linux kernel

Fantastic.  Now, I'm going to have to order the RS232 component or I can have the serial connection. 

In the how-to, you mention that it takes 20 minutes to transfer the image.  I notice that your instruction includes a line that sets the baud rate to 9600.  Have you tried setting it 11520?  That's 12 times larger than 9600.  So, it should take about 1.5 minutes to transfer instead of 20 minutes then.

--
Quang

Offline

 

#23 2006-12-10 03:20:00

qn1234
Member
Registered: 2006-08-18
Posts: 94

Re: linux kernel

Beattie,

Looks like U-boot has a command similar to that of RedBoot.   You can use the command "ftpboot "to boot the image remotely from PC running Linux or Windows.  On Linux make sure you have tftpd running with firewall turned off.  Put the image(s) in the the tftp directory, like /tftpboot.

Then from the u-boot prompt, type: ftpboot <pc-ip-address> image-to-boot

It's always a good idea to make sure the image is bootable before flashing it. wink

--
Quang

Offline

 

#24 2006-12-10 07:17:32

bchurchwell
New member
Registered: 2006-11-17
Posts: 2

Re: linux kernel

qn1234, you should check out beattie's webpage linked under his picture.  He lays out reasons there why the baud change and ftpboot aren't likely to work.

This is exciting stuff.  I wish I understood more of it so that I could contribute, but at least I'm learning fast.

Offline

 

#25 2006-12-10 07:39:45

beattie
Member / Developer
From: West Coast, USA
Registered: 2006-11-17
Posts: 92
Website

Re: linux kernel

The u-boot provided on the dsm g600 has a limited and non-standard set of commands implemented,  You can be certain that I would have found something as simple as tftpboot if it were available.  As far as I can tell this u-boot only supports 9600 baud, you could set the workstation's serial port tp 115200, but then u-boot would not recognize what you typed.

The only way to recover a unit that has been bricked due to a bad kernel or filesystem is through the serial port which is why I developed the method for loading through the serial port before building new firmware loads.

I will probably also work on building a more feature-filled u-boot, but last I heard, there were no u-boot drivers for the DSM's NIC, or IDE device,   I believe that the DSM's USB is supported by the standard u-boot but I need a JTAG interface before I try a new u-boot (to recover from a bricked u-boot).

Oh yeah, there is only one way to know if a kernel is bootable...boot it.

Last edited by beattie (2006-12-10 07:42:44)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB