interrupt

How to detecting interrupt on a GPIO line in Embedded Linux?

微笑、不失礼 提交于 2019-12-31 22:41:29
问题 There is an interrupt being generated at every 10ms on GPIO_39 in the pandaboard OMAP4. I have registered a handler for this in Linux driver code, but the handler is not being called since the interrupt is not being detected. I made sure at the hardware level (by probing the gpio pin) that the interrupt is actually being generated. It's only that the software is not being able to detect it. I've the following in my driver code. #define GPIO_NO 39 iowrite16(0x3, gpio_39_address + 2); /*

Finding out which drive was booted in x86 bootloader

家住魔仙堡 提交于 2019-12-31 07:00:14
问题 I'm writing a game bootloader for x86. At one point, early in the booting, I need to load some sectors from my boot drive into memory. I do this with interrupt 0x13 (ah=02), and when I try it in my virtual machine it works like a charm. However when I burn the image to a usb drive, the machine fails to boot, and I pinned it down to the sector loading instructions, apparently my usb drive isn't drive 0 (Floppy A), so the read fails. How can I determine which drive was used to boot? Thanks! 回答1

Disable Hardware & Software Interrupts

扶醉桌前 提交于 2019-12-30 04:48:06
问题 Is it possible to disable all interrupts with a ASM/C/C++ program to get full control about the processor? If yes -> how? If not -> how do "atomic" operation system calls work (for example entering a critical section)? Thanks for your help! 回答1: In x86 assembly the the commands are sti set interrupt enable bit cli clear interrupt enable bit These commands set and clear the IF Flag. When the IF flag is set, the CPU will handle hardware interrupts, and when it is clear the CPU will ignore

Signals and interrupts a comparison

我们两清 提交于 2019-12-29 10:05:51
问题 Based on various references, my subjective definition of signals in Linux is "The triggers that are used to notify the processes about an occurrence of a specific event.Event here may refer to a software exception.Additionally signals may also be used for IPC mechanisms." The questions I have are I presume only exceptions (software interrupts) are notified via signals.What about the case of hardware interrupts. What are the various sources of the signal? To me it looks like kernel is always

How can I clear the screen without having to fill it

北城以北 提交于 2019-12-29 06:19:49
问题 Does an interrupt service routine exist to help me clear the screen of the terminal? Will it work on windows? 回答1: Setting a graphics mode through BIOS (int 10h with AH=0) will clear the screen. Scrolling the screen up or down through BIOS (int 10h with AH=6 or 7) can clear the screen as well. This will only work where you can invoke BIOS service functions. MSDOS is where this will always work. In Windows this will work only in DOS applications and if Windows can actually run them. 64-bit

do actions on end of execution

前提是你 提交于 2019-12-29 00:35:33
问题 I have an http server (launched using http.Handle ) and I would like to do some operations. How can I do that (on linux) ? Is it possible to do those operations in case of a ctrl-C ? I'm not familiar with unix signals so the answer may be trivial. 回答1: You can subscribe to the TERM and INT signals using the signal package. But note that these signals are only sent when the process is killed explicitly; normal exit (initiated by the process itself) does not involve any sort of signals. I think

do actions on end of execution

浪尽此生 提交于 2019-12-29 00:35:04
问题 I have an http server (launched using http.Handle ) and I would like to do some operations. How can I do that (on linux) ? Is it possible to do those operations in case of a ctrl-C ? I'm not familiar with unix signals so the answer may be trivial. 回答1: You can subscribe to the TERM and INT signals using the signal package. But note that these signals are only sent when the process is killed explicitly; normal exit (initiated by the process itself) does not involve any sort of signals. I think

What is the difference between FIQ and IRQ interrupt system?

淺唱寂寞╮ 提交于 2019-12-27 18:21:25
问题 I want to know the difference between FIQ and IRQ interrupt system in any microprocessor, e.g: ARM926EJ. 回答1: A feature of modern ARM CPUs (and some others). From the patent: A method of performing a fast interrupt in a digital data processor having the capability of handling more than one interrupt is provided. When a fast interrupt request is received a flag is set and the program counter and condition code registers are stored on a stack. At the end of the interrupt servicing routine the

How can I interrupt a ServerSocket accept() method?

扶醉桌前 提交于 2019-12-27 10:20:17
问题 In my main thread I have a while(listening) loop which calls accept() on my ServerSocket object, then starts a new client thread and adds it to a Collection when a new client is accepted. I also have an Admin thread which I want to use to issue commands, like 'exit', which will cause all the client threads to be shut down, shut itself down, and shut down the main thread, by turning listening to false. However, the accept() call in the while(listening) loop blocks, and there doesn't seem to be

Enter graphics mode without interrupts in assembly

放肆的年华 提交于 2019-12-25 14:40:45
问题 How can I enter graphics mode (mode 13h) without using BIOS interrupts? I'm targeting 32-bit protected mode where BIOS interrupts aren't available. I found a tutorial on web, but it only gives me hints such as VGA registers. I want to know how VGA registers are accessed? I'm using x86 assembly in NASM . I know how to enter graphics mode using INT 13h/INT 10h BIOS interrupts. 回答1: This would be very hardware dependent. Realistic if you limit yourself to VGA-compatible adapters, but not if you