Return to BSD News archive
Xref: sserve comp.unix.sysv386:24020 comp.os.linux:10691 comp.unix.bsd:5494 comp.os.mach:2194 comp.sys.ibm.pc.misc:21818 comp.sys.ibm.pc.hardware:31796 comp.windows.x:45459 Organization: Carnegie Mellon, Pittsburgh, PA Path: sserve!manuel!munnari.oz.au!spool.mu.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!news.sei.cmu.edu!fs7.ece.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!<UNAUTHENTICATED>+ Newsgroups: comp.unix.sysv386,comp.os.linux,comp.unix.bsd,comp.os.mach,comp.sys.ibm.pc.misc,comp.sys.ibm.pc.hardware,comp.windows.x Message-ID: <YejqQPK00h70AvPkhV@cs.cmu.edu> Date: Tue, 22 Sep 92 14:34:03 -0400 From: Gerald.Malan@cs.cmu.edu Subject: Mach & BIOS access (was Re: Free software and the future of support for Diamond products) In-Reply-To: <1992Sep21.154451.10085@cbnewsj.cb.att.com> References: <1992Sep12.035549.4743@zeos.com> <1992Sep20.000851.2641@cbnewsj.cb.att.com> <1992Sep21.150821.9472@crd.ge.com>, <1992Sep21.154451.10085@cbnewsj.cb.att.com> Lines: 72 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: >> In article <1992Sep20.000851.2641@cbnewsj.cb.att.com>, dwex@cbnewsj.cb.att.com >(david.e.wexelblat) writes: >> >> | Unless I've missed something, a VESA compliant board supports a BIOS >> | standard, not a register-level standard. Unix, like other protected-mode >> | operating systems, does not use the BIOS at all, except during boot. So >> | there's no such thing as a VESA-compliant driver under Unix, unless >> | someone hacks the kernel to allow this to work. >> >> 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. >> -- >> bill davidsen, GE Corp. R&D Center; Box 8; Schenectady NY 12345 >> I admit that when I was in school I wrote COBOL. But I didn't compile. > >Well. Learn something new every day. Does anyone have a code sample that >shows how this may be done? To clarify what happens with Mach (this message seems to be cross posted to just about everywhere...), the kernel supports virtual 8086 (v86) mode for threads. As mentioned, the on-board BIOS ROM you get with your display card doesn't usually support VESA, it just supports the basic VGA modes and Int 0x10 calls. You must load a software driver that intercepts the video BIOS calls (Int 0x10) and provides support for the VESA routines. The Mach kernel doesn't ever let anyone return the machine to Real mode, it just lets you turn on V86 mode for a given thread. You can ask the kernel to allow transparent access to certain I/O ports so that your program (the VESA driver) will be able to access the hardware. The only thing that the Mach kernel will NOT let you do, is disable interrupts. The V86 thread only thinks that interrupts are off, while in fact, only "virtual" interrupts to that thread are disabled. This is how the Mach DOS software lets programs access the VGA device. We map the VGA or SuperVGA video memory into the V86 thread's task's address space, enable the thread to access the SuperVGA's I/O ports, and let 'er rip. The Mach DOS video support doesn't do this though. The Mach DOS software intercepts the Int 0x10 calls, and simulates them by directly writing to the SuperVGA's registers. So the SuperVGA drivers are never used (and only take up space if loaded). The reason for this is consistancy. Who knows what the driver expects in the way of machine control. We didn't want some people's drivers to work, and others to hang, so we just implemented them ourselves (better safe than sorry :-)). Hope this helps. If you want to look at code that would let you run VESA drivers under Mach, you should examine the Mach DOS source code. This is available via sup from CMU. If you have any questions feel free to ask. Take care, Rob Malan Mach Research Programmer