Page Fault in Task Switch 
Author Message
 Page Fault in Task Switch

I have been playing around with some protected mode code, and have come up
against a problem. I am trying to switch from ring 0 to ring 3, and every
time I do so my program reports a page fault(Int 0xE occurs) and so the
program crashes. The docs that I have(386intel.txt, the Intel 80386
Programmers reference manual 1986) says that a page fault can only occur if
you have paging enable, which I don't. The code that causes the problem is
taken from the system.h file from Linux 0.0.1, and is used in at least one
demonstration file and so should work. It goes as follows:

        mov eax,esp
        push dword DATA32_SEG
        push eax
        pushfd
        push dword CODEUS_SEG
        lea eax,[ring3]
        push eax
        iret

where ring3 is the ring3 code, DATA32_SEG is the selector for my ring 0
data segment and CODEUS_SEG is the selector for my ring 3 code segment. The
code immediatly after the ring3 label is simply jmp $, which should freeze
the program. What happens is an int 0xE occurs, which shouldn't. Any ideas?

--
Graham Cox

Remove antispam, you get the idea
ICQ# 24532124
PGP Public Thingy available upon request, or from keyserver.

If this e-mail address is used in any manner that does not have
my personal authorization then I will be writing to the relavent
authorities with enough complaints to get you in serious trouble.



Sat, 31 Aug 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Fossil Q./task switching

2. CW 2003: Task Switching?

3. Clipper, Win95, Novell network and task switching

4. Analog output stops on task switch (bug?)

5. task-switching

6. Task switching problems!...

7. Task switching...

8. Annoyances in Task Switching

9. Task Switch: code examples needed...

10. Task vs. Mode Switching

11. Timer-triggered task switching

12. task switching examples

 

 
Powered by phpBB® Forum Software