とりあえずインストール

NetBSD/xenにある Xen 2.0 Howto を見ながらインストールしてみるのだけれども、うまくいかない。
linuxの上でxenを動かした方が楽だったかも、とも思うが、そうすると linuxとNetBSDの両方のOSの面倒を見ないといけないし、linuxの泥沼に 嵌るのはいやなので、なんとかNetBSDだけの範囲で収めたい。

grubの設定をしてブートしてみるのだが、どうも、XEN用のELF形式でない、 といって怒られるので、Googleで検索。
ftp://asim.lip6.fr/outgoing/bouyer/ にある netbsd-XEN0.gz を domain0用に取ってきて とりあえず、起動するようにはなった。
起動した後は、コンソールが無反応になるので、失敗したかと勘違いするが、 外部からは、telnetで入れている。

Last login: Wed Apr 27 22:20:55 2005 from akia on ttyp0
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    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 2.99.15 (XEN0) #223: Fri Feb 18 18:48:59 CET 2005

Welcome to NetBSD!

う〜ん、NetBSD 2.99.15かぁ。限りなく3.0に近くないとまずいのかな。 カレントか、3-BETA以降を使えと書いてあるし、 2.0.2だと、./MAKEDEV xen もうまくいっていないみたいだし。
ちなみに、3.0-BETAのスナップショットを見ると、最初から kernelの バイナリーの中に含まれているのね。

katsura@bsd5[1]_% dmesg
NetBSD 2.99.15 (XEN0) #223: Fri Feb 18 18:48:59 CET 2005
        bouyer@pop.lip6.fr:/local/pop1/bouyer/tmp/i386/obj/local/pop1/bouyer/cur
rent/src/sys/arch/i386/compile/XEN0
total memory = 62104 KB
avail memory = 60600 KB
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Celeron (Mendocino) (686-class), 501.15 MHz, id 0x665
cpu0: features 183fbff
cpu0: features 183fbff
cpu0: features 183fbff
cpu0: I-cache 16 KB 32B/line 4-way, D-cache 16 KB 32B/line 4-way
cpu0: L2 cache 128 KB 32B/line 4-way
cpu0: ITLB 32 4 KB entries 4-way, 2 4 MB entries fully associative
cpu0: DTLB 64 4 KB entries 4-way, 8 4 MB entries 4-way
cpu0: 8 page colors
hypervisor0 at mainbus0
xencons0 at hypervisor0: Xen Virtual Console Driver
xencons0: console major 143, unit 0
npx0 at hypervisor0: using exception 16
PCI_PROBE_ROOT_BUSES: 0x3 0x0 0x0 0x0 0x0 0x0 0x0 0x0
pci0 at hypervisor0 bus 0
pci0: i/o space, memory space enabled
pchb0 at pci0 dev 0 function 0
pchb0: vendor 0x1106 product 0x0691 (rev. 0xc4)
agp0 at pchb0: aperture at 0xd0000000, size 0x10000000
vendor 0x1106 product 0x0686 (ISA bridge, revision 0x40) at pci0 dev 7 function
0 not configured
viaide0 at pci0 dev 7 function 1
viaide0: VIA Technologies VT82C686A (Apollo KX133) ATA100 controller
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at physical irq 14, irq 4
atabus0 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at physical irq 15, irq 5
atabus1 at viaide0 channel 1
pchb1 at pci0 dev 7 function 4
pchb1: vendor 0x1106 product 0x3057 (rev. 0x40)
tlp0 at pci0 dev 15 function 0: ADMtek AN985 Ethernet, pass 1.1
tlp0: interrupting at physical irq 11, irq 6
tlp0: Ethernet address 00:90:cc:37:99:30
acphy0 at tlp0 phy 1: ACXXX 10/100 media interface, rev. 0
acphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
pci1 at hypervisor0 bus 1
pci1: i/o space, memory space enabled
vendor 0x12d2 product 0x0018 (VGA display, revision 0x22) at pci1 dev 0 function
 0 not configured
IPsec: Initialized Security Association Processing.
wd0 at atabus0 drive 0: 
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 4110 MB, 14848 cyl, 9 head, 63 sec, 512 bytes/sect x 8418816 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
wd1 at atabus0 drive 1: 
wd1: drive supports 16-sector PIO transfers, LBA addressing
wd1: 6149 MB, 13328 cyl, 15 head, 63 sec, 512 bytes/sect x 12594960 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
wd1(viaide0:0:1): using PIO mode 4, Ultra-DMA mode 2 (Ultra/33) (using DMA)
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0:  cdrom removable
cd0: 32-bit data port
cd0: drive supports PIO mode 4, DMA mode 2
cd0(viaide0:1:0): using PIO mode 4, DMA mode 2 (using DMA)
boot device: wd0
root on wd0a dumps on wd0b
mountroot: trying nfs...
mountroot: trying ext2fs...
mountroot: trying ffs...
root file system type: ffs
init: copying out path `/sbin/init' 11

MAKEDEVはこの辺が違う

xenevt)
        mkdev xenevt c 141 0
        ;;

xencons)
        mkdev xencons c 143 0
        ;;

xbd*)
        name=xbd; unit=${i#xbd}; blk=142; chr=142
        makedisk_p16high $name $unit $blk $chr
        ;;

psの結果はこちら

katsura@bsd5[2]_% ps -ax
PID TT STAT    TIME COMMAND
  0 ?? DKs  -18576806:-49.96 [swapper]
  1 ?? Is   0:00.02 init
  2 ?? DK   0:00.00 [atabus0]
  3 ?? DK   0:00.00 [atabus1]
  4 ?? DK   0:00.00 [atapibus0]
  5 ?? DK   -18576806:-49.95 [pagedaemon]
  6 ?? DK   -18576806:-48.13 [ioflush]
  7 ?? DK   -18576806:-49.96 [aiodoned]
212 ?? Is   0:00.06 /usr/sbin/syslogd -s
271 ?? I    0:00.04 xfrd
379 ?? Ss   0:00.15 sendmail: accepting connections
396 ?? Is   0:00.01 /usr/sbin/inetd -l
401 ?? S    0:00.09 telnetd
408 ?? I    0:00.03 /usr/libexec/getty Pc ttyE3
409 ?? I    0:00.02 /usr/libexec/getty Pc ttyE1
410 ?? Is   0:00.02 /usr/sbin/cron
426 ?? I    0:00.02 /usr/libexec/getty Pc ttyE2
338 p0 Ss   0:00.09 -csh
479 p0 R+   0:00.00 ps -ax
403 ?? Is+  0:00.02 /usr/libexec/getty Pc console
katsura@bsd5[3]_%