interrupt-handling

Can a fast interrupt handler call a non-fast-interrupt-handler function?

こ雲淡風輕ζ 提交于 2021-02-08 09:51:10
问题 If I have a fast interrupt handler (by adding __attribute__((interrupt("FIQ"))) ), can I invoke other non-fast-interrupt function inside the handler? For example, void f() {//...} void g() {//...} void handler() __attribute__((interrupt("FIQ"))) { // ... f(); g(); // ... } I have a fast interrupt handler set up similarly as the example above and it's not working as intended. I used gdb to trace through the handler and I found that things are pushed to the stack during the f function call and

Identifying faulting address on General Protection Fault (x86)

馋奶兔 提交于 2021-02-07 13:13:05
问题 I am trying to write a ISR for the General Protection Fault (GP#13) on x86. I am unable to figure out from the INTEL docs as to how I can find out the faulting address causing the exception. I know that for Page fault exceptions (GP#14) the cr2 register holds the faulting address. Any help is appreciated. 回答1: All references I make here are from AMD64 Architecture Programmer's Manual Volume 2: System Programming, which also describes the legacy protected-mode (i.e., x86) behavior. Figure 8-8

Identifying faulting address on General Protection Fault (x86)

人盡茶涼 提交于 2021-02-07 13:13:00
问题 I am trying to write a ISR for the General Protection Fault (GP#13) on x86. I am unable to figure out from the INTEL docs as to how I can find out the faulting address causing the exception. I know that for Page fault exceptions (GP#14) the cr2 register holds the faulting address. Any help is appreciated. 回答1: All references I make here are from AMD64 Architecture Programmer's Manual Volume 2: System Programming, which also describes the legacy protected-mode (i.e., x86) behavior. Figure 8-8

How to close an Excel instance if the Python console program gets interrupted and closed?

扶醉桌前 提交于 2021-01-29 08:31:27
问题 I'm trying to figure out how to close an Excel instance properly if the Python console program is interrupted and closed while executing. Below is a minimal reproducible example: # import pythoncom import traceback import win32com.client import win32api def exit_handler(arg): file = open('Log.txt', 'w') file.write(f'{repr(workbook)}\n{repr(excel_application)}\n') try: # pythoncom.CoInitialize() workbook.Close(SaveChanges=False) excel_application.Quit() except Exception: file.write(traceback

How to fire a command when a shell script is interrupted?

二次信任 提交于 2021-01-27 04:06:32
问题 I want to fire a command like " rm -rf /etc/XXX.pid " when the shell script is interrupted in the middle of its execution. Like using CTRL+C Can anyone help me what to do here? 回答1: Although it may come as a shock to many, you can use the bash built-in trap to trap signals :-) Well, at least those that can be trapped, but CTRL-C is usually tied to the INT signal. You can trap the signals and execute arbitrary code. The following script will ask you to enter some text then echo it back to you.

Does executing an int 3 interrupt stop the entire process on Linux or just the current thread?

大憨熊 提交于 2020-11-26 17:59:31
问题 Suppose the architecture is x86. And the OS is Linux based. Given a multithreaded process in which a single thread executes an int 3 instruction, does the interrupt handler stop from executing the entire process or just the thread that executed the int 3 instruction? 回答1: Since the question is Linux specific, let's dive into kernel sources! We know int 3 will generate a SIGTRAP, as we can see in do_int3. The default behaviour of SIGTRAP is to terminate the process and dump core. do_int3 calls

Does executing an int 3 interrupt stop the entire process on Linux or just the current thread?

梦想与她 提交于 2020-11-26 17:57:46
问题 Suppose the architecture is x86. And the OS is Linux based. Given a multithreaded process in which a single thread executes an int 3 instruction, does the interrupt handler stop from executing the entire process or just the thread that executed the int 3 instruction? 回答1: Since the question is Linux specific, let's dive into kernel sources! We know int 3 will generate a SIGTRAP, as we can see in do_int3. The default behaviour of SIGTRAP is to terminate the process and dump core. do_int3 calls