virtual 8086 LDT - problem
virtual 8086 LDT - problem
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? ::)
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:virtual 8086 LDT - problem
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 ? ...
Re:virtual 8086 LDT - problem
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.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:virtual 8086 LDT - problem
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 ...
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 ...