Hi.
I'm trying to perfom a single task-swith to a test prozess which should hang, but it allways says general protection fault.
http://nopaste.php-q.net/71991
mfg, rumpel.
problem with a simple task-switch
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:problem with a simple task-switch
question is, *where* does it GPF ? Got a look to the Guru Meditation in a Nutshell page already?
Re:problem with a simple task-switch
hi
"// the code runs fine till the far-jamp to gdt 0x30"
I wasn't sure about it, but I've expanded my int handler a bit now so that its sure. I've written a function to put out plain memory and it seems as everything (gdt, tss, test) are at the right place. Perhaps I've forgotten to fill out some fields of the tss needed to run ?
Other case: when i load a empty/uninitialised tss and then do a far-jump to that tss, the cpu fills out the tss before the jump and the code after should be executed as before I thought, but this doesn't work too.
Anyone perhaps a idea what could be wrong ?
mfg, rumpel.
"// the code runs fine till the far-jamp to gdt 0x30"
I wasn't sure about it, but I've expanded my int handler a bit now so that its sure. I've written a function to put out plain memory and it seems as everything (gdt, tss, test) are at the right place. Perhaps I've forgotten to fill out some fields of the tss needed to run ?
Other case: when i load a empty/uninitialised tss and then do a far-jump to that tss, the cpu fills out the tss before the jump and the code after should be executed as before I thought, but this doesn't work too.
Anyone perhaps a idea what could be wrong ?
mfg, rumpel.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:problem with a simple task-switch
i think you should use 'jmp far' rather than toying with db, dw etc.db 0xea ; jump to new prozess (tss2, _test)
dw 0
dw 0x30
afaik, in 32 bits mode, the offset should be a dword, not a word.
ps: having the code only out of the forum doesn't really help. If you could at least show here the snippets that you suppose being wrong, it would make things easier to read ...
Re:problem with a simple task-switch
sry. The problem was that I've had absolutly no idea where the error could be. BUT ! you're right ... I've changed the 0xea thing and it works thanks a lot.s: having the code only out of the forum doesn't really help. If you could at least show here the snippets that you suppose being wrong, it would make things easier to read ...
mfg, rumpel.