PuTTYのソースをeVC++に食わせてみる。
予想どおり、ソースのディレクトリ直下にある共通的なファイル (ssh.cなど) はコンパイルが通るんだけどwindowsディレクトリにあるファイルはundeclared identifierなどが多発してダメですねぇ。window.cから勉強していかないとダメなんでしょうね。
たったの15ファイルという考え方もあるか。
本家のページのhttp://www.chiark.greenend.org.uk/~sgtatham/putty/faq.html#faq-winceを見て待ってれば良いという話かなぁ。
雨が降っていたのでなかなか外に出る気が起きません。
なぜか実家に電話をかけたいという話になったのでかけてみました。まぁ、思っていたよりもウケはよかったみたいです。
ズボンがずいぶん破れてしまったので補給すべく錦糸町方面に向かいました。
その後、いつもの寿司屋に行ってすしを食べつつ七輪で肉や鮭のチャンチャン焼きなどを焼いて食べました。鉄火巻きを二つ頼んでおいて正解でした。
アットマークテクノさんのご好意によりArmadilloシリーズの最新機種であるArmadill-210を提供していただきました。
本当は昨日届いていたのですが、不在のため今日になったのです。
さっそく箱を空けて中身を確認して、写真を取ったり、ためつすがめつしました。
マッチ箱(って最近見ませんが)程度の大きさにCPU・メモリをはじめとした機能が満載されています。表面は9ピンのシリアルコネクタとイーサコネクタが多くの面積をとっているので裏面にCPUなど大き目の石が載っているようです。
送ってもらったのはA2100-D00(開発用モデル)というやつで、本体・ケース(PIO穴あり・なしの二つ)・ACアダプタ・A-210用シリアルケーブル・シリアルクロスケーブル・ケース用ネジ・PIO用ヘッダピン(自分でハンダづけする)・スペーサとスペーサ用ネジ・シリアル番号とMACアドレスの書いたシールが入っていました。
本体があまりに小さいのでACアダプタのほうが大きいという事実に気づいてびっくり(ACアダプタも小型のものです)。やっぱりここはPoEでスマートに給電したいなぁ、ということでPoE対応のHUBが欲しくなってしまいました。
NetBSD/evbarmを入れるのはもちろんですが、とりあえず動作確認しないと。
先日申し込んだパスポートをとりに新宿へ。
食事に入った店は水の臭いがきつく、ちょっとつらかった。最近飲んでいる水がおいしいものだということに気づかされた一瞬。
帰ってきてしばらく(なぜか)ドリームキャストで遊んだりしてから眼鏡屋へ。
なぜか眼鏡を買ってしまった。出来上がりは二日後ということ。
スタートアップガイドを読む。ふむふむ。
シリアル-Ethernet変換機とGPIO-Ethernet変換機の説明がしてありますね。この二つの用途ですぐに使えるように設定されて出荷されているみたい。
面白いのはSSHで暗号化して通信する方法がマニュアルに書かれています。SSHを使って通信を暗号化するのは目新しい方法ではないのですが、こういうSSHが使えなさそうな小さな機器で汎用的なSSHが使えるところにArmadillo-210の可能性が見えるような気がします。
マッチ箱の大きさでsshdが動く時代ですかね。Armadillo-9とほぼ同等のCPUを搭載しているからこそ可能な技ですね。
とりあえずブートして、シリアルからのログをとるかな。
ドリームキャストをアップスキャンコンバータにつなぎ、いざNBUG CDを入れて起動する。
カンカンカンと音が。んー? なんかおかしい。
電源を切ってもう一度起動する。
やっぱりカンカンと音がする。で、取り出してCDを見てみると、かなり歪んでいる。やっぱりCD-Rは素材として経年変化に弱いのでしょうか。
とりあえず、重たいものを乗せて伸ばすことにした。
connected Hermit-At v1.0.2 (armadillo210) compiled at 17:06:26, Dec 12 2005 Uncompressing kernel................................................................................done. Uncompressing ramdisk.................................................................................................................................................................................................................................................................done. Doing console=ttyAM1,115200 Doing mtdparts=armadillo210-nor:0x10000(bootloader)ro,0x170000(kernel),0x270000(userland),-(config) Linux version 2.6.12.3-a9-2 (nakai@pc-silvia) (gcc version 3.4.4 20050314 (prerelease) (Debian 3.4.3-13)) #2 Wed Dec 14 14:57:48 JST 2005 CPU: ARM920Tid(wb) [41129200] revision 0 (ARMv4T) CPU0: D VIVT write-back cache CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets Machine: Armadillo-210 ATAG_INITRD is deprecated; please update your bootloader. Memory policy: ECC disabled, Data cache writeback Built 1 zonelists Kernel command line: console=ttyAM1,115200 mtdparts=armadillo210-nor:0x10000(bootloader)ro,0x170000(kernel),0x270000(userland),-(config) PID hash table entries: 256 (order: 8, 4096 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory: 8MB 8MB 16MB = 32MB total Memory: 21468KB available (2166K code, 429K data, 96K init) Mount-cache hash table entries: 512 CPU: Testing write buffer coherency: ok checking if image is initramfs...it isn't (bad gzip magic numbers); looks like an initrd Freeing initrd memory: 8196K NET: Registered protocol family 16 NetWinder Floating Point Emulator V0.97 (double precision) Initializing Cryptographic API gpio: Armadillo-210 GPIO driver, (C) 2005 Atmark Techno, Inc. led: Armadillo-210 LED driver, (C) 2005 Atmark Techno, Inc. ttyAM0 at MMIO 0x808c0000 (irq = 52) is a EP93XX ttyAM1 at MMIO 0x808d0000 (irq = 54) is a EP93XX ttyAM2 at MMIO 0x808e0000 (irq = 55) is a EP93XX io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize loop: loaded (max 8 devices) i2c /dev entries driver i2c-armadillo9: i2c Armadillo-9 driver, (C) 2004-2005 Atmark Techno, Inc. i2c-at24cxx: i2c at24cxx eeprom driver, (C) 2003-2005 Atmark Techno, Inc. armadillo210-nor: Found 1 x16 devices at 0x0 in 16-bit bank Amd/Fujitsu Extended Query Table at 0x0040 armadillo210-nor: CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. 4 cmdlinepart partitions found on MTD device armadillo210-nor parse_mtd_partitions:4 Creating 4 MTD partitions on "armadillo210-nor": 0x00000000-0x00010000 : "bootloader" 0x00010000-0x00180000 : "kernel" 0x00180000-0x003f0000 : "userland" 0x003f0000-0x00400000 : "config" NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) IPv4 over IPv4 tunneling driver ip_tables: (C) 2000-2002 Netfilter core team Initializing IPsec netlink socket NET: Registered protocol family 1 NET: Registered protocol family 10 Disabled Privacy Extensions on device c025bab0(lo) IPv6 over IPv4 tunneling driver NET: Registered protocol family 17 NET: Registered protocol family 15 SCTP: Hash tables configured (established 1024 bind 2048) RAMDISK: ext2 filesystem found at block 0 RAMDISK: Loading 8196KiB [1 disk] into ram disk... done. VFS: Mounted root (ext2 filesystem). Freeing init memory: 96K init started: BusyBox v1.00 (2005.12.14-14:43+0000) multi-call binary Remounting root rw: Mounting proc: Changing file permissions: Starting basic firewall: Loading /etc/config: Setting up interface lo: Configuring network interfaces: Starting seri2eth: Starting snmpd: Stating sshd: eth0: Link is down! atmark-dist v1.4.0 (AtmarkTechno/Armadillo-210.Recover) Linux 2.6.12.3-a9-2 [armv4tl arch] (none) login:
hermitをもってきて、以前のhermitのNetBSD対応部分を参考に、コンパイルを通るようにしてカーネルを書き換えようとしてみました。
usl-5p# ./hermit download -v -i ./netbsd.bin.gz -r kernel --port /dev/ttyU1 opening serial port: /dev/ttyU1 command: download input: ./netbsd.bin.gz output: - region: kernel ./netbsd.bin.gz: 1304967 bytes hermit: panic: can't connect to target usl-5p#
なんかtarget_pingでとまっているみたい。+OKというのを待っていて、それの応答が帰ってこなくて失敗しているような感じだなぁ。
そういえば+OKってArmadillo-9でシリアルに出ていたような記憶があるなぁ。
もしかしたらってことで、hermitプロンプトの出ているDSUBのシリアル(COM1)につないでみることに。
usl-5p# ./hermit download -v -i ./netbsd.bin.gz -r kernel --port /dev/ttyU1 opening serial port: /dev/ttyU1 command: download input: ./netbsd.bin.gz output: - region: kernel ./netbsd.bin.gz: 1304967 bytes target_connect: ping successful. writing command: version hermit: read: Resource temporarily unavailable usl-5p#
pingは成功したようですが、やっぱりだめみたい。うーん、なんでだ。
なんかhermitのソースで修正漏れがあったのでそれを追加してもだめ(COM2)。
せっかくなので、もういっぺんDSUBのCOM1につなげてみる。
usl-5p# usl-5p# ./hermit download -v -i ./netbsd.bin.gz -r kernel --port /dev/ttyU1 opening serial port: /dev/ttyU1 command: download zsh: command not found: usl-5p# usl-5p# opening serial port: /dev/ttyU1 input: ./netbsd.bin.gz output: - region: kernel ./netbsd.bin.gz: 1304967 bytes target_connect: ping successful. writing command: version target: version hermit: warning: target didn't respond with +OK or -NG hermit: warning: unknown response `Hermit-At v1.0.2 (armadillo210) compiled at 17:06:26, Dec 12 2005 ' hermit: panic: target error, can't continue. usl-5p#
おぉ、やっぱりCOM1じゃなくてCOM2なんですね。うむ。
いずれにせよ、シリアルポートが+OKを返さないのがいかんらしい。シリアルを手で叩いても+OKって出ないんだけど、結局どうすればよいのかわからないな。
うーん、わからないな。Windowsでやってみるかー。でも、今日は寝ます。
前回触ったときに書いた日記では、Windowsで試すと書いていたが、実はその日に試していたのでした。
で、Windowsでもうまく動かなくてちょっと困っています。
Regionのコンボボックスをクリックすると「can't connect target」と表示されてしまうようです。
じゃぁ、ブートローダがおかしいのかなぁと思ってJP1とJP2をオープンにして起動すると、ちゃんとLinuxが起動します。
シリアルの設定がおかしいのかと思い、フロー制御などのパラメータを確認したけれど問題ありません。
マニュアルを読むと、CPUオンチップブートROMを使ってブートローダを出荷状態に戻すところには、Armadillo-210のCOM1につなぐように書かれていることに気がつきました。
ん? COM1って別のCOMポートだよなぁ、ということでフラッシュの書き換えのところを読むと、COMポートの記述はありません。
もしかして、COM1につなげば動くんじゃ、いや、NetBSDからはCOM1でもだめだったよな、いや、Windowsでは試してないよ、ということでやってみることに。
あっさりRegionを認識しました。なんだー。
ということで、ブートさせてみました。
ちなみに、NetBSDのコンソールはCOM1に出力されます。ややこしいなぁ。
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 3.99.15 (ARMADILLO9) #0: Mon Jan 16 15:40:01 UTC 2006 root@mini:/usr/export/o/20060112/evbarm/sys/arch/evbarm/compile/ARMADILL O9 total memory = 65536 KB avail memory = 60764 KB mainbus0 (root) cpu0 at mainbus0: ARM920T rev 0 (ARM9TDMI core) cpu0: DC enabled IC enabled WB enabled EABT cpu0: 16KB/32B 64-way Instruction cache cpu0: 16KB/32B 64-way write-back-locking-A Data cache epsoc0 at mainbus0: Cirrus Logic EP93xx SoC rev E0 epsoc0: fclk 200.02 Mhz hclk 100.01 Mhz pclk 50.00 Mhz epclk0 at epsoc0 addr 0x80810000-0x8081008f intr 4 epgpio0 at epsoc0 addr 0x80840000-0x808400cb intr 59 gpio0 at epgpio0: port A: 8 pins gpio1 at epgpio0: port B: 8 pins gpio2 at epgpio0: port C: 8 pins gpio3 at epgpio0: port D: 8 pins gpio4 at epgpio0: port E: 8 pins gpio5 at epgpio0: port F: 8 pins gpio6 at epgpio0: port G: 8 pins gpio7 at epgpio0: port H: 8 pins epled0 at epgpio0: port E bit1 0 bit2 1 armadillo9iic0 at epgpio0: port B bit1 4 bit2 5 iic0 at armadillo9iic0: I2C bus seeprom0 at iic0 addr 0x50: AT24Cxx EEPROM ohci0 at epsoc0 addr 0x80020000-0x80020fff intr 56 epe0 at epsoc0 addr 0x80010000-0x8001ffff intr 39 epe0: MAC address 00:11:0c:03:00:21 lxtphy0 at epe0 phy 0: LXT971/2 10/100 media interface, rev. 2 lxtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto epcom0 at epsoc0 addr 0x808c0000-0x808c0fff intr 52 epcom0: console epcom1 at epsoc0 addr 0x808d0000-0x808d0fff intr 54 epwdog0 at epsoc0 addr 0x80940000-0x80940007 intr 36 eppcic0 at epsoc0 addr 0x80080020-0x80080043 intr 49 pcmcia0 at eppcic0 eprtc0 at epsoc0 addr 0x80920000-0x8092010b intr 37 ohci0: OHCI version 1.0 usb0 at ohci0: USB revision 1.0 uhub0 at usb0 uhub0: Cirrus Logic OHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 3 ports with 3 removable, self powered boot device: <unknown> root device:
total memoryはArmadillo-9と同じ64Mbytesを示していますが、本当は32Mbytesですね。この辺は、判断する部分が入っていないので今後の課題ですね。
ということ色々試せたほうが良かろうということで、INSTALLカーネルを書き込もうとすると、
2006/01/20 02:16:43: Download START File : C:\Documents and Settings\Administrator\デスクトップ\netbsd-ARMADILLO9_INSTALL.bin.gz Size : 2311066 Region : kernel Mode : default Com : COM5 2006/01/20 02:16:54: Download FAILED
どうやらサイズが大きすぎたようです。なんとか2M以下にダイエットしないとだめですね。
INSTALLカーネルを地道に切り詰めて、1,479,109バイトになりました。マニュアルには約1.44Mbytesと書かれていたので心配でしたが、いくつかのコマンドが実行できる状態になりました。設定とかぼろぼろですが、とりあえずネットワークの設定とかできたりします。
[ Kernel symbol table missing! ] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 The NetBSD Foundation, Inc. All rights reserved. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. NetBSD 3.99.15 (ARMADILLO210_INSTALL) #1: Thu Jan 19 17:15:34 UTC 2006 root@mini:/usr/export/o/20060112/evbarm/sys/arch/evbarm/compile/ARMADILL O210_INSTALL total memory = 65536 KB avail memory = 59396 KB mainbus0 (root) cpu0 at mainbus0: ARM920T rev 0 (ARM9TDMI core) cpu0: DC enabled IC enabled WB enabled EABT cpu0: 16KB/32B 64-way Instruction cache cpu0: 16KB/32B 64-way write-back-locking-A Data cache epsoc0 at mainbus0: Cirrus Logic EP93xx SoC rev E0 epsoc0: fclk 200.02 Mhz hclk 100.01 Mhz pclk 50.00 Mhz epclk0 at epsoc0 addr 0x80810000-0x8081008f intr 4 epgpio0 at epsoc0 addr 0x80840000-0x808400cb intr 59 gpio0 at epgpio0: port A: 8 pins gpio1 at epgpio0: port B: 8 pins gpio2 at epgpio0: port C: 8 pins gpio3 at epgpio0: port D: 8 pins gpio4 at epgpio0: port E: 8 pins gpio5 at epgpio0: port F: 8 pins gpio6 at epgpio0: port G: 8 pins gpio7 at epgpio0: port H: 8 pins epled0 at epgpio0: port E bit1 0 bit2 1 armadillo9iic0 at epgpio0: port B bit1 4 bit2 5 iic0 at armadillo9iic0: I2C bus seeprom0 at iic0 addr 0x50: AT24Cxx EEPROM epe0 at epsoc0 addr 0x80010000-0x8001ffff intr 39 epe0: MAC address 00:11:0c:03:00:21 lxtphy0 at epe0 phy 0: LXT971/2 10/100 media interface, rev. 2 lxtphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto epcom0 at epsoc0 addr 0x808c0000-0x808c0fff intr 52 epcom0: console epcom1 at epsoc0 addr 0x808d0000-0x808d0fff intr 54 epwdog0 at epsoc0 addr 0x80940000-0x80940007 intr 36 eprtc0 at epsoc0 addr 0x80920000-0x8092010b intr 37 md0: internal 3075 KB image area boot device: <unknown> root on md0a dumps on md0b root file system type: ffs WARNING: clock lost 13167 days WARNING: CHECK AND RESET THE DATE! erase ^?, werase ^W, kill ^U, intr ^C mount: mount_ffs not found for / mount: mount_kernfs not found for /kern sysinst: not found # ls .profile dev kern mnt2 targetroot usr bin etc mnt sbin tmp var # ifconfig epe0 inet 192.168.100.210 netmask 255.255.255.0 # ping 192.168.100.1 PING 192.168.100.1 (192.168.100.1): 56 data bytes 64 bytes from 192.168.100.1: icmp_seq=0 ttl=64 time=1.734 ms 64 bytes from 192.168.100.1: icmp_seq=1 ttl=64 time=1.002 ms ^C ----192.168.100.1 PING Statistics---- 2 packets transmitted, 2 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 1.002/1.368/1.734/0.518 ms # ls /bin /sbin /usr/bin /usr/sbin /bin: cat cp df ln mkdir pax rm sh sync chmod dd ed ls mv pwd rmdir stty /sbin: fsck ifconfig mount newfs restore shutdown fsck_ffs init mount_mfs ping route swapctl halt mknod mount_nfs reboot rrestore umount /usr/bin: chgrp ftp gunzip gzcat gzip less more sed tar tset /usr/sbin: chown # ftp 192.168.100.32 Connected to 192.168.100.32. 220 mini FTP server (NetBSD-ftpd 20051003) ready. Name (192.168.100.32:root): tokuda 331 Password required for tokuda. Password: 230- NetBSD 3.99.11 (GENERIC) #1: Sat Nov 19 22:32:41 UTC 2005 Welcome to NetBSD! 230 User tokuda logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls / 227 Entering Passive Mode (192,168,100,32,232,86) 150 Opening ASCII mode data connection for '/bin/ls'. total 11740 -rw-r--r-- 2 root wheel 940 Nov 19 22:21 .cshrc -rw-r--r-- 2 root wheel 519 Nov 19 22:21 .profile drwxr-xr-x 2 root wheel 512 Nov 18 14:24 altroot drwxr-xr-x 2 root wheel 1024 Nov 19 20:41 bin lrwxr-xr-x 1 root wheel 12 Dec 10 18:31 cvsroot -> /usr/cvsroot drwxr-xr-x 4 root wheel 25088 Nov 28 18:27 dev drwxr-xr-x 23 root wheel 2048 Dec 19 16:56 etc lrwxr-xr-x 1 root wheel 11 Dec 1 17:48 export -> /usr/export drwxr-xr-x 2 root wheel 1024 Nov 19 19:07 lib drwxr-xr-x 2 root wheel 512 Nov 19 20:41 libexec drwxr-xr-x 2 root wheel 512 Nov 18 14:24 mnt -rwxr-xr-x 1 root wheel 5950870 Nov 19 22:32 netbsd drwxr-xr-x 2 root wheel 2560 Nov 19 20:45 rescue drwxr-xr-x 3 root wheel 512 Nov 28 18:36 root drwxr-xr-x 2 root wheel 2048 Nov 19 20:43 sbin drwxr-xr-x 2 root wheel 512 Nov 18 14:24 stand drwxrwxrwt 3 root wheel 512 Jan 19 17:20 tmp drwxr-xr-x 19 root wheel 512 Dec 19 15:39 usr drwxr-xr-x 23 root wheel 512 Dec 1 15:38 var 226 Transfer complete. ftp> quit 221- Data traffic for this session was 0 bytes in 0 files. Total traffic for this session was 1791 bytes in 1 transfer. 221 Thank you for using the FTP service on mini. # halt halted by root syncing disks... done unmounting file systems... done The operating system has halted. Please press any key to reboot.
メールはこちらへ...[BSD小僧 (tokuda @(at) tokuda .(dot) net)]
この日記は、GNSを使用して作成されています。