virtual 8086 LDT - problem

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.
Post Reply
crackers

virtual 8086 LDT - problem

Post by crackers »

Is there any difference between virtual 8086 task LDT and protected mode task LDT? I'm getting "task_switch: bad LDT segment" in Bochs. I've tried putting the same LDT selector in protected mode task and virtual 8086 task tss structure. In PM task it's working and in V86 I'm getting error (during task switching). Any help? ::)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:virtual 8086 LDT - problem

Post by Pype.Clicker »

any chance the selector in your V86 TSS might not be the one you expect ? what about asking BOCHS a register dump and check your assumptions on that ? ...
crackers

Re:virtual 8086 LDT - problem

Post by crackers »

I've found error. It was paging. It looks like during task switching procesor loads CR3 and after that LDT and since LDT wasn't mappend corectly in new task I was getting error.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:virtual 8086 LDT - problem

Post by Pype.Clicker »

i suppose you mean "segments registers are loaded after CR3". Whether LDT is mapped or not is pointless when you load LDTR (yet it might need the GDT to be mapped).

And yes, loading the address space with the new value is likely to be one of the first operations handled... that sounds pretty much obvious since the LDT is allowed to be _local_ to the current process, if you weren't loading the address space first, you might be accessing the LDT of the previous process ... not so good ...
Post Reply