<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=Exception_and_Interrupt_Handling</id>
	<title>Exception and Interrupt Handling - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://xinu.cs.mu.edu/index.php?action=history&amp;feed=atom&amp;title=Exception_and_Interrupt_Handling"/>
	<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Exception_and_Interrupt_Handling&amp;action=history"/>
	<updated>2026-06-15T14:48:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Exception_and_Interrupt_Handling&amp;diff=2659&amp;oldid=prev</id>
		<title>Michael: Interrupt handler moved to Exception and Interrupt Handling</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Exception_and_Interrupt_Handling&amp;diff=2659&amp;oldid=prev"/>
		<updated>2008-05-27T18:51:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/Interrupt_handler&quot; class=&quot;mw-redirect&quot; title=&quot;Interrupt handler&quot;&gt;Interrupt handler&lt;/a&gt; moved to &lt;a href=&quot;/index.php/Exception_and_Interrupt_Handling&quot; title=&quot;Exception and Interrupt Handling&quot;&gt;Exception and Interrupt Handling&lt;/a&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:51, 27 May 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Michael</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Exception_and_Interrupt_Handling&amp;diff=2156&amp;oldid=prev</id>
		<title>Michael: Whoops, the code corrected me</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Exception_and_Interrupt_Handling&amp;diff=2156&amp;oldid=prev"/>
		<updated>2007-09-18T18:30:33Z</updated>

		<summary type="html">&lt;p&gt;Whoops, the code corrected me&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 18:30, 18 September 2007&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Embedded XINU utilizes a interrupt handling system which allows components to register custom interrupt handlers to the system at runtime or &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;use &lt;/del&gt;the default trap handler.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[[&lt;/ins&gt;Embedded XINU&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]] &lt;/ins&gt;utilizes a interrupt handling system which allows components to register custom interrupt handlers to the system at runtime or &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;fall-back to &lt;/ins&gt;the default trap handler.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Since interrupt handling &lt;/del&gt;code &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;can occupy &lt;/del&gt;at &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;most 0x20 bytes of memory in the reserved system area, the &lt;/del&gt;interrupt &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;handler must be efficient and robust&lt;/del&gt;.  &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;When an exception occurs the handler checks the cause register &lt;/del&gt;for &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the number of the exception, loads the known offset to the interrupt vector table &lt;/del&gt;(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;0x8000 0200&lt;/del&gt;) &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;and adds the exception number to that offset.  After the address of the exception handler is known&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;it is loaded into a register, checks if it is the NULL pointer (not set) and jumps &lt;/del&gt;to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the handler code.  If the handler is set &lt;/del&gt;to &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;NULL, the &lt;/del&gt;code &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;uses the default trap handler instead&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MIPS processors will jump to and execute &lt;/ins&gt;code &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;beginning &lt;/ins&gt;at &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;tt&amp;gt;0x8000 0180&amp;lt;/tt&amp;gt; when an exception or &lt;/ins&gt;interrupt &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;occurs&lt;/ins&gt;.  &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Code &lt;/ins&gt;for &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;handling traps must occupy no more than 0x20 bytes at this location &lt;/ins&gt;(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;eight instructions&lt;/ins&gt;), &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;therefore Embedded XINU uses three instructions &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;jump &lt;/ins&gt;to &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;different &lt;/ins&gt;code &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;which will handle traps more robustly&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Interrupt handling occurs in a similar fashion&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;but relies on saving &lt;/del&gt;the state of the system &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;which cannot occur in &lt;/del&gt;the &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;simple &lt;/del&gt;interrupt handler.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;In order to handle exceptions (such as TLB misses) efficiently, Embedded XINU uses an interrupt vector system to quickly read the exception code, load the registered exception handler, and jump to the handler.  If any of these steps do not exist&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the handler will fall-back to the default trap handler.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;If an interrupt has occurred it is important to save &lt;/ins&gt;the state of &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;the processor and handle the interrupt gracefully so &lt;/ins&gt;the system &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;can continue running.  Thus, if &lt;/ins&gt;the interrupt handler &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;was called by an interrupt and not an exception, the code will save the state of the processor and perform a similar lookup for interrupt handlers&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Michael</name></author>
		
	</entry>
	<entry>
		<id>https://xinu.cs.mu.edu/index.php?title=Exception_and_Interrupt_Handling&amp;diff=2152&amp;oldid=prev</id>
		<title>Michael: Brief description of the interrupt handler</title>
		<link rel="alternate" type="text/html" href="https://xinu.cs.mu.edu/index.php?title=Exception_and_Interrupt_Handling&amp;diff=2152&amp;oldid=prev"/>
		<updated>2007-09-18T17:48:29Z</updated>

		<summary type="html">&lt;p&gt;Brief description of the interrupt handler&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Embedded XINU utilizes a interrupt handling system which allows components to register custom interrupt handlers to the system at runtime or use the default trap handler.&lt;br /&gt;
&lt;br /&gt;
Since interrupt handling code can occupy at most 0x20 bytes of memory in the reserved system area, the interrupt handler must be efficient and robust.  When an exception occurs the handler checks the cause register for the number of the exception, loads the known offset to the interrupt vector table (0x8000 0200) and adds the exception number to that offset.  After the address of the exception handler is known, it is loaded into a register, checks if it is the NULL pointer (not set) and jumps to the handler code.  If the handler is set to NULL, the code uses the default trap handler instead.&lt;br /&gt;
&lt;br /&gt;
Interrupt handling occurs in a similar fashion, but relies on saving the state of the system which cannot occur in the simple interrupt handler.&lt;/div&gt;</summary>
		<author><name>Michael</name></author>
		
	</entry>
</feed>