Friday, May 17, 2019

Interrupt and a Trap in an Operating System Essay

What are the differences between an let out and a ambush? What are their importance? According to Stallings (2012) an interrupt is a suspension of a process, such as the motion of a computer program, caused by an event external to that process and performed in such a personal manner that the process can be resumed (p. 716). Stallings (2012) goes on to say that interrupts are provided primarily as a authority to improve processor utilization. For example, most I/O devices are much slower than the processor (p. 14). A trap is an unprogrammed conditional jump to a specified address that is automatically activated by computer hardware the location from which the jump was made is recorded (Stallings, 2012, p. 721). A trap is actually a software generated interrupt caused either by an error (for example division by zero, invalid memory access etc.), or by a specific request by an operating frame service generated by a user program.Trap is sometimes called Exception. The hardware or s oftware can generate these interrupts. When the interrupt or trap occurs, the hardware transfers control to the operating arrangement which first preserves the current state of the system by saving the current CPU registers content and program counters value. Then the nidus shifts to the determination of which type of interrupt has occurred. For each type of interrupt, separate segments of code in the operating system determine what action should be taken and thus the system keeps on functioning by execution of instrument computational instruction, I/O instruction, storage instruction etc. Provide an example of each.Example of an give way retrieved from http//www.scriptoriumdesigns.com/embedded/show_codefile.php?fname=interrupts/AVR_ISR_1.c// AVR_ISR_1include include typedef uint8_t u8 // convenient unsigned variable designationstypedef uint16_t u16define INPORT PINDdefine OUTPORT PORTCdefine OUTDDR DDRC vapourisable u8 Int_flag = 0ISR( INT0_vect )OUTPORT = 0x01 // toggle LEDvoi d int0_init( void )MCUCR = (1

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.