<br><br><div class="gmail_quote">2012/10/29 Mulyadi Santosa <span dir="ltr">&lt;<a href="mailto:mulyadi.santosa@gmail.com" target="_blank">mulyadi.santosa@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Fan...<br>
<div class="im"><br>
On Sun, Oct 28, 2012 at 9:02 PM, Fan Yang &lt;<a href="mailto:lljyangfan@gmail.com">lljyangfan@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; [root@shell--box kernel_mod]# dmesg -c<br>
&gt; **********************************<br>
&gt; cs 60 96<br>
&gt; ds 7b 123<br>
&gt; ss 68 104<br>
&gt; es 7b 123<br>
&gt; fs d8 216<br>
&gt; gs e0 224<br>
&gt; **********************************<br>
&gt;<br>
&gt; The cs and ds in the kernel space is 60 and 7b. But the kernel define the<br>
&gt; KERNEL_CS as 60 and the KERNEL_DS as 7b.  Where am I wrong?<br>
&gt;<br>
<br>
<br>
</div>you print CS and DS twice, once during init and once during exit of<br>
your kernel module. So, which one do you want to confirm?<br>
<br>
All in all, I have a guess that you see such number (DS belongs to<br>
user space in kernel module) because IIRC kernel module loading is<br>
done using syscall and with the help of modprobe helper.<br>
<br>
Thus, it is important to access user space during that stage, hence DS<br>
still using user space data segment.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
regards,<br>
<br>
Mulyadi Santosa<br>
Freelance Linux trainer and consultant<br>
<br>
blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
</div></div></blockquote></div><div><br></div>Hi  Mulyadi Santosa<div>   I get the same result during the kernel module init and exit. Then I try to add a syscall to print these registers, and nothing changed. It is strange.</div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br><div><br></div></div>