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 ??
interrupt handler and process address spaces
-
- Member
- Posts: 62
- Joined: Mon Jan 07, 2013 10:38 am
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: interrupt handler and process address spaces
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?
-
- Member
- Posts: 62
- Joined: Mon Jan 07, 2013 10:38 am
Re: interrupt handler and process address spaces
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 thingCombuster 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?
PS: only vm86 process is running in ring3 every thing else is in ring0
Re: interrupt handler and process address spaces
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.
-
- Member
- Posts: 62
- Joined: Mon Jan 07, 2013 10:38 am
Re: interrupt handler and process address spaces
Thank you Gigasoft for your replyGigasoft 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.
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???