Re: interrrupt handling question on linux

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

 



Pankaj G wrote:

> when interrupt occurs, what is the sequence of steps that are performed by
> linux.
> i know kernel leaves the work it is presently doing and switches to interrupt
> handler to handle that interrupt.

Technically, the CPU does that on behalf of the kernel.  Fundamentally,
an interrupt is a hardware event, whether it is caused by software or
hardware.

> But it want to know the activities in terms of system calls that occur during
> that activity?

There are no system calls made while handling an interrupt.  Interrupt
service routings (ISRs) execute in kernel mode, and the kernel does not
make system calls.

System calls are made by userspace software.  They are implemented by
the C runtime library, which causes a software interrupt, but you can't
really say that interrupt happens "during" the system call.  See my
earlier posting at
http://article.gmane.org/gmane.linux.kernel.kernelnewbies/8641 for more
details.

> I also want to know if a process is running on one terminal and if i click with
> mouse on panel bar to invoke another terminal, on KDE desktop, what happens?
> again i mean in terms of system calls.

Quite a few system calls occur, but I suspect that they are all related
to memory allocataion (e.g., brk(2) and sbrk(2)).  The shells running in
those terminal windows don't even know that you've clicked on the
windows (they are probably blocked in read(2) system calls, waiting for
user input).  In Linux, there are no system calls for drawing graphics.
The X Window server draws on the display by directly accessing memory on
the video card (though it probably uses open(2), mmap(2), and/or
ioctl(2) to get access to that video memory).

Oh, and the X server communicates with your window manager, so that
probably involves I/O over a socket, so that causes read(2) and write(2)
or send(2) and recv(2) calls in both the X server and window manager.

> Suppose we have a module in which system calls are trapped by changing system
> call table pointer. Thus before the actual system call, my module is called. In
> this module some simple activities are performed like printing information, like
> process id and it's name or, in some case i may also store this information in
> some data structure i use, and then actual system call is called within that
> module.
> Calling of actual system call is done so that functionality of kernel is not
> affected.
> Now in this thing if the situation described above comes, i.e. 
> If a process is running on one terminal and if i click with mouse on panel bar
> to invoke another terminal, on KDE desktop, what happens? i mean in terms of
> system calls.

The same thing I described above.

> Will that thing affect my module or it's functionality(functionality of my
> module is as simple as i have described earlier)?

Your module runs when any userspace process makes the relevant system
calls.  The actions of the user don't matter (except to the extent that
they cause userspace to make those system calls).

I hope this helps.
--
Francis Litterio
franl <at> world . std . com


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