David Laight | 8 May 2012 11:36
Picon

kvm86 kernel option

Does anyone use (or have used in the last n years) the i386
kernel VM86, KVM86 or KVM86DEBUG options that (I think) allows
16bit user programs to run within a 32bit kernel?

My suspicions are that, if it ever worked, it will have bitrotted
out of existance!

Deleting it seems to be a good idea.

Possibly wine uses it for 16bit windows code?
In any case anything written in 16bit code can probably be emulated
fast enough to be useful.

	David

--

-- 
David Laight: david <at> l8s.co.uk

Jean-Yves Migeon | 8 May 2012 17:22
Picon
Favicon

Re: kvm86 kernel option

Le 08/05/12 11:36, David Laight a écrit :
> Does anyone use (or have used in the last n years) the i386
> kernel VM86, KVM86 or KVM86DEBUG options that (I think) allows
> 16bit user programs to run within a 32bit kernel?

Yes. It allows a program to make 16 bits calls, for example to BIOS.

> My suspicions are that, if it ever worked, it will have bitrotted
> out of existance!

What makes you think that?

> Deleting it seems to be a good idea.

I am all for dumping 16 bits compat code, but please remember that 
bioscalls may be needed by programs like X (setting video mode comes to 
mind).

It injects also a few problematic features, like allowing code to be 
mapped at NULL (0x0) (required for v8086 to work properly).

I would suggest commenting out the option from GENERIC, and see if X 
still works ok with different cards, or old drivers (vesa(4)).
NetBSD does not implement all the latest and greatest DRI2/GEM/KMS, so 
better keep code that can still be used by old systems like VESA.

> Possibly wine uses it for 16bit windows code?

Dunno if wine uses it. For DOS and 16 bits mode, dosbox emulates it just 
fine.
(Continue reading)

David Laight | 8 May 2012 19:24
Picon

Re: kvm86 kernel option

On Tue, May 08, 2012 at 05:22:58PM +0200, Jean-Yves Migeon wrote:
> Le 08/05/12 11:36, David Laight a ?crit :
> >Does anyone use (or have used in the last n years) the i386
> >kernel VM86, KVM86 or KVM86DEBUG options that (I think) allows
> >16bit user programs to run within a 32bit kernel?
> 
> Yes. It allows a program to make 16 bits calls, for example to BIOS.
> 
> >My suspicions are that, if it ever worked, it will have bitrotted
> >out of existance!
> 
> What makes you think that?
> 
> >Deleting it seems to be a good idea.
> 
> I am all for dumping 16 bits compat code, but please remember that 
> bioscalls may be needed by programs like X (setting video mode comes to 
> mind).

I was looking at the code that allows an application to run in
'viritual 8086 mode', not anything that might allow a 'normal'
application to make bios calls - although that couls have it's
own security risks.

I'm not even sure it isn't best to emulate the bios code!
(not really thought through that one).

	David

--

-- 
(Continue reading)

Jean-Yves Migeon | 8 May 2012 23:20
Picon
Favicon

Re: kvm86 kernel option

Le 08/05/12 19:24, David Laight a écrit :
> I was looking at the code that allows an application to run in
> 'viritual 8086 mode', not anything that might allow a 'normal'
> application to make bios calls - although that couls have it's
> own security risks.

Okay, misunderstood your suggestion :)

I can only think of one obstacle before doing that then: real mode 
support under VMs.

I do not know how much support is required from dom0 nowadays, 
especially with Intel's hardware virtualization (which does not support 
running VMs in real mode "easily").

IIRC, Xen introduced a real mode emulator around Xen 3.2 so they can 
support a wider range of guest HVMs. I doubt that it has to rely on 
v8086 mode from dom0, but this should be checked anyway.

--

-- 
Jean-Yves Migeon
jeanyves.migeon <at> free.fr

David Laight | 9 May 2012 09:34
Picon

Re: kvm86 kernel option

On Tue, May 08, 2012 at 11:20:31PM +0200, Jean-Yves Migeon wrote:
> Le 08/05/12 19:24, David Laight a ?crit :
> >I was looking at the code that allows an application to run in
> >'viritual 8086 mode', not anything that might allow a 'normal'
> >application to make bios calls - although that couls have it's
> >own security risks.
> 
> Okay, misunderstood your suggestion :)
> 
> I can only think of one obstacle before doing that then: real mode 
> support under VMs.
> 
> I do not know how much support is required from dom0 nowadays, 
> especially with Intel's hardware virtualization (which does not support 
> running VMs in real mode "easily").
> 
> IIRC, Xen introduced a real mode emulator around Xen 3.2 so they can 
> support a wider range of guest HVMs. I doubt that it has to rely on 
> v8086 mode from dom0, but this should be checked anyway.

The xorg code also uses an emulator to execute video bios calls.
wine doesn't use it.
dosbox & dosemu comtain emulators, apparantly DOSBOX is too slow to run
Settlers 2 and Screamer 2! dosemu being 20 times faster.

	David

--

-- 
David Laight: david <at> l8s.co.uk

(Continue reading)


Gmane