interrupt

How to read keyboard input without “consuming” it in x86 DOS assembly?

 ̄綄美尐妖づ 提交于 2019-12-25 09:49:04
问题 I need to write a sort of key-logger function that can be called from C code. what it means is a c program would call an assembly function called startlog that would indicate to start logging the keys pressed until a function called endlog is called. the logging should work like this: write the ascii value of any key pressed without disturbing the C code between startlog and endlog, meaning that if the C code also needs to read the input (let's say by scanf, it would work ok). I managed to

how do the registers get saved when a process gets interrupted?

前提是你 提交于 2019-12-25 01:13:33
问题 this has been bugging me all day. When a program sets itself up to call a function when it receives a certain interrupt, I know that the registers are pushed onto the stack when the program is interrupted, but what I can't figure out is: how do the registers get off the stack? I know that the compiler doesn't know if the function is an interrupt handler, and it can't know how many arguments the interrupt gave to the function. So how on earth does it get the registers off? 回答1: It depends on

how to force an application to run in one core and no other applications run in that core on windows?

孤街浪徒 提交于 2019-12-24 18:09:27
问题 I think my questions are unusual, but I wanna work on real time targeting in MATLAB Simulink, but I don't want to use XPC target. I just want no interrupt on the program (simulink) when it is running in order to have a real time interruptless control system. and in that order i can use my control module without target system. first of all, please ignore my weak english. and I have some questions: 1. can we force a core to only be used by simulink and nothing else? 2. how much usually (and how

ARM interrupts and context saving

被刻印的时光 ゝ 提交于 2019-12-24 16:19:21
问题 I am trying to understand how interrupts work in an ARM architecture(ARM7TDMI to be specific). I know that there are seven exceptions (Reset,Data Abort, FIQ, IRQ, Pre-fetch abort, SWI and Undefined instruction) and they execute in particular modes(Supervisor, Abort, FIQ, IRQ, Abort, Supervisor and Undefined respectively). I have the following questions. 1. When the I and F bits in CPSR(status register) are set to 1 to disable external and fast interrupt, does the other 5 exceptions are also

PCIe interrupt routing

血红的双手。 提交于 2019-12-24 13:38:23
问题 I am currently implementing a PCIE endpoint device in xilinx PFGA, and have some problem regards to the interrupt. when the driver init, it map the interrupt to IRQ 32 [ 1078.938669] alloc irq_desc for 32 on node -1 [ 1078.938670] alloc kstat_irqs on node -1 [ 1078.938675] pci 0000:06:00.0: PCI INT A -> GSI 32 (level, low) -> IRQ 32 However, when the interrupt fires, [ 1134.850064] irq 16: nobody cared (try booting with the "irqpoll" option) [ 1134.850067] Pid: 0, comm: swapper Tainted: P 2.6

x86 assembler interrupts code

↘锁芯ラ 提交于 2019-12-24 09:13:26
问题 #include <studio.h> #include <dos.h> void interrupt (*int9save) (void) void interrupt eliminate_multiple_press(void) { int9save=getvect(9); setvect(9,eliminate_multiple_press); asm { MOV AH,0 int 16h MOV scan_temp,AH CMP ZF,0 } } void interrupt uneliminate_multiple_press() { setvect(9,int9save); } void main(void) { char str[100]; int check=1; char scan_temp; unsigned int scan_code ; eliminate_multiple_press(); printf("enter a word\n"); scanf("%s",str); scan_code=(unsigned int) scan_temp;

Terminating a subprocess with KeyboardInterrupt

会有一股神秘感。 提交于 2019-12-24 04:14:11
问题 I'm using Python to call a C++ program using the subprocess module. Since the program takes some time to run, I'd like to be able to terminate it using Ctrl+C. I've seen a few questions regarding this on StackOverflow but none of the solutions seem to work for me. What I would like is for the subprocess to be terminated on KeyboardInterrupt. This is the code that I have (similar to suggestions in other questions): import subprocess binary_path = '/path/to/binary' args = 'arguments' #

How can I cancel a blocking call such as select() or read()?

青春壹個敷衍的年華 提交于 2019-12-24 00:38:12
问题 As the title says, how can I cancel a blocking call such as select() or (in the case of serial comm and similar) read() from another thread? What is the traditional way of solving things like this? I suppose one could use a small timeout and that would probably work fine but that seems like a bit of a hack to me. 回答1: The traditional way of interrupting select(2) is the self-pipe trick. The input/output calls are better served by having the descriptors non-blocking and handling EAGAIN . 回答2:

Interrupt 0x15 function 0x86 (BIOS WAIT) runs far slower on real hardware than on virtual machines?

為{幸葍}努か 提交于 2019-12-23 22:52:46
问题 I've been writing a bootloader in assembly (a game). The bootloader uses the bios WAIT function (int 0x15, ah 0x86) for delays between frames. I'm debugging with BOCHS and everything works just splendid (timing is perfect). I also made a bootable iso with the isogenimage tool and tested my bootloader in virtualbox and everything works as expected there too. So I think it's safe to say that delays work in virtual environments. Now here's the peculiar part: when I write the bootloader to a usb

How to send control C to Mac Terminal using python?

匆匆过客 提交于 2019-12-23 22:23:38
问题 I have a python script that needs to send control C to the mac terminal. I've tried sending the plain text "^C" but I get back that the terminal does not recognize the command. (The terminal meaning the pseudo terminal that python creates) Basically, I am using the terminal to run an old Unix Executable and the only way that I can think of to terminate this gracefully is to send the interrupt signal. Is there any way I can fool the terminal into thinking that I pressed control C? Thanks in