FLASH memory


Device and Purpose

DeviceMAJORMINOR Purpose
/dev/fl02500 For save configuration. conf_save.tar.gz is written in by as_flash.
/dev/fl12501 Firmware. firmimg.bin is held as it is.
/dev/fl22502 Loader.
/dev/fl32503 Status of boot from hard drive or not.
It does not exist in the HD-LAN.
/dev/fl42504 fl1, fl2, fl3, and fl0 look all in this order.
It exists only in HD-HLAN 1.40 and later, and HGLAN 1.12 and later.

Device, physical address and size

HD-LAN V1 HD-H*LAN,KURO-BOX
Device StartSize EndSize
/dev/fl0 0xFFF80000512KB 0xFFF80000512KB
/dev/fl1 0xFF00000015MB 0xFFC000003MB
/dev/fl2 0xFFF00000512KB 0xFFF00000448KB
/dev/fl3 -- 0xFFF7000064KB
/dev/fl4 -- 0xFFC000004MB

Make device

When /dev/fl0 - /dev/fl4 do not exist, create them by mknod.
# mknod /dev/fl0 b 250 0
# mknod /dev/fl1 b 250 1
# mknod /dev/fl2 b 250 2
# mknod /dev/fl3 b 250 3
# mknod /dev/fl4 b 250 4

/dev/fl0 : To save configuration

You can get configuration files like
linkstation# as_flash /dev/fl0 get -n /tmp/conf_save.tar.gz --output /tmp/conf_save.tar.gz

files in conf_save.tar.gz

In case of LinkStation HD-HLAN 1.30,
etc/network/interfaces
etc/samba/
etc/samba/smbusers
etc/samba/smb.conf
etc/samba/lmhosts
etc/samba/smbpasswd
etc/samba/secrets.tdb
etc/samba/smb.conf.bak
etc/samba/smb.conf.tmp
etc/atalk/
etc/atalk/atalkd.conf
etc/atalk/AppleVolumes.default
etc/atalk/AppleVolumes.system
etc/atalk/afpd.conf
etc/atalk/config
etc/atalk/papd.conf
etc/atalk/lw2ntx.ppd
etc/atalk/nls/
etc/atalk/nls/maccode.437
etc/atalk/nls/maccode.850
etc/atalk/nls/maccode.iso8859-1
etc/atalk/nls/maccode.iso8859-1.adapted
etc/atalk/config.papd
etc/melco/
etc/melco/timer_sleep
etc/melco/timer_backup
etc/melco/timer_backup.cron
etc/melco/timer_status
etc/melco/pass
etc/melco/info
etc/melco/shareinfo
etc/melco/usercount
etc/melco/userinfo
etc/melco/printer
etc/melco/groupinfo
etc/melco/info.bak
etc/melco/shareinfo.bak
etc/melco/pass.bak
etc/passwd
etc/group
etc/hosts
www/.htpasswd
www/cgi-bin/.htpasswd
www/script/.htpasswd
etc/ap_servd.log
etc/printcap
etc/crontab

/usr/bin/as_flash

The command which accesses a flash memory.

Initialization.

/usr/bin/as_flash /dev/fl0 init
Get.
/usr/bin/as_flash /dev/fl0 get -n filename --output outfilename
Add.
/usr/bin/as_flash /dev/fl0 add -n filename
List.
/usr/bin/as_flash /dev/fl0 list

/dev/fl1 : Kernel, RAM DISK IMAGE

firmimg.bin is held as it is.
It has 3 parts.
  • The header part created from firminfo.txt (108 bytes)
  • vmlinux.gz
  • ramdisk.image.gz

    Header

    Define with include/melco/firminfo.h of kernel source.
    offset
    (0 orig.)
    size content LAN 1.23aβ LAN 1.24a LAN 2.13a HLAN 1.3x HLAN 1.40 HLAN 1.41 HGLAN 1.10 HGLAN 1.12 KURO-BOX 1.00 KURO-BOX 1.02
    0 4 Version.
    From version field of firminfo.txt.
    0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001 0000 0001
    4 4 Firmware ID.
    From ID field of firminfo.txt.
    0000 0001 0000 0001 0000 0002 0000 0003 0000 0003 0000 0003 0000 0004 0000 0004 0000 1001 0000 1001
    8 32 Firmware NAME.
    From name field of firminfo.txt. Padding with 0x00.
    "HD-LAN" "HD-LAN(IEYASU)" "HD-LAN(IEYASU)" "HD-HLAN(PLUS)" "HD-HLAN(HIDETADA)" "HD-HLAN(HIDETADA)" "HD-HGLAN(IEMITSU)" "HD-HGLAN(IEMITSU)" "KURO-BOX(IETSUNA)" "KURO-BOX(IETSUNA)"
    40 32 Sub version
    Padding with 0x00.
    "FLASH 1.0(SJIS)" "FLASH 2.0(SJIS)" "FLASH 1.1" "FLASH 2.2" "FLASH 1.2" "FLASH 1.2" "FLASH 2.0" "FLASH 1.3" "FLASH 1.1" "FLASH 1.1"
    72 2 Major Version. 0001 0001 0002 0001 0001 0001 0001 0001 0001 0001
    74 2 Minor Version 0017 0018 000d 0002 0003 0004 0003 0004 0000 0002
    76 2 Build No. 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
    78 6 Build date.(Year-1900, Month, Day, Hour, Minute, Second) 6805 0a0b 1801 6805 190a 2a20 6805 1215 1613 6709 0911 1b1c 6803 050e 2522 6804 0816 1b18 6803 1810 3115 6804 0815 352e 6802 0910 1e2a 6804 100b 2e29
    84 4 size of firmimg.bin 0070 8c64 006f 763c 002e 96bb 002d e1f7 002d eda2 002c ba83 002f 7ec1 002e 1413 002d a21b 002b 713a
    88 4 sum 9769 78dd da73 f794 d83a 6a1a 190e c22b 1010 9b52 7e05 0f7d ecfe 7c13 7c88 b0cb 320d 8c9f 4c20 6901
    92 4 offset of vmlinux.gz *1 0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    0000 006c
    (108)
    96 4 size of vmlinux.gz *2 000b c0a7
    (770215)
    000b c0a7
    (770215)
    000b 8ede
    (757470)
    000b c9f4
    (772596)
    000c cb05
    (838405)
    000c cbaf
    (838575)
    000e 25be
    (927166)
    000e 25ca
    (927178)
    000a f8b5
    (719029)
    000a fa87
    (719495)
    100 4 offset of ramdisk.image.gz *3 000b c113
    (770323)
    000b c113
    (770323)
    000b 8f4a
    (757578)
    000b ca60
    (772704)
    000c cb71
    (838513)
    000c cc1b
    (838683)
    000e 262a
    (927274)
    000e 2636
    (927286)
    000a f921
    (719137)
    000a faf3
    (719603)
    104 4 size of ramdisk.image.gz *4 0064 cb51
    (6605649)
    0063 b529
    (6534441)
    0023 0771
    (2295665)
    0022 1797
    (2234263)
    0021 2231
    (2171441)
    001f ee68
    (2092648)
    0021 5897
    (2185367)
    001f eddd
    (2092509)
    0022 a8fa
    (2271482)
    0020 7647
    (2127431)
    *1 *2 vmlinux.gz
    *3 *4 ramdisk.image.gz

    vmlinux.gz

    Linux Kernel.

    ramdisk.image.gz

    With the HD-LAN, it becomes the root file system.
    With the HD-H*LAN and the KURO-BOX, it becomes the root file system when the firmware does not installed.

    /dev/fl2 : Loader

    bootcode.bin created by "make zImage"

    /dev/fl3 : boot status

    Normally
    # od -xc /dev/fl3
    0000000 4f4b 4f4b 4f4b 4f4b 4f4b 4f4b 4f4b 4f4b
              O   K   O   K   O   K   O   K   O   K   O   K   O   K   O   K
    *
    0000400 ffff ffff ffff ffff ffff ffff ffff ffff
            377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
    *
    0200000
    

    In case of hard drive problem

    # od -xc /dev/fl3
    0000000 4e47 4e47 4e47 4e47 4e47 4e47 4e47 4e47
              N   G   N   G   N   G   N   G   N   G   N   G   N   G   N   G
    *
    0000400 ffff ffff ffff ffff ffff ffff ffff ffff
            377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
    *
    0200000
    

    /usr/bin/write_ng is command to write NGNGNG... to /dev/fl3
    /usr/bin/write_ok is command to write OKOKOK... to /dev/fl3


    Why don't you hack the LinkStation/KURO-BOX

    Copyright (C) 2004 Yasunari Yamashita. All Rights Reserved.
    yasunari (a) yamasita.jp