Re: Re: How Kernel module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2005-05-28 at 11:08 +0000, jhoney jhoney wrote:
> Hello All,
> 
> Thanks for your explanations.In addition to previous one,
> When any process is started, ie after executing the a.out at the linux
> shell , It starts executing in the 4GB address space of the process.
> At that time it is unable to access the kernel memory. But the moment
> when it executed system call which issues a trap , enters in to kernel
> mode and could access the kernel memory. Now the module is can access
> the user space(4GB virtual)  and the kernel memory space also. How
> this is achieved.

as mentioned previously, the module (which becomes part of the kernel,
once loaded) runs in the privileged mode of the CPU. This lets it access
user space as well as kernel space memory. The page tables of a process
are setup in such a way that the kernel will generate a page fault if
the process tries to access mem outside it's allocation (be it kernel or
some other process's mem.)

HTH,
-mandeep

> 
> 
> 
> 
> On Wed, 25 May 2005 Gaurav Dhiman wrote :
> >On 24 May 2005 05:16:49 -0000, jhoney jhoney
> ><jhoney_joney@xxxxxxxxxxxxxx> wrote:
> > >
> > >
> > >  Hello All,
> > >
> > >  When application runs ,it can not access the kernel memory but
> when the
> > > module for the corresponding application runs in kernel mode , it
> has access
> > > to kernel memory.
> >
> >kernel module is a part of kernel code itself once its loaded into
> the
> >memory, its linked to the kernel core image in memory by insmod.
> >kernel module can be used by any process running in user space by
> >making a specific system call which might lead the control of
> >execution to module code.
> >
> >-gd
> >
> > >
> > >  My question is what made to access the kernel memory module which
> could not
> > > be done by an application.
> > >
> > >  Regards
> > >
> > >  Jhoney
> > >
> > >
> > >
> > >
> >
> >--
> >Kernelnewbies: Help each other learn about the Linux kernel.
> >Archive:      http://mail.nl.linux.org/kernelnewbies/
> >FAQ:          http://kernelnewbies.org/faq/
> >
> 
> 
> 
> 
> 

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux