Page 1 of 1
interrupt handler and process address spaces
Posted: Wed Dec 18, 2013 8:40 am
by dansmahajan
Hi everyone, i am trying to develop network support for my os and recently faced an issue- whenever a packet is received from network, an interrupt is raised; problem here is since mmio address of device is mapped to a network process's vas resulting in a page fault exception
so i guess my option here is either i have to switch the address space in the interrupt handler or i have to map the correct memory addresses..as far as i know interrupt handler should be as short as possible but in either of the cases its a lot of work for the interrupt handler
so is there any other solution ??
or
am i doing it wrong ??
Re: interrupt handler and process address spaces
Posted: Wed Dec 18, 2013 8:48 am
by Combuster
You say you have a network process with device access (microkernel) yet you try to run device-specific code in kernel land (monolithic). Where do you want to go?
Re: interrupt handler and process address spaces
Posted: Wed Dec 18, 2013 9:07 am
by dansmahajan
Combuster wrote:You say you have a network process with device access (microkernel) yet you try to run device-specific code in kernel land (monolithic). Where do you want to go?
my network process just initializes the device and sets up a handler thats it (by the way it is a ring0 process). So when an interrupt occurs its the kernel which do rest of the thing
PS: only vm86 process is running in ring3 every thing else is in ring0
Re: interrupt handler and process address spaces
Posted: Wed Dec 18, 2013 2:01 pm
by Gigasoft
You should preferably have a way to allocate linear pages that are visible in every process, as some devices may require writing to a register to deassert an IRQ. Otherwise, address space switching is unavoidable, but you can reduce the number of switches needed when nested interrupts happen by putting any further interrupts in a queue and executing the handlers in an orderly fashion. An EOI should then not be sent until all drivers that are registered with a given interrupt line have finished processing the interrupt.
Re: interrupt handler and process address spaces
Posted: Thu Dec 19, 2013 6:09 am
by dansmahajan
Gigasoft wrote:You should preferably have a way to allocate linear pages that are visible in every process, as some devices may require writing to a register to deassert an IRQ. Otherwise, address space switching is unavoidable, but you can reduce the number of switches needed when nested interrupts happen by putting any further interrupts in a queue and executing the handlers in an orderly fashion. An EOI should then not be sent until all drivers that are registered with a given interrupt line have finished processing the interrupt.
Thank you Gigasoft for your reply
this is what i should do; map the corresponding frames in the current address space and complete the interrupt handler,send and EOI and then resume back..by doing this theres a possibility of missing some interrupts???