Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Jul 2006 14:55:20 +1000
From:      Andrew Reilly <andrew-freebsd@areilly.bpc-users.org>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        freebsd-amd64@freebsd.org
Subject:   Re: console in 1024x768 mode?
Message-ID:  <20060701045520.GA8222@duncan.reilly.home>
In-Reply-To: <20060630090210.GD734@turion.vk2pj.dyndns.org>
References:  <463aea570606240729u6b696c05vc1de0b1e03afae0f@mail.gmail.com> <20060624222706.GE747@turion.vk2pj.dyndns.org> <200606271242.50222.peter@wemm.org> <20060630032951.GR74776@tarc.po.cs.msu.su> <20060630033351.GA2475@tarc.po.cs.msu.su> <20060630090210.GD734@turion.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 30, 2006 at 07:02:10PM +1000, Peter Jeremy wrote:
> On Fri, 2006-Jun-30 07:33:51 +0400, Arseny Nasokin wrote:
> >On Fri, Jun 30, 2006 at 07:29:52AM +0400, Arseny Nasokin wrote:
> >> Can it be needed for something else, not only for VESA videomode emulating?
> >
> >yes, it can: binary drivers, such N-Vidia =)
> 
> Building a vm86 emulator that can handle occasional calls to VESA BIOS
> to change screen configuration is relatively easy - efficiency is
> irrelevant and you could adapt a x86 disassembler with minimal effort.
> 
> Building a VM86 emulator that can usefully execute a binary driver -
> especially a performance-critical one like a video driver - is a
> totally different undertaking.

A static trans-code would probably work though.  Since the
operating system functionality and APIs are nominally the same,
you might be able to get some way with an ia32->c, c->amd64 (or
other) translation.  Actually, given the similarity, it would be
even more straightforward to do an ia32->asm->munge->asm->amd64
recompilation.  Only computed branches, if any, would cause a
problem, but that can be cadged with a hash table of valid entry
points...  It would be an interesting project, IMO.

On the other hand, something like the freebsd-ia32-6.0 nvidia
drivers are ia32, not 8086, so it *ought* to be possible to
convince the kernel to run them natively, just the way ia32
binaries can be run now.  Sure, there'd be shims and call gates,
and that'd slow it down a bit, but it *might* work...

I've often thought that it'd be neat to have qemu in the
kernel, (or at least have the kernel know how to run it as an
interpreter in user-land for the appropriately typed binaries)
and be able to just run binaries from all sorts of processor
architectures.  Not terribly useful, but neat :-) I believe
there's a qemu mode that lets individual linux executables (as
opposed to whole operating systems) run that way, but don't know
if that extends to FreeBSD executables, or if Linux has the
necessary exec magic to just run them.

Cheers,

-- 
Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060701045520.GA8222>