OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Jun 26, 2019 12:04 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: in-kernel vm86 mode
PostPosted: Sun Aug 30, 2009 11:41 am 
Offline
Member
Member
User avatar

Joined: Thu Jun 04, 2009 5:01 pm
Posts: 168
Vm86 mode is generally used for running tasks separate from the kernel, but what if I want to run some of my kernel's code in vm86 mode? What I need is for my kernel to send the BIOS an interrept (for VESA) then immediately return to protected mode. All the guides I have found for vm86 mode talk about ring 3 and setting up a TSS, I'm wondering if I can accomplish the same thing without this if I plan on doing it all in ring 0 and within my kernel.

The simplest answer is the best one. If you can point me to docs describing how to do what I ask, that works too, though I haven't found any yet :)

Thanks

_________________
Valix is an experiment in an interpreted userspace with object-oriented and functional design patterns. Developers needed! Join #valix on irc.freenode.net


Top
 Profile  
 
 Post subject: Re: in-kernel vm86 mode
PostPosted: Sun Aug 30, 2009 11:52 am 
Offline

Joined: Tue Feb 26, 2008 3:43 am
Posts: 22
Location: The Netherlands
xvedejas wrote:
All the guides I have found for vm86 mode talk about ring 3 and setting up a TSS, I'm wondering if I can accomplish the same thing without this if I plan on doing it all in ring 0 and within my kernel.


How about reading the Intel manuals.

Quote:
Intel 3A: 15.2.1 Enabling Virtual-8086 Mode
...when checking privileged instructions, on page accesses, or when performing other permission checks. (Virtual-8086 mode always executes at CPL 3.)


Top
 Profile  
 
 Post subject: Re: in-kernel vm86 mode
PostPosted: Sun Aug 30, 2009 6:27 pm 
Offline
Member
Member

Joined: Tue Apr 15, 2008 6:37 pm
Posts: 191
Location: Gotham, Batmanistan
It's feasible to preform the task you're talking about in vm86 mode at CPL3, simply create a virtual monitor and set the TSS to operate at the proper address. Article wise it's almost completely covered in the Virtual Monitor page in the wiki here. The links at the bottom should provide you with code for some working examples, other then that the TSS is covered in depth in the Intel SDM.

_________________
Reserved for OEM use.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group