From owner-freebsd-emulation@FreeBSD.ORG Thu Apr 29 06:11:11 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4BBE16A4CE for ; Thu, 29 Apr 2004 06:11:11 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69ACE43D49 for ; Thu, 29 Apr 2004 06:11:09 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i3TDB8xZ007505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 29 Apr 2004 09:11:08 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i3TDB3jA088343; Thu, 29 Apr 2004 09:11:03 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16528.65255.326986.106534@grasshopper.cs.duke.edu> Date: Thu, 29 Apr 2004 09:11:03 -0400 (EDT) To: freebsd-emulation@freebsd.org X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Subject: user mode linux? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2004 13:11:11 -0000 Has anybody succeeded in running user mode linux on FreeBSD? Not user-mode bsd, but user-mode linux. I do some linux driver development at work, and it would be very handy to have linux running in a vm on my desktop. [vmware is not an option, as we've already interfaced our hardware simulator to uml, so we can do firmware and driver development under uml] The first problem I have is really stumping me. The linux kernel (http://uml.linode.com/linux-2.4.19-5.bz2) is failing to start very early. Its creating a 1785856 byte sparse file and failing to mmap it: 2974 linux-2.4.19-5 CALL linux_llseek(0x3,0,0x1b4000,0xbfbfe280,0) 2974 linux-2.4.19-5 RET linux_llseek 0 2974 linux-2.4.19-5 CALL write(0x3,0xbfbfe2d7,0x1) 2974 linux-2.4.19-5 GIO fd 3 wrote 1 byte "\0" 2974 linux-2.4.19-5 RET write 1 2974 linux-2.4.19-5 CALL linux_fcntl64(0x3,0x2,0x1) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_mmap(0xbfbfe2d0) 2974 linux-2.4.19-5 RET linux_mmap -1 errno 12 Cannot allocate memory 2974 linux-2.4.19-5 PSIG SIGSEGV SIG_DFL 2974 linux-2.4.19-5 NAMI "linux-2.4.19-5.core" According to a printf from the linux_mmap(), the arguments look reasonable: mmap: 0, 1785856, 3, 0x00000001, 3, 0 I think this works out to: mmap(NULL, 1785856, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) But I just can't see why this should fail. If anybody can point out what I'm missing, I'd appreciate it. I've included the full kdump, just in case.. FWIW, this was done on a ~1 month old -current. -stable gets a bit further, but also dies in a later mmap(). Thanks, Drew 2974 ktrace RET linux_brk 0 2974 ktrace CALL linux_olduname(0xbfbfe667,0xbfbfe524,0xbfbfe52c) 2974 ktrace NAMI "./linux-2.4.19-5" 2974 linux-2.4.19-5 RET linux_olduname 0 2974 linux-2.4.19-5 CALL linux_fcntl64(0,0x1,0) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_fcntl64(0x1,0x1,0) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_fcntl64(0x2,0x1,0) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_newuname(0xbfbfe300) 2974 linux-2.4.19-5 RET linux_newuname 0 2974 linux-2.4.19-5 CALL geteuid 2974 linux-2.4.19-5 RET geteuid 1387/0x56b 2974 linux-2.4.19-5 CALL linux_getuid 2974 linux-2.4.19-5 RET linux_getuid 1387/0x56b 2974 linux-2.4.19-5 CALL getegid 2974 linux-2.4.19-5 RET getegid 0 2974 linux-2.4.19-5 CALL linux_getgid 2974 linux-2.4.19-5 RET linux_getgid 0 2974 linux-2.4.19-5 CALL linux_brk(0) 2974 linux-2.4.19-5 RET linux_brk -1608359936/0xa0226000 2974 linux-2.4.19-5 CALL linux_brk(0xa0226020) 2974 linux-2.4.19-5 RET linux_brk -1608359904/0xa0226020 2974 linux-2.4.19-5 CALL linux_brk(0xa0227000) 2974 linux-2.4.19-5 RET linux_brk -1608355840/0xa0227000 2974 linux-2.4.19-5 CALL linux_getpid 2974 linux-2.4.19-5 RET linux_getpid 2974/0xb9e 2974 linux-2.4.19-5 CALL linux_rt_sigprocmask(0x2,0xbfbfe450,0,0x8) 2974 linux-2.4.19-5 RET linux_rt_sigprocmask 0 2974 linux-2.4.19-5 CALL linux_execve(0xbfbfe690,0xa02262f0,0xbfbfe560) 2974 linux-2.4.19-5 NAMI "./linux-2.4.19-5" 2974 linux-2.4.19-5 RET linux_execve 0 2974 linux-2.4.19-5 CALL linux_fcntl64(0,0x1,0) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_fcntl64(0x1,0x1,0) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_fcntl64(0x2,0x1,0) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_newuname(0xbfbfe200) 2974 linux-2.4.19-5 RET linux_newuname 0 2974 linux-2.4.19-5 CALL geteuid 2974 linux-2.4.19-5 RET geteuid 1387/0x56b 2974 linux-2.4.19-5 CALL linux_getuid 2974 linux-2.4.19-5 RET linux_getuid 1387/0x56b 2974 linux-2.4.19-5 CALL getegid 2974 linux-2.4.19-5 RET getegid 0 2974 linux-2.4.19-5 CALL linux_getgid 2974 linux-2.4.19-5 RET linux_getgid 0 2974 linux-2.4.19-5 CALL linux_brk(0) 2974 linux-2.4.19-5 RET linux_brk -1608359936/0xa0226000 2974 linux-2.4.19-5 CALL linux_brk(0xa0226020) 2974 linux-2.4.19-5 RET linux_brk -1608359904/0xa0226020 2974 linux-2.4.19-5 CALL linux_brk(0xa0227000) 2974 linux-2.4.19-5 RET linux_brk -1608355840/0xa0227000 2974 linux-2.4.19-5 CALL linux_getpid 2974 linux-2.4.19-5 RET linux_getpid 2974/0xb9e 2974 linux-2.4.19-5 CALL linux_rt_sigprocmask(0x2,0xbfbfe350,0,0x8) 2974 linux-2.4.19-5 RET linux_rt_sigprocmask 0 2974 linux-2.4.19-5 CALL linux_getrlimit(0x3,0xbfbfe340) 2974 linux-2.4.19-5 RET linux_getrlimit 0 2974 linux-2.4.19-5 CALL gettimeofday(0xbfbfd1f8,0) 2974 linux-2.4.19-5 RET gettimeofday 0 2974 linux-2.4.19-5 CALL linux_getpid 2974 linux-2.4.19-5 RET linux_getpid 2974/0xb9e 2974 linux-2.4.19-5 CALL linux_open(0xbfbfd2b0,0xc2,0x180) 2974 linux-2.4.19-5 NAMI "/compat/linux/var/tmp" 2974 linux-2.4.19-5 NAMI "/var/tmp/vm_file-iogmcl" 2974 linux-2.4.19-5 RET linux_open 3 2974 linux-2.4.19-5 CALL linux_unlink(0xbfbfd2b0) 2974 linux-2.4.19-5 NAMI "/compat/linux/var/tmp/vm_file-iogmcl" 2974 linux-2.4.19-5 NAMI "/var/tmp/vm_file-iogmcl" 2974 linux-2.4.19-5 RET linux_unlink 0 2974 linux-2.4.19-5 CALL fchmod(0x3,0x1ff) 2974 linux-2.4.19-5 RET fchmod 0 2974 linux-2.4.19-5 CALL linux_llseek(0x3,0,0x1b4000,0xbfbfe280,0) 2974 linux-2.4.19-5 RET linux_llseek 0 2974 linux-2.4.19-5 CALL write(0x3,0xbfbfe2d7,0x1) 2974 linux-2.4.19-5 GIO fd 3 wrote 1 byte "\0" 2974 linux-2.4.19-5 RET write 1 2974 linux-2.4.19-5 CALL linux_fcntl64(0x3,0x2,0x1) 2974 linux-2.4.19-5 RET linux_fcntl64 0 2974 linux-2.4.19-5 CALL linux_mmap(0xbfbfe2d0) 2974 linux-2.4.19-5 RET linux_mmap -1 errno 12 Cannot allocate memory 2974 linux-2.4.19-5 PSIG SIGSEGV SIG_DFL 2974 linux-2.4.19-5 NAMI "linux-2.4.19-5.core"