Lec 3

Post on 17-Feb-2017

80 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

Transcript

Faculty of Computers and Faculty of Computers and InformationInformation

Second Year (Second Semester) Second Year (Second Semester) ____________________________________________________________

Operating Systems IOperating Systems I

( )( )

____________________________________________________________

Dr. Ashraf ElsisiDr. Ashraf Elsisi____________________________________________________

Computer Hardware Basics

• What are the meanings of the following terms?g g

1. 32-bit microprocessor, and 32-bit instructions. p ,2. Opcode, immediate operand, and operand address.3. Local data bus, and local address bus.3. Local data bus, and local address bus.4. Machine cycle, processor cycle, and bus cycle.

It refers to the number of bits that can be processedor transmitted in parallel, or the number of bits usedfor single element in a data format.

Th titi th t ll difi d b thThe entities that are usually modified by thesenumbers are:

•BusBus•Microprocessor•Software •Operating system

Opcode operand and addressing modeOpcode, operand, and addressing mode

A hi i i i d f d d• A machine instruction is made up of an opcode andone or more operands.

• The opcode tells the processor what action top pperform over the following operands.

• The methods for specify the operand(s) for a machinei t ti ll d dd i dinstruction are called addressing modes.

BusA bus is a collection of wires through which datais transmitted from one part of a computer to

thanother.

According to the type of data transmitted through the g yp gbus, we have:

b h b d l d• Data bus: The bus used to carry actual data.•Address bus: The bus transferring informationabout where the data should goabout where the data should go.•Control bus: The physical connections that carrycontrol information between the CPU and otherdevices within the computer.

According to the location of buses, or what kinds ofcomponents they connect, we have:p y ,

Local bus:Local bus:

Another name of system bus, which connects themicroprocessor main memory and all kinds of I/Omicroprocessor, main memory, and all kinds of I/Omodules.

A local bus is also called frontside bus, memory bus, or, y ,host bus.

Backside bus:

A microprocessor bus that connects the CPU to a Level 2cache.

Typically, a backside bus runs at a faster clock speed thanthe frontside

External bus:

A bus that connects a computer to peripheral devices.

S dSpeeds• System clockThere are so many circuits inside a computerThere are so many circuits inside a computer.

To perform a specific action, it is necessary forp p ysome sort of synchronization to occur so thatdifferent parts function and cooperate as expected.

The”conductor” of the PC is the system clock,which brings synchronizationwhich brings synchronization.

A clock is just a signal that alternates between zeroj gand one, back and forth.

The pulses generated by the clockThe pulses generated by the clock

Memory Access time:also known as response time or latency refers to howquickly the memory can respond to a read or write

trequest.

•Memory cycle:Memory cycle: refers to the minimum period between two successive requests. q

For various reasons the time separating two successive i l 0 i i hrequests is not always 0, i.e a memory with a response

time of 80 ns cannot satisfy a request every 80 ns.

Machine cycle:Machine cycle:

also called instruction cycle, the four steps which theCPU i t f h hi lCPU carries out for each machine languageinstruction: fetch, decode, execute, and store.

CachesCachesLevel 1 (Primary) Cache:•The fastest memory on the PC.y•It is in fact, built directly into the processor itself.•This cache is very small, generally from 8 KB to 64KB, but it is extremely fast; it runs at the same speed asthe processor.

If the processor requests information and can find it inthe level 1 cache, that is the best case, because thethe level 1 cache, that is the best case, because theinformation is there immediately and the system doesnot have to wait.

Level 2 (Secondary) Cache:Level 2 (Secondary) Cache:

The level 2 cache is a secondary cache to the level 1 h d i l d li htl lcache, and is larger and slightly slower.

Name some OS’sName some OS s• Linux • PalmOS• Unix• Windows

• TinyOS• WinCEW dows

• Multics• BSDUnix

W C• Spring• 2KBSDUnix

• Mac/Tiger• Vista

2K• ….

• Vista

MulticoreMulticore

• A multicore computer, also known as a chipA multicore computer, also known as a chipmultiprocessor , combines two or moreprocessors (called cores) on a single piece ofp ocesso s (ca ed co es) o a s g e p ece osilicon (called a die).

• Typically, each core consists of all of thet f i d d t hcomponents of an independent processor, such

as registers, ALU, pipeline hardware, andcontrol nit pl s L1 instr ction and data cachescontrol unit, plus L1 instruction and data caches.

• Virtualization– enables a single PC or server to simultaneously run

l i l i l i l i fmultiple operating systems or multiple sessions of a single OS

– a machine can host numerous applications, includinga machine can host numerous applications, including those that run on different operating systems, on a single platformh t ti t t b– host operating system can support a number of virtual machines (VM)

– each has the characteristics of a particular OSeach has the characteristics of a particular OS

Virtual Virtual MemoryMemoryMemory Memory ConceptConcept

Process perspective:Process perspective:

• the machine on which it executes consists of the virtual memory space assigned to the process

• the processor registers it may use• the user-level machine instructions it may execute• OS system calls it may invoke for I/O• ABI defines the machine as seen by a process

Application perspective:Application perspective:

• machine characteristics are specified by high-level language capabilities and OS system library calls

• API defines the machine for an application

Application perspective:Application perspective:

• processes share a file system and other I/O resources

OS perspective:OS perspective:

• system allocates real memory and I/O resources to the processes• ISA provides the interface between the system and machine

Process and System Virtual MachinesProcess and System Virtual MachinesProcess and System Virtual MachinesProcess and System Virtual Machines

Process and System Virtual MachinesProcess and System Virtual MachinesProcess and System Virtual MachinesProcess and System Virtual Machines

•What is the meaning of installation?(Installation program)(Installation program)

•Why we are using installation?Wh t f i ll i ?•What are types of installations?

•What are Device drivers?

•List programs in system tools in Win7?•List programs in system tools in Win7?

Chapter 3 Process Concept and State

Major Requirements of an Operating SSystem

• Interleave the execution of several jobs toInterleave the execution of several jobs tomaximize processor utilization whileproviding reasonable response timep ov d g easonable espo se t e

All t t• Allocate resources to processes

• Support interjobs communication and user creation of processes (jobs)

Process

• Textbook uses the terms job and process almost interchangeablyinterchangeably

• Process a program in execution;• Process – a program in execution; process execution must progress in sequential fashion

• A process includes:– program counterprogram counter – stack– data section

It is programswitches theswitches theprocessor from oneprocess to another

Traces of processes

Two-State Process ModelTwo State Process Model

• Process may be in one of two statesProcess may be in one of two states– Running– Not-runningNot running

Not-Running Process in a QQueue

Process CreationProcess Creation• When a new process, OS builds the data

structures that are used to manage the processstructures that are used to manage the process.• Reasons for process creation

– Submission of a batch job– User logs on– Created to provide a service such as printingp p g– Process creates another process (spawning)

[parent – child]

Process TerminationProcess Termination

• Any computer system must provide a meansAny computer system must provide a means for a process to indicate its completion.

• Batch job issues Halt instruction (call for• Batch job issues Halt instruction (call for termination) U l ff• User logs off

• Quit an application• Error and fault conditions

Reasons for Process TerminationReasons for Process Termination• Normal completion

Ti li it d d• Time limit exceeded• Memory unavailable• Protection error• Protection error

– example write to read-only file• Arithmetic errorArithmetic error• When a process finishes, the operating system

will free the memory space it occupies andy p premove the data structures it allocated tomanage the process.

A fi t t d lA five-state model

• As a process executes, it changes statep , grunning: Instructions are being executed

new: The process is being created

waiting: The process is waiting for some event to occur

ready: The process is waiting to be assigned to a process

terminated: The process has finished executionterminated: The process has finished execution

• RunningRunning• Ready

Bl k dNot running

• Blocked• New• Exit

Using Two QueuesUsing Two Queues

Process swapping and Suspended PProcesses

• Processor is faster than I/O so all processesProcessor is faster than I/O so all processes could be waiting for I/O

• Swap these processes to disk to free up moreSwap these processes to disk to free up more memory

• Blocked state becomes suspend state whenBlocked state becomes suspend state when swapped to disk

• Two new statesTwo new states– Blocked, suspend (in secondary memory)– Ready, suspend in (secondary memory)y, p ( y y)

One Suspend StateOne Suspend State

Two Suspend StatesTwo Suspend States

top related