Differences

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

information:firmware_info 2011/05/15 14:29 information:firmware_info 2017/09/06 18:38 current
Line 4: Line 4:
**Note:** I haven't tested writing to most of these devices, for fear of bricking my unit. Testers wanted! **Note:** I haven't tested writing to most of these devices, for fear of bricking my unit. Testers wanted!
 +
 +===== Boot process =====
 +  - You press the power button
 +  - The device powers on
 +  - The bootloader image is loaded from the flash chip: 0x7D0000 - 0x800000
 +  - The bootloader loads the kernel image: 0x20000 - 0x1A0000
 +  - The kernel copies the environment to the RAM: 0x1A0000 - 0x7D0000 to /dev/ram0
 +  - The kernel runs /etc/inittab, gathering that /dev/ram0 is the rootfs from /etc/fstab
 +    - inittab runs /etc/rc.sh
 +      - rc.sh mounts all the filesystems
 +      - mtd_check
 +      - It copies and links a lot of files from the squashfs image and mtdblock0
 +      - mtdblock0 is unmounted
 +      - Load /lib/modules/sd_mod.ko and usblp.ko to the kernel
 +      - adjtimex -t 9960
 +      - Writes time to system
 +      - /sbin/fan.script
 +        - Stop fan for 1 second
 +        - Set fan to low speed
 +        - Write status to /tmp/fan_status
 +      - Setup loopback network interface
 +      - Read MAC address from firmware files
 +      - Sleep 2 seconds
 +      - Set /proc/sys/net/ipv4/ip_forward to 0
 +      - If /tmp/wrongdate exists, reboot now
 +      - chg_hostname
 +      - Run rc.init.sh from mtdblock0
 +        - Start DHCP:
 +        - /sbin/udhcpc -i egiga0 -H NAS -p /var/run/udhcpc.pid -s /usr/share/udhcpc/default.script -x 192.168.0.32 -q -b
 +        - route add default gw 192.168.0.1
 +        - route add -net 224.0.0.0 netmask 255.0.0.0 dev egiga0
 +        - /bin/hostname DNS-323 (change hostname to DNS-323)
 +      - Set full permissions for /dev/null and change it's owner to 501 (nobody)
 +      - judge_swap 2
 +      - write_raidtab
 +      - chkraidversion
 +      - hd_verify
 +      - write_raidtab
 +      - check_mtdaapd_path
 +      - scsi_mapping
 +      - Start SMB:
 +      - smbcom
 +      - smbd -D
 +      - nmbd -D
 +      - ex_goweb & (background)
 +      - SetTimeZone
 +      - stime
 +      - crond
 +      - xmldb -n config & (background)
 +      - Display version information (/sys/crfs/default/version.txt)
 +      - route add -net 224.0.0.0 netmask 255.0.0.0 dev egiga0
 +      - /usr/sbin/mfg_search
 +      - Run /bin/upnpscript from mtdblock0
 +        - Kill processes called 'upnp'
 +        - Start UPNP with D-Link information, sharing /mnt
 +      - Record current LAN MAC to /etc/macaddr
 +      - Start bittorrent support
 +      - Softlink BT config files
 +      - chk_openssl & (background)
 +      - sharedname_sort & (background)
 +      - Kill processes called 'webs'
 +      - Start web interface server in background
 +      - Backup SCSI file from /proc/scsi/scsi
 +      - Run /usr/sbin/chk_fun_plug & (background)
 +        - Sleep 30 seconds (annoying!)
 +        - In a very convoluted way, run /mnt/HD_a2/fun_plug if it exists
 +      - Run fanscript
 +        - This determines how the fan reacts to temperature
 +        - Read the value for CF-FAN-CONTROL from /web/sib.conf
 +        - If 0, the fan will automatically change speed or switch off
 +        - If 1, the fan will automatically change speed, but never swtich off
 +        - If 2, the fan remains at high speed
 +        - Default to 0
 +      - Start USB support
 +      - daylight (DST)
 +      - ex_opserver
 +      - Touch /tmp/boot_finished
 +      - Record /proc/uptime to /tmp/uptimes
 +      - /usr/sbin/upscan
 +      - If /tmp/upsin exists, remove it and run "/sbin/hotplug usb add" in background
 +        - See [[http://linux-hotplug.sourceforge.net]] for more info
 +    - inittab starts a shell, /bin/sh, on the system console
===== Flash memory access ===== ===== Flash memory access =====
Line 28: Line 110:
These contain the more volatile configuration files of the firmware. 0 is represented in mtdchar0 and mtdchar1, while 1 is represented in mtdchar1 and mtdchar2. These contain the more volatile configuration files of the firmware. 0 is represented in mtdchar0 and mtdchar1, while 1 is represented in mtdchar1 and mtdchar2.
-The behaviour of the block devices is rather odd. One can read and write to them with no problems initially, however, on reboot, problems start to occur. If both blocks are mounted and a file is written to both, the data is not saved. If only one block is mounted, and a file written to it, the data is saved to both blocks. You also need to manually unmount to save the data. I haven't tested for deleting data, or in the case of power loss.+The behaviour of the block devices is rather odd. One can read and write to them with no problems initially, however, on reboot, problems start to occur. If both blocks are mounted and a file is written to both, the data is not saved. If only one block is mounted, and a file written to it, the data is saved to both blocks. You also sometimes need to manually unmount to save the data. I haven't tested for deleting data, or in the case of power loss.
The easiest thing to do is to only deal with 0 as the de-facto configuration block. Never mount or modify 1, and always ensure to unmount after your modifications. The easiest thing to do is to only deal with 0 as the de-facto configuration block. Never mount or modify 1, and always ensure to unmount after your modifications.
Line 93: Line 175:
When a RAID arrangement is set up between the SATA drives, they are mounted to /dev/md0 or both md0 and md1, depending on the RAID setting. When a RAID arrangement is set up between the SATA drives, they are mounted to /dev/md0 or both md0 and md1, depending on the RAID setting.
 +
 +==== USB printer ====
 +
 +USB printers are automatically found and loaded to /dev/usblp0 with the usblp.ko kernel module.
==== Loopback devices ==== ==== Loopback devices ====
Line 154: Line 240:
  * /dev/mouse: Normally the mouse device, now just a symlink to /dev/null   * /dev/mouse: Normally the mouse device, now just a symlink to /dev/null
  * /dev/fb: Framebuffer device. Symlink to /dev/fb0. As there is no graphics capability, this does not work.   * /dev/fb: Framebuffer device. Symlink to /dev/fb0. As there is no graphics capability, this does not work.
-  * /dev/rtc: Real time clock. Normally returns the current timestamp, but in this case is always busy, even when using hwclock.+  * /dev/rtc: Real time clock. Normally returns the current timestamp, but in this case is always busy, even when using hwclock. Use the rtc command to get the time. 
 + 
 +===== Issues ===== 
 + 
 +  * Sometimes /mnt/HD_a2/fun_plug is NOT run when an unformatted hard drive is in the right bay. This is because the DNS-323 assigns /dev/sda to the right bay and /dev/sdb to the left bay, oddly. Swap the drives around. 
 +  * The script waits 30 seconds before executing the fun_plug 
 +  * rc.init.sh is not executed in the background 
 +  * Hotplug does not automount USB devices 

Navigation

Personal Tools