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.

Announcement

#76 2007-01-05 08:11:10

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

Re: New Firmware instead of Fun_Plug

beattie wrote:

Actually if the USB-Serial device has external RS232 level converters, you can bypass them and drop the 74c14.

I got UC-232A adapter with Prolific PL2303 chip and it did require 74C14 to get readable console, without it I did get unreadable characters.


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

Offline

 

#77 2007-01-05 18:28:29

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

Re: New Firmware instead of Fun_Plug

sala wrote:

beattie wrote:

Actually if the USB-Serial device has external RS232 level converters, you can bypass them and drop the 74c14.

I got UC-232A adapter with Prolific PL2303 chip and it did require 74C14 to get readable console, without it I did get unreadable characters.

I could not find a data sheet for the PL2303 part, but what I did find indicates that it might output rs232 levels directly, in which case the most reliable solution is an rs232 driver such as the MAX3232 device.

http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1068

Offline

 

#78 2007-01-05 19:01:06

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

Re: New Firmware instead of Fun_Plug

beattie wrote:

I could not find a data sheet for the PL2303 part

http://dns323.kood.org/downloads/people … -A-1.1.pdf


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

Offline

 

#79 2007-01-05 19:32:11

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

Re: New Firmware instead of Fun_Plug

sala wrote:

beattie wrote:

I could not find a data sheet for the PL2303 part

http://dns323.kood.org/downloads/people … -A-1.1.pdf

Yeah, I found it.  I was confused by their misuse of rs232, they do not interface directly with rs232, but use logic levels that need to be converted to rs232.  As I see it you have three choices, 1. get an rs232 line driver/converter that will run from the 3.3v supply avail at the dsm's serial port pad, such as the MAX3232 (you could also use a 5V part and find a 5V supply on the DSM board), 2. used the diode trick to the 74c14 for the input, 3. locate and remove the line driver/converter on the USB - serial device.  If it was me, I'd do 1 or 3,

Offline

 

#80 2007-01-05 19:38:35

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

Re: New Firmware instead of Fun_Plug

sala wrote:

I test it out after work smile
I noticed lately that ramdisk has some files that we do not really need, for example /web/path/Thumbs.db (56Kb), which is Microsoft's way of caching thumbnail images in folders, and if we replace all web interface .jpg and .gif files with css or just regular html buttons we gain about 200Kb additional free space.

I looked into this and these files are in the cramfs image that is copied on boot (did I say that I think this firmware is crap).  So it will be another step to remove them, I'll probably wait till I have the pivot root working.

Offline

 

#81 2007-01-05 19:44:24

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

Re: New Firmware instead of Fun_Plug

beattie wrote:

As I see it you have three choices, 1. get an rs232 line driver/converter that will run from the 3.3v supply avail at the dsm's serial port pad, such as the MAX3232 (you could also use a 5V part and find a 5V supply on the DSM board), 2. used the diode trick to the 74c14 for the input, 3. locate and remove the line driver/converter on the USB - serial device.  If it was me, I'd do 1 or 3,

What about PL2303 and 74c14 since I have them already, sounds kind of stupid? big_smile


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

Offline

 

#82 2007-01-07 10:09:12

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

Re: New Firmware instead of Fun_Plug

Well I have gotten pivot_root working.  I have released 0.4,  The source tar file is http://www.beattie-home.net/beattie/DSM … SM-0.4.tgz .  There is also a firmware image http://www.beattie-home.net/beattie/DSM … 600-0.4.fw .  Give sala's experinece I would not suggest that anybody who does not have  a working serial console touch this, until it has been tested by others.

Offline

 

#83 2007-01-08 21:15:39

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

Re: New Firmware instead of Fun_Plug

beattie wrote:

There is also a firmware image http://www.beattie-home.net/beattie/DSM … 600-0.4.fw .  Give sala's experinece I would not suggest that anybody who does not have  a working serial console touch this, until it has been tested by others.

This one works. I guess the main reason (beside 92 byte start offset) why it did fail for me before was that my ramdisk was to big to fit in flash.
Maybe we can add some checks to avoid firmware building if ramdisk or kernel is to big.

Now I am trying to make some more space by replacing some coreutils tools and busybox applets (switch to bb-1.00 final) + new web interface pages.

Also SVN should be up in couple of days smile


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

Offline

 

#84 2007-01-08 22:37:38

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

Re: New Firmware instead of Fun_Plug

sala wrote:

This one works. I guess the main reason (beside 92 byte start offset) why it did fail for me before was that my ramdisk was to big to fit in flash.
Maybe we can add some checks to avoid firmware building if ramdisk or kernel is to big.

Now I am trying to make some more space by replacing some coreutils tools and busybox applets (switch to bb-1.00 final) + new web interface pages.

Also SVN should be up in couple of days smile

the 92 byte offset never caused me any problems.

The web interface update checks the size of the ramdisk image, that's where I got the ramdisk size, though it is confirmed by the readme which give the layout of the flash.  It may be that it does it wrong, or in the wrong place.  I can certainly add a check, but I'd be surprised if that was the problem (I've been surprised many times in my career smile ).  I'd suggest that rather than buiding ramdisk images with the new webpages, that you look at placeing those web pages on the hard drive and modify the ramdisk to look on the hard drive.  That would make updqating the web pages quicker and safer.

I've not used SVN before, though I doubt it's all that hard to use.

Offline

 

#85 2007-01-09 17:45:31

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

Re: New Firmware instead of Fun_Plug

I'm had reports from sala that pehaps his report of a bricked unit was not corrrect, maybe he will post more information on that.

I have received a request for some enhancements so I thought I'd ask if there are any other things people would like to see:

What Buld_DSM does:
Build_DSM will build a modfied version of the D-Link firmware sutible for downloading via the web interface.  The modifications currently add a mechanizim to "hijack" the startup to run from an external filesystem, either in the harddrive or a usb disk/key.

Requested enhancements:
have fwbuild check the size of the kernel and ramdisk and if they exceed to size of the flash partition, refuse to build a fw image.

Extract the kernel and ramdisk from e firmware image;

I will start thinking about these features, I'd like to hear from anybody who has ideas.

Offline

 

#86 2007-01-09 20:06:10

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

Re: New Firmware instead of Fun_Plug

beattie wrote:

I'm had reports from sala that pehaps his report of a bricked unit was not corrrect, maybe he will post more information on that.

My English problem is actually very big one and it is relatively hard to run this kind of site like that but what the hell, you can always kick my butt and ask me again big_smile

OK, I did following things before I did see Bad Data CRC error.
*compiled Build_DSM-0.3.tgz with no problems
*didn't check if ramdisk is oversize or not, because I didn't modify build script and I was thinking it will not produce oversize ramdisk by default.
*flashed the image from web interface
*flashing did fail
*I did say some bad words and I did leave DSM-G600 running
*about 30 minutes latter, I did start to building next firmware image, using Build_DSM-0.3.tgz again
*I did delete old one because I think there was a bug in built script (if old firmware image exists then new one will not be created)
*when new image was ready I did reboot dsmg by pressing restart button in webinterface
*DSM-G600 newer booted up
*then I did look serial output and I did see

Code:

U-Boot 0.2.0 (May 11 2005 - 18:56:16)

CPU:   MPC8245 V1.2 at 170.503 MHz:
Board: Sandpoint 8245
DRAM:  32 MB
FLASH: FUJI_DL323BE
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
## Booting image at fff10000 ...
   Image Name:   Linux-2.4.21-pre4
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    853695 Bytes = 833.7 kB
   Load Address: 00000000
   Entry Point:  00000000
 Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at ffc20000 ...
   Image Name:   default
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    3072965 Bytes =  2.9 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... Bad Data CRC
*

*after that I newer used Build_DSM-0.3.tgz again, instead I started to use Build_DSM-0.4.tgz and now I have always built flashable images
*I am not sure what was going wrong here but I think it will make a nice novel big_smile

Meanwhile I did add a new wiki page how to recover from bad flash.
http://dns323.kood.org/dsmg600/howto:recover
And yes, it works my unit is now up and running. In other words if you have a serial port installed you can safely try firmware images built using beattie build script smile

And about automatically grabbing a files I didn't meant that we are going to grab them from D-Link. I meant that we can grab them from original source and then patch them. As you are going to see that needed patches is already done (u-boot and busybox patch). Toolchain built script do not need patches.


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

Offline

 

#87 2007-01-16 20:48:55

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

Re: New Firmware instead of Fun_Plug

Hi beattie,

How's your project going?  We haven't heard from you recently.  We're anxiously waiting for your updates.

Thanks,
Quang

Offline

 

#88 2007-01-16 23:10:03

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

Re: New Firmware instead of Fun_Plug

By now I got working
*built in telnet with login
*I had to remove upnp stuff to get more flash space
*couple of tools are recompiled and stripped to get more flash space
*using busybox 1.00 final
*hotplug script syntax cleanup (empty if statements)
*new busybox applets: chroot, mknod, telnetd, ash (tabcomplete+history), sed (not vi, because sed can be more useful), pivot_root and some more that I cant remember right now

work in progress
*new admin interface web pages (here we can get enough free space to put back upnp stuff and maybe also vi)
*tinylogin patchset port for busybox login
*nologin option
*test out pivot root and add a wiki page
*modify build script to do all mentioned before automatically

Last edited by sala (2007-01-18 15:53:39)


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

Offline

 

#89 2007-01-16 23:38:52

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

Re: New Firmware instead of Fun_Plug

qn1234 wrote:

Hi beattie,

How's your project going?  We haven't heard from you recently.  We're anxiously waiting for your updates.

Thanks,
Quang

Life's been busy, but what I'm working on right now, is building strace, so I can see what calls the utilities are making, I want to find out where the buttons and LEDs are.

Offline

 

#90 2007-01-28 23:07:37

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

Re: New Firmware instead of Fun_Plug

So far so good tongue
*telnetd (by default has same password with admin. if password is somehow not working then try to restore default settings. if you don't want telnetd running then kill it using fun_plug)
*upnp stuff completely removed, including upnp related web pages
*new cramfs image (image.cfs) without upnp files
*kernel has now domain socket support, CONFIG_UNIX and additionally CONFIG_FILTER (this means screen, dtach and udhcpd will work)
*dtach included in firmware
*busybox 1.00 final with many applets

Code:

[, arping, ash, autoip, awk, basename, bunzip2, busybox, bzcat,
cat, chgrp, chmod, chown, chroot, clear, cmp, cp, crond, crontab,
cut, date, df, dmesg, dumpleases, echo, egrep, env, expr, false,
fgrep, find, free, freeramdisk, fsck.minix, goweb, grep, gunzip,
gzip, head, hexdump, hostname, hwclock, id, ifconfig, init, insmod,
kill, killall, ln, login, losetup, ls, lsmod, mkdir, mkfs.minix,
mknod, mkswap, modprobe, more, mv, netstat, pidof, ping, pipe_progress,
pivot_root, poweroff, ps, pwd, rdate, reboot, reset, rm, rmmod,
route, sed, sh, sleep, sort, swapoff, swapon, sync, tail, tar,
telnetd, test, top, touch, true, udhcpc, udhcpd, uname, uptime,
vi, yes, zcat

*syntax typo fixes for hotplug scripts and rc.sh
*has all modifications that beattie did add in build script 0.4 (pivot_root lines in rc.sh)

Still missing:
*upnp (maybe we can add all needed files to hard disk and run it from there)
*new web pages (if done then we might be able to fit upnp back in firmware)
*get the latest NTFS driver working
*built script which does all above automaticaly

Full reboot log captured with serial port:
http://dns323.kood.org/downloads/people/sala/putty.log

Firmware image:
http://dns323.kood.org/downloads/people … a-20070128

Big fat warning!
Although this firmware works for me, there is still slight chance that you may brick your device. And only way to recover is using a serial port!


//edit
Bugs discovered so far:
*mounting fat file systems using hotplug scripts will give errors because of iocharset=cp850 parameter.
*image.cfs produces double mount loop0 & loop1 (this bug will not affect functionality).
*usb hard drives fail to mounted automatically (use fun_plug or telnet to mount them manually)

Last edited by sala (2007-02-02 17:51:21)


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

Offline

 

#91 2007-01-29 21:54:00

smarchini
New member
Registered: 2007-01-29
Posts: 1

Re: New Firmware instead of Fun_Plug

Sala,

Your FW works for me too! Thanks...

Got frustrated trying to get telnet to work, and although have no serial port access took a shot.

Telnet works fine now, but without the firmware I could only get the fun_plug dmesg.out to work.  I've read
the forum and how to but couldnt figure it..

Any risk flashing back to dlink 1.02us?

Thanks
Scott

Offline

 

#92 2007-01-29 22:41:44

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

Re: New Firmware instead of Fun_Plug

smarchini wrote:

Any risk flashing back to dlink 1.02us?

None as far as I know, at least not any extra risk.


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

Offline

 

#93 2007-01-30 17:03:30

SystemR89
Member
From: >>Turin<< >>Italy<<
Registered: 2006-09-19
Posts: 88

Re: New Firmware instead of Fun_Plug

Hi!  Good work!    I've immediately upgraded my DSMG600, but now I've encountered a problem: I can't no more mount my internal FAT32 partition sad   

This is the error: 
# mount
%root% on / type unknown (rw)
proc on /proc type proc (rw)
/image.cfs on /sys/crfs type cramfs (rw,loop=/dev/loop1)
/dev/sda2 on /mnt/HD_a2 type ext2 (rw) 
# mount /dev/sda3  mount: wrong fs type, bad option, bad superblock on /dev/sda3, or too many mounted file systems

Obviously I've replaced the default fstab with my fstab (that I've alredy used with "old" firmwire)


Free is BETTER!!
Use GNU/Linux!!

Offline

 

#94 2007-01-30 17:22:57

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

Re: New Firmware instead of Fun_Plug

SystemR89,

Does vfat show up in /proc/filesystems? 
Is the module fat or vfat loaded?

Also try mounting it with the -t vfat flag and see what happens.

--
Quang

Offline

 

#95 2007-01-30 20:24:31

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

Re: New Firmware instead of Fun_Plug

SystemR89 wrote:

Hi!  Good work!    I've immediately upgraded my DSMG600, but now I've encountered a problem: I can't no more mount my internal FAT32 partition sad   

This is the error: 
# mount
%root% on / type unknown (rw)
proc on /proc type proc (rw)
/image.cfs on /sys/crfs type cramfs (rw,loop=/dev/loop1)
/dev/sda2 on /mnt/HD_a2 type ext2 (rw) 
# mount /dev/sda3  mount: wrong fs type, bad option, bad superblock on /dev/sda3, or too many mounted file systems

Obviously I've replaced the default fstab with my fstab (that I've alredy used with "old" firmwire)

Works fine in here without any extra mount option.

Code:

# mount
%root% on / type unknown (rw)
proc on /proc type proc (rw)
/image.cfs on /sys/crfs type cramfs (rw,loop=/dev/loop1)
/dev/sda2 on /mnt/HD_a2 type ext3 (rw)
/dev/sdb1 on /mnt/HD_a2/gentoo type vfat (rw)
# df -m |grep sdb1
/dev/sdb1                19084         4     19080   0% /mnt/HD_a2/gentoo
# cat /proc/filesystems
nodev   rootfs
nodev   bdev
nodev   proc
nodev   sockfs
nodev   tmpfs
nodev   pipefs
        ext3
        ext2
        cramfs
nodev   ramfs
        minix
        msdos
        vfat
        iso9660
nodev   nfs
        ntfs
        udf
nodev   autofs
#

But I can tell that mounting through hotplug/usbount will give error. usbmount uses mount parameters such iocharset=cp850 and I think that kernel does not like it. I might try to set FAT_DEFAULT_IOCHARSET to kernel config.

Code:

# mount -t vfat -o umask=0,iocharset=cp850,shortname=winnt /dev/sdb1 /mnt/HD_a2/gentoo/
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       or too many mounted file systems
#

Now there is this possibility that we have one kernel source and D-Link has the other (more patched/modified). So our firmware and D-Link's original firmware can act little differently.
To meet GPL needs D-Link must release new tarballs with new firmwares they release but this is what D-Link does not do.

Also I would very much like to see D-Link releasing Ralink rt2500 drivers sources. I have e-mailed couple of times to support but they just ignore the main point of my emails, tell me to contact my local support or call them instead of emailing.

If I only could have more time, English skills and better knowledges about GPL I would troll over http://gpl-violations.org/ big_smile
I am sure that D-Link is known case to them.

Last edited by sala (2007-01-31 15:20:21)


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

Offline

 

#96 2007-01-30 21:29:10

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

Re: New Firmware instead of Fun_Plug

To address this kernel problem little closer I have made kernel patchset for 2.4.21-pre4. It is almost clean but it needs some final touch (make mrproper because of old modversions) before we can use it for compiling kernel.

//edit
look this topic for mrpropered patch.

Last edited by sala (2007-01-31 09:01:38)


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

Offline

 

#97 2007-01-31 23:36:22

Nope
New member
Registered: 2007-01-31
Posts: 2

Re: New Firmware instead of Fun_Plug

I have followed the developers hard work in this forum for some time now and must say that all of you are doing a great job. Running sala 0.4 on my G600 and it's working great. Looking forward to see what kind of cool stuff gonna be included in the future. Hope to see some good working UPNP software, becuse the original version in G600 really sux.... Again really nice work guys..

Offline

 

#98 2007-02-02 08:30:00

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

Re: New Firmware instead of Fun_Plug

Sala,

I successfully updated it using your prebuilt firmware 0.4.  However, I keep getting an error using the firmware that I build.  I'm building it on Ubuntu Server 6.10 using your Sala_DSM-0.4 as the source.  The build process ran just fine, and the fwimage file is built.  I use the "kernel" file in ramdisk-0.2 as is, even though I successfully built the kernel as well.

I'm using gcc 3.3.6, btw.  Give me any hints you might have.

Thanks,
Quang

Offline

 

#99 2007-02-02 12:53:11

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

Re: New Firmware instead of Fun_Plug

Sala_DSM-0.4 source, where did you get that one? You mean beattie?
You should post the error you get. Without this information I guess it is hard to help.


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

Offline

 

#100 2007-02-02 17:31:32

indy75
Member
Registered: 2007-01-14
Posts: 8

Re: New Firmware instead of Fun_Plug

I may be wrong, but it seems this firmware lacks support for USB external HDD ? At least, my USB EXT2-formatted HD is not recognized since I tried Sala's firmware.
Just to be sure...

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB