flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Exit from Virtual 8086 Mode in Protected Mode

Author
Thread Post new topic Reply to topic
neo-92



Joined: 26 Feb 2014
Posts: 25
neo-92
Hi, i post a simple code in protected mode that goes in virtual 8086 mode:
Code:
use16

vm86:
mov ax,0e41h
mov bx,7
int 10h             ;this here we go. Print a character 'A' as in real mode.

;here i problems to use a task switch return in protected mode.

use32

pmode:
push 0
push 0
push 0
push 0
push 0
push 0fffeh
push 20000h
push 0
push vm86
iret
    

How can i return in protected mode from a task virtual 8086 mode? Thanks all.
Post 12 Aug 2014, 09:39
View user's profile Send private message Reply with quote
neo-92



Joined: 26 Feb 2014
Posts: 25
neo-92
Please, can someone help me?
Post 13 Aug 2014, 16:23
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
FYI: the USE32 is in the wrong place. when you return from "int 10h" your still in 16bit mode.
Post 14 Aug 2014, 00:45
View user's profile Send private message Visit poster's website Reply with quote
neo-92



Joined: 26 Feb 2014
Posts: 25
neo-92
BAiC wrote:
FYI: the USE32 is in the wrong place. when you return from "int 10h" your still in 16bit mode.

Ok Stefan. But, how do i get out of a v86 task and return in pmode?
The code
Post 14 Aug 2014, 08:39
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
what is the perspective of the code your dealing with? I mean; are you trying to jack the CPU from within a v86 task? Virtual-86 mode is a protected mode; your not supposed to "get out" of it. your supposed to finish your work then signal the OS/Hypervisor to terminate your task for you (an 'int' tied to a task gate would be the most ideal IMO).

- Stefan

_________________
byte me.
Post 14 Aug 2014, 11:35
View user's profile Send private message Visit poster's website Reply with quote
neo-92



Joined: 26 Feb 2014
Posts: 25
neo-92
How do i to return from a v86 task 'iret' in pmode?
Post 14 Aug 2014, 13:18
View user's profile Send private message Reply with quote
neo-92



Joined: 26 Feb 2014
Posts: 25
neo-92
I want kill the v86 task, is there a solution?
Post 14 Aug 2014, 13:45
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
from what I understand you don't 'return' from a v86 task. you invoke an OS service to end the task for you. this shit is complicated. why are you determined to do such work when you don't even know the simpler stuff?
Post 14 Aug 2014, 14:00
View user's profile Send private message Visit poster's website Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
Post 14 Aug 2014, 14:19
View user's profile Send private message Visit poster's website Reply with quote
neo-92



Joined: 26 Feb 2014
Posts: 25
neo-92
I looked the site, but using 'iret' in v86 through another task i get a triple fault. Why? Is right the task switch or wrong?
Post 14 Aug 2014, 16:04
View user's profile Send private message Reply with quote
BAiC



Joined: 22 Mar 2011
Posts: 272
Location: California
BAiC
I gave you that link to help you learn. the patchwork methods you are using don't fucking work for anything as complex as a Hypervisor ("Monitor"). stop skipping the meat of the OS. your not helping yourself at all.

BTW: I'm not helping you patch together a petty v86 hypervisor. you need to build a system. a fucking function will not cut it.

- Stefan
Post 14 Aug 2014, 16:11
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.