TB2 Flashcards

1
Q

Computer Architecture

A

Those attributes that have a direct impact on the logical execution of a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Computer Organisation

A

Refer to operational units and their interconnections that realise the architectural operation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Computer Structure

A

The way in which the components are interrelated.

. Central Processing Unit (CPU)
. Main Memory
. I/O
. System Interconnection (Buses)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Computer Function

A

The operation of each individual component as part of the structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Computer Functions

A

Data Processing

Data Storage
. Short-term
. Long-term

Data Movement
. Input/Output (I/O)
. Peripheral
. Data Communication

Control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Central Processing Unit (CPU)

A

Control Unit
Arithmetic & Logic Unit (ALU)
Registers
CPU interconnections

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The First Generation : Vacuum Tubes

A

ENIAC (Electronic Numerical Integrator And Computer)
World War II
University of Pennsylvania
30 tons, 1500 square feet, 18000 vacuum tubes, 5000 additions per second
Decimal (not binary)
Manual programming

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Von Neumann Machine

A

Stored-program concept

IAS (Institute of Advanced Study) computer

1946 - 1952

Binary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

IAS Computer

A

Stored-program concept

Main three key concepts:
. Single read–write memory (Data and Instructions)
. Addressable Memory
. Execution occurs in a sequential fashion (unless explicitly modified) from one instruction to the next.

Structure:
. Main Memory (data & instructions)
. Arithmetic Logic Unit (operating binary numbers)
. Control Unit (interprets the instructions)
. Input/Output

Memory structure
. 1000 locations
. Words (40 bits) - Binary

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Registers

A

Memory Buffer Register (MBR)

Memory Address Register (MAR)

Instruction Register (IR)

Instruction Buffer Register (IBR)

Program Counter (PC)

Accumulator (AC) & Multiplier Quotient (MQ)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Computer function

A

. Execution of a program (set of instructions)
. Processor execute the instructions:
.Fetch (Read the instructions)
.Execute (Perform the instructions)
. Program execution: Repeating fetch & execute
. Program execution halt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Interconnection structure

A

. Computer as a network of basic modules

. Paths for connecting the modules

. Structure depends on the exchanges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Interconnection structure - Memory

A

. N words equal length
. Unique numerical address
. Read/Write data word
. Operation is indicated by read and write control signals
. The location for the operation is specified by an address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Interconnection structure - I/O module

A

. Similar to Memory (internal point of view): read/write
. Control more than one external device (port - unique address)
. External data path (input/output) with an external device
. Interrupt signals (?!)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Interconnection structure - Processor

A

. Reading instruction and data
. Write out data after processing
. Use control signals to control the overall operations
. Receive interrupt signals

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Interconnection structure - transfers

A

. Memory to Processor: The processor reads an instruction or a unit of data from memory.

. Processor to Memory: The processor writes a unit of data to memory

. I/O to Processor: The processor reads data from an I/O device via an I/O module.

. Processor to I/O: The processor sends data to the I/O device.

. I/O to or from Memory: I/O module is allowed to ex- change data directly with memory, without going through the processor, using direct memory access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Bus Interconnection

A

. Communication pathway connecting two or more devices

. Key characteristics: shared transmission medium(?!)

. Multiple devices connect to the bus, and a signal transmitted by any one device is available for reception by all other devices attached to the bus

. Signal overlap and become garble –> Only one device at a time can successfully transmit

. A bus consist of multiple communication pathways, lines - each transmit signals representing binary 0 or 1 (e.g. 8-bit unit of data –> transmit over 8 bus lines)

. System Bus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Bus Structure - Functional Groups

A

. Data lines: to provide a path for moving data among system modules:
.Moving data
.Data Bus
.Bus Width - Number of lines
.Data bus width - Key factor in determining overall system performance

. Address lines: to designate the source or destination of the data on the data bus:
.Source/destination of the data on data bus - .Address Bus
.Bus width - Determines the maximum possible memory capacity
.Address I/O ports
.Higher order bits - select module
.Lower order bits - memory location or I/O port

. Control lines: to control the access to and the use of the data and address lines:
. Control the access and the use of the data and address bus

. Control signals:
. Command signals: Specify operation to be performed
. Timing Signals: Validity of data and address information
. Control lines include: Memory write & read, I/O write & read, …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Bus Operation

A

If one module wishes to send data to another:
. Obtain the use of the bus
. Transfer the data via the bus

If one module wishes to request data from another module
. Obtain the use of the bus
. Transfer a request to other module over the appropriate control and address lines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Point-to-point Interconnection

A

. Contemporary systems increasingly rely on Point-to-point interconnect
. Bus system problem
. Lower latency, higher data rate, better scalability
. QuickPath Interconnect (QPI - 2008):
.Multiple Direct Connections
.Layered Protocol Architecture
.Packetized Data Transfer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Memory

A

Computer memory is the area where the computer stores or remembers data (Binary values).

Memory stores information temporarily or permanently and provides the CPU with its instructions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Memory Key Characteristics

A

Location:
. Internal (e.g. processor registers, main memory, cache)
. External (e.g. optical disks, magnetic disks, tapes)

Capacity:
. Number of words
. Number of bytes

Unit of Transfer (the number of bits read out of or written into memory at a time):
. Bits (main memory)
. Word
. Block

Access Method:
. Sequential access (linear sequence) - Tape units
. Direct access - Disk units
. Random access - Main memory, Cache systems
. Associative access - Cache systems

Performance:
. Access time (latency)
. Cycle time
. Transfer rate (1/cycle time)

Physical Type:
. Semiconductor
. Magnetic
. Optical
. Magneto-optical

Physical characteristics:
. Volatile/nonvolatile
. Erasable/non-erasable

23
Q

Memory - Hierarchy

A

As one goes down:
Decreasing cost per bit
Increasing capacity
Increasing access time
Decreasing frequency of access of the memory by processor

24
Q

Cache Memory

A

Concept:
Combine fast and expensive memory with less expensive and lower speed

Cache contains a copy of portions of memory

25
Q

Development of operating systems - Late 1940s:

A

No operating system. The programmer was also the user. Programs and data were entered in binary by means of switches on the front of the machine. Each switch represented one bit. Output was by means of lights, with each light representing one bit. The programmer did everything that an operating system does today.

26
Q

Development of operating systems - Late 1950s:

A

The introduction of specialist operators, who were not programmers themselves, but who tended the machine, fed the programs to the machine, and delivered back the output. They used punch machines to encode their programs as a series of holes in stiff cards, which the computer could read and interpret. The operators acted as a human interface between the programmer and the hardware.

27
Q

Development of operating systems - Late 1960s:

A

Human intervention was a serious source of delay in the system. Loading and unloading punched cards, starting and stopping devices – all of this slowed things down. So instead of giving verbal commands to a human operator, the programmer punched instructions on control cards, which were inserted at the appropriate places before and after the program cards and the data cards. These commands were written in specially developed job control languages.

28
Q

Development of operating systems - Late 1960s and 1970:

A

First attempts to provide interactive use of a computer.

Computer users found that programs were growing in size and required more memory. The initial solution was to break programs up into little chunks, each of which would fit in the available memory at any one time.

Larger memory - timesharing

The issue of protecting one program from another became more and more important (OS job!)

29
Q

Development of operating systems - Late 1980s and 1990:

A

1980s: Networking and communication

1990s: Move to open systems. Previously, operating systems had been developed specifically for particular hardware platforms, e.g. MS-DOS for the PC. Now there is a move to build generic operating systems (e.g. Linux) which will run on any hardware.

30
Q

What is an operating system?

A

The operating system is itself a program, which is written, compiled, tested and debugged just like any other program. This program is run whenever a computer is switched on. It is almost always done automatically – no special command is required – so users may not be aware that it happens every time they switch on a machine. It stays running all the time until the machine is switched off.

Operating system is software which makes the hardware more useful and more user-friendly.

31
Q

What does an operating system do?

A

. Provides an environment which helps others to do productive work
. Helps a user to develop and run programs, by providing a convenient environment
. Starting and stopping programs, and sharing the CPU between them

Managing memory:
. which parts of memory are in use and which are free
. provides mechanisms by which programs can ask for more memory or give back memory they no longer need

Input and output
. covers up the differences between alternative makes and models of devices
. overlaps input and output with processing

. File systems / organisation

. Protection
one memory, one CPU : protect programs interference

. Networking
covers up the differences between machines

. Error handling and recovery

32
Q

What is Kernel?

A

. Central component or heart of operating system

. Interface between hardware components and software applications

. Makes the software to interact with the hardware to get a specific task done.

. It decides the amount of resources (RAM, GPU,… ) to be used by every application.

. It decides on what programs to be executed and on what order.

. It has separate space on memory so it functions independently.

. It acts as a central authority which guides memory and keeps eye on all the hardware and software data flow.

. System call: Every process which starts on a system, demands the resources from kernel.

33
Q

CPUs operate in at least two different modes:

A

User Mode: the CPU can only execute a subset of its instructions – the more common ones, like add, subtract, load and store, etc. If a program is executed in user mode, it does not have access to memory, hardware and such resources .

Kernel Mode: the CPU can execute all of its instructions, including extra privileged instructions. If a program is executed in Kernel mode, it has direct access to memory, hardware and such resources .

Monolithic kernel : user services and kernel services both are kept in the same address space (entire OS is in kernel space), larger than micro kernel, less access time and fast execution, hard to extend, higher performance, higher risk of system crash. Linux uses monolithic kernel.

Microkernel : user services and kernel services are kept in separate address space, smaller in size (minimum code in kernel space), greater access time and slow execution, easily extendable, lower responsibility. Windows use hybrid (Micro + Monolithic)

34
Q

Type of Operating Systems

A

Different types of operating system: To meet particular requirements and to write specialist systems dedicated to specific purposes:

Batch system

Interactive system

General-purpose system:
. Network OS
. Distributed systems
. Specialist systems

35
Q

Batch Systems

A

Earliest systems developed

Data and the commands to manipulate the program and data are all submitted together to the computer in the form of a ‘job’.

Little or no interaction between users and an executing program.

Example: Payroll processing & Bank or credit card statements - no need for any operator interaction once the job has been started

36
Q

Interactive systems

A

Most common mode of computing using keyboard, mouse and screen.

Significant improvement on batch systems, as it is now possible to intervene directly while a program is being developed, or as it is running.

Single user: Multitasking & Interactive computing on a single-user basis such as Windows, MS-DOS and OS/2.

Multi-user: Interactive computing on a multi-access or Multi-user basis (using different terminals) such as Unix, Linux, Windows 10, Ubuntu, Mac OS.

37
Q

General Purpose OS:

A

General Purpose OS: A given environment may want a bit of everything. For example, a timesharing system may support interactive users, but also include the ability to run programs in batch mode.

Network OS: To share resources such as printers and databases across a network, such as Windows Server.

Distributed systems: The most recent development in operating systems, meeting the requirements of a multi-user system. Essentially, it consists of a group of machines acting together as one. When a user starts a program, it may actually run on the local machine. But if that computer is heavily loaded, and the operating system knows that another machine is idle, then the job may be transferred to that idle machine.

Specialist systems: Dedicated to processing large volumes of data, which are maintained in an organized way such as real-time operating system, banking system

38
Q

What is Process?

A

A process is the unit of work in a computer system.

A sequence of states (for example steps in fetch-execute cycles), resulting from the action of a set of instructions on the states as they develop

39
Q

Two aspects of any process:

A

Static part : Task - resources allocated to the process, includes:
.Certain amount of space in memory
.A current working directory
.Sources of input and output such as a keyboard, screen and open files
.A connection with another process over a network
.A program (sequence of instructions - inert)

Dynamic part: A program in action
.Instructions that make up a program are actually being carried out
.It is known as a ‘thread of execution’, or a ‘thread of control’, or a ‘thread’
.A thread has access to all of the resources assigned to the task

40
Q

Operating System Overhead

A

It happens frequently that a process begins running on a processor and almost immediately stops again to wait for some input to become available.

The operating system has to save or restore the whole state of the machine as it was at the moment when the process stopped running or begins running again.

Saving and restoring state is overhead and non-productive work, and here it is becoming a large part of the overall work of the computer.

Increasing the size of operations, operating systems become more complex, so requiring ever more state to be remembered.

41
Q

Multi-threading

A

The operating systems overhead led to the idea of having a number of paths of execution (threads) through the program at the same time. If one thread is blocked another can execute.

It is not necessary to save and restore the full state of the machine for this, as it is using the same memory, files and devices – it is just jumping to another location in the program code.

Each thread must maintain some state information of its own, for example the program counter and general-purpose registers. This is so that when it regains control it may continue from the point it was at before it lost control.

Multithreading enables the processing of multiple threads at one time, rather than multiple processes.

Multithreading is an important utility for many computer programs and increase performance efficiency and scalability.

42
Q

Type of Threads

A

User threads are above the kernel and without kernel support. These are the threads that application programmers use in their programs. This saves on the overhead of bothering the operating system each time control changes from one thread to another. The operating system gives control of the CPU to a process.

Kernel threads are supported within the kernel of the OS itself. OS handles all the switching between threads. All modern OSs support kernel level threads, allowing the kernel to perform multiple simultaneous tasks and/or to service multiple kernel system calls simultaneously.

43
Q

Context switching

A

.The whole procedure of reallocating a processor from one thread to another.

Context switching is called when:
. A thread loses control of the processor and moves into the WAIT state to wait for a resource to become available
. A timer interrupts to tell it that it has used up its time slice

It is absolutely essential that the current state of the machine be saved when a thread loses control of the CPU (values in the general- purpose registers, memory management registers,…) and use them to run again. This state, or volatile environment as it is called, is saved in the thread structure of its own thread.

44
Q

CPU Scheduler

A

Whenever the CPU becomes idle, the operating system must select one of the processes in the ready queue to be executed. The selection process is carried out by the CPU scheduler.

The scheduler selects a process from the processes in memory that are ready to execute and allocates the CPU to that process.

Conceptually, all the processes in the ready queue are lined up waiting for a chance to run on the CPU. The records in the queues are generally process control blocks (PCBs) of the processes.

45
Q

Non pre-emptive Scheduling

A

Process cannot be stopped by other processes.

CPU non-pre-emptive or cooperative scheduling decisions may take place under the following circumstances:
.When a process switches from the running state to the waiting state (for example, as the result of an I/O request).

.When a process terminates.

. There is no choice in terms of scheduling. A new process (if one exists in the ready queue) must be selected for execution.

. CPU has been allocated to a process, the process keeps the CPU until it releases the CPU either by terminating or by switching to the waiting state.

46
Q

Pre-emptive Scheduling

A

When a new process with higher priority arrives, the running may be stopped.

CPU pre-emptive scheduling decisions may take place under the following circumstances:
. When a process switches from the running state to the ready state (for example, when an interrupt occurs).
. When a process switches from the waiting state to the ready state (for example, at completion of I/O)

. There are Choices in terms of scheduling.

It requires the special hardware (for example, a timer) needed for pre-emptive scheduling.

47
Q

There are three types of Scheduler:

A

Long term scheduler: This is the decision of long term scheduler that how many processes will stay in the ready queue. Long term scheduler decides the degree of multiprogramming of system.

Medium term scheduler: Most often, a running process needs I/O operation which does not requires CPU. Hence during the execution of a process when a I/O operation is required then the operating system sends that process from running queue to waiting queue. When a process completes its I/O operation then it should again be shifted to ready queue. All these decisions are taken by the medium-term scheduler.

Short term scheduler: When there are lots of processes in main memory initially all are present in the ready queue. Among all of the process, a single process is to be selected for execution. This decision is handled by short term scheduler.

48
Q

Dispatcher

A

A dispatcher is a special program which comes into play after the scheduler.

When the scheduler completes its job of selecting a process, it is the dispatcher which takes that process to the desired state/queue.

The dispatcher is the module that gives a process control over the CPU after it has been selected by the short-term scheduler.

This function involves the following:
.Switching context
.Switching to user mode
.Jumping to the proper location in the user program to restart that program

Once the scheduler has selected a process from the queue, the dispatcher comes into the picture, and it is the dispatcher who takes that process from the ready queue and moves it into the running state.

49
Q

Scheduling Criteria

A

CPU utilization: keep the CPU as busy as possible

Throughput: Number of processes that complete their execution per time unit

Turnaround time: amount of time to execute a particular process

Waiting time: amount of time a process has been waiting in the ready queue

Response time: amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)

50
Q

Scheduling Algorithms

A

CPU scheduling deals with the problem of deciding which of the processes in the ready queue is to be allocated the CPU. There are many different CPU-scheduling algorithms.

6 main scheduling algorithms:
1- First-Come, First-Served Scheduling (FCFS)
2- Shortest-Job-First Scheduling
3- Priority Scheduling
4- Round-Robin Scheduling
5- Multilevel Queue Scheduling
6- Multilevel Feedback Queue Scheduling

51
Q

First-Come, First-Served Scheduling (FCFS)

A

The process that requests the CPU first is allocated the CPU first.

Managed with First In First Out (FIFO) queue.

When a process enters the ready queue, its PCB is linked onto the tail of the queue. When the CPU is free, it is allocated to the process at the head of the queue. The running process is then removed from the queue.

Once the CPU has been allocated to a process, that process keeps the CPU until it releases the CPU, either by terminating or by requesting I/O.

52
Q

Shortest-Job-First Scheduling (SJF)

A

This is scheduling algorithm in which the process with the shortest execution time should be selected for execution next.

SJF is optimal: it gives minimum average waiting time for a given set of processes.

The difficulty is knowing the length of the next CPU request

53
Q

Round Robin Scheduling

A

The round-robin (RR) scheduling algorithm is designed especially for time-sharing systems. It is similar to FCFS scheduling, but pre-emption is added to enable the system to switch between processes.

Each process gets a small unit of CPU time (time quantum or time slice), usually 10-100 milliseconds. After this time has passed, the process is pre-empted and added to the end of the ready queue.

The ready queue is treated as a circular queue and FIFO queue of processes.

The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum.

No process is allocated the CPU for more than 1 time quantum in a row (unless it is the only runnable process).

54
Q

Multilevel Queue Scheduling

A

Ready queue is partitioned into separate queues, eg:
.foreground (interactive) processes
.background (batch) processes

These two types of processes have different response-time requirements and so may have different scheduling needs.

The processes are permanently assigned to one queue, generally based on some property of the process, such as memory size, process priority, or process type.

Each queue has its own scheduling algorithm, eg:
. foreground (interactive) processes - RR
. background (batch) processes - FCFS