GW中についそそのかされてKURO-BOX/PRO(玄箱Pro)を買ってしまいました。ハックをするにしても、シリアルコンソールがないと詰まったときにどうしようもなくなるので、SCON-KIT/PROの到着待ち。
しかし、ハンダ付けをしなきゃならないのはいいとしても、保証がなくなるのが痛い。メーカとして保証対象外にするのは分かるけど、ハックしないとただのNASなので、コネクタ実装した状態で出荷して欲しかったなぁ。シリアル-USB変換で端子がUSBなのは良いですね。どうせ本体のUSBコネクタを2つも使わないので、シリアル-USB変換基板を本体に内蔵して、USBタイプAオス同士のケーブルを使ってシリアルコンソール使おうと企み中。
以下は個人的に調べたメモ。間違いがあるかもしれないので注意。より詳しいサイトがたくさんありますので、そちらのほうをどうぞ。
□ KURO-BOX/PRO(玄箱)メモ † 基本スペック/価格 † * KURO-BOX/PROサイト http://www.kuroutoshikou.com/modules/display/?iid=966 シリアルコンソールキットSCON-KIT/PROサイト http://kuroutoshikou.com/modules/display/?iid=992 * 本体は2007年3月発売。シリアルコンソールキットは同年4月末発売。 * 本体価格19,800円前後。シリアルコンソールキット2,980円前後。 * 玄箱本体の他に、SATA接続のハードディスクもしくはフラッシュディスク等が必要。 * 付属品はCD-ROM/解説書の紙/ACケーブル/LANケーブル(きしめん) 基本ハードウェア仕様 † * CPU: Marvell 88F5182 (400MHz) ARM系 * RAM: 128MB * Flash 256KB NOR (u-boot ブートローダ) * Flash: 256MB NAND (Linux) * LAN: Gigabit(1000BASE-T等)コネクタ1個 * USB: コネクタ2個(タイプA) * 内部拡張コネクタ: PCI-Ex1press X1 / SATA / UART,GPIO,I2Cが基板のスルーホールに有 設置/初期設定 † * 底面にMacアドレス/製造番号が記載されたシールが貼られている * 解説の紙の通りにSATA HDDを接続し、本体後部の赤いリセットスイッチを 5秒以上押すとディスクの初期化が始まり、終了するとNASとして使用できる。 * 初期状態では、ネットワークはDHCP設定 * 初期状態のパスワードはtelnetやSwatのログインともに ユーザ名: root パスワード: kuroadmin * 標準では以下のサービスが稼働している telnetd: リモートログイン samba(smb/nmb): Windows共有。samba 3.0.21 swat: Web経由でのsamba設定 httpd: swatを動かすためのもの。busyboxのhttpd * 玄箱のアドレスにブラウザでアクセスすると、玄人志向のロゴのみのページが出る。 これは/www以下のコンテンツ。玄人志向のサイトへのリンクとなっている。 例: http://192.168.0.100/ * Swatはポート901にて開いている。英語版で日本語化されていない。 例: http://192.168.0.100:901/ 各種出力 † * uname -aによるカーネル情報 # uname -a Linux KUROBOX-PRO 2.6.12.6-arm1 #27 Tue Apr 10 22:47:16 JST 2007 armv5tejl unknown * /proc/versionによる情報 # cat /proc/version Linux version 2.6.12.6-arm1 (root@dev-hara) (gcc version 3.4.4 (release) (CodeSourcery ARM 2005q3-2)) #27 Tue Apr 10 22:47:16 JST 2007 * /proc/cpuinfoによるCPU情報 # cat /proc/cpuinfo Processor : ARM926EJ-Sid(wb) rev 0 (v5l) BogoMIPS : 266.24 Features : swp half thumb fastmult CPU implementer : 0x41 CPU architecture: 5TEJ CPU variant : 0x0 CPU part : 0x926 CPU revision : 0 Cache type : write-back Cache clean : cp15 c7 ops Cache lockdown : format C Cache format : Harvard I size : 32768 I assoc : 1 I line length : 32 I sets : 1024 D size : 32768 D assoc : 1 D line length : 32 D sets : 1024 Hardware : MV-88fxx81 Revision : 0000 Serial : 0000000000000000 * /proc/buffalo/enetによるネットワーク情報 bash-2.05b# cat /proc/buffalo/enet MAC=00:16:01:12:34:56 link=1000Mbps duplex=full jumboframe=enable mtu=1500 * /proc/meminfoによるメモリ情報 # cat /proc/meminfo MemTotal: 126328 kB MemFree: 106444 kB Buffers: 0 kB Cached: 10712 kB SwapCached: 0 kB Active: 6832 kB Inactive: 6936 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 126328 kB LowFree: 106444 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB Mapped: 6448 kB Slab: 4372 kB CommitLimit: 63164 kB Committed_AS: 25628 kB PageTables: 268 kB VmallocTotal: 385024 kB VmallocUsed: 4560 kB VmallocChunk: 380412 kB * netstatによるポート状況 # netstat -l Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 *:swat *:* LISTEN tcp 0 0 *:8873 *:* LISTEN tcp 0 0 *:rsync *:* LISTEN tcp 0 0 *:netbios-ssn *:* LISTEN tcp 0 0 *:http *:* LISTEN tcp 0 0 *:telnet *:* LISTEN tcp 0 0 *:microsoft-ds *:* LISTEN udp 0 0 KUROBOX-PRO:netbios-ns *:* udp 0 0 *:netbios-ns *:* udp 0 0 KUROBOX-PRO:netbios-dgm *:* udp 0 0 *:netbios-dgm *:* udp 0 0 *:22936 *:* udp 1752 0 *:bootpc *:* Active UNIX domain sockets (only servers) Proto RefCnt Flags Type State I-Node Path * nmapによる外部から見たポート状況 $ nmap 192.168.0.103 Starting nmap 3.81 ( http://www.insecure.org/nmap/ ) at 2007-05-04 21:56 JST Interesting ports on 192.168.0.103: (The 1657 ports scanned but not shown below are in state: closed) PORT STATE SERVICE 23/tcp open telnet 80/tcp open http 139/tcp open netbios-ssn 445/tcp open microsoft-ds 873/tcp open rsync 901/tcp open samba-swat * hdparmによるディスク速度測定 bash-2.05b# hdparm -Tt /dev/sda /dev/sda: Timing buffer-cache reads: 128 MB in 0.87 seconds =147.13 MB/sec Timing buffered disk reads: 64 MB in 1.61 seconds = 39.75 MB/sec * psによるプロセス状況 bash-2.05b# ps PID Uid VmSize Stat Command 1 root 612 S init 2 root SWN [ksoftirqd/0] 3 root SW< [events/0] 4 root SW< [khelper] 5 root SW< [kthread] 11 root SW< [kblockd/0] 14 root SW [khubd] 53 root SW [pdflush] 54 root SW [pdflush] 56 root SW< [aio/0] 55 root SW [kswapd0] 58 root SW< [xfslogd/0] 59 root SW< [xfsdatad/0] 60 root SW [xfsbufd] 163 root SW [kseriod] 185 root SW [scsi_eh_0] 186 root SW [scsi_eh_1] 196 root SW [mtdblockd] 239 root SWN [jffs2_gcd_mtd2] 332 root 632 S /bin/sh /usr/local/sbin/Keventd 414 root SW [xfssyncd] 428 root SWN [jffs2_gcd_mtd3] 559 root 504 S cat /proc/buffalo/kernevnt 561 root 536 S /sbin/dhcpcd -L /etc/dhcpc -h KUROBOX-PRO -t 15 eth0 598 root 612 S httpd -p 80 -h /www 607 root 528 R telnetd 616 root 788 S inetd 626 root 2736 S /usr/local/sbin/smbd -D 630 root 2716 S /usr/local/sbin/smbd -D 631 root 1904 S /usr/local/sbin/nmbd -D 667 root 536 S /usr/local/sbin/clientUtil_server -i eth0 685 root 604 S /bin/sh /usr/local/sbin/Fand 756 root 612 S /sbin/getty -L ttyS0 115200 vt100 2701 root 808 S -sh 11318 root 424 S sleep 60 11321 root 1256 S bash 11322 root 632 R ps * /bin以下 o 基本的にbash, unzip以外は全てbusyboxへのシンボリックリンクとなっている。 o busyboxとは、UNIX系でよく使われるコマンドやユーティリティをまとめて1つの 実行形式ファイルにしたもので、サイズを節約できるため組込み系Linuxに向いている。 http://busybox.net/ http://jr0bak.homelinux.net/~imai/linux/embedded_beginner-5.html http://www-06.ibm.com/jp/developerworks/linux/060922/j_l-busybox.shtml bash-2.05b# ls -l /bin/ lrwxrwxrwx 1 root root 7 Apr 10 22:45 addgroup -> busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 adduser -> busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 ash -> busybox -rwxrwxrwx 1 root root 619848 Dec 21 13:31 bash lrwxrwxrwx 1 root root 4 Apr 10 22:45 bash2 -> bash lrwxrwxrwx 1 root root 7 Apr 10 22:45 bbconfig -> busybox -rwxr-xr-x 1 root root 797180 Apr 6 22:45 busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 cat -> busybox <中略> lrwxrwxrwx 1 root root 7 Apr 10 22:45 umount -> busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 uname -> busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 uncompress -> busybox -rwxr-xr-x 1 root root 114232 Dec 20 13:45 unzip lrwxrwxrwx 1 root root 7 Apr 10 22:45 usleep -> busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 vi -> busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 watch -> busybox lrwxrwxrwx 1 root root 7 Apr 10 22:45 zcat -> busybox * busyboxで利用できるコマンド # busybox --helpを参照のこと。 (BusyBox v1.1.1) * /usr/local/bin/以下 o パーティションの作成や消去、初期化といったシェルスクリプトが置いてある。 o slコマンドがなにげに入っている(w bash-2.05b# ls -l /usr/local/bin/ -rwxr-xr-x 1 root root 86 Feb 15 10:37 CleanupUimage.sh -rwxr-xr-x 1 root root 1101 Feb 7 14:38 CreatePartition.sh -rwxr-xr-x 1 root root 124 Feb 8 22:11 DiskDelete.sh -rwxr-xr-x 1 root root 688 Feb 23 15:20 InitAll.sh -rwxr-xr-x 1 root root 1636 Feb 8 18:36 InitDisk1.sh -rwxr-xr-x 1 root root 828 Feb 9 23:21 KeventHandller.sh -rwxr-xr-x 1 root root 58 Feb 7 14:08 PartitionDefinition -rwxr-xr-x 1 root root 35 Feb 8 11:44 PartitionDefinition1 -rwxr-xr-x 1 root root 238 Feb 7 19:57 PlayBeep.sh -rwxr-xr-x 1 root root 984 Dec 20 23:48 create_partition.sh -rwxr-xr-x 1 root root 7216 Feb 28 22:38 kuro_lib -rwxr-xr-x 1 root root 11628 Dec 20 22:12 libbuffalo_bin -rwxr-xr-x 1 root root 107 Dec 21 21:44 shutdown.sh -rwxr-xr-x 1 root root 13569 Jan 19 18:24 sl -rwxr-xr-x 1 root root 4270 Mar 8 13:30 update_mtd.sh * /usr/local/sbin/以下 o LED/ブザー/ファン制御等を行うmiconaplコマンドや nmbd,smbd,smbcontrol,swat,smbpasswdといったSamba関連のコマンドが並ぶ。 o nvramコマンドでは、u-bootの起動環境変数を取得/設定できる。 bash-2.05b# nvram -h nvram Ver.1.00 nvram -c* nvramコマンドの実行結果 bash-2.05b# nvram -c printenv 1: [baudrate=115200] 2: [loads_echo=0] 3: [ipaddr=192.168.11.150] 4: [serverip=192.168.11.1] 5: [rootpath=/nfs/arm] 6: [cpuName=926] 7: [CASset=min] 8: [MALLOC_len=4] 9: [bootargs_end=:::DB88FXX81:eth0:none] 10: [ethact=egiga0] 11: [ethaddr=00:16:01:12:34:56] 12: [stdin=serial] 13: [stdout=serial] 14: [stderr=serial] 15: [enaMonExt=no] 16: [enaFlashBuf=yes] 17: [enaCpuStream=no] 18: [ethprime=egiga0] 19: [buffalo_ver=BOOTVER=1.091] 20: [build_time=18:10:02] 21: [initrd=initrd.buffalo] 22: [kernel=uImage.buffalo] 23: [bootargs_base=console=ttyS0,115200] 24: [bootargs_root=root=/dev/mtdblock2 rw panic=5] 25: [bootargs=$(bootargs_base) $(bootargs_root) $(buffalo_ver)] 26: [nand_uImage_offset=20000] 27: [default_kernel_addr=0x00100000] 28: [default_initrd_addr=0x02000000] 29: [bootcmd=nboot $(default_kernel_addr) 0 $(nand_uImage_offset) ;setenv bootargs $(bootargs_base) $(bootargs_root) $(buffalo_ver); bootm $(default_kernel_addr)] 30: [def_tftp=tftp $(default_kernel_addr) $(kernel); tftp $(default_initrd_addr) $(initrd); setenv bootargs $(bootargs_base) $(bootargs_root) rw initrd=0x02000040,20M panic=5 $(buffalo_ver); bootm $(default_kernel_addr) $(default_initrd_addr)] 31: [nand_boot=yes] 32: [bootdelay=3] 33: [disaMvPnp=no] 34: [overEthAddr=no] 35: [usb0Mode=host] 36: [usb1Mode=host] * miconaplコマンドについて strings /usr/local/sbin/miconaplをホゲフガすれば...だが役に立ちそうなものをいくつか。 http://www.yamasita.jp/linkstation/ls-gl/miconapl.html http://www.yamasita.jp/linkstation/2007/03/070313_miconapl.html * ファンの速度を取得 # /usr/local/sbin/miconapl -a fan_get_speed #[miconapl.fan_get_speed] fan_rpm=3360 * 温度を取得 # /usr/local/sbin/miconapl -a temp_get #[miconapl.temp_get] temp=37 * /usr/local/music/ 起動時のビープ音はここに入っている。 /etc/init.d/rcSの一番最後の行で /usr/local/bin/PlayBeep.sh /usr/local/music/SW_ON.msc が実行されている。 ------------------ TEMPO=30 b4 b5 b4 b6 ------------------ TEMPOの数字を大きくすると、発音タイミングが遅くなる 下のMERODYデータの内容を変更すれば音が変わるが、変なデータを送ると 音がなりっぱなしになるので注意。 (# miconapl -a bz_on stopでリセット可能?) ドレミファソラシドにする場合は、c4 d4 e4 f4 g4 a4 b4 c5の例のようなデータにする。 * dmesgによるカーネルメッセージ FO batch:1 HighMem zone: 0 pages, LIFO batch:1 Built 1 zonelists Kernel command line: console=ttyS0,115200 root=/dev/mtdblock2 rw panic=5 BOOTVER=1.091 PID hash table entries: 1024 (order: 10, 16384 bytes) Console: colour dummy device 80x30 Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) Memory: 128MB 0MB 0MB 0MB = 128MB total Memory: 126208KB available (3037K code, 426K data, 112K init) Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok NET: Registered protocol family 16 serial_initialize_ttyS1 (Debug): ttyS1 is initialized. config_device_cs Error : Unknown board CPU Interface ------------- SDRAM_CS0 ....base 00000000, size 128MB SDRAM_CS1 ....disable SDRAM_CS2 ....disable SDRAM_CS3 ....disable PEX0_MEM ....base e0000000, size 128MB PEX0_IO ....base f2000000, size 1MB PCI0_MEM ....base e8000000, size 128MB PCI0_IO ....base f2100000, size 1MB INTER_REGS ....base f1000000, size 1MB DEVICE_CS0 ....base fa000000, size 2MB DEVICE_CS1 ....base f4000000, size 32MB DEVICE_CS2 ....base fa800000, size 1MB DEV_BOOCS ....base ff800000, size 8MB CRYPTO ENG ....no such Flash bankwidth 1, base ff800000, size 400000 KUROBOX FLASH size 4096[KB] Marvell Development Board (LSP Version 1.10.3.patch5_DB_NAS)-- KUROBOX_BOARD_KUROBOX Soc: 88F5182 A2 Detected Tclk 166664740 and SysClk 250000000 Marvell USB EHCI Host controller #0: c04e4b00 Marvell USB EHCI Host controller #1: c04e4a40 pexBarOverlapDetect: winNum 2 overlap current 0 mvPexInit:Warning :Bar 2 size is illigal it will be disabled please check Pex and CPU windows configuration PCI: bus0: Fast back to back transfers enabled PCI: bus1: Fast back to back transfers enabled SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub Use the XOR engines (offloading) for enhancing the following functions: o RAID 5 Xor calculation o kernel memcpy o kenrel memzero o copy user to/from kernel buffers Number of XOR engines to use: 2 cesadev_init(c00122e4) Fast Floating Point Emulator V0.9 (c) Peter Teichmann. inotify device minor=63 JFFS2 version 2.2. (NAND) (C) 2001-2003 Red Hat, Inc. SGI XFS with no debug enabled Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled ttyS0 at MMIO 0x0 (irq = 3) is a 16550A ttyS1 at MMIO 0x0 (irq = 4) is a 16550A io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 3 RAM disks of 32768K size 1024 blocksize loop: loaded (max 8 devices) Marvell Gigabit Ethernet Driver 'egiga': o Ethernet descriptors in DRAM o DRAM SW cache-coherency o Checksum offload enabled o Loading network interface ** egiga_init_module (10) 'eth0' Intergrated Sata device found scsi0 : Marvell SCSI to SATA adapter scsi1 : Marvell SCSI to SATA adapter Vendor: Seagate Model: ST3320620AS Rev: 3.AA Type: Direct-Access ANSI SCSI revision: 03 SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB) SCSI device sda: drive cache: write back SCSI device sda: 625142448 512-byte hdwr sectors (320073 MB) SCSI device sda: drive cache: write back sda: sda1 Attached scsi disk sda at scsi0, channel 0, id 0, lun 0 Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0 physmap flash device: 400000 at ff800000 CFI: Found no phys_mapped_flash device at location zero Found: SST 39LF020 phys_mapped_flash: Found 1 x8 devices at 0x0 in 8-bit bank phys_mapped_flash: Found an alias at 0x40000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x80000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0xc0000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x100000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x140000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x180000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x1c0000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x200000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x240000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x280000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x2c0000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x300000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x340000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x380000 for the chip at 0x0 phys_mapped_flash: Found an alias at 0x3c0000 for the chip at 0x0 number of JEDEC chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. RedBoot partition parsing not available Debug nand_scan : nand_flash_ids[i].pagesize is exist Debug nand_scan : mtd->erasesize=0x00020000 Debug nand_scan : mtd->oobblock=0x00000800 Debug nand_scan : mtd->oobsize=0x00000040 NAND device: Manufacturer ID: 0x20, Chip ID: 0xda (ST Micro NAND 256MiB 3,3V 8-bit) Scanning device for bad blocks Using static partition definition Creating 3 MTD partitions on "nand_mtd": 0x00000000-0x00400000 : "uImage" 0x00400000-0x04400000 : "rootfs" 0x04400000-0x10000000 : "extra" usbmon: debugs is not available ehci_platform ehci_platform.4523: EHCI Host Controller ehci_platform ehci_platform.4523: new USB bus registered, assigned bus number 1 ehci_platform ehci_platform.4523: irq 17, io mem 0x00000000 ehci_platform ehci_platform.4523: park 0 ehci_platform ehci_platform.4523: USB 0.0 initialized, EHCI 1.00, driver 10 Dec 2004 hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected ehci_platform ehci_platform.16781: EHCI Host Controller ehci_platform ehci_platform.16781: new USB bus registered, assigned bus number 2 ehci_platform ehci_platform.16781: irq 12, io mem 0x00000000 ehci_platform ehci_platform.16781: park 0 ehci_platform ehci_platform.16781: USB 0.0 initialized, EHCI 1.00, driver 10 Dec 2004 hub 2-0:1.0: USB hub found hub 2-0:1.0: 1 port detected ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI) USB Universal Host Controller Interface driver v2.2 Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. usbcore: registered new driver usbhid drivers/usb/input/hid-core.c: v2.01:USB HID core driver mice: PS/2 mouse device common for all mice md: raid0 personality registered as nr 2 md: raid1 personality registered as nr 3 md: raid5 personality registered as nr 4 raid5: measuring checksumming speed arm4regs : 304.000 MB/sec 8regs : 215.200 MB/sec 32regs : 249.200 MB/sec raid5: using function: arm4regs (304.000 MB/sec) md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27 Buffalo Platform Linux Driver(Light) 0.01 installed. MICON ctrl (C) BUFFALO INC. V.1.00 installed. Kernel event proc (C) BUFFALO INC. V.1.00 installed. MICON V2 (C) BUFFALO INC. V.1.00 installed. NET: Registered protocol family 2 IP: routing cache hash table of 1024 buckets, 8Kbytes TCP established hash table entries: 8192 (order: 4, 65536 bytes) TCP bind hash table entries: 8192 (order: 3, 32768 bytes) TCP: Hash tables configured (established 8192 bind 8192) NET: Registered protocol family 1 NET: Registered protocol family 17 md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. Empty flash at 0x00df85f8 ends at 0x00df8800 VFS: Mounted root (jffs2 filesystem). Freeing init memory: 112K XFS mounting filesystem sda1 Starting XFS recovery on filesystem: sda1 (dev: sda1) Ending XFS recovery on filesystem: sda1 (dev: sda1) eth0: link down eth0: link up<5>, full duplex<5>, speed 1 Gbps<5>