NetBSD/gigalandisk への道 最終回

昨日から書き始めた「NetBSD/gigalandisk への道」ですが、マルチユーザモードで動作してしまったので本日をもって終了いたします。
昨日コケてた箇所はやっぱり setttb() で evbarm で言うところの KERNEL_BASE_VIRT が想定していた値と食い違っていたのが原因だった。ベースとした IQ80321 と同じ値に修正したら root device のプロンプトまで到達。適当に外部割り込み番号を修正したら、あっさりマルチユーザモードで起動するし。すげーぜ、NetBSD。今回は感動する暇も無かったよ。
あ、カーネルコンフィグに igphy を突っ込むのを忘れてて ukphy が使われてる。ネットワークが何か遅いと思ったのはこれが原因かな。原因だと良いな。igphy にしても変化無し、残念。
自分でソースを修正した文字数よりも s/IQ80321/GIGALANDISK/g と s/iq80321/gigalandisk/g で置換された文字数の方が多いに違いない。
あー、そういや RTC ってどうなってるんだ。

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    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.7 (LANDISK) #74: Wed Jul 20 02:23:16 JST 2005
        nonaka@koharu:/sys/arch/gigalandisk/compile/LANDISK
total memory = 128 MB
avail memory = 119 MB
mainbus0 (root)
cpu0 at mainbus0: i80219 400MHz rev 0 (XScale core)
cpu0: DC enabled IC enabled WB enabled LABT branch prediction enabled
cpu0: 32KB/32B 32-way Instruction cache
cpu0: 32KB/32B 32-way write-back-locking Data cache
iopxs0 at mainbus0: i80321 I/O Processor, acting as PCI host
i80321: SBDR = 0xa0000000 SBR0 = 0x80000014 SBR1 = 0x80000014
i80321: BANK0 = 0x08000000 BANK1 = 0x00000000
iopxs0: configuring PCI bus
iopiic0 at iopxs0: I2C controller
iic0 at iopiic0: I2C bus
iopiic1 at iopxs0: I2C controller
iic1 at iopiic1: I2C bus
iopwdog0 at iopxs0: 7 second period
pci0 at iopxs0 bus 0
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
wm0 at pci0 dev 1 function 0: Intel i82541GI 1000BASE-T Ethernet, rev. 5
wm0: interrupting at irq 27
wm0: Ethernet address XX:XX:XX:XX:XX:XX
ukphy0 at wm0 phy 1: Generic IEEE 802.3u media interface
ukphy0: Intel IGP01E1000 Gigabit PHY (OUI 0x005500, model 0x0038), rev. 0
ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
acardide0 at pci0 dev 2 function 0
acardide0: Acard ATP865-A Ultra133 IDE Controller (rev. 0x07)
acardide0: bus-master DMA support present
acardide0: primary channel wired to native-PCI mode
acardide0: using irq 28 for native-PCI interrupt
atabus0 at acardide0 channel 0
acardide0: secondary channel wired to native-PCI mode
atabus1 at acardide0 channel 1
ohci0 at pci0 dev 3 function 0: NEC USB Host Controller (rev. 0x43)
ohci0: interrupting at irq 29
ohci0: OHCI version 1.0
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uhub0: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 3 ports with 3 removable, self powered
ohci1 at pci0 dev 3 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at irq 29
ohci1: OHCI version 1.0
usb1 at ohci1: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 3 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at irq 29
ehci0: EHCI version 1.0
ehci0: companion controllers, 3 ports each: ohci0 ohci1
usb2 at ehci0: USB revision 2.0
uhub2 at usb2
uhub2: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub2: 5 ports with 5 removable, self powered
obio0 at mainbus0
com0 at obio0 addr 0xfe800000 xint 3: ns16550a, working fifo
com0: console
clock: hz=100 stathz=0 profhz=0
ehci0: handing over full speed device on port 1 to ohci0
uhub2: port 1, device disappeared after reset
ehci0: handing over full speed device on port 2 to ohci0
uhub2: port 2, device disappeared after reset
umass0 at uhub0 port 1 configuration 1 interface 0
umass0: PQI Travel Flash, rev 1.10/2.05, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 3 luns per target
sd0 at scsibus0 target 0 lun 0: <General, Flash Disk Drive, 2.05> disk removable
sd0: fabricating a geometry
sd0: 125 MB, 125 cyl, 64 head, 32 sec, 512 bytes/sect x 256000 sectors
sd1 at scsibus0 target 0 lun 1: <General, Flash Disk Drive, 2.05> disk removable
sd1: drive offline
sd2 at scsibus0 target 0 lun 2: <General, Flash Disk Drive, 2.05> disk removable
sd2: drive offline
umass1 at uhub1 port 1 configuration 1 interface 0
umass1: TEAC TEAC FD-05PUB, rev 1.00/0.00, addr 2
umass1: using UFI over CBI with CCI
atapibus0 at umass1: 2 targets
umass2 at uhub2 port 4 configuration 1 interface 0
umass2: USB2.0 CardReader, rev 2.00/91.44, addr 2
umass2: using SCSI over Bulk-Only
scsibus1 at umass2: 2 targets, 4 luns per target
sd3 at atapibus0 drive 0: <TEAC, FD-05PUB, 1026> disk removable
sd3: drive offline
wd0 at atabus0 drive 0: <TOSHIBA MK4019GAX>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 38154 MB, 77520 cyl, 16 head, 63 sec, 512 bytes/sect x 78140160 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(acardide0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100) (using DMA)
sd4 at scsibus1 target 0 lun 0: <USB2.0, CF  CardReader, 9144> disk removable
sd4: fabricating a geometry
sd4: 244 MB, 244 cyl, 64 head, 32 sec, 512 bytes/sect x 499712 sectors
sd5 at scsibus1 target 0 lun 1: <USB2.0, SM  CardReader, 9144> disk removable
sd5: drive offline
sd6 at scsibus1 target 0 lun 2: <USB2.0, SD  CardReader, 9144> disk removable
sd6: fabricating a geometry
sd6: 244 MB, 244 cyl, 64 head, 32 sec, 512 bytes/sect x 499712 sectors
sd7 at scsibus1 target 0 lun 3: <USB2.0, MS  CardReader, 9144> disk removable
sd7: drive offline
boot device: <unknown>
root device: wd0a
dump device (default wd0b):
file system (default generic):
root on wd0a dumps on wd0b
mountroot: trying ffs...
root file system type: ffs
WARNING: CHECK AND RESET THE DATE!
init path (default /sbin/init):
init: copying out path `/sbin/init' 11
Tue Jul 19 17:26:45 UTC 2005
swapctl: adding /dev/wd0b as swap device at priority 0
Checking for botched superblock upgrades: done.
Starting file system checks:
/dev/rwd0a: file system is clean; not checking
Setting tty flags.
Setting sysctl variables:
Starting network.
Hostname: gigalandisk
Configuring network interfaces: wm0.
add net default: gateway gw
Adding interface aliases:
Building databases...
Starting syslogd.
Checking for core dump...
savecore: no core dump
Starting rpcbind.
Mounting all filesystems...
mount_kernfs: kernfs on /kern: No such file or directory
mount_procfs: procfs on /proc: No such file or directory
Clearing /tmp.
Creating a.out runtime link editor directory cache.
Checking quotas: done.
Setting securelevel: kern.securelevel: 0 -> 1
Starting virecover.
Starting local daemons:.
Updating motd.
Starting inetd.
Starting cron.
Tue Jul 19 17:26:51 UTC 2005

NetBSD/gigalandisk (gigalandisk) (console)

login: root
Jul 19 17:26:55 gigalandisk login: ROOT LOGIN (root) ON console
Last login: Tue Jul 19 16:57:15 2005 on console
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    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.7 (LANDISK) #74: Wed Jul 20 02:23:16 JST 2005

Welcome to NetBSD!

Terminal type is vt100.
We recommend creating a non-root account and using su(1) for root access.
gigalandisk# ping 192.168.0.2
PING koharu (192.168.0.2): 56 data bytes
64 bytes from 192.168.0.2: icmp_seq=0 ttl=255 time=3.266 ms
64 bytes from 192.168.0.2: icmp_seq=1 ttl=255 time=1.269 ms
64 bytes from 192.168.0.2: icmp_seq=2 ttl=255 time=1.593 ms
64 bytes from 192.168.0.2: icmp_seq=3 ttl=255 time=1.197 ms
64 bytes from 192.168.0.2: icmp_seq=4 ttl=255 time=1.361 ms
64 bytes from 192.168.0.2: icmp_seq=5 ttl=255 time=1.260 ms
64 bytes from 192.168.0.2: icmp_seq=6 ttl=255 time=1.463 ms
64 bytes from 192.168.0.2: icmp_seq=7 ttl=255 time=1.166 ms
64 bytes from 192.168.0.2: icmp_seq=8 ttl=255 time=1.190 ms
64 bytes from 192.168.0.2: icmp_seq=9 ttl=255 time=1.234 ms
64 bytes from 192.168.0.2: icmp_seq=10 ttl=255 time=1.119 ms
^C
----koharu PING Statistics----
11 packets transmitted, 11 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 1.119/1.465/3.266/0.613 ms
gigalandisk# /sbin/shutdown -h now
Shutdown NOW!
shutdown: [pid 500]
gigalandisk# wall: You have write permission turned off; no reply possible

*** FINAL System shutdown message from root@gigalandisk ***
System going down IMMEDIATELY


Jul 19 17:27:48 gigalandisk shutdown: halt by root:

System shutdown time has arrived

About to run shutdown hooks...
Stopping cron.
Waiting for PIDS: 464.
Stopping inetd.
Waiting for PIDS: 438.
Removing block-type swap devices
swapctl: removing /dev/wd0b as swap device
Tue Jul 19 17:27:54 UTC 2005

Done running shutdown hooks.
Jul 19 17:27:59 gigalandisk syslogd: Exiting on signal 15
syncing disks... done
unmounting file systems...
unmounting / (/dev/wd0a)... done
The operating system has halted.
Please press any key to reboot.