CIS 3207 Midterm Review PDF

Title CIS 3207 Midterm Review
Course Introduction to Systems Programming and Operating Systems
Institution Temple University
Pages 12
File Size 194.1 KB
File Type PDF
Total Downloads 12
Total Views 179

Summary

CIS 3207 Midterm Review...


Description

3207 Midterm Review

Quiz 1 Answers (sept. 11) TRUE : The OS masks the details of the hardware from the programmer and provides the programmer with a convenient interface for using the system TRUE : The ‘interrupt stage’ of the instruction cycle executes after the fetch and execute stages have completed FALSE : The PSW includes a bit that specifies that the program is executing in User Mode or Kernel Mode. A user program can set the Mode bit to Kernel when it is necessary to safely access privileged instructions and memory addresses. FALSE : A program executing in a system with an OS has a stack. When the process is interrupted, the program counter and processor status word are pushed onto the process’ stack to save the process state while the interrupt is serviced. TRUE : During a DMA transfer, the processor executes more slowly because it must pause for a bus cycle (Read or write) while another device transfers data using the bus FALSE : In a two-level memory hierarchy, such as cache and main memory, the Hit Ratio is defined as the fraction of all memory accesses found in the slower memory. TRUE : In Linux, if you want to copy data from a particular record in one file to a record in another file, and then check if the correct number of bytes have been transferred, you could use a code sequence such as: ret_read = read(inputFD, &buffer, Num-to-Copy); ret_write = write (outputFD, &buffer, Num-to-Copy); if (ret_read == ret_write){ OK }; WRITTEN ANSWER: q: The CPU does fetch-decode-execute in a forever loop. Suppose that the CPU is executing a user’s program. In a multi-tasking OS, if the program is buggy or malicious, how is it that the program doesn’t take hold of the CPU forever preventing operation system code from running? a: In the OS there is a unversal built-in clock that will give the buggy programs a limited amount of time before keeping the CPU forever. It will stop the process for now by calling an interrupt and move onto another process of higher priority FALSE : If we were to scan through memory looking at memory cell contents pointed to at any instant by the program counter, we would be able to tell is the cell contained an instruction opcode or data Quiz 1 cont. TRUE : Memory mapped I/O is a method by with the CPU executes general machine instructions to directly manipulate the registers of a device ____________________________________________________________________________ Quiz 2 Answers (sept. 25) FALSE : In a multithreaded environment there are separate stacks for each thread, as well as a separate

3207 Midterm Review

control block for each thread FALSE : Termination of a process does not terminate all threads within that process A thread includes all of the the following, except an ADDRESS SPACE When a process is in the READY/SUSPEND state it is in secondary memory but is available for execution as soon as it is loaded into main memory FALSE : On a uniprocessor, multiprogramming does not enable the interleaving of multiple threads within multiple processes Assume that initially the process ID executing the following code is 2394, and the PID always increases sequentially by 1. For example, the first time this process calls fork() the PID of the child is 2395. You can also assume no other processes in the system are calling fork() after this program starts to execute. for (i = 0; i...


Similar Free PDFs