Re: Why SAVE_ALL (for x86) macro in 2.6 loads __USER_DS to %ds

2010-06-08 Thread Joel Fernandes
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

Re: Why SAVE_ALL (for x86) macro in 2.6 loads __USER_DS to %ds

2010-06-08 Thread rahul dev
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

Re: Why SAVE_ALL (for x86) macro in 2.6 loads __USER_DS to %ds

2010-06-08 Thread Alexander Potashev
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

Re: Why SAVE_ALL (for x86) macro in 2.6 loads __USER_DS to %ds

2010-06-08 Thread Joel Fernandes
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

Why SAVE_ALL (for x86) macro in 2.6 loads __USER_DS to %ds

2010-06-07 Thread rahul dev
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