Re: Understanding code flow in kernel from kernel module

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

 



Thanks for your reply.

Could please tell or send me a link which can help me
to build & install user mode linux. I have never
worked with user mode linux, so I request to please
guide me over this. This will a great help to
understand the code flow in kernel. 

>I am quite sure you neither need nor want to access
> the runqueue.
I am novice in kernel programming and trying to learn
by implementing practically. I was thinking of a case
where someone needs to have a kernel modules and that
module will keep of a zombie objects created per user
and this information can be retrieved by /proc
filesystem. That's why I was trying to get the hold of
runqueue and traverse it for zombie process.

User mode linux sounds to be nice technique. Please
give more inputs as being novice i will be requiring
your initial guidance.

Regards
Dinesh
--- Jan Hudec <bulb@xxxxxx> wrote:

> On Thu, May 19, 2005 at 04:15:41 +0100, Dinesh Ahuja
> wrote:
> > Hi All,
> > 
> > I am implementing Blocking I/O techniques in
> device
> > driver and want to understand the fu nctionality
> of
> > schedule() function i.e  how the process [
> represented
> > by task_struct ] switch from wait_queue to
> run_queue.
> > 
> > To understand the code flow, i want to adopt the
> > simplest technique which is quick and effective.
> If I
> > put printk() in schedule() function, i need to
> compile
> > the kernel which i somewhat time consuming. Is
> there
> > any easier way so that I can understand the flow
> from
> > the module to kernel code and could see what is
> code
> > flow in kernel.
> 
> You can build user-mode-linux, to which you can
> attach debugger. It's
> a hell lot safer than playing with live kernel and
> you don't need to
> work as root.
> 
> On the other hand, I don't see what's the problem.
> From module's point
> of view, schedule() is a thing, that sleeps for some
> time (and the CPU
> is doing other work meanwhile). You just have to
> note, that the other
> thing can be your module called on behalf of other
> process.
> 
> When schedule() returns is controlled by the task
> state.
> IIRC set_current_state() is the appropriate macro to
> set that.
> 
> Btw., most of the time you don't want to call
> schedule() directly, but
> rather with wait_event (or wait_event_interruptible)
> or do semaphore or
> completion operations.
> 
> > Another question is , i need to access runqueue
> from
> > my module, but the kernel doesnot export the
> functions
> > needs to work on runqueue. Please guide me how to
> > accesses functions which are not exported by
> kernel in
> > kernel module.
> 
> I am quite sure you neither need nor want to access
> the runqueue. You
> may want to make process go to different queues, but
> that's done by
> setting their state. Or, even more probably, hidden
> in wait_event and
> wake_up.
> 
>
-------------------------------------------------------------------------------
> 						 Jan 'Bulb' Hudec <bulb@xxxxxx>
> 


________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

--
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