문제

I have been developing an 32 bit operating system and I want to allow programs to separate segments from the kernel.

To do that I need to make SS, and DS registers actually point to the programs stack and .data section.

From my research I believe this is done through setting up a local descriptor table.

I am assuming this is very similar to the GDT and the LDT is loaded through lldt.

However I do not get how I use this once my segments are set up. Could anyone explain?

도움이 되었습니까?

해결책

No, there's no need to set up a separate LDT just to set up userspace SS/CS/DS segment descriptors.

It's possible to do that just saving registers state in interrupt handlers and using an entry for task selector in GDT (it is required by CPU to loookup a kernel-space SS of the process to go into an interrupt from userspace).

다른 팁

Well, you can't find better tutorial than Intel manual. Really, find Intel 80386 programming manual (386 manual is shorter and imho better written than newer ones; it has main spots you need). Or IA32 programming manual from Intel website. It has all information you are searching for.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top