*BSD News Article 5367


Return to BSD News archive

Xref: sserve comp.unix.sysv386:23957 comp.windows.x:45414 comp.os.linux:10528 comp.unix.bsd:5415 comp.os.mach:2183 comp.sys.ibm.pc.misc:21775 comp.sys.ibm.pc.hardware:31633
Path: sserve!manuel!munnari.oz.au!spool.mu.edu!uunet!mcsun!news.funet.fi!hydra!klaava!torvalds
From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
Newsgroups: comp.unix.sysv386,comp.windows.x,comp.os.linux,comp.unix.bsd,comp.os.mach,comp.sys.ibm.pc.misc,comp.sys.ibm.pc.hardware
Subject: Re: Free software and the future of support for Diamond products
Keywords: Diamond, free-software
Message-ID: <1992Sep21.164816.9162@klaava.Helsinki.FI>
Date: 21 Sep 92 16:48:16 GMT
References: <1992Sep20.000851.2641@cbnewsj.cb.att.com> <1992Sep21.150821.9472@crd.ge.com> <1992Sep21.154451.10085@cbnewsj.cb.att.com>
Organization: University of Helsinki
Lines: 33

In article <1992Sep21.154451.10085@cbnewsj.cb.att.com> dwex@cbnewsj.cb.att.com (david.e.wexelblat) writes:
>In article <1992Sep21.150821.9472@crd.ge.com> davidsen@crd.ge.com (bill davidsen) writes:
>> 
>>   Youu've missed something. The kernel supports vm86 operation, and it
>> is possible to drop into real mode, allow access to the i/o ports
>> needed, and run the BIOS in real mode, then exit back to protected mode.
>> I am not suggesting this, I'm just saying it can be done.
>
>Well.  Learn something new every day.  Does anyone have a code sample that
>shows how this may be done?

Hmm.  The linux alpha DOS-emulator might be able to do it with some
minor tweaking: you'd have to get the initial 'int 0x10' address from
somewhere (as it's normally over-written by the kernel), and the process
should do a mmap("/dev/mem") the put the bios/screen memory into the
normal address space.  Additionally, you can use the iopl() system call
to give the process IO priviledges before switching to vm86 mode - that
way you don't even have to emulate any IO instructions.  Some additional
setup to initialize the normal BIOS data areas, and off you go.  The
only thing that doesn't work with the current linux setup is to get the
original offset to the 'int 0x10' call: a minor kernel diff to look it
up at bootup would be possible. 

I don't know how other systems would do it, but it should certainly be
possible - but I do not think it's a good idea.  It's ugly, and it's not
guaranteed to be safe: the BIOS call might do something nasty while it
has IO priviledges if it assumes a normal DOS setup and the vm86 setup
is incomplete.  Besides, that way you can only set modes that the BIOS
knows about - the X386 (XFree86) driver has already proven that
programming the chipset directly can lead to much better results (ie
nonstandard resolutions etc). 

		Linus