Definition of Terms Introduction Trap Are a Mechanism To

Total Page:16

File Type:pdf, Size:1020Kb

Definition of Terms Introduction Trap Are a Mechanism To Eidgenössische Definition of Terms Technische Hochschule Zürich Interrupt: Asynchronous interruption of the instruction flow Programming in Systems Caused by external event! (37-023) Hit program execution in Programming in Assembler «between» 2 Instructions Basics of Operating Systems Exception: Unexpected event during Models of Computer Architecture program execution (division by zero, page fault) Lecturer today: Prof. Thomas M. Stricker Hits «during» an instruction Text-/Reference-Books: Trap: Software generated Inter- R.P.Paul: SPARC Architecture... and C rupt Sun SPARC V8 Manual and K&R C Reference Caused by an exception or by an explicit trap instruction Topics of Today: (e.g. for a system call) • Traps, Exceptions and Supervisor Mode Supervisor Privileged execution mode • SPARC V8 Trap Model Mode: in contrast to User Mode • Traps in tkisem System Calls, Interrupt-, • Register Window Trap-Handlers Exception- and Traphandler execute in supervisor mode. 9/14.1.02 - 1 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 2 37-023 Systemprogrammierung © Alonso/Stricker Introduction Trap are a mechanism to... Standard library in C (libc.a) provides ... avoid programming mistakes with sys- two different kind of functions: tem resources. • pure library functions ... share common system resources in a fair way under OS control. • self contained code (sin, printf...) ... prevent access to protected memory • «visible» execution in user mode. segments. • examination in single-step mode of ... catch Instructions which would lead to the debugger possible. error conditions and inconsistent sys- • glue code to system calls tem state (z.B. Division by 0, Window- (read, write, open, close...) Overflow). • «invisible» execution ➜ Two modes of execution: Supervisor and User Mode • call some code in the operating system (Trap) ➜ Traps: • execute in supervisor mode Mechanism to get into/return from supervisor mode. • very hard to examine (kernel debugger or simulator required) Mechanism to jump into OS code and to handle exceptions and Why are there two categories? interrupts. 9/14.1.02 - 3 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 4 37-023 Systemprogrammierung © Alonso/Stricker User and Supervisor Mode Alternate Address Space Instr. User Mode: • address space identifiers (ASI): • Access only to the text- and data- ASI Memory Segment segment of your own process. 0x08 User Text • Limited instruction set - only regular 0x09 Supervisor Text instructions. 0x0A User Data 0x0B Supervisor Data • Limited access to system status registers. ➜normal ld and st affect ASI 0x0A or 0x0B depending on mode Supervisor Mode: • load/store alternate space instructions: • Unlimited access to memory segments: • load and store to alternate memory Instruction Meaning (AS=alternate space) ldsba/stba ld/st signed byte from AS • load and store to I/O devices ldsha/stha ld/st signed halfword from AS • load and store to code segments lduba/stba ld/st unsigned byte from AS (needed by operating system). lduha/stha ld/st unsigned halfword from AS • system tables lda/sta ld/st from AS • Privileged Instructions ldda/stda ld/st double word from AS • access to several status registers ➜lda [address]asi, rd • access to I/O-devices (if not mem.) lda [0x0800]0x09, %l3 9/14.1.02 - 5 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 6 37-023 Systemprogrammierung © Alonso/Stricker Trap Trap Types • Branch to operating system code to • precise traps (synchronous traps): carry out certain functions. Trap/exception is raised before the cor- responding instruction has cause any • Program execution transferred from effect to the system state. user code to systems code. • deferred trap (asynchronous traps): • Trap handler runs in supervisor mode. Trap/exception is raised later, after the • State of the machine (CPU) will be save «trapping» instruction has had any and restore upon return to user code effects - eventually even many cycles (return from trap instruction, rett) later, but still before the next instruction had any effects. • Operating system provides different rou- tines to handle the different trap instruc- • interrupting trap tions/conditions Trap/exception is raised by an (external) (trap handler) interrupts or by an exception, of an instruction that is executed earlier. • txx is a nondelayed branch: CWP-- • Interrupt requests can be handled like traps although they are caused by exter- nal events. 9/14.1.02 - 7 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 8 37-023 Systemprogrammierung © Alonso/Stricker Status Registers of the Processor Processor State Register (PSR) icc PIL S CWP ET EF PS • Y-Reg. for Multiplication and Division: 31 23 20 1211 87654 0 ➜ read and write with rdy, wry in user mode. icc: Condition Code Flags • PC and nPC: EF: indicates FP-Coprocessor available. ➜ read and write is implicit (jmpl, ret...) in user mode. PIL: Level of Interrupts that will be cur- rently be accepted by processor • PSR Processor State Register: ➜ read and write only in the S: Supervisor mode flag supervisor mode (%psr, rdpsr, PS: Bit to save mode before the execu- wrpsr) tion of the last trap. • WIM Window Invalid Mask Register: ET: enable trap: ET == 1 ➜ read and write only in the Held to zero during trap, ET == 0 supervisor mode (%wim, rdwim, wrwim) CWP: Current Window Pointer Bits 31-23 contain the imple- • TBR Trap Base Register: ➜ mentation and version of the read and write only in the CPU (hard wired) supervisor mode (%tbr, rdtbr, wrtbr) Bits 19-14 are always 0 9/14.1.02 - 9 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 10 37-023 Systemprogrammierung © Alonso/Stricker Window Invalid Mask (WIM) Trap Base Register (TBR) • k Flags for the representation of the k TBA tt zero register sets implemented (2≤k≤32) 31 1211 4 3 0 • WIM[n] indicates the status of the regis- TBA: trap base address, upper part of the ter sets n: base address of the trap table. 1: Register set has invalid contents tt: trap type, 256 possible traps, offset 0: Register set has valid contents into the trap table. • Test upon save, restore oder zero:last four bits are always zero. rett against WIM[CWP]: • WIM[CWP]==1 • TBR puts the bits TBA and tt together save: ⇒ Window into a destination address for the CALL. Overflow • The zero-bits make the subsequent trap restore, ⇒ Window entry points spaced 16 bytes apart. rett: Underflow Table can hold the first 4 instructions of • WIM[CWP]==0 ⇒ Window valid the trap handlers: • Flags of unimplemented windows read handler_vect: as 0es and can not be written. set handler, %l3 jmpl %l3, %r0 • wrwim with all ones followed by rdwim indicates the implemented registers with nop a one. handler: ... 9/14.1.02 - 11 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 12 37-023 Systemprogrammierung © Alonso/Stricker FP Processor Status Reg. (FSR) Priorities of Traps- and Interrupts RD TEM ftt fcc cexc • 0x80 - 0xFF 3130 27 23 16 14 1110 4 0 Software- Traps RD: Field specifies rounding mode: 0: Nearest Number 2: +∞ • 0x00 - 0x7F 1: towards 0 3: -∞ Hardware- Traps fcc: floating point cond. code, is set by (partially FP-compare instructions. used in cur- cexc:current exception field, set after rent impl- every FP-instruction (invalid op, mentations) overflow, underflow, division by zero, result inexact) TEM: trap enable mask, switches FP- traps on and off. After each com- pleted FP-instruction TEM OR cexc will be examined: TEM OR cexc != 0 ⇒ FP-Trap ftt: floating point trap type (no trap, trap in cexc, unfinished, unimplemented, invalid register) 9/14.1.02 - 13 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 14 37-023 Systemprogrammierung © Alonso/Stricker Priorities of Traps- and Interrupts Steps executed with a trap •If ET=1, traps will be handler according If ET == 1: to priorities in the table before. 1. ET = 0 • If ET=0, all interrupts are ignored and disable traps any further trap will reset the machine. 2. PS = S • Priority decides about the order in save current execution mode which concurrent interrupt/traps are 3. S = 1 handled. switch to supervisor mode • Interrupts have smaller priorities than 4. CWP = CWP-1 mod NWINDOWS exceptions, i.e. they have higher trap advance register window without numbers (17-31) test for window overflow • Interrupts on IRL 1 (Interrupt Request 5. %l1(%r17) = PC; %l2(%r18) = nPC Level) have smallest priority save trapped program counters • Only IRL > PIL (processor interrupt 6. tt = trap_type level) will be handled: write tt field ➜ Mechanism to mask-out interrupts 7. PC = TBR; nPC = TBR+4 ➜ IRL 15 is unmaskable transfer control into trap table (Reset Trap: PC = 0; nPC = 4) • It is expected, that Interrupts with lower priority will stick until they are handled. (if not they can be missed) 9/14.1.02 - 15 37-023 Systemprogrammierung © Alonso/Stricker 9/14.1.02 - 16 37-023 Systemprogrammierung © Alonso/Stricker Steps executed with a trap Return from a trap handler Optional: rett address • %l0(%r16) = %psr 1. CWP = CWP+1 mod NWINDOWS save PSR if trap handler changes it advance register window temporarily and it must be restored. 2. nPC = address • If the local register %l3-%l7 are not initiate delayed transfer to address sufficient to program the trap handler of return from trap instruction and WIM[CWP]==1 the register window 3. S = PS must be saved explicitly/manually. restore previous mode of execution • if trap is an interrupt: PSR must be 4. ET = 1 saved, PIL set, ET=1 and the Window re-enable traps must be saved in any case (➜ traps) Notes: If ET == 0: • eventually restore PSR, PIL, Regis- ter Window • Interrupts will be ignored. • Instruction before rett must be • Further traps/exception conditions will jmpl, otherwise the instruction result in a reset of the machine. after rett will be read from the • Deferred traps, which are caused by an supervisor memory while the exe- instruction that started execution still cution is already in used mode.
Recommended publications
  • Tricore™ Tricore™ V1.6 Microcontrollers User Manual
    TriCore™ 32-bit TriCore™ V1.6 Core Architecture 32-bit Unified Processor Core User Manual (Volume 1) V1.0, 2012-05 Microcontrollers Edition 2012-05 Published by Infineon Technologies AG 81726 Munich, Germany © 2012 Infineon Technologies AG All Rights Reserved. Legal Disclaimer The information given in this document shall in no event be regarded as a guarantee of conditions or characteristics. With respect to any examples or hints given herein, any typical values stated herein and/or any information regarding the application of the device, Infineon Technologies hereby disclaims any and all warranties and liabilities of any kind, including without limitation, warranties of non-infringement of intellectual property rights of any third party. Information For further information on technology, delivery terms and conditions and prices, please contact the nearest Infineon Technologies Office (www.infineon.com). Warnings Due to technical requirements, components may contain dangerous substances. For information on the types in question, please contact the nearest Infineon Technologies Office. Infineon Technologies components may be used in life-support devices or systems only with the express written approval of Infineon Technologies, if a failure of such components can reasonably be expected to cause the failure of that life-support device or system or to affect the safety or effectiveness of that device or system. Life support devices or systems are intended to be implanted in the human body or to support and/or maintain and sustain and/or protect human life. If they fail, it is reasonable to assume that the health of the user or other persons may be endangered.
    [Show full text]
  • PRE LIM INARY KDII-D Processor Manual (PDP-Ll/04)
    PRE LIM I N A R Y KDII-D Processor Manual (PDP-ll/04) The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this manual. Copyright C 1975 by Digital Equipment Corporation Written by PDP-II Engineering PREFACE OVE~ALt DESCRIPTION 3 8 0 INsT~UCTION SET 3~1 Introduction 1~2 Addressing ModIs 3.3 Instruction Timing l@4 In~truet1on Dtlcriptlonl le!5 Dlffer~ncei a,tween KOlle and KOllS ]0 6 Programming Diftereneel B~twlen pepita ).7 SUI L~tency Tim@1 CPu OPERlTING 5PECIFICATID~S 5 e 0 DETAILED HARDWARE DESC~ltTION 5.1 IntrOduction 5 m2 Data path Circuitry 5.2g1 General D~serlpt1on 5.2,,2 ALU 5,2 .. 3 Scratch Pad Mtmory 5.2,.3.1 Scratch P~d Circuitry 5.2.3.2 SCrateh P~d Addr~11 MUltlplex.r 5.2.3.3 SCrateh Pad Regilter 5 0 2 .. 4 B J:H'!qilil ter 5.2 .. 4.1 B ReQister CircuItry 5.2 .. 4.2 8 L~G MUltl~lex@r 5,2.5 AMUX 5.2.6 Pfoeellof statuI Word (PSW) 5.3 Con<Htion COd@i 5.3.1 G~neral De~erl~tlon 5.3.2 Carry and overflow Decode 5.3.3 Ayte Multiplexing 5.4 UNIBUS Addf@$5 and Data Interfaces S.4 g 1 U~IBUS Dr1v~rl and ~lee1Vtrl 5.4@2 Bus Addr~s~ Generation 5 8 4111 Internal Addrf$$ D@coder 5 0 4,.4 Bus Data Line Interface S.5 Instruet10n DeCoding 5.5,,1 General De~er1pt1nn 5;5.2 Instruction Re91lt~r 5.5,,3 Instruetlon Decoder 5.5.3 0 1 Doubl~ O~erand InltrYetions 5.5.3.2 Single Operand Inltruetlons 5,5.3.3 Branch In$truetionl 5 8 5.3 6 4 Op~rate rn~truet1ons 5.6 Auil11ary ALU Control 5.6.1 G~ntral Delcrlptlon 5.6.2 COntrol Circuitry 5.6.2.1 Double Op@rand Instructions 5.6.2.2 Singl@ nDef~nd Instruet10ns PaQe 3 5.7 Data Transfer Control 5,7,1 General Descr1ption 5,7,2 Control CIrcuItry 5,7,2,1 Procelsor Cloek Inhibit 5,7,2.2 UNIBUS Synchronization 5,7.2,3 BUs Control 5.7,2.4 MSyN/SSYN Timeout 5,7.2.5 Bus Error.
    [Show full text]
  • Debugging a Program
    Debugging a Program SunPro A Sun Microsystems, Inc. Business 2550 Garcia Avenue Mountain View, CA 94043 U.S.A. Part No: 801-5106-10 Revision A December 1993 1993 Sun Microsystems, Inc. 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. All rights reserved. This product and related documentation are protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or related documentation may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Portions of this product may be derived from the UNIX® and Berkeley 4.3 BSD systems, licensed from UNIX System Laboratories, Inc. and the University of California, respectively. Third-party font software in this product is protected by copyright and licensed from Sun’s Font Suppliers. RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the United States Government is subject to the restrictions set forth in DFARS 252.227-7013 (c)(1)(ii) and FAR 52.227-19. The product described in this manual may be protected by one or more U.S. patents, foreign patents, or pending applications. TRADEMARKS Sun, Sun Microsystems, the Sun logo, SunPro, SunPro logo, Sun-4, SunOS, Solaris, ONC, OpenWindows, ToolTalk, AnswerBook, and Magnify Help are trademarks or registered trademarks of Sun Microsystems, Inc. UNIX and OPEN LOOK are registered trademarks of UNIX System Laboratories, Inc., a wholly owned subsidiary of Novell, Inc. All other product names mentioned herein are the trademarks of their respective owners. All SPARC trademarks, including the SCD Compliant Logo, are trademarks or registered trademarks of SPARC International, Inc.
    [Show full text]
  • Exceptions and Processes
    Exceptions and Processes! Jennifer Rexford! The material for this lecture is drawn from! Computer Systems: A Programmerʼs Perspective (Bryant & O"Hallaron) Chapter 8! 1 Goals of this Lecture! •#Help you learn about:! •# Exceptions! •# The process concept! … and thereby…! •# How operating systems work! •# How applications interact with OS and hardware! The process concept is one of the most important concepts in systems programming! 2 Context of this Lecture! Second half of the course! Previously! Starting Now! C Language! Application Program! language! service! levels! Assembly Language! levels! Operating System! tour! tour! Machine Language! Hardware! Application programs, OS,! and hardware interact! via exceptions! 3 Motivation! Question:! •# How does a program get input from the keyboard?! •# How does a program get data from a (slow) disk?! Question:! •# Executing program thinks it has exclusive control of CPU! •# But multiple programs share one CPU (or a few CPUs)! •# How is that illusion implemented?! Question:! •# Executing program thinks it has exclusive use of memory! •# But multiple programs must share one memory! •# How is that illusion implemented?! Answers: Exceptions…! 4 Exceptions! •# Exception! •# An abrupt change in control flow in response to a change in processor state! •# Examples:! •# Application program:! •# Requests I/O! •# Requests more heap memory! •# Attempts integer division by 0! •# Attempts to access privileged memory! Synchronous! •# Accesses variable that is not$ in real memory (see upcoming $ “Virtual Memory” lecture)! •# User presses key on keyboard! Asynchronous! •# Disk controller finishes reading data! 5 Exceptions Note! •# Note:! ! !Exceptions in OS % exceptions in Java! Implemented using! try/catch! and throw statements! 6 Exceptional Control Flow! Application! Exception handler! program! in operating system! exception! exception! processing! exception! return! (optional)! 7 Exceptions vs.
    [Show full text]
  • Providing Memory Performance Feedback in Modern Processors
    Informing Memory Operations: Providing Memory Performance Feedback in Modern Processors Mark Horowitz Margaret Martonosi Todd C. Mowry Michael D. Smith Computer Systems Department of Department of Electrical Division of Laboratory Electrical Engineering and Computer Engineering Applied Sciences Stanford University Princeton University University of Toronto Harvard University [email protected] [email protected] [email protected] [email protected] Abstract other purely hardware-based mechanisms (e.g., stream buffers [Jou90]) are complete solutions. Memory latency is an important bottleneck in system performance that cannot be adequately solved by hardware alone. Several prom- In addition to hardware mechanisms, a number of promising soft- ising software techniques have been shown to address this problem ware techniques have been proposed to avoid or tolerate memory successfully in specific situations. However, the generality of these latency. These software techniques have resorted to a variety of software approaches has been limited because current architectures different approaches for gathering information and reasoning about do not provide a fine-grained, low-overhead mechanism for memory performance. Compiler-based techniques, such as cache observing and reacting to memory behavior directly. To fill this blocking [AKL79,GJMS87,WL91] and prefetching [MLG92, need, we propose a new class of memory operations called inform- Por89] use static program analysis to predict which references are ing memory operations, which essentially consist of a memory likely to suffer misses. Memory performance tools have relied on operation combined (either implicitly or explicitly) with a condi- sampling or simulation-based approaches to gather memory statis- tional branch-and-link operation that is taken only if the reference tics [CMM+88,DBKF90,GH93,LW94,MGA95].
    [Show full text]
  • Chapter 3 Protected-Mode Memory Management
    CHAPTER 3 PROTECTED-MODE MEMORY MANAGEMENT This chapter describes the Intel 64 and IA-32 architecture’s protected-mode memory management facilities, including the physical memory requirements, segmentation mechanism, and paging mechanism. See also: Chapter 5, “Protection” (for a description of the processor’s protection mechanism) and Chapter 20, “8086 Emulation” (for a description of memory addressing protection in real-address and virtual-8086 modes). 3.1 MEMORY MANAGEMENT OVERVIEW The memory management facilities of the IA-32 architecture are divided into two parts: segmentation and paging. Segmentation provides a mechanism of isolating individual code, data, and stack modules so that multiple programs (or tasks) can run on the same processor without interfering with one another. Paging provides a mech- anism for implementing a conventional demand-paged, virtual-memory system where sections of a program’s execution environment are mapped into physical memory as needed. Paging can also be used to provide isolation between multiple tasks. When operating in protected mode, some form of segmentation must be used. There is no mode bit to disable segmentation. The use of paging, however, is optional. These two mechanisms (segmentation and paging) can be configured to support simple single-program (or single- task) systems, multitasking systems, or multiple-processor systems that used shared memory. As shown in Figure 3-1, segmentation provides a mechanism for dividing the processor’s addressable memory space (called the linear address space) into smaller protected address spaces called segments. Segments can be used to hold the code, data, and stack for a program or to hold system data structures (such as a TSS or LDT).
    [Show full text]
  • Low-Overhead Call Path Profiling of Unmodified, Optimized Code
    Low-Overhead Call Path Profiling of Unmodified, Optimized Code Nathan Froyd John Mellor-Crummey Rob Fowler [email protected] [email protected] [email protected] Rice University, Houston, TX ABSTRACT tiple places. To understand the performance implications of Call path profiling associates resource consumption with data copying in such applications, it can thus be necessary the calling context in which resources were consumed. We to attribute costs at all of these levels. To do this in general describe the design and implementation of a low-overhead requires an efficient data collection mechanism that tracks call path profiler based on stack sampling. The profiler costs along entire call paths. Since understanding and im- uses a novel sample-driven strategy for collecting frequency proving the on-node performance of MPI programs is a key counts for call graph edges without instrumenting every pro- factor in overall performance, context-sensitive profiling is cedure’s code to count them. The data structures and al- of particular importance for large-scale parallel systems. gorithms used are efficient enough to construct the com- An ideal profiler should have the following properties. plete calling context tree exposed during sampling. The First, it should collect performance measurements with low, profiler leverages information recorded by compilers for de- controllable overhead; this makes it feasible to collect pro- bugging or exception handling to record call path profiles file information during production runs as well as during even for highly-optimized code. We describe an implemen- development. Second, it should identify differences in the tation for the Tru64/Alpha platform.
    [Show full text]
  • Segmentation, Protected Mode
    Copyright Notice CS 410/510 • These slides are distributed under the Creative Commons Languages & Low-Level Programming Attribution 3.0 License • You are free: Mark P Jones • to share—to copy, distribute and transmit the work Portland State University • to remix—to adapt the work • under the following conditions: Fall 2018 • Attribution: You must attribute the work (but not in any way that suggests that the author endorses you or your use of the work) as follows: “Courtesy of Mark P. Jones, Portland State University” Week 3: Segmentation, Protected Mode, Interrupts, and Exceptions The complete license text can be found at http://creativecommons.org/licenses/by/3.0/legalcode !1 2 General theme for the next two weeks Diagrams and Code • In a complex system … • There are a lot of diagrams on these slides • Many of these are taken directly from the “Intel® 64 and App App App App App IA-32 Architectures Software Developer’s Manual”, Operating System Operating System particularly Volume 3 Microkernel • There is a link to the full pdf file in the Reference section Hardware • There is also a lot of code on these slides • Remember that you can study these more carefully later if • Question: how can we protect individual programs from you need to! interference with themselves, or with one another, either directly or by subverting lower layers? • General approach: leverage programmable hardware features! 3 4 Taking stock: Code samples ... so far vram video RAM simulation vram.tar.gz hello boot and say hello on bare metal, via hello.tar.gz GRUB simpleio a simple library for video RAM I/O Segmentation bootinfo display basic boot information from (or: where do “seg faults” come from?) GRUB baremetal.tar.gz mimg memory image bootloader & make tool example-mimg display basic boot information from mimgload example-gdt basic demo using protected mode segments (via a Global Descriptor Table) prot.tar.gz example-idt context switching to user mode (via an Interrupt Descriptor Table) 5 6 BASIC EXECUTION ENVIRONMENT • General-purpose registers.
    [Show full text]
  • Using As the Gnu Assembler
    Using as The gnu Assembler Version 2.14.90.0.7 The Free Software Foundation Inc. thanks The Nice Computer Company of Australia for loaning Dean Elsner to write the first (Vax) version of as for Project gnu. The proprietors, management and staff of TNCCA thank FSF for distracting the boss while they got some work done. Dean Elsner, Jay Fenlason & friends Using as Edited by Cygnus Support Copyright c 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled \GNU Free Documentation License". Chapter 1: Overview 1 1 Overview This manual is a user guide to the gnu assembler as. Here is a brief summary of how to invoke as. For details, see Chapter 2 [Command-Line Options], page 15. as [-a[cdhlns][=file]] [-D][{defsym sym=val] [-f][{gstabs][{gstabs+] [{gdwarf2][{help] [-I dir][-J][-K][-L] [{listing-lhs-width=NUM][{listing-lhs-width2=NUM] [{listing-rhs-width=NUM][{listing-cont-lines=NUM] [{keep-locals][-o objfile][-R][{statistics][-v] [-version][{version][-W][{warn][{fatal-warnings] [-w][-x][-Z][{target-help][target-options] [{|files ...] Target Alpha options: [-mcpu] [-mdebug | -no-mdebug] [-relax][-g][-Gsize] [-F][-32addr] Target ARC options: [-marc[5|6|7|8]] [-EB|-EL] Target ARM
    [Show full text]
  • Downloaded for Free From
    The Design of the NetBSD I/O Subsystems SungWon Chung Pusan National University 2 This book is dedicated to the open-source code developers in the NetBSD community. The original copy of this publication is available in an electronic form and it can be downloaded for free from http://arXiv.org. Copyright (c) 2002 by SungWon Chung. For non-commercial and personal use, this publication may be reproduced, stored in a retrieval system, or transmitted in any form by any means, electronic, mechanical, photocopying, recording or otherwise. For commercial use, no part of this publication can be reproduced by any means without the prior written permission of the author. NetBSD is the registered trademark of The NetBSD Foundation, Inc. Contents Preface 14 I Basics to Learn Filesystem 15 1 Welcome to the World of Kernel ! 17 1.1 How Does a System Call Dive into Kernel from User Program ? . 17 1.1.1 Example: write system call . 17 1.1.2 Ultra SPARC 0x7c CPU Trap . 18 1.1.3 Jump to the File Descriptor Layer . 24 1.1.4 Arriving at Virtual Filesystem Operations . 28 1.2 General Data Structures in Kernel such as List, Hash, Queue, ... 30 1.2.1 Linked-Lists . 30 1.2.2 Tail Queues . 34 1.2.3 Hash . 38 1.3 Waiting and Sleeping in Kernel . 39 1.4 Kernel Lock Manager . 39 1.4.1 simplelock and lock . 39 1.4.2 Simplelock Interfaces . 40 1.4.3 Lock Interfaces . 40 1.5 Kernel Memory Allocation . 43 1.6 Resource Pool Manager .
    [Show full text]
  • Error Messages
    Error Messages TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents ...................................................................................................................... Misc ................................................................................................................................................ Error Messages .......................................................................................................................... 1 General Error Messages ......................................................................................................... 2 General Command Parameter Parser .................................................................................... 18 Debugger and In-Circuit Emulator ......................................................................................... 48 Error Messages Related to the Peripheral View (PER) 48 Error Messages Related to FLASH Programming 50 Error Messages Related to Co-Processor Debugging 54 Error Messages Related to HiPerLoad 55 Error Messages Related to FDX 56 Error Messages Related to Terminal Function 57 Error Messages Related to RTOS Support 58 Error Messages Related to Differential Download 60 Error Messages Related to Breakpoints 61 Error Messages Related to Debugging 71 Error Messages Related to Debug Hardware and Software 81 Error Messages Related to Analyzer/Trace 84 Error Messages Related to MCDS 86 Error Messages Related to Trace Testfocus/Autofocus 87 Error Messages Related to APU API 90 HLL Expression
    [Show full text]
  • Exception Handling in the 68000, Part 1
    Exception handling in the 68000, Part 1 Motorola's 68000 is an example of a microprocessor with sophisticated exception handling facilities. In the first of two tutorial papers, Alan Clements presents an overview of the 68000's exceptions and interrupts status of the peripheral, and the cycle continues until a The paper gives an overview of the implementation of key is pressed. The following program shows how this is exception handling in the 68000 microprocessor, starting done. with an introductory discussion of interrupts. The different types of interrupt are outlined. This is followed by a KEY _STATUS EQU $F00000 (Lo{ation of input statu_,, discussion of privileged states on the 68000. The types of word) KEY_ VALUE EQU KEY__STATUS-e ,: (Location of input data exception supported by the 68000 are described, as are the w~rd) use and maintenance of the exception vector table. Finally, the response of the 68000 CPU to an exception is covered. LEA.L KEY~TATUS, AO {AO points to Key status} LEA.L KEY_VALUE, A1 (AI points to Key value) TEST LOOP BTST.B #0, (AO) (Test status, ie least microprocessors exceptions interrupts 68000 significant bit) BEQ lESt __LOOP (Repeat while l{odst qgnificant bit clear) MOVE.B {A1 ), I) ~ (Read the data) This two-part paper examines how the 68000 16-bit microprocessor implements exception handling. The two instructions BTST.B #0, (A0} and BEQ TEST_LOOP Most of the first- and second-generation 8-bit micro- constitute a 'polling loop', which is executed until the processors had rather primitive exception handling least significant bit of the status word is true, signifying that facilities consisting of little more than one ortwo interrupt the data from the keyboard is valid.
    [Show full text]