SVX日記

2004|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|09|10|11|12|
2024|01|02|03|

2006-12-02(Sat) 遅ればせながら玄箱いじり

  はいきた。これほどにイマサラ感の漂う記事も少ないが、玄箱である。

  発売直後からずっと横目でニラんではいたのだが、LANポートをひとつしか搭載していない、ということで、ウチで稼動しているLinuxサーバの代替にはなり得ず、放置してあった。しかし、先のエントリで紹介しているWRAPに対してNFSサービスを提供する、という目的が出てくるとこれにはピッタリの用途なのである。

  ただ、購入当初は単純にNFSサーバをやらせればいいや、と考えていたのだが、WRAPのRHEL4化が至極アッサリと達成できてしまったので、ちょっと欲が出た。WRAPの処理能力もヘボいのだから、玄箱側にもバックグラウンド的な処理をやらせるべきではないか。すると、やっぱりガリガリと環境を構築したいわけでそうなるとRHEL4化は避けられないのである。

  玄箱のCPUはPowerPC系である。確かにRHEL4はPowerPC系もサポートしているが、決定的な違いとして、ウチには母艦となるPowerPC系のマシンがないのである。カーネルをコンパイルしようと思えばクロスコンパイル環境の構築が必要だろうし、ユーザランドを構築しようと思えばインストーラの力を借りずにやらねばならない。

  DebianとかVineなら先人がいくらでもいるが、極力、自分でやりたいんだよな。イメージをペタっと貼って完成したって嬉しかない。この際だ、x86系プラットホーム以外を経験するのも勉強だ。ひとつどーにかしてやろーじゃないか。ごそごそとRedhatのサイトで評価版の登録をして、RedHatNetworkからRed Hat Enterprise Linux AS (v. 4 for 64-bit IBM POWER)という版のインストールCDのイメージファイルをダウンする。

  しかし、カーネルを入れ替えるとか、そういう派手なことをやる場合、デバッグのためのシリアルコンソール接続は必須であろう。安定稼動に移った後は外部の表示装置や赤外線リモコンなどを制御させてもいいしな。玄箱は幸いなことに先人によってシリアルコンソールの接続方法が確立されており、それをなぞるだけでいい。

  画像の説明 画像の説明

  どうもメイン基板中心のヘッダピンが取り付けられるスルーホールがそれらしい。1番からTxD、RxD、+3.3V、GNDということだ。しかし、バカにするワケではないが、ちまたのサイトにはちゃんとこの記述がしてあるものが少ない。携帯電話の変換ケーブルの色とピン番号の対応に終始し、単につないで完成、なんて記事ばかり。わかっとらんでもできるという環境を否定するわけではないが、そういう記事が溢れると正確な情報を得るのに苦労するのも確か。ま、オシロ出せばいいんだけどさ。

  とりあえず、パッケージング関係から作戦を練る。ケース加工も悪くないが面倒。どーしよーかなー、D-SUB9pinをつけられる場所もなくはないが……無印玄箱ではLANのストレート/クロスを切り替えるスイッチのあった場所である。玄箱HGではオミットされているので化粧シールを剥がしてそこを活用するのはいいが……つーか、D-SUB9pinをつけるってことは、レベルコンバートしなきゃってことじゃん。中にMAX232系のチップも入れる? メンドーだなぁ。それに、あのゴツいケーブルをこの小さく軽い玄箱に接続するのもバランスが悪い。

  画像の説明

  ……というわけで、ピンヘッダのメスを内部に接着することにした。穴のサイズをフル活用するとギリギリ6ピンを通すことができる。現状、4ピンが通れば十分だからうってつけである。レベルコンバータは外付けにしよう……というか、よく考えたらレベルコンバートなんて不要なんだよね。だって、ノートPCにつなぐんだから。

  画像の説明

  と、ここでオイラ自作のシリアル/USB変換基板がリングに登るのである。基板上のピンヘッダにチョンチョンとつなぐだけであら不思議、である。最初、玄箱側が3.3Vロジックであることに気づいて、10秒くらいうろたえたが、FT232BMのデータシートにその記載を発見し、自分の作った基板もちゃんとコンフィギュレーション可能なように設計されているコトに気づいて安心した。やるじゃんかよ、昔のオレ。

  ホントは変換基板にはバスパワーの5Vから降圧して3.3Vを「同時に」供給するのが筋だが、玄箱側から供給してしまっているので電圧の供給タイミングに気をつける必要があるかもしれない(たぶん、玄箱の電源をONにしてから、PCのUSB端子に変換基板を接続しなくてはならない)。ま、しかし一度動いてしまえばあとは問題ないだろうからこれで完成としてしまう。

  で、お約束のシリアルコンソールログだ。

******* Product Information *******
----------------------------------
Product Name: KURO-BOX/HG(IESHIGE)
          VER: 1.00
         Date: 2004/10/19 17:18:54
----------------------------------
Firmware check:done.
 
>>root=/dev/hda1
Now Loading...done.
Now Booting
Memory BAT mapping: BAT2=128Mb, BAT3=0Mb, residual: 0Mb
Linux version 2.4.17_mvl21 (root@toda_dev.melcoinc.co.jp) (gcc version 2.95.3 20010315 (release/MontaVista)) #24 2004年 10月 19
日 火曜日 17:17:03 JST
KURO-BOX (C) 2004 KUROUTO-SHIKOU.
On node 0 totalpages: 32768
zone(0): 32768 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/hda1
OpenPIC Version 1.2 (1 CPUs and 139 IRQ sources) at 80040000
decrementer frequency = 32.768000 MHz
Calibrating delay loop... 174.48 BogoMIPS
Memory: 124760k available (1244k kernel code, 556k data, 188k init, 0k highmem)
Dentry-cache hash table entries: 16384 (order: 5, 131072 bytes)
Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
Mount-cache hash table entries: 2048 (order: 2, 16384 bytes)
Buffer-cache hash table entries: 8192 (order: 3, 32768 bytes)
Page-cache hash table entries: 32768 (order: 5, 131072 bytes)
POSIX conformance testing by UNIFIX
PCI: Probing PCI hardware
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Disabling the Out Of Memory Killer
Journalled Block Device driver loaded
pty: 256 Unix98 ptys configured
MELCO INC. RTC driver ver 1.00
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI enabled
ttyS00 at 0x80004600 (irq = 138) is a 16550A
ttyS01 at 0x80004500 (irq = 137) is a 16550A
block: 128 slots per queue, batch=32
RAMDISK driver initialized: 16 RAM disks of 10000K size 1024 blocksize
Uniform Multi-Platform E-IDE driver Revision: 6.31
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
CMD680: IDE controller on PCI bus 00 dev 60
CMD680: chipset revision 2
CMD680: 100% native mode on irq 17
    ide0: BM-DMA at 0xbffed0-0xbffed7, BIOS settings: hda:pio, hdb:pio
    ide1: BM-DMA at 0xbffed8-0xbffedf, BIOS settings: hdc:pio, hdd:pio
hda: Maxtor 93652U8, ATA DISK drive
ide0 at 0xbffef8-0xbffeff,0xbffef6 on irq 17
hda: 71346240 sectors (36529 MB) w/2048KiB Cache, CHS=70780/16/63, UDMA(66)
Partition check:
 hda: [PTBL] [4441/255/63] hda1 hda2 hda3
FLASHDISK:Initialized [FUJITSU MBM29PL32TM]
eth0: RTL8169s/8110s Gigabit Ethernet driver supports Jambo Frame 1.8n4b <2004-3-16> at 0xc9000f00, 00:0d:0b:ad:9b:c7, IRQ 16
eth0: Auto-negotiation Enabled.
SCSI subsystem driver Revision: 1.00
request_module[scsi_hostadapter]: Root fs not mounted
usb.c: registered new driver usbdevfs
usb.c: registered new driver hub
hcd.c: ehci-hcd @ 00:0e.2, PCI device 1033:00e0 (NEC Corporation)
hcd.c: irq 19, pci mem c9002f00
usb.c: new USB bus registered, assigned bus number 1
hcd/ehci-hcd.c: USB 2.0 support enabled, EHCI rev 1. 0
hub.c: USB hub found
hub.c: 5 ports detected
usb-ohci.c: USB OHCI at membase 0xc9004000, IRQ 19
usb-ohci.c: usb-00:0e.0, NEC Corporation USB
usb.c: new USB bus registered, assigned bus number 2
hub.c: USB hub found
hub.c: 3 ports detected
usb-ohci.c: USB OHCI at membase 0xc9006000, IRQ 19
usb-ohci.c: usb-00:0e.1, NEC Corporation USB (#2)
usb.c: new USB bus registered, assigned bus number 3
hub.c: USB hub found
hub.c: 2 ports detected
usb.c: registered new driver usblp
printer.c: v0.11: USB Printer Device Class driver
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 1024 buckets, 8Kbytes
TCP: Hash tables configured (established 8192 bind 8192)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: AppleTalk 0.18a for Linux NET4.0
RAMDISK: Compressed image found at block 0
Freeing initrd memory: 2137k freed
fff70000:4f4b4f4b
EXT2-fs warning: checktime reached, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem).
fff70000:4f4b4f4b
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem) readonly.
change_root: old root has d_count=2
Trying to unmount old root ... okay
Freeing unused kernel memory: 188k init
modprobe: modprobe: Can't locate module char-major-4
INIT: version 2.78 booting
Activating swap...
Adding Swap: 257032k swap-space (priority -1)
EXT3-fs warning: checktime reached, running e2fsck is recommended
EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ide0(3,1), internal journal
Checking all file systems...
Parallelizing fsck version 1.22 (22-Jun-2001)
Setting kernel variables.
Calculating module dependencies... done.
Loading modules:
Mounting local filesystems...
mount: none already mounted or /dev/pts busy
mount: according to mtab, devpts is already mounted on /dev/pts
kjournald starting.  Commit interval 5 seconds
EXT3-fs warning: checktime reached, running e2fsck is recommended
EXT3 FS 2.4-0.9.17, 10 Jan 2002 on ide0(3,3), internal journal
EXT3-fs: mounted filesystem with ordered data mode.
/dev/hda3 on /mnt type ext3 (rw,noatime)
Cleaning: /tmp /var/lock /var/run.
Hostname KURO-BOX
Configuration network interface: lo eth0
dhcpcd[92]: timed out waiting for a valid DHCP server response
 
Hostname: KURO-BOX, 192.168.11.150
Checking share directory information: done.
Netatalk configration file generating...
Samba configration file generating...
Initializing random number generator... done.
Starting system log daemon: syslogd klogd.
 
/dev/hda:
 setting standby to 241 (30 minutes)
INIT: Entering runlevel: 2
umount: /proc/bus/usb: device is busy
Starting internet superserver: inetd.
Start services: thttpd
Start services: lpd
Starting periodic command scheduler: cron.
Starting AppleTalk services: (backgrounded)
Start services: smbd nmbd
Start services: ppc_uartd
 
Kuroutoshikou KURO-BOX/HG (IESHIGE)
 
KURO-BOX login: root
Password:
Linux (none) 2.4.17_mvl21 #24 2004年 10月 19日 火曜日 17:17:03 JST ppc unknown
root@KURO-BOX:~# ls
root@KURO-BOX:~# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0 25 20:12 ?        00:00:15 init
root         2     1  0 20:12 ?        00:00:00 [keventd]
root         3     0  0 20:12 ?        00:00:00 [ksoftirqd_CPU0]
root         4     0  0 20:12 ?        00:00:00 [kswapd]
root         5     0  0 20:12 ?        00:00:00 [bdflush]
root         6     0  0 20:12 ?        00:00:00 [kupdated]
root         8     1  0 20:12 ?        00:00:00 [khubd]
root        10     1  0 20:12 ?        00:00:00 [kjournald]
root        48     1  0 20:12 ?        00:00:00 [kjournald]
root       144     1  0 20:12 ?        00:00:00 /sbin/syslogd
root       146     1  0 20:12 ?        00:00:00 /sbin/klogd
root       168     1  0 20:12 ?        00:00:00 /usr/sbin/inetd
root       171     1  0 20:12 ?        00:00:00 /usr/sbin/thttpd -C /etc/thttpd.
daemon     175     1  0 20:12 ?        00:00:00 lpd Waiting
root       180     1  0 20:12 ?        00:00:00 /usr/sbin/cron
root       188     1  0 20:12 ?        00:00:00 /bin/sh /etc/rc.d/rc2.d/S90atalk
root       191   188  0 20:12 ?        00:00:00 /usr/sbin/atalkd -f /etc/atalk/a
root       192   191  0 20:12 ?        00:00:00 /usr/sbin/atalkd -f /etc/atalk/a
root       193     1  0 20:12 ?        00:00:00 /usr/sbin/smbd -D
root       195     1  0 20:12 ?        00:00:00 /usr/sbin/nmbd -D
root       198     1  0 20:12 ?        00:00:00 /usr/sbin/ppc_uartd
root       200     1  0 20:12 ttyS0    00:00:00 -bash
root       204   200  0 20:13 ttyS0    00:00:00 ps -ef
root@KURO-BOX:~#
root@KURO-BOX:~# shutdown -h now
 
Broadcast message from root (console) Sat Dec  2 20:13:42 2006...
 
The system is going down for system halt NOW !!
INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
INIT: SeStopping periodic command scheduler: cron.
Stopping internet superserver: inetd.
Stop services: thttpd
Saving random seed... done.
Stop services: lpd
Stop servecies: atalkd afpd
Stopping system log daemon: klogd syslogd.
Stop services: smbd nmbd
Stop services: ppc_uartd
Sending all processes the TERM signal... done.
Sending all processes the KILL signal... done.
Deactivating swap... done.
Unmounting local filesystems... done.
flushing ide devices: hda
Power down.

  さりげなく、貧乏くさいHDDが装着されていることをバラしつつ、ではまた。