Re: runtimeimage of kernel module

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

 



Anumula Venkat wrote:
> 
> U are talking about stack used by kernel when a
> context switch takes place in a process. I am talking
> about Kernel Modules which completely runs in
> KERNEL MODE. If u have answer to this question please
> write to me.

I answered it. Every time code in your kernel module
executes, it is doing so on behalf of some process.
Whether that process is a user-mode process that
has entered kernel mode for some reason, or is a
kernel thread, it is still a process in kernel mode
that executes on the current kernel stack. ALL CODE
in the Linux kernel, other than the boot code that
runs before init starts, is running in the context
of some process. The only difference between kernel
threads and user processes is that a kernel thread
-always- executes in kernel mode, using its kernel
stack and the kernel's pagetables.

Cheers,

-- Joe

> Regards
> Venkat
> 
> --- Joseph A Knapka <jknapka@earthlink.net> wrote:
> > Anumula Venkat wrote:
> > >
> > > Hello Friends,
> > >
> > >     Can anybody tell me how runtime image of
> > kernel
> > > module will be formed ?
> > >      I know that all kernel modules will run in
> > one
> > > address space. And for user level applications
> > stack
> > > will be formed at 0xbfff.. ( something of this
> > kind ).
> > >
> > > My doubt is where does the stack will be formed
> > for
> > > kernel modules ?
> >
> > All kernel code runs in the context of the process
> > that's running when kernel mode is entered. That
> > means module code will execute using the kernel
> > stack
> > of the current process.
> >
> > Cheers,
> >
> > -- Joe
> > --
> > To unsubscribe, send a message with 'unsubscribe
> > linux-mm' in
> > the body to majordomo@kvack.org.  For more info on
> > Linux MM,
> > see: http://www.linux-mm.org/
> 
> =====
> 'Arise, awake and stop not till the GOAL is reached' -- Swami Vivekananda
> 
> __________________________________________________
> Do You Yahoo!?
> Buy the perfect holiday gifts at Yahoo! Shopping.
> http://shopping.yahoo.com

-- 
# "This torch I bear is scorching me; Buffy's
   laughing, I've no doubt! I hope she fries,
   I'm free if that bitch dies... I'd better
   help her out." -- Spike, OMWF, BtVS
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/



[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