Interrupt context...



This I had posted in comp.os.linux.misc, but no luck. Someone suggested
me to post it here. So in case, here, anyone gets irritated for
reposting, please undererstand that I have no intention of increasing
traffic here. I badly need help.

Hi All,

I have been tearing my hair on interrupt architecture of linux. I have
gone through most of the posts on interrupt in usenet. It helped me a
lot. But, still couple of doubts poke me every now and then.

When an interrupt comes, whatever the user is executing is saved in the
kernel stack and ISR is executed. Now my question is, what will be the
context of that interrupt? What things will be setup to execute ISR? I
mean will there be code, heap, stack allocated for this ISR? Or since
ISR is part of kernel, it will be executed on the kernel that was
loaded into RAM(meaning, that will use kernel code, heap, stack). If
so, then one more doubt - we have 4 GB AS for each process in linux and
within that 1Gb is for Kernel. So, for each process we setup a 1GB or
all process share a common 1GB kernel? Is Kernel stack (8KB) is
allocated in that 1 GB? if yes, then does it puts a upper limit on
number of process that can be run on linux (since there is only < 1GB
on which we have to allocate 8K kernel stack for each process being
run)? what is the place holder (data structure) in 1GB kernel that
maintain all the Kernel stacks for all process? How is the
architecture? Assuming kernel is a process with code, heap and stack,
so which part of that used to hold all the kernel stacks? How kernel
finds out the exact kernel stack for the process which is scheduled
now?

Also, when a switch from user to ISR happens(or a context switch
between another user process), is the previous process environment
(code, heap, stack, I mean the pages allocated in the RAM for that
process) destroyed? If not, then on what basis pages for new process
are loaded into RAM?

Can I ignore all interrupts with cli assembly command? Does all
interrupt comes through PIC? how about timer interrupt?

I know this is big, but, you will definitely help me to understand OS
better by answering this. Appreciate for any help.

I am basically an C application programmer, I want to move to serious
network protocol development, is it a good idea to understand OS
(linux) concept before I start coding protocols? I felt understanding
lower level details would help me design and write better code for a
protocol. I know i have realised that late, but, at least I have a
start now. ;)

-paul

.



Relevant Pages

  • Re: Installable ISR - general questions
    ... The ISR (Interrupt Service Routine) is called by the interrupt ... handler installed by the OS. ... SYSINTR_RESCHEDULE tells the kernel that it should check if a thread ...
    (microsoft.public.windowsce.platbuilder)
  • Re: minimizing interrupt latency to user application in Wince 6.0
    ... As soon as the IST is signaled by the ISR, ... my device simply delivers external event rather then signaling ... So can I somehow bypass driver's IST and wait directly on interrupt hEvent ... Looks like as if kernel is handling this ...
    (microsoft.public.windowsce.embedded)
  • Re: Evaluation question, can OAL functions be called from application code?
    ... Everything in CE runs in user mode (except for the kernel, ... > type show only driver and OAL related applications for these calls. ... > That's a great tip regarding the installable ISR. ... >> simply need to use the Installable Interrupt mechanism, ...
    (microsoft.public.windowsce.embedded)
  • Re: WorkQPanic
    ... One of the design goals of VxWorks is low interrupt latency. ... flag is set to indicate that the system is in a critical kernel area ... until AFTER both the ISR finishes, ... Note that the deferred routines are processed while ...
    (comp.os.vxworks)
  • Interrupt context...
    ... I have been tearing my hair on interrupt architecture of linux. ... kernel stack and ISR is executed. ... What things will be setup to execute ISR? ... ISR is part of kernel, it will be executed on the kernel that was ...
    (comp.os.linux.misc)