December 23, 2007

在 Debian Sarge 上運作 NetBSD

在 2003 年的 BSDcon 上,筑波大學的 Hideki Eiraku 發表論文 [Running BSD Kernels as User Processes by Partial Emulation and Rewriting of Machine Instructions],以相當巧妙的方式實做了 x86 上精簡的虛擬機器,手法除了仿效 UML (User-Mode Linux) 的 syscall redirection 外,還以編譯時期的 machine instruction rewriting 途徑達到此系統模擬的效果,隨後此成果以 GNU GPLv2 發表,即 [LilyVM],支援 Linux 與 NetBSD 作為 host,以及 Linux / FreeBSD / NetBSD 作為 guest OS。

在 Debian GNU/Linux 3.1 (Sarge) / IA32 的測試,大部分功能可運作,測試環境:
$ uname -a
Linux people 2.6.12-vs2.0 #1 SMP Tue Aug 30 10:44:14 CST 2005 i686 GNU/Linux
啟動 NetBSD 1.6.1:
$ ./start-netbsd
startkernel
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
    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 1.6.1 (a.PROF) #38: Wed Dec  8 14:04:39 JST 2004

cpu0: Intel Pentium 4 (686-class), 2793.37 MHz
cpu0: L2 cache 1 MB 64b/line 8-way
cpu0: features 201d
cpu0: features 201d
total memory = 65148 KB
avail memory = 58628 KB
using 839 buffers containing 3356 KB of memory
mainbus0 (root)
isa0 at mainbus0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns8250 or ns16450, no fifo
com0: console
#00000010##A021E337##A040CFE0##00000000#FPE
npx0 at isa0 port 0xf0-0xff: using exception 16
biomask ffef netmask ffef ttymask ffef
md0: using 192 MB image file
Profiling kernel, textsize=1323040 [a0100000..a0243020]
boot device: 
root on md0a dumps on md0b
root file system type: ffs
No SYSEMU patch.
Sun Dec 23 11:42:55 UTC 2007
Starting file system checks:
/dev/rmd0a: file system is clean; not checking
Setting tty flags.
Setting sysctl variables:
Starting network.
Hostname: user-level-netbsd
NIS domainname: localdomain
IPv6 mode: host
Configuring network interfaces: vmn0.
add net default: gateway 10.255.255.255
Adding interface aliases:
Building databases...
kvm_mkdb: machdep.booted_kernel: sysctl() failed with No such file or directory:
 No such file or directory
Starting syslogd.
Checking for core dump...
savecore: /dev/wd0a: Device not configured
Dec 23 11:42:58 user-level-netbsd savecore: /dev/wd0a: Device not configured
Mounting all filesystems...
Clearing /tmp.
Creating a.out runtime link editor directory cache.
Checking quotas: done.
/etc/rc: WARNING: No swap space configured!
Starting virecover.
starting local daemons:.
Updating motd.
Starting inetd.
Starting cron.
Sun Dec 23 11:43:00 UTC 2007

NetBSD/i386 (user-level-netbsd) (console)

login:
登入後關閉系統:
login: root
Last login: Sun Dec 23 11:40:39 2007 on console
Dec 23 11:43:07 user-level-netbsd login: ROOT LOGIN (root) ON console
Dec 23 11:43:07 user-level-netbsd login: ROOT LOGIN (root) ON console
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
        The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
        The Regents of the University of California.  All rights reserved.

NetBSD 1.6.1 (a.PROF) #38: Wed Dec 8 14:04:39 JST 2004

Welcome to NetBSD!

You have new mail.
Terminal type is vt100.
We recommend creating a non-root account and using su(1) for root access.
user-level-netbsd# poweroff
Dec 23 11:43:15 user-level-netbsd poweroff: powered off by root
Dec 23 11:43:15 user-level-netbsd syslogd: Exiting on signal 15
Dec 23 11:43:15 user-level-netbsd syslogd: Exiting on signal 15
syncing disks... done

The operating system has halted.
Please press any key to reboot.

rebooting...
注意:[LilyVM] 的 wiki [Bugs] 記載了現有實做上的限制。
由 jserv 發表於 December 23, 2007 08:03 PM
迴響
發表迴響









記住我的資訊?