Virtual Addressing...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

i assumed you were using software task-switching, since most people do (its easier to get it working correctly, and faster... sometimes... maybe...) -- and the code you have posted seems to agree


ya you should, CS is the only segment selector stored on stack without privilege change, and its only CS and SS with a privilege change, so you should be popping 0 into DS, which will GPF...

idk why its working... it shouldnt be

unless the code your iret returns to isnt using DS... that is possible -- actually, that is quite likely, a lot of simple code wont (the kind used to test multi-tasking)
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

...
Last edited by Lprogster on Tue Oct 23, 2007 11:13 am, edited 1 time in total.
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post by JAAman »

almost -- there are exceptions: iirc any address using BP uses SS (which is quite common in compiled code), and there are a few instructions that use alternate segment registers (like the string instructions use ES:DI)

but was the user code compiled or assembled? because for short sections of code, the compiler could easily keep variables in registers instead of memory, or could use special instructions which dont reference DS

im thinking this is the most likely reason, as you should get a GPF if DS is being used

or maybe your GPF handler isnt working correctly, and you just dont realize that your getting one... :lol:
Lprogster
Member
Member
Posts: 174
Joined: Tue Nov 14, 2006 11:59 am

Post by Lprogster »

I'm beginning to get somewhere now - the intel manuals are really very good. I really need a good tutorial, though - if anyone knows one?

Thank you loads jnc, AJ, JAAman and others,
Lster
Post Reply