Dobrica Pavlinušić's random unstructured stuff
DSM-G600: Revision 23
Collection of some hints about Debian installation on my D-Link DSM-G600:

{toc: }

^ Resources

* wiki at http://dsmg600.info/
* forum at http://forum.dsmg600.info/

^ firmware (kernel+busybox)

It will fix various problems, including, but not limited to, problems with web interface in firefox.

http://download.dsmg600.info/people/sala/fwimage-04-sala-20070128

I tried to build firmware from source, but had various problems with building gcc. Thet are mostly related to gdb, but after a few random patches it passed compilation (but is broken, because I just commented offending lines).

^^ usbfs

I also want usbfs which generate compilation errors because of missing files in `include/linux/usbdevice_fs.h`

.pre
#define USBDEVFS_DISCONNECT _IO('U', 22)
#define USBDEVFS_CONNECT _IO('U', 23)
.pre

I copied them from current 2.6 kernel and this made it compile.

^ Debian installation

Based on "instructions on wiki"<http://dsmg600.info/howto:chroot_debian> and "post on forum"<http://forum.dsmg600.info/t17-Debian-howto.html>

.pre
cd /mnt/HD_a2
export DEBOOTSTRAP_DIR=`pwd`/usr/lib/debootstrap
export PATH=$PATH:/mnt/HD_a2/bin:/mnt/HD_a2/sbin
./usr/sbin/debootstrap --arch powerpc etch /mnt/HD_a2/debian http://ftp.de.debian.org/debian
cp /etc/resolv.conf /mnt/HD_a2/debian/etc/resolv.conf
# prepare chroot jail
mount -t proc proc /mnt/HD_a2/debian/proc
cd /mnt/HD_a2/
./chroot /mnt/HD_a2/debian /bin/bash
# install additional packages
apt-get update
apt-get install locales
dpkg-reconfigure locales
passwd root
apt-get install dropbear hotplug
.pre

^ USB printer

Kernel module for USB printers for 2.4.21-pre4 kernel: {file: printer.o}

After installation of `cupsys` and `foomatic` all went smoothly, USB printer ("Samsung ML-2510"<http://openprinting.org/show_printer.cgi?recnum=Samsung-ML-2510>) was found and configured automatically. There are a few more details in "this forum thread"<http://forum.dsmg600.info/t105-Printing.html>.

^ Kernel 2.4

As a try to understand this ppc board, I tried to port changes from MontaVista (D-Link used that tree) to current upstream 2.4 kernel and got to the point where SCSI controller times out when reading partition table. This means that board does init, it has serial port which works and has some idea about PCI space (which seems somewhat fishy if you ask me). {file: linux-2.4.34.4-dsmg600.diff.gz}

Few more details are available in "this forum post"<http://forum.dsmg600.info/p3067-Today-182143.html#p3067>.

^ Kernel 2.6

I have a creazy idea: this device *should* run 2.6! So, here is my work in progress...

According to "patches for kurobox"<http://genbako.vodapone.com/> which is quite similar to our hardware, there isn't any changes in current upstream version execept for missing drivers. For DSM G600 that boils town to "IP1000"<http://www.icplus.com.tw/driver-pp-IP1000A.html> network driver, which still isn't in mainland, but seems to be referenced on LKLM as possible inclusion.

* patch against upstream 2.6.21.1 {file: linux-2.6.21.1-dsmg600.diff.gz} (adds IP1000A driver for LAN, wifi missing)

^^ Compilation notes

Compile kernel and convert it to binary format for "loader.o"<http://download.dsmg600.info/people/sala/loader.o>:

.pre
. env.sh
make
powerpc-linux-objcopy -O binary vmlinux
scp vmlinux disk:/tmp/
.pre

Then try out your kernel on DSM:

.pre
cd /mnt/HD_a2 && sync && insmod /mnt/HD_a2/loader.o kernel=/mnt/HD_a2/debian/tmp/vmlinux
.pre

Please note that *you must use full path* to kernel binary. Also note that all paths are customized for my particular device (to help with copy/paste :-)

Expirince with 2.4 kernel shows that I have to do more porting to make 2.6 port usable. As a start, code for board initialization is specific for DSM-G600 as well as serial port driver. When we have those two things working we can see if `loader.o` could boot our kernel. I think that shouldn't be problem, because `loader.o` origin shows that it's possible to boot 2.6 kernel from 2.4 kernel using loader.o.

^ Emulation

It's useful to have development environment for DSM on another machine, so I tried to use "QEMU"<http://fabrice.bellard.free.fr/qemu/> to do so.

* patch which adds support for "platforms based on MPC82xx"<http://qemu-forum.ipi.fi/viewtopic.php?t=1528>
* "Installing Debian Sarge for the PowerPC under the QEMU"<http://overselfresearch.com/kb/qemu.html> which I updated to etch to be in sync with DSM