From owner-freebsd-current@FreeBSD.ORG Mon Sep 15 22:59:23 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEDEF1065670 for ; Mon, 15 Sep 2008 22:59:23 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-gx0-f17.google.com (mail-gx0-f17.google.com [209.85.217.17]) by mx1.freebsd.org (Postfix) with ESMTP id 940FC8FC12 for ; Mon, 15 Sep 2008 22:59:23 +0000 (UTC) (envelope-from peter@wemm.org) Received: by gxk10 with SMTP id 10so24457315gxk.19 for ; Mon, 15 Sep 2008 15:59:22 -0700 (PDT) Received: by 10.142.194.4 with SMTP id r4mr67673wff.292.1221519562084; Mon, 15 Sep 2008 15:59:22 -0700 (PDT) Received: by 10.142.255.21 with HTTP; Mon, 15 Sep 2008 15:59:22 -0700 (PDT) Message-ID: Date: Mon, 15 Sep 2008 15:59:22 -0700 From: "Peter Wemm" To: pfgshield-freebsd@yahoo.com In-Reply-To: <179579.54770.qm@web32701.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <179579.54770.qm@web32701.mail.mud.yahoo.com> Cc: Xin LI , freebsd-current@freebsd.org, Oliver Fromme , Jung-uk Kim Subject: Re: Why VESA and DPMS are available only for i386? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2008 22:59:23 -0000 On Mon, Sep 15, 2008 at 1:43 PM, Pedro Giffuni wrote: > On Mon, Sep 15, 2008 at 1:32 PM, Jung-uk Kim wrote: > ... >>> Another way would be to write a 32bit x86 instruction >>> emulator (similar to what programs like qemu or bochs do), >>> so you can execute the VESA functions within an emulated >>> virtual machine that programs the VGA hardware registers. >>> This isn't exactly trivial either. Note that there are >>> already such emulators, but I'm not aware of a BSD-licensed >>> one that could be included in the FreeBSD kernel without >>> problems. >> >> doscmd(1) had a rudimentary 16-bit CPU emulation: >> > > FWIW, > > I can't find any reference, but according to the Wikipedia, even in long mode AMD64 is able to run 16-bit (or 80286) protected mode applications: > > http://en.wikipedia.org/wiki/AMD64#Operating_modes > > Pedro. I think you're right. We probably could implement bios32() and bios16() calls without too much trouble. It is vm86() real-mode calls that we can't do without switching out of long mode. For that we could theoretically use libint10 from Xfree86/Xorg. Our VESA code in i386 is vm86() based. We use bios16 in APM on i386. We use bios32 in APM and PCI on i386. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell