Chapter 9 Flashcards

Operating System Support

1
Q

Define

Purpose of Operating System

A

To mask the details of the hardware from the programmer and provide the programmer with a convenient interface for using the system

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

List

Services OS provides

A

Program creation
Program execution
Access to I/O devices
Controlled access to files
System access
Error detection and response
Accounting

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

List

Key interfaces in a typical computer system

A

Instruction set architecture (ISA)
Application binary interface (ABI)
Application programming interface (API)

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

Define

Instruction set architecture

A

Defines the machine language instructions that a computer can follow.
Boundary between hardware and software.

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

Define

Application binary interface

A

Defines a standard for binary portability across programs.
Defines the system call interface to the operating system and the hardware resources and services available in a system through the user ISA

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

Define

Application programming interface

A

Gives a program access to the hardware resources and services available in a system through the user ISA supplemented with high-level language (HLL) library calls.
Using an API enables applicatoin software to be ported easily to other systems that support the same API

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

Describe

How the OS is unusual as a control mechanism

A

It functions as ordinary computer software - is a program executed by the processor.
OS frequently relinquishes control and must depend on the processor to allow it to regain control.

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

List

Types of Operating systems

A

Interactive system
Batch system

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

Define

Interactive system

OS type

A

The user/programmer interacts directly with the computer to request the execution of a job or to perform a transaction.
User may, depending on the nature of the application, communicate with the computer during the execution of the job

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

Define

Batch system

OS type

A

Opposite of interactive. The user’s program is batched together with programs from other users and submitted by a computer operator. After the program is completed results are printed out for the user.

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

Describe

Batch OS from view of processor

A

Processor executes instructions from the portion of main memory containing the monitor. These instructions are in the job control language (JCL). The monitor handles setup and scheduling

monitor = batch OS

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

List

Desirable hardware features

A

Memory protection
Privileged instructions
Timer
Interrupts

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

Define

Memory protection

A

User program must not alter the memory area containing the monitor.
The process hardware should detect an error and transfer control to the monitor
The monitor aborts the job, prints an error message, and loads the next job

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

Define

Privledged instructions

A

Can only be executed by the monitor
If the processor encounters such an instruction while executing a user program, and error interrupt occurs.
I/O instructions are privileged so the monitor retains control of all I/O devices

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

Define

Batch multiprogramming vs Time Sharing

A

BM: maximizes processor use. JCL commands provided with the job.
Time Share: minimizes response time. Commands entered at the terminal.

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

Define

Long-term scheduling

A

The decision to add to the pool of processes to be executed.

Determines which programs are submitted for processing.
Once submitted, a job becomes a process for the short term scheduler.
In some systems a newly created process begins in a swapped-out condition, in which case it is added to a queue for the medium-term scheduler.

17
Q

Define

Medium-term scheduling

A

The decision to add to the number of processes that are partially or fully in mm.

Part of swapping function.
Swapping-in decision is based on the need to manage the degree of multiprogramming.
Swapping-in decision will consider the memory requirements of the swapped-out processes

18
Q

Define

Short-term scheduling

A

The decision as to which available process will be executed by the processor

AKA dispatcher
Executes frequently and makes the fine-grained decision of which job to execute next

19
Q

Define

I/O scheduling

A

The decision as to which process’s pending I/O request shall be handled by an available I/O device

20
Q

Define

Advantages and disadvantages of Demand Paging

A

Each page of a process is brought in only when it is needed
Adv: More processes can be maintained in memory. Time is saved because unused pages are not swapped in and out of memory
Dis: When one page is brought in, another must be replaced. If a page is thrown out before used, OS must get again. Thrashing

21
Q

Define

Segmentation

A

Usually visible to the programmer.
Provided as a convenience for organizing programs and data and as a means for associating privilege and protection attributes with instructions and data.
Allows the programmer to view memory as consisting of multiple address spaces or segments.

22
Q

List

Advantages of segmentation

A
  • Simplifies handling of growing data structures
  • Allows programs to be altered and recompiled independently without requiring that an entire set of programs be re-linked and re-loaded
  • Lends itself to sharing among processes
  • Lends itself to protection
23
Q

Describe

Intel x86 and Memory Mangement

for referring on test, understand more than memorize

A

Includes hardware for both segmentation and paging.
Unsegmented unpaged memory - virtual address same as physical address. Useful in low-complexity, high-performance controller applications.

Unsegmented paged memory - memory is viewed as a paged linear address space. Protection and management of memory is done via paging. Favored by some OSs

Segmented unpaged memory - Memory is viewed as a collection of logical address spaces. Affords protection down to level of single byte. Guarantees that the translation table needed is on-chip when the segment is in memory. Results in predictable access times.

Segmented paged memory - Segmentation is used to define logical memory partitions subject to access control, and paging is used to manage the allocation of memory within the partitions. Operating systems such as UNIX System V favor this view

24
Q

Describe

Segmentation bit details

A

Each virtual address consists of a 16-bit segment reference (2 bits deal with protection mech, 14 specify seg) and a 32-bit offset.

Unsegmented virtual memory is 2^32 = 4Gbytes.

Segmented virtual memory is 2^46 = 64Tbytes.

Physical address space employs a 32-bit address for a maximum of 4Gbytes.

Virtual address space is divided into two parts: global and local.

25
Q

Define

Segment Protection

A

Associated with each segment are two forms of protection: Privilege level and Access attribute.

26
Q

Define

Privilege level

A

For privilege levels, from 0 (most protected) to 3 (least protected).
Privilege level associated with data segment is “classification.”
Privilege level associated with a program segment is its “clearance.”
Privilege mechanism also limits the use of certain instructions.

27
Q

List and define

Segment descriptor

memory management parameters

A

Base - defines starting address of segment within the 4Gb linear address space.
D/B bit - indicates whether operands and addressing modes are 16 or 32 bits.
Descriptor Privilege level (DPL)
**Granularity bit (G) **- inidicates whether limit is to be interpreted in units by one byte or 4 Kbytes
**Limit **- defines size of seg, interprets based on G
S bit - Determines whether a given seg is a system, code, or data segment
**Segment Present bit (P) **- Used for nonpaged systems. Indicates if seg is present in mm. For paged, bit always set to 1
Type - distinguishes between various kinds of segments and indicates access attributes

28
Q

List and Define

Page Directory Entry and Page Table Entry

memory management parameters

A

**Accessed bit (A) **- set to 1 by processor in both levels of page tables when a r/w operation to the corresponding page occurs.
Dirty bit (D) - set to 1 by processor when a write operation to the corresponding page occurs.
Page Frame Address - Provides the physical addres of the page in memory if the present bit is set. Since page frames are aligned on 4K boundaries, the bottom 12 bits are 0, and only the top 20 bits are included in the entry. In a page directory, the address is that of a page table.
Page Cache Disable bit (PCD) - indicates whether data from page may be cached
Page size bit (PS) - indicates whether a page size is 4 Kbyte or 4 Mbyte
Page Write Through bit (PWT) - Indicates whether write-through or write-back caching policy will be used for data in the corresponding page.
**Present bit (P) **- indicates whether page table or page is in mm
R/W bit - For user-level pages, indicates whether the page is read-only access or r/w access.
**User/Supervisor bit (US) **- indicates whether page is available only to op system (sup level) or to ops and apps (user level)

29
Q

Define

Paging

A

Segmentation may be disabled, in which case linear address space is used.
Two level page lookup: first, page directory (1024 entries max, splits 4Gb linear mem into 1024 page groups of 4 Mb, each page table has 1-24 entries corresponding to 4kb pages, can use one page directory for all processes (one per process or mixture), page directory for current process always in mem)
Use TLB holding 32 page table entries
Two page sizes available, 4k or 4M

30
Q

List

Virtual memory address translation sizes

A

Supersections (optional) - consist of 16-MB blocks of main memory
Sections - consist of 1MB blocks of main memory
Large pages - consist of 64kB blocks of main memory
Small pages - consist of 4kB blocks of main memory

Sections and supersections are supported to allow mapping of a large region of memory while only using a single entry in the TLB

31
Q

Define

Virtual memory address translation tables

A

Level 1 table: Holds level 1 descriptors that contain the base address and translation properties for a Section and Supersection, and translation properties and pointers to a level 2 table for a large page or a small page.

Level 2 table: Holds level 2 descriptors that contain the base address and translation properties for a Small page or a Large page. Requires 1kB of memory

32
Q

List and define

ARM Memory-Management Parameters

don’t memorize

A

Access Permission (AP), Access Permission Extension (APX) -
control access to the corresponding memory region. If an access is made to an area of memory without the required permissions, a Permission Fault is raised.
Bufferable (B) bit - Determines, with the TEX bits, how the write buffer is used for cacheable memory.
Cacheable (C) bit - Determines whether this memory region can be mapped through the cache.
Domain - Collection of memory regions. Access control can be applied on the basis of domain.
not Global (nG) - Determines whether the translation should be marked as global (0), or process specific (1).
Shared (S) - Determines whether the translation is for not-shared (0), or shared (1) memory.
SBZ - Should be zero.
Type Extension (TEX) - together with the B and C bits, control accesses to the caches, how the write buffer is used, and if the memory region is shareable and therefore must be kept coherent.
Execute Never (XN)- Determines whether the region is executable (0) or not executable (1).

33
Q

Define

Access Control

A

A region of memory can be designated as no access, read only, or r/w