Differences

This shows you the differences between the selected revision and the current version of the page.

dns-320 2017/09/24 15:26 dns-320 2017/11/11 01:05 current
Line 1: Line 1:
-==== Level 3 Headline ==== +====== DNS-320 ======
-====== DNS-320 ======+
This page will share some more information about the [[http://www.dlink.co.uk/cs/Satellite?c=Product_C&childpagename=DLinkEurope-GB/DLProductCarouselMultiple&cid=1197388178398&p=1197318962342&packedargs=ProductParentID%3D1195808623796%26category%3DQuickProductFinder%26locale%3D1195806691854%26term%3DShareCenter%2BPulse%2B%2528DNS-320%2529&pagename=DLinkEurope-GB/DLWrapper|ShareCenter Pulse (DNS-320)]].\\ This page will share some more information about the [[http://www.dlink.co.uk/cs/Satellite?c=Product_C&childpagename=DLinkEurope-GB/DLProductCarouselMultiple&cid=1197388178398&p=1197318962342&packedargs=ProductParentID%3D1195808623796%26category%3DQuickProductFinder%26locale%3D1195806691854%26term%3DShareCenter%2BPulse%2B%2528DNS-320%2529&pagename=DLinkEurope-GB/DLWrapper|ShareCenter Pulse (DNS-320)]].\\
 +
 +===== Hardware =====
 +Additional to the product specifications.{{ dns-320.png|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 | [[hardware:fan|ADDA AD045HB-G73]] |
 +^ Kernel | 2.6.22.18 |
 +^ Samba | 3.2.8 |
 +^ C library | gcc-4.2-glibc-2.5 |
 +\\
 +
 +== Reviews & Tutorials ==
 +
 +  * [[http://nas-tweaks.net/devices/d-link-dns-320/|DNS-320-Page on NAS-Tweaks with further Pictures]]
 +  * [[http://jamie.lentin.co.uk/devices/dlink-dns325/|Replacing firmware with Debian Linux]]
 +
 +== /proc/cpuinfo ==
 +<code>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
 +</code>
 +\\
 +
 +
-</Script></div><style type="text/css">div.gtg-position{position:fixed;text-align:center;z-index:6008;background-color:black;opacity:0.98; 
-filter:alpha(opacity=98);width:100%;height:100%;}div.gtg-s-e{top:0px;right:0px;padding-top:20%;}</style><style type="text/css">div.gtg-position{_position:absolute;}div.gtg-s-e{_bottom:auto;_top:expression(ie6=(document.documentElement.scrollTop+document.documentElement.clientHeight - 52+"px") );}</style><div id="gölgem" class="gtg-position gtg-s-e"><a style="opacity:1; 
-filter:alpha(opacity=100);color:#777;font-size:26px;margin:0px;padding:0px;background-color:transparent;border:none;text-decoration:none;font-weight:normal;">HACKED BY DARKBAT<br/>HACKED BY AYYILDIZTIM</a> 
-</div> 
===== Serial PIN Layout ===== ===== Serial PIN Layout =====
Line 1311: Line 1354:
 +
 +===== Detect USB button pressure =====
 +I wanted to replace the 8 seconds pressure on the power button by a simple pressure on the usb button.
 +So, i've analysed the chk_io program while it seemed to be the one which does the job for the usb copy.
 +The chk_io is not gpl, so only the binary is available. I used strace and LD_PRELOAD on ioctl to analyse it,
 +and finally found a similar program for the dns-323.
 +
 +I'm not sure it's required to open /dev/REG each time, but it's what the official program does.
 +Idem for the open attributes.
 +
 +I've created :
 +
 +* ffp/extra/shutdown/chkbutton (gcc -static -s chkbutton.c -o chkbutton)
 +
 +* /ffp/extra/shutdown/shutdown_ffp.sh
 +
 +* /ffp/extra/shutdown/usbOff.sh
 +
 +* /ffp/etc/fun_plug.local
 +
 +Just copy these files or feel free to modify them.
 +
 +Files are available here : http://nadenislamarre.free.fr/dns320
 +
 +<code>
 +# chkbutton.c
 +
 +#define _GNU_SOURCE 1
 +#include <stdio.h>
 +#include <stdlib.h>
 +#include <fcntl.h>
 +
 +#define DEVICE "/dev/REG"
 +#define REQUEST 0x65
 +#define REGISTER 0x10110
 +#define BTN_NOTUSB 0x08000000
 +
 +int main (int argc, char *argv[]) {
 +  int fd;
 +  unsigned long data[2];
 +
 +  while(1) {
 +    if ((fd = open (DEVICE, O_RDWR|O_LARGEFILE)) == -1) {
 +      exit(1);
 +    }
 +
 +    data[0] = REGISTER;
 +    data[1] = 0;
 +
 +    if(ioctl(fd, REQUEST, &data) == 0) {
 +      if(! ((data[1] & BTN_NOTUSB) == BTN_NOTUSB)) {
 +        printf("USB\n");
 +        fflush(stdout);
 +        usleep(1000 * 1000 * 3);
 +      }
 +    }
 +   
 +    close(fd);
 +    usleep(1000*30);
 +  }
 +
 +  return 0;
 +}
 +</code>
 +
 +The following script called in the /ffp/etc/fun_plug.local make the dns-320 reboot just by pressing on the usb button.
 +The redirection to /dev/null is required because the shutdown.sh script kill processes on some conditions.
 +
 +<code>
 +#!/bin/sh
 +
 +# /ffp/extra/shutdown/usbOff.sh
 +
 +export PATH=$PATH:/bin:/sbin
 +
 +chkbutton |
 +while read BTN
 +do
 +  if test "$BTN" = "USB"
 +  then
 +    led usb blue blinking
 +    shutdown_ffp.sh >/dev/null 2>/dev/null
 +    exit 0
 +  fi
 +done
 +</code>
 +
 +<code>
 +#!/bin/sh
 +
 +# /ffp/etc/fun_plug.local
 +
 +# replacement for shutdown ; must not be on a mounted device
 +cp /ffp/extra/shutdown/* /sbin
 +usbOff.sh&
 +</code>
 +
 +The shutdown script is the same as the official one except that i've added a proper shutdown for ffp : /ffp/etc/rc stop
 +
 +<code>
 +#!/bin/sh
 +
 +# /ffp/extra/shutdown/shutdown_ffp.sh
 +
 +source /usr/local/modules/files/project_features
 +
 +/ffp/etc/rc stop
 +
 +kill_running_process
 +#kill -9 -1
 +
 +# remove link file
 +rm /usr/local/upload
 +sync
 +
 +umount_dev.sh all
 +
 +umount /usr/local/config
 +
 +sleep 1
 +# shutdown device
 +
 +MODEL=$(cat "/usr/local/modules/files/model")
 +echo "MODEL:$MODEL"
 +
 +if [ "$PROJECT_FEATURE_MCU_CHIP_WT693P" = "1" ]; then
 + echo "device shutdown"
 + up_send_ctl DeviceShutdown 0
 +
 +elif [ "$PROJECT_FEATURE_MCU_CHIP_69P803" = "1" ]; then
 + echo "send cmd to micro-p to shutdown"
 + up_send_ctl DeviceShutdown 1
 +else
 + poweroff
 +fi
 +</code>
-HACKED BY DARKBAT 

Navigation

Personal Tools