RE: Invoking int 0x10 from a service

"Jan Stoess" <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
Hello Alex,

> I'm currently planning to write a VESA driver for our Pistachio-based
> OS. Video mode setting is done by calling the BIOS interrupt 0x10,
> which uses real-mode addressing, and therefore cannot be run from
> protected mode. What I thought about was to use VM86 mode for that
> call, but it looks like there is no way to do that with Pistachio.

You're right, Pistachio doesn't offer support for vm86 mode. I don't know
too much about VESA drivers, but I am not sure if vm86 would solve your
problem actually. vm86 mode only allows you to run 16-bit user-mode code; on
interrupts or exceptions, the processor automatically enters the kernel and
switches back to protected mode again. Thus, executing int $0x10 in a vm86
compartment should bring you back into the kernel rather than to the
corresponding BIOS function. I guess what you really need is to switch to
real mode and then call int $0x10??? 

> Have I missed something? Do you know a way to workaround this without
> modifying Pistachio?

I can't imagine a solution that doesn't involve modifying the kernel. We do
have support for compatibility 32-bit mode on x64 processors, though, and it
is pretty similar to vm86 on x32 in that it also uses different segment
descriptors. For x64 we used a bit in space_control to denote that this
space should be running in compatibility 32-bit mode. We then changed the
segments for threads within that particular address space, and offer a
32-bit KIP and code to translate system calls (e.g., IPC) into their 64-bit
counterparts. For vm86 support you could start from there. For real-mode
support, the first hack that comes into my mind is to allow privileged tasks
to somehow switch to real mode (e.g, via processor_control) and provide an
entry point to switch back to protected mode. 

-Jan


--
Jan Stoess
System Architecture Group
University of Karlsruhe
smime.p7s (application/x-pkcs7-signature, 3.1 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.