I was looking at the SAVE_ALL code for kernel 2.6.
I am confused why SAVE_ALL restores __USER_DS to ds and es ?
#define SAVE_ALL \
cld; \
pushl %fs; \
pushl %es; \
pushl %ds; \
pushl %eax; \
pushl %ebp; \
pushl %edi; \
pushl
Hi Joel,
snip
since Linux doesn't use segmentation , all the segment descriptor values
are the same. So I think it doesn't matter what selector value you load in
DS, ES etc. Though I don't know the real reason for why __USER_DS is used
instead of __KERNEL_DS
Although, linux doesn't
Hi,
These are the definitions of __KERNEL_DS and __USER_DS:
#define __KERNEL_DS (GDT_ENTRY_KERNEL_DS * 8)
#define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS* 8 + 3)
The difference is firstly in the privilege level (+ 3). There also
is a comment in the same file
snip
since Linux doesn't use segmentation , all the segment descriptor values
are the same. So I think it doesn't matter what selector value you load in
DS, ES etc. Though I don't know the real reason for why __USER_DS is used
instead of __KERNEL_DS
Although, linux doesn't use
Guys,
I was looking at the SAVE_ALL code for kernel 2.6.
I am confused why SAVE_ALL restores __USER_DS to ds and es ?
#define SAVE_ALL \
cld; \
pushl %fs; \
pushl %es; \
pushl %ds; \
pushl %eax; \
pushl %ebp; \
pushl %edi; \
pushl