Architectures and Design Methods for Embedded Systems. Summer ...... [1] A.N.
Sloss, D.Symes, C. Wright: ARM System Developer's Guide, Publisher: Morgan.
EXCEPTION HANDLING. Resources. [1] Object Oriented Programming with C++
(3rd Edition). E Balagurusamy. [2] Teach Yourself C++ (3rd Edition) H Schildt ...
Syntax errors are due to the fact that the syntax of the Java language is not
respected. Let us see ... Lecture Notes for Introduction to Programming. A.A. 2004
/05 ...
Oct 5, 2004 - studied for a long time, distributed exception handling techniques are only ... built with languages without any support for it except system call level .... for Erlang's initial target, namely the software running massive telecoms.
exception handling practices from 32 projects in both Java and ...... java.lang.NullPointerExceptionâ . System.ArgumentOutOfRangeException java.lang.
assignments and projects using systems like RT- ... 4 Client/Server model: All system services and ..... uses the interrupt descriptor table RTM_desc_table[] to.
Oct 20, 2010 - VMware, the VMware logo and design, VMware vSphere, and ... multaneously running one or more application programs, .... A hypervisor could be used during the development of an OS to probe into the machine state,.
Dec 19, 2014 - Empirical Study of of 32 Java Software Packages ..... s.update(); }. 3 ..... ios in which they are indeed relevant and meaning- ful. 3.5 Challenging ...
Stijn Mostinckx**, Jessie Dedecker***,. Elisa Gonzalez Boix, Tom ... criteria, and describe its realisation in the ambient-oriented programming language ..... subsequently propagate a concerted exception [12] which best captures the particular ...
A large part of any software design is the handling of error situations or rare ... component found by examining the dynamic calling sequence leading to the ...
Mar 4, 2008 - and functional languages such as Haskell [3], OCaml. [12], and Standard ML [13] ..... David MacQueen, The Definition of Standard. ML, Revised ...
Each such BOi involves exchange of one or more business documents, and is carried out by a business conversation. We assume that an electronic contract is.
we speak of unwinding the stack to reach the activation record associated with the ... closed dynamic contexts, unwind the stack and restore registers, before ...
significant improvement over other mechanisms like checking return codes, it's far from perfect. In fact, it can be argued that this mechanism is seriously flawed.
languages. This method uses a table of assembly code regions. ... MIPS, IBM Power 1 (PowerPC), HPPA, and Alpha [ SML03]. ...... STORE Reg 1,Mem z13. 52.
form of a set of system calls (e.g. Windows NT exception handling [8]). However, when developing a software sys- tem with an explicit architectural focus, ...
sowanie we wspóÅczesnych jÄzykach programowania. JeÅli chodzi o dziedzinÄ ..... Contrarily to Java in C++ the above signature means that function can throw.
better performance than moving toward an entirely automated process in exception handling. ... The last step is to prepare for admission to the NICU. ..... transitions, starting from an initial workflow state, ending at a final workflow state.
Sep 26, 1988 - tives, scheduling mechan/sms, .... dispatching and ... operating systems [8]include a monolithic, kernel, process hierarchy,functional hierarchy,.
better performance than moving toward an entirely automated process in exception handling. ... The last step is to prepare for admission to the NICU. ..... transitions, starting from an initial workflow state, ending at a final workflow state.
by their hosting organizations [2-4]. ..... correctness of the processes managed by the enactment ..... The exception handling process managed the interactions.
(e-mail: [email protected]). activities. ... pursuing a common organizational goal; and workflow management as the automated coordination of activities between ...
This paper proposes that execution-time control features for interrupt handling ... The execution-time clocks and timers standardized with Ada 2005 allow the ...
such a practice may lead an undergoing software project to a fragile, insecure and ..... under development (hereby we call it context code) containing generic or ...
Programmed Interrupts. - x86 provides INT instruction. - Invokes the interrupt handler for vector N (0-255). - JOS: we u
6.828: Operating System Engineering
Interrupt and Exception Handling on the x86
( Lecture 8 )
x86 Interrupt Vectors - Every Exception/Interrupt type is assigned a number: - its vector - When an interrupt occurs, the vector determines what code is invoked to handle the interrupt. - JOS example: vector 14 → page fault handler vector 32 → clock handler → scheduler 0 2 3 6 11 12 13 14 18 32-255
Divide Error Non-Maskable Interrupt Breakpoint Exception Invalid Opcode Segment Not Present Stack-Segment Fault General Protection Fault Page Fault Machine Check User Defined Interrupts
PIC: Programmable Interrupt Controller (8259A) - Has 16 wires to devices (IRQ0 – IRQ15) - Can be programmed to map IRQ0-15 → vector number - Vector number is signaled over INTR line. - In JOS/lab4: vector ← (IRQ# + OFFSET)
Sources: Software-generated Interrupts Programmed Interrupts - x86 provides INT instruction. - Invokes the interrupt handler for vector N (0-255) - JOS: we use 'INT 0x30' for system calls Software Exceptions - Processor detects an error condition while executing an instruction. - Ex: divl %eax, %eax - Divide by zero if EAX = 0 - Ex: movl %ebx, (%eax) - Page fault or seg violation if EAX is un-mapped virtual address. - Ex: jmp $BAD_JMP - General Protection Fault (jmp'd out of CS)
Enabling / Disabling Interrupts Maskable Hardware Interrupts - Clearing the IF flag inhibits processing hardware interrupts delivered on the INTR line. - Use the STI (set interrupt enable flag) and CLI (clear interrupt enable flag) instructions. - IF affected by: interrupt/task gates, POPF, and IRET. Non-Maskable Interrupt - Invoked by NMI line from PIC. - Always Handled immediately. - Handler for interrupt vector 2 invoked. - No other interrupts can execute until NMI is done.
IDT: Interrupt Descriptor Table IDT: - Table of 256 8-byte entries (similar to the GDT). - In JOS: Each specifies a protected entry-point into the kernel. - Located anywhere in memory.
IDTR register: - Stores current IDT.
lidt instruction: - Loads IDTR with address and size of the IDT. - Takes in a linear address.
IDT Entries
Selector Offset P DPL D [bit 40]
Segment Selector for dest. code segment Offset to procedure entry point Segment Present Flag Descriptor Privilege Level Size of gate: 1 = 32 bits; 0 = 16 bits 0 = interrupt gate; 1 = trap gate
JOS: Interrupts and Address Spaces - JOS approach tries to minimize segmentation usage - so ignore segmentation issues with interrupts Priority Level Switch - CPL is low two bits of CS (11=kernel, 00=user) - Loading new CS for handler can change CPL. - JOS interrupt handlers run with kernel CPL. Addressing Switch - No address space switch when handler invoked. - Paging is not changed. - However in: Kernel VA regions now accessible Stack Switch (User » Kernel) - stack switched to a kernel stack before handler is invoked.
TSS: Task State Segment - Specialized Segment for hardware supported multi-tasking (we don't use this x86 feature)
- TSS Resides in memory - TSS descriptor goes into GDT (size and linear address of the TSS)
- ltr(GD_TSS) loads descriptor - In JOS's TSS: - SS0:ESP0 kernel stack used by interrupt handlers. - All other TSS fields ignored
Exception Entry Mechanism Kernel»Kernel (New State)
SS unchanged ESP (new frame pushed) CS:EIP (from IDT)
JOS Trap Frame (inc/trap.h) struct Trapframe { ... u_int tf_trapno; /* below here defined by x86 hardware */ u_int tf_err; u_int tf_eip; u_short tf_cs; u_int : 0; u_int tf_eflags; /* below only when crossing rings(e.g. user to kernel) */ u_int tf_esp; u_short tf_ss; u_int : 0; };
Exception Return Mechanism iret: interrupt return instruction (top of stack should point to old EIP) Where do we return? - Hardware Interrupts old CS:EIP points past last completed instruction. - Traps (INT 30, ... ) old CS:EIP points past instruction causing exception - Faults (page fault, GPF, ... ) old CS:EIP points to instruction causing exception - Aborts (hardware errors, bad system table vals...) uncertain CS:EIP, serious problems, CPU confused
Example: Page Fault Exceptions Why? x86 Page Translation Mechanism encountered an error translating a linear address into a physical address. Error Code special error code format: CR2 register Linear Address that generated the exception.
Saved CS:EIP Point to the instruction that generated the exception