Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Operating system
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=====Software interrupt===== A software interrupt is a message to a [[Process (computing)|process]] that an event has occurred.<ref name="lpi-ch20-p388_quote1"/> This contrasts with a ''hardware interrupt'' โ which is a message to the [[central processing unit]] (CPU) that an event has occurred.<ref name="osc-ch2-p30">{{cite book | last = Silberschatz | first = Abraham | title = Operating System Concepts, Fourth Edition | publisher = Addison-Wesley | year = 1994 | page = 30 | isbn = 978-0-201-50480-4 | quote = Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus. }}</ref> Software interrupts are similar to hardware interrupts โ there is a change away from the currently running process.<ref name="lpi-ch20-p388_quote2">{{cite book | last = Kerrisk | first = Michael | title = The Linux Programming Interface | publisher = No Starch Press | year = 2010 | page = 388 | isbn = 978-1-59327-220-3 | quote = Signals are analogous to hardware interrupts in that they interrupt the normal flow of execution of a program; in most cases, it is not possible to predict exactly when a signal will arrive. }}</ref> Similarly, both hardware and software interrupts execute an [[Interrupt handler|interrupt service routine]]. Software interrupts may be normally occurring events. It is expected that a [[Preemption (computing)#Time slice|time slice]] will occur, so the kernel will have to perform a [[context switch]].<ref name="lpi-ch20-p388_quote3">{{cite book | last = Kerrisk | first = Michael | title = The Linux Programming Interface | publisher = No Starch Press | year = 2010 | page = 388 | isbn = 978-1-59327-220-3 | quote = Among the types of events that cause the kernel to generate a signal for a process are the following: A software event occurred. For example, ... the process's CPU time limit was exceeded[.] }}</ref> A [[computer program]] may set a timer to go off after a few seconds in case too much data causes an algorithm to take too long.<ref name="lpi-ch20-p388">{{cite book | last = Kerrisk | first = Michael | title = The Linux Programming Interface | publisher = No Starch Press | year = 2010 | page = 388 | isbn = 978-1-59327-220-3 }}</ref> Software interrupts may be error conditions, such as a malformed [[machine code|machine instruction]].<ref name="lpi-ch20-p388"/> However, the most common error conditions are [[division by zero]] and [[segmentation fault|accessing an invalid memory address]].<ref name="lpi-ch20-p388"/> [[User (computing)|Users]] can send messages to the kernel to modify the behavior of a currently running process.<ref name="lpi-ch20-p388"/> For example, in the [[Command-line interface|command-line environment]], pressing the ''interrupt character'' (usually [[Control-C]]) might terminate the currently running process.<ref name="lpi-ch20-p388"/> To generate ''software interrupts'' for [[x86]] CPUs, the [[INT (x86 instruction)|INT]] [[assembly language]] instruction is available.<ref name="intel-developer">{{cite web |url=https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf |access-date=2022-05-05 |title=Intelยฎ 64 and IA-32 Architectures Software Developer's Manual |volume=2 |date=September 2016 |publisher=[[Intel Corporation]] |page=610 |archive-date=23 March 2022 |archive-url=https://web.archive.org/web/20220323231921/https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf |url-status=live }}</ref> The syntax is <code>INT X</code>, where <code>X</code> is the offset number (in [[hexadecimal]] format) to the [[interrupt vector table]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)