linux segment

Fan Yang lljyangfan at gmail.com
Mon Oct 29 20:44:57 EDT 2012


2012/10/29 Mulyadi Santosa <mulyadi.santosa at gmail.com>

> Hi Fan...
>
> On Sun, Oct 28, 2012 at 9:02 PM, Fan Yang <lljyangfan at gmail.com> wrote:
> >
> > [root at shell--box kernel_mod]# dmesg -c
> > **********************************
> > cs 60 96
> > ds 7b 123
> > ss 68 104
> > es 7b 123
> > fs d8 216
> > gs e0 224
> > **********************************
> >
> > The cs and ds in the kernel space is 60 and 7b. But the kernel define the
> > KERNEL_CS as 60 and the KERNEL_DS as 7b.  Where am I wrong?
> >
>
>
> you print CS and DS twice, once during init and once during exit of
> your kernel module. So, which one do you want to confirm?
>
> All in all, I have a guess that you see such number (DS belongs to
> user space in kernel module) because IIRC kernel module loading is
> done using syscall and with the help of modprobe helper.
>
> Thus, it is important to access user space during that stage, hence DS
> still using user space data segment.
>
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>

Hi  Mulyadi Santosa
   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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20121030/b35509b3/attachment.html 


More information about the Kernelnewbies mailing list