interrupt-handling

Linux Interrupt Handling in User Space

霸气de小男生 提交于 2019-11-30 11:17:48
In Linux, what are the options for handling device interrupts in user space code rather than in kernel space? Experience tells it is possible to write good and stable user-space drivers for almost any PCI adapter. It just requires some sophistication and a small proxying layer in the kernel. UIO is a step in that direction, but If you want to correctly handle interrupts in user-space then UIO might not be enough, for example if the device doesn't support the PCI-spec's interrupt disable bit which UIO relies on. Notice that process wakeup latencies are a few microsecs so if your implementation

OsDev syscall/sysret and sysenter/sysexit instructions enabling

六月ゝ 毕业季﹏ 提交于 2019-11-30 08:54:08
问题 I am building an 32 bit OS in assembly. I have setup the IDT and I am handling program interruptus through int instruction. How can I enable the syscall and sysenter instructions and how do I handle them/return? Is true that syscall instruction isn't supported in 32 bit by Intel processors so I can't use it? Is true that sysret instruction isn't safe? Do somewhere exist a tutorial for that? EDIT : My main question is how to enable the syscall and sysenter instructions! (No duplication) 回答1:

printk inside an interrupt handler , is it really that bad?

谁说胖子不能爱 提交于 2019-11-30 05:14:59
everybody knows that interrupt handler should be short as possible. and adding functions like printk for debugging inside an interrupt handler is something that shouldn't be done. Actually, I tried it before when I was debugging the linux kernel for an interrupt driven char device I written, and it wrecked the timing of the driver. The question I have, is why this is happening ? printk function is buffered ! it means, as far as I understand that the data is inserted in to a queue, and it's being handled later, most probably after the interrupt handler is finished. So why doesn't it work ? The

How to trap ERR when using 'set -e' in Bash

匆匆过客 提交于 2019-11-30 00:07:32
I have a simple script : #!/bin/bash set -e trap "echo BOO!" ERR function func(){ ls /root/ } func I would like to trap ERR if my script fails (as it will here b/c I do not have the permissions to look into /root). However, when using set -e it is not trapped. Without set -e ERR is trapped. According to the bash man page, for set -e : ... A trap on ERR, if set, is executed before the shell exits. ... Why isn't my trap executed? From the man page it seems like it should. chepner's answer is the best solution : If you want to combine set -e (same as: set -o errexit ) with an ERR trap, also use

Linux Interrupt Handling in User Space

时间秒杀一切 提交于 2019-11-29 17:00:42
问题 In Linux, what are the options for handling device interrupts in user space code rather than in kernel space? 回答1: Experience tells it is possible to write good and stable user-space drivers for almost any PCI adapter. It just requires some sophistication and a small proxying layer in the kernel. UIO is a step in that direction, but If you want to correctly handle interrupts in user-space then UIO might not be enough, for example if the device doesn't support the PCI-spec's interrupt disable

How can we detect call interruption in our iphone application? [closed]

懵懂的女人 提交于 2019-11-29 13:05:28
I need to detect incoming call interruption in my application. When application is in active state and there is any incoming call or SMS, my application grab the calling number in case if call and all details in case of SMS. I want to store these in my application. Is this possible to detect Call interruption and incoming SMS alert in our iPhone application? You will have to use CoreTelephony Framework You can get information about the state of the call by using the CTCall class. the CTCallCenter allows you to register for call event state changes but your app needs to be in running state.You

Where is the Linux ISR Entry Point

放肆的年华 提交于 2019-11-29 11:14:01
I'm trying to understand the system call interface and implementation in the Linux kernel. I know about entry.S and the relationship between libc headers and implementation. What I want to know is where in the kernel is the int 80h received for the first time i.e. the place that decides that it's actually the 80h interrupt. Can anyone point me to the LXR link for this please? CONFIG_X86_32 arch/x86/kernel/entry_32.S:system_call (INT $0x80) arch/x86/kernel/entry_32.S:ia32_sysenter_target (SYSENTER) CONFIG_X86_64 arch/x86/kernel/entry_64.S:system_call (SYSCALL, 64bit) CONFIG_X86_64 and CONFIG

what is chained irq in linux, when are they need to used?

别说谁变了你拦得住时间么 提交于 2019-11-29 09:33:10
问题 What is chained IRQ ? What does chained_irq_enter and chained_irq_exit do, because after an interrupt is arised the IRQ line is disabled, but chained_irq_enter is calling functions related to masking interrupts. If the line is already disabled why to mask the interrupt ? 回答1: what is chained irq ? There are two approaches how to call interrupt handlers for child devices in IRQ handler of parent (interrupt controller) device. Chained interrupts: "chained" means that those interrupts are just

OsDev syscall/sysret and sysenter/sysexit instructions enabling

拈花ヽ惹草 提交于 2019-11-29 08:59:21
I am building an 32 bit OS in assembly. I have setup the IDT and I am handling program interruptus through int instruction. How can I enable the syscall and sysenter instructions and how do I handle them/return? Is true that syscall instruction isn't supported in 32 bit by Intel processors so I can't use it? Is true that sysret instruction isn't safe? Do somewhere exist a tutorial for that? EDIT : My main question is how to enable the syscall and sysenter instructions! (No duplication) See the OSdev wiki for details on sysenter , including a note about how to avoid a security/safety problem.

Future.cancel() method is not working

别来无恙 提交于 2019-11-29 07:46:58
The code that I have creates a Callable instance and using ExecutorService a new thread is being created. I want to kill this thread after certain amount of time if the thread is not done with its execution. After going through the jdk documentation I've realized that Future.cancel() method can be used to stop the execution of the thread, but to my dismay its not working. Of course future.get() method is sending an interrupt to the Thread after the stipulated time (in my case its 2 seconds) and even the thread is receiving this interrupt but this interruption is taking place only once the