Some questions about PM
Re:Some questions about PM
Okay, what's your concept for that mechanism then? Since you generate the segments, how does the code know which segment to far call?
Re:Some questions about PM
AR :
In any case, for code execution, it always uses the cs segment register to far call.
In any case, for code execution, it always uses the cs segment register to far call.
Re:Some questions about PM
And that is a revelation of what exactly? Of course the code segment register can only contain code segments, I was wondering about a mechanism for determining which code segment to use.DruG5t0r3 wrote: AR :
In any case, for code execution, it always uses the cs segment register to far call.
EDIT: After some thought and a random realisation, thunks seem to be the easiest way to implement this, the thunks form nice linkage targets so fullfills that compatiblity requirement but it isn't exactly the most efficient in terms of memory (a thunk "table" is needed as part of every process which would include sets of movs for loading DS/ES/FS/GS before far jumping, however you also benefit in that there will never be a case where you need 2 copies of the same library in memory at once merely because the second copy needed to relocated at a different base address but I doubt this would outweight the overall memory cost...), it is also prohibitive of lazy linking since the code section won't be writable after initalization.