This is an old revision of the document!


DNS-320

This page will share some more information about the ShareCenter Pulse (DNS-320).
Take a look at the DNS-320-Page on NAS-Tweaks for further Pictures.

Note: This page is in progress, as of today (November 22nd 2010) the device is still pretty new.

Note: Last edited on June 13th 2011 by Zane Chua

Hardware

Additional to the product specifications.Front view of the DNS-320

CPU 800 MHz Marvell 88F6281 (Kirkwood)
RAM 128 MB
USB 1 USB2.0 Port (front)
LAN Marvell 88E1118R-NNC1
Cooling Speed controlled 40mm fan ? (verifying)
Kernel 2.6.22.18
Samba 3.2.8
C library gcc-4.2-glibc-2.5


/proc/cpuinfo
Processor       : ARM926EJ-S rev 1 (v5l)
BogoMIPS        : 791.34
Features        : swp half thumb fastmult edsp
CPU implementer : 0x56
CPU architecture: 5TE
CPU variant     : 0x2
CPU part        : 0x131
CPU revision    : 1
Cache type      : write-back
Cache clean     : cp15 c7 ops
Cache lockdown  : format C
Cache format    : Harvard
I size          : 16384
I assoc         : 4
I line length   : 32
I sets          : 128
D size          : 16384
D assoc         : 4
D line length   : 32
D sets          : 128

Hardware        : Feroceon-KW
Revision        : 0000
Serial          : 0000000000000000


Serial PIN Layout

BusyBox break-in code is still 5784468

Jumper: JP3
TX [5]
GND [4]
VD33 [3]

RX [1]

Serial console boot messages

Below the messages sent to the serial console during the system startup, till init is started.


 ** MARVELL BOARD: DB-88F6281A-BP LE 

U-Boot 1.1.4 (Jun  7 2010 - 10:33:37) Marvell version: 
3.4.14.DNS320_02 
U-Boot code: 00600000 -> 0067FFF0  BSS: -> 006CEE80 
Soc: MV88F6281 Rev 3 (DDR2) 
CPU running @ 800Mhz L2 running @ 400Mhz 
SysClock = 200Mhz , TClock = 166Mhz 
DRAM CAS Latency = 3 tRP = 3 tRAS = 8 tRCD=3 
DRAM CS[0] base 0x00000000   size 128MB 
DRAM Total size 128MB  16bit width 
Flash:  0 kB 
Addresses 8M - 0M are saved for the U-Boot usage. 
Mem malloc Initialization (8M - 7M): Done 
NAND:128 MB 
*** Warning - bad CRC or NAND, using default environment 
CPU : Marvell Feroceon (Rev 1) 
Streaming disabled 
Write allocate disabled 
USB 0: host mode 
PEX 0: interface detected no Link. 
Net:   egiga0 [PRIME] 
Hit any key to stop autoboot:  0 
NAND read: device 0 offset 0x100000, size 0x300000 
load addr ....  =a00000 
 3145728 bytes read: OK 
NAND read: device 0 offset 0x600000, size 0x300000 
load addr ....  =f00000 
 3145728 bytes read: OK 
## Booting image at 00a00000 ... 
   Image Name:   Linux-2.6.22.18 
   Created:      2010-11-15   9:49:59 UTC 
   Image Type:   ARM Linux Kernel Image (uncompressed) 
   Data Size:    2196588 Bytes =  2.1 MB 
   Load Address: 00008000 
   Entry Point:  00008000 
   Verifying Checksum ... OK 
OK 
## Loading Ramdisk Image at 00f00000 ... 
   Image Name:   Ramdisk 
   Created:      2010-12-06   7:00:10 UTC 
   Image Type:   ARM Linux RAMDisk Image (gzip compressed) 
   Data Size:    1563868 Bytes =  1.5 MB 
   Load Address: 00e00000 
   Entry Point:  00e00000 
   Verifying Checksum ... OK 
Starting kernel ...

Uncompressing Linux.....................................................................................................................
Linux version 2.6.22.18 (bing@SWTEST1) (gcc version 4.2.1) #22 Mon Nov 15 17:49:27 CST 2010
CPU: ARM926EJ-S [56251311] revision 1 (ARMv5TE), cr=00053977
Machine: Feroceon-KW
Using UBoot passing parameters structure
Memory policy: ECC disabled, Data cache writeback
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists.  Total pages: 32512
Kernel command line: root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
PID hash table entries: 512 (order: 9, 2048 bytes)
Console: colour dummy device 80x30
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 128MB 0MB 0MB 0MB = 128MB total
Memory: 123776KB available (4120K code, 251K data, 124K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16

CPU Interface
-------------
SDRAM_CS0 ....base 00000000, size 128MB 
SDRAM_CS1 ....disable
SDRAM_CS2 ....disable
SDRAM_CS3 ....disable
PEX0_MEM ....base e8000000, size 128MB 
PEX0_IO ....base f2000000, size   1MB 
INTER_REGS ....base f1000000, size   1MB 
NFLASH_CS ....base fa000000, size   2MB 
SPI_CS ....base f4000000, size  16MB 
BOOT_ROM_CS ....no such
DEV_BOOTCS ....no such
CRYPT_ENG ....base f0000000, size   2MB 

  Marvell Development Board (LSP Version KW_LSP_4.3.4_patch30)-- DB-88F6281A-BP  Soc: 88F6281 A1 LE

 Detected Tclk 166666667 and SysClk 200000000 
MV Buttons Device Load
Marvell USB EHCI Host controller #0: c05bb600
PEX0 interface detected no Link.
PCI: bus0: Fast back to back transfers enabled
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
Time: kw_clocksource clocksource has been installed.
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP reno registered
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 1527K
cpufreq: Init kirkwood cpufreq driver
XOR registered 1 NET_DMA over 4 channels
XOR 2nd invalidate WA enabled
cesadev_init(c00119d8)
mvCesaInit: sessions=640, queue=64, pSram=f0000000
Warning: TS unit is powered off.
MV Buttons Driver Load
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
squashfs: version 3.3 (2007/10/31) Phillip Lougher
squashfs: LZMA suppport for slax.org by jro
Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
JFFS2 version 2.2. (NAND) �Â�© 2001-2006 Red Hat, Inc.
SGI XFS with large block numbers, no debug enabled
io scheduler noop registered
io scheduler anticipatory registered (default)
Serial: 8250/16550 driver $Revision: 1.7 $ 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A
serial8250.0: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 10240K size 1024 blocksize
loop: module loaded
Loading Marvell Ethernet Driver:
  o Cached descriptors in DRAM
  o DRAM SW cache-coherency
  o Single RX Queue support - ETH_DEF_RXQ=0
  o Single TX Queue support - ETH_DEF_TXQ=0
  o TCP segmentation offload enabled
  o LRO support supported
  o Receive checksum offload enabled
  o Transmit checksum offload enabled
  o Network Fast Processing (Routing) supported
  o Driver ERROR statistics enabled
  o Driver INFO statistics enabled
  o Proc tool API enabled
  o SKB Reuse supported
  o SKB Recycle supported
  o Rx descripors: q0=128
  o Tx descripors: q0=532
  o Loading network interface(s):
    o  register under egiga0 platform
    o egiga0, ifindex = 1, GbE port = 0

Warning: Giga 1 is Powered Off

mvFpRuleDb (c7dd0000): 1024 entries, 4096 bytes
Integrated Sata device found
scsi0 : Marvell SCSI to SATA adapter
scsi1 : Marvell SCSI to SATA adapter
scsi 0:0:0:0: Direct-Access     SAMSUNG  HD502IJ          1AA0 PQ: 0 ANSI: 5
scsi 1:0:0:0: Direct-Access     SAMSUNG  HD502IJ          1AA0 PQ: 0 ANSI: 5
scsi 0:0:0:0: Attached scsi generic sg0 type 0
scsi 1:0:0:0: Attached scsi generic sg1 type 0
NFTL driver: nftlcore.c $Revision: 1.1.1.1 $, nftlmount.c $Revision: 1.1.1.1 $
NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 98 at 0x00c40000
Using static partition definition
Creating 6 MTD partitions on "nand_mtd":
0x00000000-0x00100000 : "u-boot"
0x00100000-0x00600000 : "uImage"
0x00600000-0x00b00000 : "ramdisk"
0x00b00000-0x07100000 : "image"
0x07100000-0x07b00000 : "mini firmware"
0x07b00000-0x08000000 : "config"
ehci_marvell ehci_marvell.70059: Marvell Orion EHCI
ehci_marvell ehci_marvell.70059: new USB bus registered, assigned bus number 1
ehci_marvell ehci_marvell.70059: irq 19, io base 0xf1050100
ehci_marvell ehci_marvell.70059: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
USB Universal Host Controller Interface driver v3.0
mice: PS/2 mouse device common for all mice
i2c /dev entries driver
md: linear personality registered for level -1
md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: dm-devel@redhat.com
dm_crypt using the OCF package.
usbcore: registered new interface driver usbhid
drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Freeing init memory: 124K
init started: BusyBox v1.11.2 (2010-11-17 11:44:30 CST)
[...]

Setting up ffp

There is a complete Tutorial on the Installation of ffp available on NAS-Tweaks: Installation of fun_plug 0.5. If you want to do everything yourself instead, just follow the instructions below.

To get the fonz fun_plug running some small changes to the available ffp fun_plug file are needed.

Search and replace all entries of /mnt/HD_a2/ with /mnt/HD/HD_a2/.

Then follow the normal instructions of how to install ffp.

shadowandy has provided modified ffp package for DNS-320 here

Another article in German on installing fun_plug 0.5 can be found here

Once installed and running you might want to set-up ssh and change the root password. (for example this)

But to need to change store-passwd.sh also because that is functioning differently on our device. It can be found at /ffp/sbin/store-passwd.sh

And make it look like this:

#!/bin/sh

echo "Copying files to /usr/local/config/..."
cp -f /etc/passwd /usr/local/config/.
cp -f /etc/group /usr/local/config/.
cp -f /etc/shadow /usr/local/config/.
cp -f /etc/samba/smbpasswd /usr/local/config/.

Installation and Configuration of Transmission with addons

Contributed by Zane Chua on 10th June 2011.

First of all, you need Funplug 0.5 above. SSH into the NAS by using PuTTY. Installation of Transmission:

wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz
wget http://kylek.is-a-geek.org:31337/files/Transmission-2.31-1.tgz
funpkg -i curl-7.18.1.tgz
funpkg -i Transmission-2.31-1.tgz


Once installed, you need to edit the transmission.sh in /ffp/start SSH into the NAS by using PuTTY again. Type these commands:

wget http://ffp.wolf-u.li/additional/app-editors/nano-2.0.9-2.tgz
funpkg -i nano-2.0.9-2.tgz
cd /ffp/start/
nano transmission.sh

Edit the line from

 
TRANSMISSION_HOME=/mnt/HD_a2/.transmission-daemon 

to

TRANSMISSION_HOME=/mnt/HD/HD_a2/.transmission-daemon

Press Ctrl + O and Ctrl + X
After that, i believe that you would want to access the Transmission Web Interface.
SSH into the NAS by using PuTTY again.

/ffp/start/transmission.sh stop
su nobody -c "transmission-daemon -f -g /mnt/HD/HD_a2/.transmission-daemon -w /mnt/HD/HD_a2/Downloads -a 127.0.0.1,192.168.1.*"


I downloaded Transmission Torrent Client Utilities v0.2 from http://dns323.thecorewithin.net/
Run this code via SSH again

wget http://dns323.thecorewithin.net/trans_utils-0.2.tgz
mv trans_utils-0.2.tgz /mnt/HD/HD_a2/trans_utils-0.2.tgz
cd /mnt/HD/HD_a2/
tar xvzf trans_utils-0.2.tgz
cd trans_utils-0.2
nano install.sh

Change the line from

BASE_SHARE=/mnt/HD_a2 

to

BASE_SHARE=/mnt/HD/HD_a2

Press Ctrl + O and Ctrl + X

Continue with the code:

cd scripts
nano torrent_utils.sh

Change the line from

BASE_SHARE=/mnt/HD_a2

to

BASE_SHARE=/mnt/HD/HD_a2

and the line from

TRANSMISSION_HOME=/mnt/HD_a2/.transmission-daemon

to

TRANSMISSION_HOME=/mnt/HD/HD_a2/.transmission-daemon

and the line from

WATCH_DIR=$BASE_SHARE/watch

to

WATCH_DIR=$BASE_SHARE/Downloads/watch 

and the line from

COMPLETE_DIR=$BASE_SHARE/complete

to

COMPLETE_DIR=$BASE_SHARE/Downloads

Press Ctrl + O and Ctrl + X

Continue with the code:

cd ..
nano trans_utils.sh


Change the line from

TRAN_UTILS=/mnt/HD_a2/.transmission-daemon/scripts

to

TRAN_UTILS=/mnt/HD/HD_a2/.transmission-daemon/scripts


Continue with the code:

cd ..
./install.sh

It shouldn't have any issues running but it should make a watch and complete folder in /mnt/HD/HD_a2 which is not even used so we shall just remove them and create them in the proper directories Continue with the code:

cd ..
rm -rf watch
rm -rf complete
cd Downloads
mkdir watch
cd ..
/ffp/start/transmission.sh stop   (wait a while after this)
chown -R nobody /mnt/HD/HD_a2/.transmission-daemon
chown -R nobody /mnt/HD/HD_a2/Downloads


Extras
If you're a paranoid freak like me and you want to be able to remote access your DNS-320 not from your home and want to use a different port. You have to change the line in torrent_utils.sh from

TRANS_REMOTE=$BASE_SYS/bin/transmission-remote 

to

TRANS_REMOTE="$BASE_SYS/bin/transmission-remote Port" 


and then if you're intending to use authentication by username and password you have to add the username and password in the respective fields in the Settings.json File located in /mnt/HD/HD_a2/.transmission-daemon. Then you have to change the line in torrent_utils.sh from

TRANS_REMOTE=$BASE_SYS/bin/transmission-remote 

to

TRANS_REMOTE="$BASE_SYS/bin/transmission-remote port --auth username:password"

That should work. Theoretically. If something is wrong with my commands, can someone please edit.

Changing the port of Web Configuration Utility


Contributed by Anand Kothapeta on 5/20/2011.

I was running two NAS servers (one D-Link DNS-320 and my old PC with FreeNAS) and a web server on a different PC. These are all behind my router. My router and FreeNAS allows me to change the default port for the web configuration utilities. So, I can change them from port 80 and port forward them, and can access the web configuration utilities from internet. However I always have an issue with DNS-320, since it doesn't allow me to change the port and it conflicts with web server. There are some articles on how to change it by running lighttpd. However, I found out that DNS-320 also uses the lighttpd to run the webconfig utility. Also those articles change the port to 81 (not much flexibility). I finally figured out a way to change the port to whatever I wish it to be. Here are the steps. You need to first install the ffp using above articles and links.

1) telnet/ssh login to the DNS-320 box. (see ffp tutorials) and run the following command

cp /etc/lighttpd/lighttpd.conf /ffp/lighttpd_portmod.conf


2) Now edit the /ffp/lighttpd_portmod.conf file and change the following line to lets say 8888 and save the file.

server.port = 8888


3) edit the fun_plug script and add the following lines between fun_plug.local and FFP_RC if conditions.

# run fun_plug.local, if present
if [ -x /ffp/etc/fun_plug.local ]; then
    echo "* Running /ffp/etc/fun_plug.local ..."
    /ffp/etc/fun_plug.local
fi

#*** start Mods for different http port for webadmin tool
echo "killing  lighttpd-angel"
kill -9 `pidof lighttpd-angel`
echo "killing  lighttpd"
kill -9 `pidof lighttpd`

echo "Restart  lighttpd-angel with different port"
/usr/sbin/lighttpd-angel -D -m /usr/local/lib -f /ffp/lighttpd_portmod.conf &
#*** end Mods different http port

# run commands
if [ -x $FFP_RC ]; then
    echo "* Running $FFP_RC ..."
    $FFP_RC
    echo "*  OK"
else
    echo "$FFP_RC: Not found or not executable"
fi


4) Now reboot it.

5) Look at ffp.log to make sure you see the following lines.

killing  lighttpd-angel
killing  lighttpd
Restart  lighttpd-angel with different port


6) Now open the browser and try http://<ipaddress>:8888/ should take you to the web config tool.

7) Now you can port forward 8888 in your router, and port forward 80 to web server.


Setting up Debian in chrooted enviroment

D-Link has recently put a prebuilt Debian Squeeze package on their ftp site. The package size is approximately 150 MB. Read the instruction inside.

Source code for firmware

Dlink have release source code for firmware 1.0 on their ftp site. The source code size is approximate 25 MB

U-BOOT Configuration

You can access the boot console (for trying to run your own kernel) via a netconsole. To interrupt the U-Boot startup, press SPACE and 1 before the one-second timeout.

The full U-Boot environment (MAC addresses hidden) is:

Marvell_DNS320>> printenv
bootargs=root=/dev/ram console=ttyS0,115200 :::DB88FXX81:egiga0:none
bootcmd=nand read.e 0xa00000 0x100000 0x300000;nand read.e 0xf00000 0x600000 0x300000;bootm 0xa00000 0xf00000
baudrate=115200
loads_echo=0
ipaddr=2.76.88.201
serverip=2.76.88.2
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
CASset=min
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
MALLOC_len=1
ethprime=egiga0
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(m;
bootdelay=1
disaMvPnp=no
ethaddr=00:50:XX:XX:XX:XX
ethmtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:XX:XX:XX:XX,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:XX:XX:XX
nandEcc=1bit
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
enaAutoRecovery=yes
ethact=egiga0

Environment size: 1238/131068 bytes

Building a Custom Firwmware ("ROM")

D-Link provides a complete build environment on its ftp server that lets you create your own firmware images easily. Untar it and run

 source build_fw 

this will result in a file “DNS320-firmware” in the merge folder, which can be flashed to the unit via the webinterface (firmware update). Right now the build_fw script does not do a full rebuild of the complete firmware, it rather puts together precompiled binaries that come with the built environment. Here is an attempt at rebuilding the build script. This blog post describes how to assemble a firmware image for the DNS-323 and will probably helpful for the DNS-320 as well.

Use this custom build_fw to make a custom settings for the kernel

# Dlink build envorment it only works on x86 arch (32Bits) 

if [ ! -d "arm-none-linux-gnueabi-6xxx" ]; then
   # directory did not exists unpack it
   tar zxvf arm-none-linux-gnueabi-6xxx.tgz
fi

WORKDIR=$(pwd)
export WORKDIR
PATH=${WORKDIR}/arm-none-linux-gnueabi-6xxx/bin:$PATH
export PATH
CC=arm-none-linux-gnueabi-gcc
export CC
export CROSS_COMPILE=arm-none-linux-gnueabi-
CXX=${CROSS_COMPILE}g++
export CXX
RANLIB=arm-none-linux-gnueabi-ranlib
export RANLIB
LD=arm-none-linux-gnueabi-ld
export LD
STRIP=arm-none-linux-gnueabi-strip
export STRIP

# gl setup path to mkimage
if [ ! -d "ramdisk" ]; then
  tar -xzf ramdisk.tgz
fi
PATH=${WORKDIR}/ramdisk:$PATH

# gl extract kernel
if [ ! -d "linux-2.5.22.18" ]; then
  tar -xzf linux-2.6.22.18.tgz
fi

# config our kernel and build it
cd ./linux-2.6.22.18
sh cv.sh
make clean
make menuconfig
make
make modules
make uImage
cd ../

# Dlink run merge now
if [ ! -d "merge" ]; then
 tar zxvf merge.tgz
fi

if [ ! -f "merge/uImage.org" ]; then
  mv merge/uImage merge/uImage.org
fi

if [ -f "merge/uImage" ]; then
 rm merge/uImage
fi

cp linux-2.6.22.18/arch/arm/boot/uImage merge/uImage

cd merge
sudo cp ../ramdisk/uRamdisk .
./merge

Other info

The following thread handles some DNS-320 initial conversation, request there if you want some specific info here, or add yourself.

Fan Speed settings

With ffp is enabled, login to the box via telnet and run FT_testing

ex:

/ # FT_testing -H
Fan and Temperature Testing Tools
Usage
FT_testing      -H      ...Help message
FT_testing      -T      ...Get Temperature
FT_testing      -F      ...Set Fan in Full Speed
FT_testing      -L      ...Set Fan in Low Speed
FT_testing      -S      ...Set Fan Stop
FT_testing      -A      ...Print Receive UART Packet.
FT_testing      -G      ...Get Fan Status.
FT_testing      -P      ...Power off system.
FT_testing      -R      ...Reboot system.

if you need the fan is always off, type:

ps uax |grep fan_control

and kill this process

or

killall fan_control

, and run

FT_testing -S

Navigation

Personal Tools