From owner-freebsd-emulation Fri Jun 9 10:14:40 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from cypherpunks.ai (cypherpunks.ai [209.88.68.47]) by hub.freebsd.org (Postfix) with ESMTP id 6509337B60E; Fri, 9 Jun 2000 10:14:36 -0700 (PDT) (envelope-from jeroen@vangelderen.org) Received: from vangelderen.org (grolsch.ai [209.88.68.214]) by cypherpunks.ai (Postfix) with ESMTP id 6CB0451; Fri, 9 Jun 2000 13:14:35 -0400 (AST) Message-ID: <394125FB.964917F7@vangelderen.org> Date: Fri, 09 Jun 2000 13:14:35 -0400 From: "Jeroen C. van Gelderen" X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Luoqi Chen Cc: current@FreeBSD.ORG, emulation@FreeBSD.ORG Subject: Re: VMware detection code in boot loader References: <200006091527.e59FRYb10540@lor.watermarkgroup.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Luoqi Chen wrote: > > Would anyone object if I add a ficl word to detect whether we're booting > from a vmware virtual machine? I find it extremely useful when I'm running > FreeBSD as a guest under NT. Because it is a dual cpu box, I can't use a > single kernel to boot both directly or inside the virtual machine. With this > new word, I can determine which kernel to use in the loader script, saving > me the trouble to unload and reload a new kernel each time I reboot. > > Here's the patch to the boot loader, > > Index: boot/ficl/ficl.h > =================================================================== > RCS file: /home/ncvs/src/sys/boot/ficl/ficl.h,v > retrieving revision 1.14 > diff -u -r1.14 ficl.h > --- boot/ficl/ficl.h 2000/06/01 18:10:43 1.14 > +++ boot/ficl/ficl.h 2000/06/07 18:18:38 > @@ -860,6 +860,7 @@ > #if defined(__i386__) && !defined(TESTMAIN) > extern void ficlOutb(FICL_VM *pVM); > extern void ficlInb(FICL_VM *pVM); > +extern void vmware(FICL_VM *pVM); I'm not sure it is a good idea to name this variable VMWare as that is implementation specific. It may be better to have a var named 'emulation' set to 'none' or 'vmware' or 'bochs' or ... Just my EC 0.02, Jeroen -- Jeroen C. van Gelderen o _ _ _ jeroen@vangelderen.org _o /\_ _ \\o (_)\__/o (_) _< \_ _>(_) (_)/<_ \_| \ _|/' \/ (_)>(_) (_) (_) (_) (_)' _\o_ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message