interrupt

Lua / Java / LuaJ - Handling or Interrupting Infinite Loops and Threads

丶灬走出姿态 提交于 2019-12-22 08:30:14
问题 I'm using LuaJ to run user-created Lua scripts in Java. However, running a Lua script that never returns causes the Java thread to freeze. This also renders the thread uninterruptible. I run the Lua script with: JsePlatform.standardGlobals().loadFile("badscript.lua").call(); badscript.lua contains while true do end . I'd like to be able to automatically terminate scripts which are stuck in unyielding loops and also allow users to manually terminate their Lua scripts while they are running. I

Lua / Java / LuaJ - Handling or Interrupting Infinite Loops and Threads

[亡魂溺海] 提交于 2019-12-22 08:29:00
问题 I'm using LuaJ to run user-created Lua scripts in Java. However, running a Lua script that never returns causes the Java thread to freeze. This also renders the thread uninterruptible. I run the Lua script with: JsePlatform.standardGlobals().loadFile("badscript.lua").call(); badscript.lua contains while true do end . I'd like to be able to automatically terminate scripts which are stuck in unyielding loops and also allow users to manually terminate their Lua scripts while they are running. I

How to setup ARM interrupt vector table branches in C or inline assembly?

◇◆丶佛笑我妖孽 提交于 2019-12-22 05:26:06
问题 Can someone please show me an example of how to setup an ARM9 interrupt vector table using C or inline assembly in a bare-metal environment with no RTOS or Linux OS? Specifically how can I use inline assembly or C to set branches to my IRQ interrupt handler ISR coded in C? /// timer1 64-bit mode interrupt handler connected to TINT2 interrupt=#34 /// \todo I think I need to ACK it once I get working interrupt void interruptHandlerTimer1(void) { printf("\n [* ISR *] \n"); // ACK TINT2 interrupt

why clear interrput flag cause segmentation fault in C?

浪尽此生 提交于 2019-12-22 05:19:10
问题 I am learning some basics about Assembly and C. for learning purpose I decide to write a simple program that disable Interrupts and when user wants to type something in the console he/she can't : #include <stdio.h> int main(){ int a; printf("enter your number : "); asm ("cli"); scanf("%d", &a); printf("your number is %d\n" , a); return 0; } but when I compile this with GCC I got segmentation fault : Segmentation fault (core dumped) And when I debug it with gdb I got this message when program

Help Writing TSR Program(s) in NASM Assembly for DOS

时间秒杀一切 提交于 2019-12-22 04:05:29
问题 I've been trying to write TSR (Terminate-Stay-Resident) programs (in general) in Assembly (16-bit) for MS-DOS. I've read through a Wikipedia page on TSR and also a page on using it specifically in DOS (but it seems to be teaching it in C and not Assembly directly). I've looked at a site with tons of DOS interrupt documentation and find this one, this one, and another most relevant to TSR programs. I can't post all of the links because as a new user I can have up to 2 hyperlinks on a post. So,

Sequence of micro-operations for operations?

南楼画角 提交于 2019-12-21 22:01:30
问题 Consider the following sequence of micro-operations. MBR ← PC MAR ← X PC ← Y Memory ← MBR Which one of the following is a possible operation performed by this sequence? Instruction fetch Operand fetch Conditional branch Initiation of interrupt service Answer is option (4). My attempt : Instruction fetch : Fetch instruction: Read instruction code from address in PC and place in IR. ( IR ← Memory[PC] ) Operand fetch : Fetch operands from memory if necessary: If any operands are memory addresses

Sequence of micro-operations for operations?

假如想象 提交于 2019-12-21 21:50:37
问题 Consider the following sequence of micro-operations. MBR ← PC MAR ← X PC ← Y Memory ← MBR Which one of the following is a possible operation performed by this sequence? Instruction fetch Operand fetch Conditional branch Initiation of interrupt service Answer is option (4). My attempt : Instruction fetch : Fetch instruction: Read instruction code from address in PC and place in IR. ( IR ← Memory[PC] ) Operand fetch : Fetch operands from memory if necessary: If any operands are memory addresses

do system calls execute inside a software interrupt handler in entirety?

我是研究僧i 提交于 2019-12-21 17:26:53
问题 Do system calls execute in the context of a software interrupt handler in entirety? I mean, some system calls like read() could take a long time to return, against the policy that ISR should be very short in execution time. Are system calls offloaded to other threads? How does that work? [A reference to any kernel is fine] 回答1: The syscalls run on most kernels inside an ISR . Take a quick glance at a former release of Linux and you will notice the int $Ox80 to invoke the kernel. This solution

Temporarily disable interrupts on ARM

梦想与她 提交于 2019-12-21 12:46:24
问题 I am starting working with the ARM platform (specifically the TI TMS570 family). I have some code with critical regions where I don't want an exception to occur. So I want to save the IRQ and FIR enabled flags on entering the regions and restore them on exiting. How do I do that? 回答1: To temporarily mask IRQs and FIQs at the CPU, the nicest option for ARMv7 is to use cps: // assembly code assuming interrupts unmasked on entry cpsid if // mask IRQ and FIQ ... // do critical stuff cpsie if //

Linux Interrupt vs. Polling

女生的网名这么多〃 提交于 2019-12-21 03:55:12
问题 I am developing a system with a DSP and an ARM. On the ARM there is a linux OS. I have a DSP sending data to the ARM (Linux) - In the Linux there is a kernel module which read the data received from the DSP. The kernel module is waking up to read the data, using an hardware interrupt between the DSP to the ARM. I want to write a user space app, that will read the data from the kernel space (The kernel module) each time there's a new data arrived from the DSP. The question is: What is better