50
System Software Overall Syllabus Discussion

Overall 23 11_2007_hdp

Embed Size (px)

Citation preview

Page 1: Overall 23 11_2007_hdp

System Software

Overall Syllabus Discussion

Page 2: Overall 23 11_2007_hdp

System Software

•The subject introduced the design and implementation of system software

•System software consists of a variety of programs that support the operation of a computer

•operating system, compiler, assembler, macro processor, loader or linker, debugger, text editor, database management systems, software engineering tools, ….

Page 3: Overall 23 11_2007_hdp

We Discussed On…Machine Architecture

Assemblers

Loaders and Linkers

Editors and Debugging Systems

Macro Processor

Compilers

Lex and Yacc

Page 4: Overall 23 11_2007_hdp

Machine Architecture

This Chapter Gave you…

•System Software & Machine Architecture•The Simplified Instructional Computer SIC and SIC/XE•Traditional (CISC) MachinesComplex Instruction Set Computers•RISC MachinesReduced Instruction Set Computers

Page 5: Overall 23 11_2007_hdp

System Software & Machine Architecture

•Machine Dependent

•Machine Independent

Page 6: Overall 23 11_2007_hdp

SIC Machine Architecture

Space for 2 inch x 2 inch

size Picture

Space for 2 inch x 2 inch

size Picture

•Memory and Registers

•Data Formats

•Instruction Formats

•Addressing Modes

•Instruction Set

•Input and Output

Page 7: Overall 23 11_2007_hdp

SIC/XE Machine Architecture•Memory and Registers

•Data Formats

•Instruction Formats

•Addressing Modes

•Instruction Set

•Input and Output

Page 8: Overall 23 11_2007_hdp

Example Programs SIC

Example Programs (SIC/XE)

Page 9: Overall 23 11_2007_hdp

Different Architectures•Traditional (CISC) machines

- VAX Architecture

- Pentium Pro Architecture

•RISC machines

- UltraSPARC Architecture

- Cray T3E Architecture

Page 10: Overall 23 11_2007_hdp

Traditional (CISC) Machines

•Complex Instruction Set Computers

•Has relatively large and complex instruction set

•Different instruction formats, different lengths, different addressing modes

•Implementation of hardware is complex

• VAX and Intel x86 processors are examples

Page 11: Overall 23 11_2007_hdp

RISC Machines•Reduced Instruction Set Computers

•Intended to simplify the design of processors. Greater reliability, faster execution and less expensive processors

•Standard and fixed instruction length

•Number of machine instructions, instruction formats, and addressing modes relatively small

Page 12: Overall 23 11_2007_hdp

Comparison of these•Memory

•Registers

•Data Formats

•Instruction Formats

•Addressing Modes

•Instruction Set

•Input and Output

Page 13: Overall 23 11_2007_hdp

Assemblers

This Chapter Gave you…

-Assembler Definition- Assembler Features

- Machine dependent and machine independent features

- Design of various assemblers- One-pass- Multi-pass

Page 14: Overall 23 11_2007_hdp

Assemblers• Translating source code written in assembly

language to object code.

• Assigning machine address to symbolic labels.

Page 15: Overall 23 11_2007_hdp

Assembler Design

• Assembler Design can be done in:– Single pass– Two pass

• Single Pass Assembler:– Does everything in single pass– Cannot resolve the forward referencing

Page 16: Overall 23 11_2007_hdp

• Multi pass assembler:– Does the work in two pass– Resolves the forward references

• First pass:– Scans the code– Validates the tokens– Creates a symbol table

• Second Pass:– Solves forward references– Converts the code to the machine code

Page 17: Overall 23 11_2007_hdp

Machine-Dependent Assembler Features

In Machine Specific Instructions we have:Instruction Format and Addressing modes

How to handle program relocation

Page 18: Overall 23 11_2007_hdp

Machine independent features

Literals Symbol defining statementsExpressionsProgram blocksControl Sections and program linkings

Page 19: Overall 23 11_2007_hdp

Types of Assemblers

One-pass assembler

Multi-pass assembler

Two-pass assembler with overlay

Page 20: Overall 23 11_2007_hdp

Loaders and Linkers

This Chapter Gave you…

- Basic Loader Functions - Machine-Dependent Loader Features - Machine-Independent Loader Features - Loader Design Options - Implementation Examples

Page 21: Overall 23 11_2007_hdp

Role of Loader

Source

ProgramTranslator

Object

ProgramLoader

Object program ready for execution

Memory

Translator – Assembler/Compiler

Page 22: Overall 23 11_2007_hdp

Role of Loader

Source

ProgramAssembler

Object

ProgramLoader

Object program ready for execution

Memory

Page 23: Overall 23 11_2007_hdp

Role of Loader and Linker

Source

ProgramAssembler

Object

ProgramLinker

Executable Code

Loader

Object program ready for execution

Memory

Page 24: Overall 23 11_2007_hdp

Role of Absolute Loader

Object

Program

AbsoluteLoader

Object program ready for execution

Memory

1000

2000

Page 25: Overall 23 11_2007_hdp

Machine-Dependent Loader Features

Absolute Loader – Simple and efficient

Disadvantage is – programmer has to specify the starting address

One program to run – no problem – not for several

Difficult to use subroutine libraries efficiently

Page 26: Overall 23 11_2007_hdp

Program Linking• Goal - Resolve the problems with EXTREF and EXTDEF from different control sections (Sec 2.3.5)• Example - Program in Fig. 3.8 and object code in Fig. 3.9

• Use modification records for both relocation and linking

- address constant - external reference

Page 27: Overall 23 11_2007_hdp

Machine-independent Loader Features

Features that are not directly related to machine architecture and design

- Automatic Library Search

- Loader Options

Page 28: Overall 23 11_2007_hdp

Linking Loaders

Library

Object Program(s)

Linking loader

Memory

Processing of an Object program using LL

The source program is first assembled or compiled, producing an object program. A linking loader performs all linking and loading operations, and loads the program into memory for execution

Page 29: Overall 23 11_2007_hdp

Linkage Editors

Library

Object Program(s)

Linkage editor

MemoryProcessing of an Object program using LE

Linked program

Relocating loader

Page 30: Overall 23 11_2007_hdp

Implementation examples…

•Brief description of loaders and linkers for actual computers

•They are

MS-DOS Linker - Pentium architecture

SunOS Linkers - SPARC architecture

Cray MPP Linkers – T3E architecture

Page 31: Overall 23 11_2007_hdp

Editors and Debugging Systems

This Chapter Gave you…

- Text editors- Interactive Debugging Systems

Page 32: Overall 23 11_2007_hdp

Text Editors

An Interactive text editor has become an important part of almost any computing environment

Text editor acts as a primary interface to the computer for all type of “knowledge workers” as they compose, organize, study, and manipulate computer-based information

Page 33: Overall 23 11_2007_hdp

Editing component

Traveling component

Viewing component

Command language processor

Editing buffer

Editing filter

Viewing filterViewing

buffer

Main memory

File system

Display component

Output devices

input

Typical editor structure

Page 34: Overall 23 11_2007_hdp

Editors function in three basic types of computing environments:

Time sharing

Stand-alone

Distributed

Each type of environment imposes some constraints on the design of an editor

Page 35: Overall 23 11_2007_hdp

Interactive Debugging Systems

An interactive debugging system provides programmers with facilities that aid in testing and debugging of programs

Many such systems are available during these days

Our discussion was broad in scope, giving the overview of interactive debugging systems – not specific to any particular existing system

Page 36: Overall 23 11_2007_hdp

We Discussed

Important functions and capabilities of IDS

Relationship of IDS to other parts of the system

The nature of the user interface for IDS

Page 37: Overall 23 11_2007_hdp

Macro Processor

This Chapter Gave you…- Basic Macro Processor Functions- Algorithms- Nested macros-Comparison of different macro design- Machine-Independent macro features- Implementation of conditional macros

Page 38: Overall 23 11_2007_hdp

Macros•A macro instruction (Macro) is a notational convenience for the programmer

•Allows the programmer to write short hand programs (modular programming).

•The macro processor replaces each macro instruction with its equivalent block of instructions.•The macro processor is not concerned with the meaning of the involved statements during expansion.•The design of the macro processor is generally machine independent.

Page 39: Overall 23 11_2007_hdp

Macro Expansion

Macro Invocation

Two-Pass Macro ProcessorDesign of two-pass macro processor

Pass 1: Process all macro definitions

Pass 2: Expand all macro invocation statements

Page 40: Overall 23 11_2007_hdp

One-Pass Macro Processor•A one-pass macro processor that alternate between macro definition and macro expansion in a recursive way is able to handle recursive macro definition

Data Structure for One-Pass Macro Processor

- DEFTAB (definition table)

- NAMTAB

- ARGTAB

Page 41: Overall 23 11_2007_hdp

-Machine-Independent Macro Processor Features

-Concatenation of Macro Parameters

-Generating Unique Labels

-Macro-time Looping

-Conditional Macro expansion

-Keyword macro parameters

-Recursive Macros-Line-by-Line Macros-Integrated Macros

Page 42: Overall 23 11_2007_hdp

Compilers Introduction

Basic Compiler Function

Lexical Analysis,

Syntactic Analysis

Operator-Precedence Parsing

Shift Reduce Parsing

Recusive Descent Parsing

Page 43: Overall 23 11_2007_hdp

Phases of Compilers

Target Program

Lexical analysis

Source Program

Syntax analysis

Intermediate Code generation

Code Optimization

Code Generation

Table Management

Error Handling

Page 44: Overall 23 11_2007_hdp

Code Generation

Machine - Dependent Code Optimization

Machine Independent Compiler Features

Machine - Independent Code Optimization

Page 45: Overall 23 11_2007_hdp

MACHINE - DEPENDENT CODE OPTIMIZATION  There are several different possibilities for performing machine-dependent code optimization .

Assignment and use of registers

Divide the problem into basic blocks.

Rearrangement of machine instruction to improve efficiency of execution

Page 46: Overall 23 11_2007_hdp

•Machine Independent Compiler Features•Storage Allocation •Block Structured Languages •Compiler Design Options – Division Into Passes •Interpreters •P-Code Compilers •Compiler-Compilers

Page 47: Overall 23 11_2007_hdp

Lex and Yacc

-LEX is a program generator designed for lexical processing of character input streams.

-Yacc provides a general tool for describing the input to a computer program

Page 48: Overall 23 11_2007_hdp

LEX (LEXical Analyzer Generator)

Features

Creating a Lexical Analyzer with LEX

LEX Source

LEX Regular Expressions

Functions

Page 49: Overall 23 11_2007_hdp

YACC –Yet Another Compiler-Compiler

YACC Basic Specification

How does the Parser Works?

Ambiguity and Conflicts

YACC Programs

simple expression with +, - , /, and *.

recognize an valid variable.

Lex and Yacc

Page 50: Overall 23 11_2007_hdp

Notes for all the topics are available @

http://forum.vtu.ac.in