[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Mismatch of GDT ( Global descriptor table) Entries.



Hi

I don't know how well this question suites to this group.But a small
light towards this will help me to proceed futher.
Here are the entries I foung in the setup.s which are mismatching  with
the  segment.h..


setup.s.
After comming into the protected mode this is the initialized GDT.
gdt:
 .word 0,0,0,0  !  1st entry

 .word 0,0,0,0  !   2nd entry

 .word 0x07FF  ! 3rd entry
 .word 0x0000  !
 .word 0x9A00  !
 .word 0x00C0  !


 .word 0x07FF  !4rth entry
 .word 0x0000  !
 .word 0x9200  !
 .word 0x00C0  !

As each entry takes 8 bytes.Thus filled entries will be at the following
locations.
1st entry will be at offset 0x0h
2nd entry will be at offset 0x08h
3rd entry will be at offset 0X10h
4rth entry will be at offset 0x18h




#ifndef _LINUX_SEGMENT_H
#define _LINUX_SEGMENT_H

#define KERNEL_CS 0x10
#define KERNEL_DS 0x18

#define USER_CS  0x23
#define USER_DS  0x2B

#endif

I did not understand how  and where USER_CS and  USER_DS segments are
getting created in GDT.
More over these two values are not falling on the border of multiples of
8, like our KERNEL_CS and
KERNEL_DS.


please if this group is not the right place to post this query, point me
the right group.

if my question is not clear please let me know . I will try my level
best to put this in more clear way.

---
GL.