Quiz
Operating system ch 1-6 from textbook
This quiz has question types that open in the usual player.
Questions in this quiz (88)
1What are the three main purposes of an operating system?
- ATo provide an environment for a computer user to execute programs on computer hardware in a convenient and efficient manner.
- BTo allocate the separate resources of the computer as needed to
solve the problem given - CAs a control program it serves two major functions: (1) supervision of the execution of user programs to prevent errors and improper use of the computer, and (2) management of the operation and control of I/O devices
- DTo supervise the allocation of system CPU resources to the needed programs
2List the four steps that are necessary to run a program on a completely
dedicated machine—a computer that is running only that program.- AReserve machine time.
- BManually load program into memory
- CLoad starting address and begin execution.
- DMonitor and control execution of program from console
- EBegin execution of the program from memory
3When is it appropriate for the operating system to forsake this principle and to “waste” resources? Why is such a system not really wasteful?
Single-user systems should maximize use of the system for the user. A GUI might “waste” CPU cycles, but it optimizes the user’s interaction with the system.- ATrue
- BFalse
4Which of the following instructions should be privileged?
- ASet value of timer.
- BRead the clock.
- CClear memory.
- DIssue a trap instruction.
- ETurn off interrupts.
- FModify entries in device-status table.
- GSwitch from user to kernel mode.
- HAccess I/O device.
5Timers could be used to compute the current time. Provide a short de- scription of how this could be accomplished:
The program could set a timer for some time in the future and go to sleep. When it is awakened by the interrupt, it could update its local state, which it is using to keep track of the number of interrupts it has received thus far- ATrue
- BFalse
6The internet is LAN
- ATrue
- BFalse
7 explain what the output will be at Line A

- A5
8how many processes are created?
main counts as 1
- A8
9When a process creates a new process using the fork() operation, which of the following state is shared between the parent process and the child process?
- AStack
- BHeap
- CShared memory segments
10Provide three programming examples in which multithreading provides better performance than a single-threaded solution
- AA Web server that services each request in a separate thread
- BA parallelized application such as matrix multiplication where different parts of the matrix may be worked on in parallel
- CAn interactive GUI program such as a debugger where a thread is used to monitor user input, another thread represents the running application, and a third thread monitors performance
- DAn resource heavy program execution that uses two multithreads to complete processing
11What are two differences between user-level threads and kernel-level threads?
- AUser-level threads are unknown by the kernel, whereas the kernel is aware of kernel threads.
- BOn systems using either M:1 or M:N mapping, user threads are scheduled by the thread library and the kernel schedules kernel threads
- CKernel threads are unknown by the CPU until the user-level thread has completed
12What are the four main components of a computer system?
- Ahardware
- BOS
- Capplication programs
- Dusers
- Ekernel
13provide at least three resources the operating system allocates
- ACPU time
- Bmemory space
- Cfile-storage space
- DI/O devices
- Eprocessing burst time
14What is the common name used to refer to the operating system program
- Akernel
- BCPU
- Croot
15what do mobile operating systems often include in addition to the core kernel?
- Amiddleware
- Bbackend hardware
- Cfrontware
16what is an interrupt?
the occurrence of an event signaled from either software or hardware- ATrue
- BFalse
17what special operation triggers a software interrupt?
- Asystem call
- Broot call
- Ckernel call
18what is an advantage of using solid state disk over magnetic disk?
generally faster than HDD and are nonvolatile- ATrue
- BFalse
19volatile vs nonvolatile storage
[blank_start]volatile[blank_end] - losses contents when power is lost
[blank_start]nonvolatile[blank_end] - retains contents when power is lost- Avolatile
- Bnonvolatile
20what is another term for multiprocessor system
- Aparellel
- Bmultiprocessor
- Cmulti-threaded
21provide at least two advantages of multiprocessor systems
- Aincreased throughput
- Beconomy of scale
- Cincreased reliability
22the most common multiple-processor system uses asymmetric multiprocessing
- ATrue
- BFalse
23what is the name of a multiprocessor system that uses multiple computer cores?
- Amulticore
- Bmultiplex core
- Cmulti-threaded core
24how does a clustered system differ from a multicore system
[blank_start]multicore[blank_end] - multiple cores on a single chip
[blank_start]clustered[blank_end] - gathers together multiple CPU- Amulticore
- Bclustered
25how does multiprogramming increases CPU utilization
by organizing jobs so that CPU always has one to execute- ATrue
- BFalse
26what is the term for a program that has been loaded and is executing
- Aprocess
- Bawaiting execution
- Cdelayed
27what part of the operating system makes the decision with regards to which job it will run
- ACPU scheduling
- Bsystem root
- CCPU pipeline
28What are the two separate modes of operation
- Auser mode and kernel
- BCPU scheduling and threading
29what is the mode of the system at boot time?
- Akernel
- Bsleep
- Cuser mode
30what is the mode of the system when the operating system gains control
- Auser mode
- Bkernel
31what is the mode of the system when a user program is running
- Auser mode
- Bkernel
32two activities the operating system is responsible for in connection with process management
scheduling processes and threads on the CPU
creating and deleting both user and system processes- ATrue
- BFalse
33two activities the operating system is responsible for in connection with memory management
keeping track which parts of memory are currently being used and who is using them
deciding which processes and data to move into and out of memory- ATrue
- BFalse
34managing files is one of the most visible aspects of an operating system
- ATrue
- BFalse
35two activities the operating system is responsible for in connection with file management
creating and deleting files
creating and deleting directories to organize files- ATrue
- BFalse
36two activities the operating system is responsible for in connection with disk management
file-space management
storage allocation- ATrue
- BFalse
37of the following five forms of storage, rank them from fastest to slowest in access time:
1 - [blank_start]registers[blank_end]
2 - [blank_start]cache[blank_end]
3 - [blank_start]main memory[blank_end]
4 - [blank_start]solid state disk[blank_end]
5 - [blank_start]magnetic disk[blank_end]- Aregisters
- Bcache
- Cmain memory
- Dsolid state disk
- Emagnetic disk
38protection vs security:
[blank_start]protection[blank_end] - controls access of process or users to resources defined by the computing system
[blank_start]security[blank_end] - defends a system from external and internal attacks- Aprotection
- Bsecurity
39four common kernel data structures
- Alinks, stacks and queues
- Btrees
- Chash functions and maps
- Dbitmaps
- Eindexed lists
40a bitmap of length N can be used to represent the status of 2N items
- ATrue
- BFalse
41four types of computing environments
- Atraditional computing
- Bmobile computing
- Cdistributed systems
- Dclient-server
- Euser to user server
42linux is an example of an open source operating system
- ATrue
- BFalse
43what are the four components of a process
- Astack
- Bheap
- Cdata
- Dtext
- Etime
- Fspeed
44provide at least three states a process may be in
- Arunning
- Bwaiting
- Cready
- Dqueued
- Escheduled
45what is process control block (PCB)
a process represented in an operating system- also called task control block. contains many pieces of information such as process state, program counter, CPU registers, CPU scheduling information, memory management information and I/O status information- ATrue
- BFalse
46what is another term for process
- Ajob
- Btask
- CI/O
47most operating systems allow a process to have multiple threads
- ATrue
- BFalse
48what is the role of the process scheduler
to switch the CPU among processes so frequently that users can interact with each program while it is running - selects an available process for program execution on the CPU- ATrue
- BFalse
49what is the degree of multiprogramming
the number of processes in memory - controlled by the long term scheduler- ATrue
- BFalse
50what is the term that describes saving the state of one process, and restoring the state of another?
- Acontext switch
- Bprocess switch
- Cmemory switch
51what is the process identifier (PID)
a unique identifier used in most operating systems to identify processes - typically an int- ATrue
- BFalse
52what system call creates a process on UNIX systems
- Afork()
- Bbranch()
- Ctree()
53what system call creates a process on window systems
- AcreateProcess()
- BcreateTree()
- CcreateFork()
54what system call terminates a process on UNIX systems
- Aexit()
- Bterminate()
- Cstop()
55what is the name of the process that UNIX and linux systems assign as the new parent of orphan processes
- Ainit
- Bnew
- Cparent
56what are the two fundamental models of interprocess communication
- Aindependant
- Bcooperating
- Cinter-connect call
57what are the two system calls used with message-passing systems
- Asend()
- Brecieve()
- Cread()
- Dwrite()
58message passing is typically faster than shared memory
- ATrue
- BFalse
59provide at least two types of communication mechanisms in client-server systems
- Asockets
- Bpipes
- Clinks
60TCP sockets are:
- Aconnection-oriented
- Bconnection-less
61UDP sockets are:
- Aconnection-oriented
- Bconnection-less
62what is parameter marshaling?
involves packaging the parameters into a form that can be transmitted over a network- ATrue
- BFalse
63two types of pipes:
- Aordinary pipes
- Bnamed pipes
- Clinked pipes
- Dshort pipes
64how many threads does a traditional heavyweight process have
- Aone thread
- Btwo thread
- Cunknown amount of thread
65three benefits of multithreaded programming
- Aresponsive
- Beconomy
- Cscalability
- Duser suitability
66concurrency is only possible with parallelism
- ATrue
- BFalse
67amdahl's law addresses the disproportionate effect of the serial portion of a program
- ATrue
- BFalse
68three challenges when designing programming for multicore systems
- Aidentify the tasks
- Bdata splitting
- Ctesting and debugging
- Dperformance of split tasks
69What are two general types of parallelism
[blank_start]data parallelism[blank_end] - focuses on distribution subsets of the same data across multiple computing cores and performing the same operation on each core
[blank_start]task parallelism[blank_end] - involves distributing not data but tasks across multiple cores- Adata parallelism
- Btask parallelism
70three common ways of mapping user threads to kernel threads
- Amany to one
- Bone to one
- Cmany to many
- Done to none
71only linux and windows implement the one to one model
- ATrue
- BFalse
72what are the main thread libraries in use
- APThread
- Bwindow thread
- Cjava thread
- Duser thread
- ECPU thread
73what is the PThread API for creating a thread
- Apthread_create()
- BcreateThread()
74what is the windows API for creating a thead
- AcreateThread()
- Bpthread_create()
75the semantics of the fork() call can vary on multithreaded systems
- ATrue
- BFalse
76window threads provide both user and kernel stacks
- ATrue
- BFalse
77what term does linux use to refer to n process of a thead
- Atask
- Bthread
- Cprocess
78a nonpreemptive kernel is essentially free from race conditions
- ATrue
- BFalse
79all solutions to the critical selection problem are based on the premise of looking
- ATrue
- BFalse
80two functions used with mutex locks
- Aaccuire()
- Brelease()
- Clock()
- Dobtain()
81what are the two operations that can be performed on a semaphore
- Await() and signal()
- Bdelay() and assign()
82how many writers may concurrently share the database with the readers-writer problem
- A1
- B2
- C3
- D0
83what is the problem if all philosophers simultaneously pick up their left fork
creates a deadlock- ATrue
- BFalse
84what is the term used to describe the segment of code where shared data is accessed and possibly manipulated
- Acritical selection
- Bdeadlock
- Cmuplex
85what are the three requirements that the critical-section problem must satisfy
- Amutual exclusion
- Bprogress
- Cbound waiting
- DCPU scheduling
86To calculate the # of processes created by multiple fork() calls use the following method:
2n where n is number of fork system calls.
example:
fork()
fork()
fork()
2^3 = 8 processes- ATrue
- BFalse
87Predict the Output of the following program
void forkexample()
{
// child process because return value zero
if (fork() == 0)
printf("Hello from Child!\n");
// parent process because return value non-zero.
else
printf("Hello from Parent!\n");
}- AHello from Child!
Hello from Parent! - BHello from Parent!
Hello from Child! - Cboth are correct
- AHello from Child!
88[blank_start]Arrival Time[blank_end]: Time at which the process arrives in the ready queue.
[blank_start]Completion Time[blank_end]: Time at which process completes its execution.
[blank_start]Burst Time[blank_end]: Time required by a process for CPU execution.
Turn Around Time: Time Difference between completion time and arrival time.
Turn Around Time = Completion Time – Arrival Time
Waiting Time(W.T): Time Difference between turn around time and burst time.
Waiting Time = Turn Around Time – Burst Time- AArrival Time
- BCompletion Time
- CBurst Time
Information
- Description
- Computer Science Quiz on Operating system ch 1-6 from textbook, created by Duncan Levings on 29/10/2019.
- Author
- Duncan Levings
- Language
- English
- Views
- 7
- Tags
- Rating
- No ratings yet Rate this quiz