Test
385 midterm
Crea una cuenta gratis para terminar este test
Guarda tu progreso y consulta tu resultado final.
¿Ya tienes cuenta? Inicia sesión
Preguntas del test (85)
1What is true of the operating system kernel for a modern system?
- AThe kernel code executes in response to hardware interrupts and system calls
- BThe kernel only stores resource state, it does not execute code
- CThe kernel code executes when the kernel process is scheduled
- DThe kernel code is always executing
2Which one of these is not a kernel structure?
- Amodules
- Blayered
- Cmacrokernel
- Dmicrokernel
3Microkernels
- Adynamically load modules at run time
- Ballow programs to write directly to disks and other I/O devices
- Cprovide minimal process support in the kernel
- Dare broken into layers
4xv6 is a
- Alayered kernel
- Bmonolithic kernel
- Cmicrokernel
- Dnone of the above
5What is the main reason that we trap into the kernel at fixed points in the kernel code?
- AUsability: It makes the kernel code easier for programmers to use
- BReliability: It means kernel code always behaves the same
- CSecurity: It means programs can't use the kernel code in unintended ways
- DMore than one of the above
6What's wrong with MS-DOS?

- AHard to add functionality
- BInsecure
- CLess efficient
- DMore than one of the above
7What is wrong with UNIX?

- ADifficult to implement/maintain
- BLack of hardware protection
- CInefficient
- DMore than one of the above
8What is wrong with the layered structure?

- AEach layer provides abstraction
- BInsecure
- CHard to figure out logical layers
- DHard to modify
9What is wrong with microkernels?

- AInefficient
- BInsecure
- CHard to change
- DMore than one of the above
10What is NOT true about modules?
- AFeatures can easily be added to the kernel
- BHave a lot of overhead
- CMore flexible than layers
- DNone of the above
11What keeps a process from just running forever?
- AEventually it will need to syscall
- BTimer interrupts
- CEventually it will run out of memory
12When a process is in the kernel, function calls use
- Athe kernel heap
- Bthe process heap
- Cthe process stack
- Dthe kernel stack
13The kernel is entered when what happens?
- AException
- BInterrupt
- CSystem Call
- DAll of the above
14Why shouldn't processes control context switching?
- AIt would cause too much overhead
- BThey don't have enough information about the other processes
- CThey could refuse to give up the CPU
15A process CANNOT go from
- ARunning to Runnable
- BRunnable to Running
- CRunning to Sleeping/Blocked
- DRunnable to Sleeping/Blocked
16What happens if you try to run a privileged instruction in user mode?
- AIt traps into the kernel
- BNothing happens
- CIt fails and returns an error message
17What takes the most time [during a system call]?
- APerforming the calculation
- BEntering/exiting the kernel
- CStoring the return value
18What call creates a new address space for a process?
- AExit()
- BExec()
- CWait()
- DFork()
19If a process has exited, but its parent has not called wait, it is a(n)
- Aorphan
- Bzombie
- Cwitch
- DNone of the above
20What is used to copy a new program into an address space?
- AExec()
- BWait()
- CExit()
- DFork()
21Why can't we just have one stack in the kernel?
- AWe could, it world work fine with a single stack
- BFor security: otherwise, processes could get information about each other
- CBecause of preemption: when we switch between processes, they are at different points in the stack
22Why don't we have per-process data sections in the kernel?
- AIt would take up too much space
- BThe kernel uses the same variable across multiple processes
- CSwitching between them would be too much overhead
23What order will the PID be printed in?
- AFirst parent, then child
- BFirst child, then parent
- CIt will vary
24Exit will return
- Aonce
- Btwice
- Czero times
- Dzero times, unless there are errors
25The xv6 kernel is loaded by
- Athe init function
- Ba bootloader
- Cthe paging hardware
26The allocproc() function
- AAdds a new process to the proc table
- BSets up the stack for the process
- CStarts running the process
- DA and B
27The scheduler selects a process with the state of _____ to put on the CPU
- ARUNNING
- BRUNNABLE
- CEMBRYO
- DSLEEPING
28Why have a bootloader on disk rather than ROM?
- AIts faster to run it from the disk than in ROM
- BCan have bigger bootloader
- CEasier to change functionality
- DB and C
- EA and B
29The bootloader loads xv6 into memory at 0x100000 in physical memory. Why does it need to load at this particular spot?
- AVirtual memory is not turned on yet
- BMemory below 0x100000 is used for I/O devices
- CPhysical memory may not exist at 0x80000000
- DMore than one of the above
30Why do we need to map both virtual addresses 0x0 and 0x80000000 to physical address 0x0?
- AThe entry code is still running using the original (physical) addresses for things
- BIt is a redundancy system in case 0x80000000 mapping fails to be created
- CMuch like the Klingons have two of every internal organ in case one gets injured in battle, we need two virtual addresses in case of program errors
31What are we doing in this code?

- AWe want the stack pointer to point at forkret, so the process will start executing there
- BWe want the instruction pointer to point at forkret, so the process will start executing there
- CWe want the stack pointer to point at trapret, so the process will start executing there
32In modern systems, the physical memory address of every global/static variable is generated by the compiler at compile time.
- ATrue
- BFalse
33An unused piece of memory within an allocated memory region leads to
- Amemory compaction
- Bmemory fragmentation
- Cmemory partitioning
34Which of these is NOT true of the buddy system?
- AIt allocates memory in powers of two
- BIt coalesces neighboring memory regions
- CIt eliminates fragmentation
35Which is true regarding the size of segments?
- AIt depends on the operating system
- BAll segments are the same time
- CSegments are different sizes
36An address in segments has
- AThe segment number and an offset
- BThe segment number
- Cthe segment number and the segment size
37With segments, logical memory is translated to physical memory using the
- Apage table
- Bsegment table
- Cmemory table
38What form of fragmentation is easiest for the OS to reduce/eliminate?
- AInternal fragmentation
- BExternal fragmentation
- CNeither
- DBoth
39What memory allocation algorithm leaves the smallest fragments (external)?
- Afirst-fit
- Bworst-fit
- Cbest-fit
40Where would worst-fit place this memory chunk?

- AA
- BB
- CC
41How would the buddy system allocate the following requests? Assume 8 MB free initially.
Alloc 3 MB, Alloc 1.5 MB, Alloc 1 MB
- AA
- BB
- CC
42Will the base register alone provide protection?

- AYes
- BNo
43Given what we currently know about memory, what must we do during a context switch?
- AAllocate memory to the switching process
- BLoad the base and bound registers
- CConvert logical to physical memory addresses
44Segments
- AAre all the same size
- BAre associated with a single process
- CCannot change size after allocation
- DNone of the above
45What is the physical address?

- A8000
- B9200
- CNone, it gives an error
465 bit segment address, 32 bit logical address, 1 GB physical memory. How many entries will we have in our segment table?
- A32: the logical address size is 32 bits
- B32: the segment address is 5 bits
- C30: We need to address 1 GB of physical memory
47How many bits do we need for the base?

- A30 bits, to address 2^30 bytes (1 GB) of physical memory
- B5 bits, because that's how many segment bits we have
- C27 bits, because that's how many offset bits we have
48How many bits do we need for the bound?

- A5 bits: the size of the segment portion of the virtual address
- B27 bits: the size of the offset portion of the virtual address
- C32 bits: the size of the virtual address
49When using paging, a logical memory page is
- Asmaller than a physical memory frame
- Bthe same size as a physical memory frame
- Clarger than a physical memory frame
50The "offset" portion of a logical address specifies
- Awhich entry to use in the paging table
- Bthe page containing the address' data
- Cthe frame containing the address' data
- Dthe location of a byte within a frame
51A page fault occurs when a process
- Atries to access a page that's not in memory
- Bruns out of free memory
- Cswaps a portion of its memory out to disk
52Which is false
- ASegments cause more external fragmentation
- BPages cause more internal fragmentation than segements
- CA process will have more pages than it would have segments
- DMore than one of the above
53Given 32 bit logical, 1 GB physical memory (max)
How many entries are there in the page table?
- A2^12 because that's how many the offset field can address
- B2^20 because that's how many the page field can address
- C2^30 because that's how many we need to address 1 GB
- D2^32 because that's how many the entire address can address
54Given 32 bit logical, 1 GB physical memory (max) with 20 bit page number and 12 bit offset.
What will be the frame size?
- A2^8 bytes, the page addresses/offset addresses
- B2^10 bytes, 1 GB of physical memory/1 MB entries
- C2^12 bytes, because that's how much the offset can address
55Given 32 bit logical, 1 GB physical memory (max)
How big is each entry?
- A18 bits
- B21 bits
- C3 bytes
- D4 bytes
56Given 32 bit logical, 1 GB physical memory (max).
How many bits do we need for the frame?- A12
- B18
- C20
- D30
- E32
57Which of these would be true about a multi-level page table, compared to a single-level page table?
- AMulti-level usually use less memory
- BMulti-level usually has faster lookup times
- CBoth cause the same amount of fragmentation
- DMore than one of the above is true
58Which address would generate an error if we attempted to access it?

- ASegment 17, Page 506, Offset 24
- BSegment 18, Page 532, Offset 12
- CBoth of these would generate an error
- DNeither of these would generate an error
59In xv6
- Aeach process' page table includes mappings for the kernel's memory space
- Bonly the kernel's page table includes mappings for the kernel's memory space
60xv6 uses ______ levels of page tables
- A1
- B2
- C3
- D4
61A fault will occur if
- Athe page table entry is not present
- Bthe page directory entry is not present
- Ceither of the above
62Which is false
- AA larger TLB will take more time per lookup
- BMore cached entries will be slower overall
- CThe larger the TLB, the longer a context switch will take
63A page fault occurs. What must we do in response?
- AFind the faulting page on disk
- BEvict a page from memory and and write it to disk
- CBring in the faulting page and retry the operation
- DTwo of the above
- EAll of the above (sometimes)
64When replacing a page in memory, we would prefer to choose a victim page
- Athat has been in memory for a long time
- Bthat has been in memory for a short time
- Cthat will be used again soon
- Dthat will not be used again soon
65In Second-Chance Page Replacement, the reference bit is used to
- Amark pages for deletion
- Bmark which pages have been used recently
- Cmark which pages have been modified but not written to disk
66A process is thrashing if
- Ait is able to execute very quickly
- Bit tries to access a page that is not in memory
- Cit is spending more time paging than executing
67Handling faults from disks seems very expensive. How can we get away with this in practice?
- AWe have lots of memory, and it isn't usually full
- BWe use special hardware to speed things up
- CWe tend to use the same pages over and over
- DThis is too expensive to do in practice!
68What exhibits locality?
- AFor loop
- BDatabase
- CAccessing array elements in order
- DAll of the above
69xv6 context switches
- Adirectly between two user processes
- Bonly in response to a system call like yield
- Cbetween a user process, the kernel scheduler, and another user process
70If a process is CPU-bound, it makes I/O requests
- Afrequently
- Binfrequently
- Cthis term has nothing to do with I/O
71When context switch, xv6 releases the lock on the process table in a different thread than the one that acquired it. This is because
- Athe lock is necessary to protect the scheduler code
- Bthe lock is necessary to protect process context during the context switch
- Cthe processes use the lock to protect against race conditions in user-level code
72What is true of the clock algorithm?
- AClock will always have fewer than FIFO
- BClock will always have the same fault count as LRU
- CClock will always have more faults than Optimal
- DMore than one of the above
- ENone of the above
73If the working set is bigger than the resident set
- AThrashing will occur
- BA few processes will be able to make progress
- CWe will have space for lots of processes in memory
74The working set for a process will change
- Agradually
- Ball at once
- Cwhen the process' locality changes
- Dmore than one of the above
75What scheduling algorithm is provably optimal in terms of time?
- AFIFS
- BPriority
- CRound Robin
- DShortest job Next
76Which scheduling algorithm can cause starvation?
- AFirst Come First Served
- BPriority
- CRound Robin
77Starvation is
- Aunavoidable
- Bfixed by aging
- Csometimes desireable
78Which is true of round robin schedules relative to first come first served?
- ARound Robin requires knowledge of process run times
- BRound Robin schedules have lower average turnaround times
- CRound Robin schedules have higher average turnaround time
- DRound Robin has higher overhead
- EMore than one of these
79Shortest Process Next
- AIs pre-emptive
- BWill result in the shortest possible average turnaround time
- COnly requires knowledge of process arrival time
80How can we know process service times?
- AHave users tell us
- BGuess based on similar processes
- CGuess based on how long they've already run
- DMore than one of the above
81Is every process guaranteed to run with Shortest Remaining Time?
- AYes
- BNo
82Multi-level feedback queues will naturally prioritize
- Acomputer bound processes
- BI/O bound processes
- Clong running processes
- Dshort processes
83Priority Scheduling is useful when
- AWe want a fast turnaround
- BWe want to favor interactive processes
- CWe want to order processes based on some criteria
84Why would we use Rate Monotonic rather than Earliest Deadline?
- ABetter utilization
- BLess overhead
- CWe should always use Earliest Deadline
85xv6's scheduler is
- AFirst Come, First Served
- BPriority
- CRound Robin
- DMulti-level Queue
Información
- Descripción
- Test sobre 385 midterm, creado por Bresia Prudente el 13/10/2015.
- Autor
- Bresia Prudente
- Idioma
- English
- Visitas
- 0
- Valoración
- Aún sin valoraciones Valora este test