I implemented the multitasking in my os. Now I want to implement the protection. Must I implement the GDT if I want protection?
Have you any tutorial or guide?
Multitasking with protection
No you always need to have minimum 3 gdt entrys:
-null entry
-data entry all 4gb of space
-code entry all 4gb of space
And in most OSes you will use 6/7:
-null entry
-data entry all 4gb of space in dpl0 (kernel)
-code entry all 4gb of space in dpl0
-stack entry in dpl0
(OPTIONAL - if you want to have physical maped kernel stack)
-data entry all 4gb of space in dpl3 (apps)
-code entry all 4gb of space in dpl3
(app stack is maped on end of ram normally)
-tss segment
(needed minimum one, even if you use software task-switch)
-null entry
-data entry all 4gb of space
-code entry all 4gb of space
And in most OSes you will use 6/7:
-null entry
-data entry all 4gb of space in dpl0 (kernel)
-code entry all 4gb of space in dpl0
-stack entry in dpl0
(OPTIONAL - if you want to have physical maped kernel stack)
-data entry all 4gb of space in dpl3 (apps)
-code entry all 4gb of space in dpl3
(app stack is maped on end of ram normally)
-tss segment
(needed minimum one, even if you use software task-switch)