Quiz 1 Flashcards

1
Q

What are four components of a computer system?

A

Hardware – provides basic computing resources
CPU, memory, I/O devices

Operating system - Controls and coordinates use of hardware among various applications and users

Application programs – define the ways in which the system resources are used to solve the computing problems of the users. i.e. Word processors, compilers, web browsers, database systems, video games

Users - People, machines, other computers

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

What is a bootstrap program?

A
  • A bootstrap program is loaded at power-up or reboot
  • Typically stored in ROM or EPROM, generally known as firmware
  • Initializes all aspects of system
  • Loads operating system kernel and starts execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some resources that the operating system allocates?

A

CPU Time, memory space, storage space, I/O devices

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

What is resource utilization?

A

How various hardware and software resources are shared

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

What is middleware?

A

A set of software frameworks that provide additional services to application developers.

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

What is a kernel?

A

The one program that is running at all times on the computer, a broad definition used for many different types of operating systems.

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

What is a device driver?

A

An operating system will typically have a device driver which understands the device controller and provides the rest of the operating system with a uniform interface of the device.

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

Besides the kernel what are the other two types of programs?

A

A system program (ships with the operating system, but not part of the kernel)

An application program, all programs not associated with the operating system

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

How does a device controller operate?

A
  • I/O devices and the CPU can execute concurrently
  • Each device controller is in charge of a particular device type
  • Each device controller has a local buffer
  • Each device controller type has an operating system device driver to manage it
  • CPU moves data from/to main memory to/from local buffers
  • I/O is from the device to local buffer of controller
  • Device controller informs CPU that it has finished its operation by causing an interrupt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are interrupts and what are some common interrupt functions?

A
  • Interrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines
  • Interrupt architecture must save the address of the interrupted instruction
  • A trap or exception is a software-generated interrupt caused either by an error or a user request
  • An operating system is interrupt driven
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How are interrupts handled?

A
  • The operating system preserves the state of the CPU by storing registers and the program counter
  • Determines which type of interrupt has occurred:
    - polling
    - vectored interrupt system
  • Separate segments of code determine what action should be taken for each type of interrupt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between polling and interrupting?

A

With interrupting the system waits for input from an I/O device to interrupt in order to handle that input. With polling, the system is constantly checking to see if it needs to handle any input.

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

What is a system call?

A

Request to the OS to allow user to wait for I/O completion

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

What is a device status table?

A

Contains entry for each I/O device indicating its type, address, and state

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

What is main memory?

A
  • Only large storage media that the CPU can access directly
  • Random access
  • Typically volatile
  • Typically random-access memory in the form of Dynamic Random-access Memory (DRAM)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is secondary storage?

A

Extension of main memory that provides large nonvolatile storage capacity

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

What is an HDD

A
  • Rigid metal or glass platters covered with magnetic recording material
  • Disk surface is logically divided into tracks, which are subdivided into sectors
  • The disk controller determines the logical interaction between the device and the computer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are non-volatile memory (NVM) devices?

A

Faster than hard disks, nonvolatile memory is memory that can store information even after the device has been turned off.

  • Various technologies
  • Becoming more popular as capacity and performance increases, price drops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is caching?

A

Copying information into faster storage system; main memory can be viewed as a cache for secondary storage

20
Q

What is the storage system hierarchy?

A

Speed
Cost
Volatility

21
Q

What is the Direct Memory Access Structure?

A
  • Used for high-speed I/O devices able to transmit information at close to memory speeds
  • Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention
  • Only one interrupt is generated per block, rather than the one interrupt per byte
22
Q

What are the types of multiprocessoing and what are the advantages?

A
  • Also known as parallel systems, tightly-coupled systems
  • Advantages include:
    1. Increased throughput
    2. Economy of scale
    3. Increased reliability – graceful degradation or fault tolerance
  • Two types:
    1. Asymmetric Multiprocessing – each processor is assigned a specific task.
    2. Symmetric Multiprocessing – each processor performs all tasks
23
Q

What are clustered systems?

A
  • Like multiprocessor systems, but multiple systems working together
  • Usually sharing storage via a storage-area network (SAN)
  • Provides a high-availability service which survives failures
    1. Asymmetric clustering has one machine in hot-standby mode
    2. Symmetric clustering has multiple nodes running applications, monitoring each other
  • Some clusters are for high-performance computing (HPC)
    1. Applications must be written to use parallelization
  • Some have distributed lock manager (DLM) to avoid conflicting operations
24
Q

What are system daemons?

A

Services provided outside of the kernel

25
Q

What is multiprogramming?

A
  • Single user cannot keep CPU and I/O devices busy at all times
  • Multiprogramming organizes jobs (code and data) so CPU always has one to execute
  • A subset of total jobs in system is kept in memory
  • One job selected and run via job scheduling
  • When it has to wait (for I/O for example), OS switches to another job
26
Q

What is timesharing (multitasking)

A
  • A logical extension of multiprogramming in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing
  • Response time should be < 1 second
  • Each user has at least one program executing in memory -> process
  • If several jobs ready to run at the same time -> CPU scheduling
  • If processes don’t fit in memory, swapping moves them in and out to run
  • Virtual memory allows execution of processes not completely in memory
27
Q

What is dual-mode?

A
  • Dual-mode operation allows OS to protect itself and other system components
  • User mode and kernel mode
  • Mode bit provided by hardware
    1. Provides ability to distinguish when system is running user code or kernel code
    2. Some instructions designated as privileged, only executable in kernel mode
    3. System call changes mode to kernel, return from call resets it to user
28
Q

What is a program counter?

A
  • Specifies location of next instruction to execute

- Process executes instructions sequentially, one at a time, until completion

29
Q

What are some common kernel data structures?

A

Singly linked list, doubly linked list, circular linked list, binary search tree, hash maps.

30
Q

What are some types of computing environments?

A

Traditional:

  • Stand-alone general purpose machines
  • But blurred as most systems interconnect with others (i.e., the Internet)
  • Portals provide web access to internal systems
  • Network computers (thin clients) are like Web terminals
  • Mobile computers interconnect via wireless networks
  • Networking becoming ubiquitous – even home systems use firewalls to protect home computers from Internet attacks

Mobile:

  • Handheld smartphones, tablets, etc
  • What is the functional difference between them and a “traditional” laptop?
  • Extra feature – more OS features (GPS, gyroscope)
  • Allows new types of apps like augmented reality
  • Use IEEE 802.11 wireless, or cellular data networks for connectivity
  • Leaders are Apple iOS and Google Android

Client-Server Computing

  • Dumb terminals supplanted by smart PCs
  • Many systems now servers, responding to requests generated by clients
    1. Compute-server system provides an interface to client to request services (i.e., database)
    2. File-server system provides interface for clients to store and retrieve files

Peer-to-Peer

  • Another model of distributed system
  • P2P does not distinguish clients and servers
    1. Instead all nodes are considered peers
    2. May each act as client, server or both
    3. Node must join P2P network
    i. Registers its service with central lookup service on network, or
    ii. Broadcast request for service and respond to requests for service via discovery protocol
    4. Examples include Napster and Gnutella, Voice over IP (VoIP) such as Skype

Cloud Computing

  • Delivers computing, storage, even apps as a service across a network
  • Logical extension of virtualization because it uses virtualization as the base for it functionality.
    1. Amazon EC2 has thousands of servers, millions of virtual machines, petabytes of storage available across the Internet, pay based on usage
  • Many types
    1. Public cloud – available via Internet to anyone willing to pay
    2. Private cloud – run by a company for the company’s own use
    3. Hybrid cloud – includes both public and private cloud components
    4. Software as a Service (SaaS) – one or more applications available via the Internet (i.e., word processor)
    5. Platform as a Service (PaaS) – software stack ready for application use via the Internet (i.e., a database server)
    6. Infrastructure as a Service (IaaS) – servers or storage available over Internet (i.e., storage available for backup use)

Real-time embedded systems

  • Real-time embedded systems most prevalent form of computers
    1. Vary considerably, special purpose, limited purpose OS, real-time OS
    2. Use expanding
  • Many other special computing environments as well
    1. Some have OSes, some perform tasks without an OS
  • Real-time OS has well-defined fixed time constraints
    1. Processing must be done within constraint
    2. Correct operation only if constraints met
31
Q

What is dual core design?

A
  • Multi-chip and multicore
  • Systems containing all chips
  • Chassis containing multiple separate systems
32
Q

What are some operating system services?

A

-User interface - Almost all operating systems have a user interface (UI).
1. Varies between Command-Line (CLI), Graphics User Interface (GUI), touch-screen, Batch
-Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error)
-I/O operations - A running program may require I/O, which may involve a file or an I/O device
-File-system manipulation - The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management.
-Communications – Processes may exchange information, on the same computer or between computers over a network
1. Communications may be via shared memory or through message passing (packets moved by the OS)
-Error detection – OS needs to be constantly aware of possible errors
May occur in the CPU and memory hardware, in I/O devices, in user program
For each type of error, OS should take the appropriate action to ensure correct and consistent computing
Debugging facilities can greatly enhance the user’s and programmer’s abilities to efficiently use the system
-Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them
1. Many types of resources - CPU cycles, main memory, file storage, I/O devices.
-Logging - To keep track of which users use how much and what kinds of computer resources
-Protection and security - The owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other
1. Protection involves ensuring that all access to system resources is controlled
2. Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts

33
Q

What are system calls? (ch2)

A
  • Programming interface to the services provided by the OS
  • Typically written in a high-level language (C or C++)
  • Mostly accessed by programs via a high-level Application Programming Interface (API) rather than direct system call use
  • Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM)
34
Q

How are system calls implemented?

A
  • Typically, a number associated with each system call
    1. System-call interface maintains a table indexed according to these numbers
  • The system call interface invokes the intended system call in OS kernel and returns status of the system call and any return values
  • The caller need not know nothing about how the system call is implemented
    1. Just needs to obey API and understand what OS will do as a result call
    2. Most details of OS interface hidden from programmer by API
    i. Managed by run-time support library (set of functions built into libraries included with compiler)
35
Q

What are the types of system calls?

A
  • Process control
    1. create process, terminate process
    2. end, abort
    3. load, execute
    4. get process attributes, set process attributes
    5. wait for time
    6. wait event, signal event
    7. allocate and free memory
    8. Dump memory if error
    9. Debugger for determining bugs, single step execution
    10. Locks for managing access to shared data between processes
  • File management
    1. create file, delete file
    2. open, close file
    3. read, write, reposition
    4. get and set file attributes
  • Device management
    1. request device, release device
    2. read, write, reposition
    3. get device attributes, set device attributes
    4. logically attach or detach devices
  • Information maintenance
    1. get time or date, set time or date
    2. get system data, set system data
    3. get and set process, file, or device attributes
  • Communications
    1. create, delete communication connection
    2. send, receive messages if message passing model to host name or process name
    i. From client to server
    3. Shared-memory model create and gain access to memory regions
    4. transfer status information
    5. attach and detach remote devices
  • Protection
    1. Control access to resources
    2. Get and set permissions
    3. Allow and deny user access
36
Q

How are parameters passed to the system call?

A
  • Often, more information is required than simply identity of desired system call
    1. Exact type and amount of information vary according to OS and call
  • Three general methods used to pass parameters to the OS
    1. Simplest: pass the parameters in registers
    i. In some cases, may be more parameters than registers
    2. Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register
    i. This approach taken by Linux and Solaris
    3. Parameters placed, or pushed, onto the stack by the program and popped off the stack by the operating system
    4. Block and stack methods do not limit the number or length of parameters being passed
37
Q

How are Operating Systems designed?

A
  • Design and Implementation of OS not “solvable”, but some approaches have proven successful
  • Internal structure of different Operating Systems can vary widely
  • Start the design by defining goals and specifications
  • Affected by choice of hardware, type of system
  • User goals and System goals
    1. User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast
    2. System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient
  • Important principle to separate
    1. Policy: What will be done?
    2. Mechanism: How to do it?
  • Mechanisms determine how to do something, policies decide what will be done
  • The separation of policy from mechanism is a very important principle, it allows maximum flexibility if policy decisions are to be changed later (example – timer)
  • Specifying and designing an OS is highly creative task of software engineering
38
Q

What are microkernels?

A

-Moves as much from the kernel into user space as possible

  • Mach example of microkernel
    1. Mac OS X kernel (Darwin) partly based on Mach

-Communication takes place between user modules using message passing

  • Benefits:
    1. Easier to extend a microkernel
    2. Easier to port the operating system to new architectures
    3. More reliable (less code is running in kernel mode)
    4. More secure
  • Detriments:
    1. Performance overhead of user space to kernel space communication
39
Q

What are different ways of structuring an OS?

A

Simple Structure - MS-DOS

More Complex - UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts

  • Systems programs
  • The kernel
    1. Consists of everything below the system-call interface and above the physical hardware
    2. Provides the file system, CPU scheduling, memory management, and other operating-system functions; a large number of functions for one level

Layered Approach - an abstraction

  • The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface.
  • With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers

Microkernel - Mach

40
Q

What are hybrid systems?

A
  • Most modern operating systems are actually not one pure model
    1. Hybrid combines multiple approaches to address performance, security, usability needs
    2. Linux and Solaris kernels in kernel address space, so monolithic, plus modular for dynamic loading of functionality
    3. Windows mostly monolithic, plus microkernel for different subsystem personalities
  • Apple Mac OS X hybrid, layered, Aqua UI plus Cocoa programming environment
    1. Below is kernel consisting of Mach microkernel and BSD Unix parts, plus I/O kit and dynamically loadable modules (called kernel extensions)
41
Q

What are log files?

A

OS generate log files containing error information

42
Q

What is a core dump?

A

Failure of an application can generate core dump file capturing memory of the process

43
Q

What is a crash dump?

A

Operating system failure can generate crash dump file containing kernel memory

44
Q

What is GRUB?

A

Common bootstrap loader, GRUB, allows selection of kernel from multiple disks, versions, kernel options

45
Q

What does the term SYSGEN refer to?

A

In computing System generation or sysgen is the process of creating a particular unique instance of an operating system by combining user-specified options and parameters with manufacturer-supplied general-purpose program code to produce an operating system tailored for a particular hardware and software environment.