{ "q1": { "type": "blank", "question": "\n\n\nModern operating systems use a basic technique known as ____, which allows\nusers to run as many concurrent processes as they would like on a single\n____. To do this, the OS will need to employ low-level ____ or methods\nsuch as a ____, which gives the OS the ability to stop one program and start\nanother on a given CPU. Additionally, on top of these methods, the OS will\nneed to provide intelligence in the form of ____ or algorithms that make\ndecisions within the OS.\n\n\n" }, "q3": { "type": "blank", "question": "\nA process be in three different states:\n\n
    \n\n
  1. The ____ state is where a process can be ran, but for some reason\n the OS has chosen not to run it at the current moment.
  2. \n\n
  3. The ____ state is where a process has performed some kind of\n operation that makes it unavailable to be ran until another even takes\n place.
  4. \n\n
  5. The ____ state is where a process is actively executing on a processor
  6. \n\n
\n" }, "q2": { "type": "multiple", "question": "\n\n\nWhen a program is executed, the operating system must do which of the\nfollowing tasks (choose all that apply)r?\n\n\n", "responses": { "code": "Load code and static data in memory.", "compile": "Compile the code.", "init": "Signal the init process.", "fs": "Allocate space on the hard drive.", "kill": "Kill an existing process.", "io": "Setup I/O or file descriptors.", "main": "Jump to the main() routine.", "stack": "Create and initialize the stack and heap." } }, "q5": { "type": "order", "question": "\n\n\nSuppose our user application wishes to open a file for reading. Order the\nfollowing events:\n\n\n", "responses": { "jump": "Hardware jumps to trap handler.", "handler": "OS handles track by doing work of syscall.", "return": "OS returns-from-trap.", "trap": "Hardware receives trap.", "syscall": "User application calls open() system call.", "kernelmode": "Hardware moves to kernel mode.", "registers": "Hardware saves registers to kernel stack." } }, "q4": { "type": "blank", "question": "\n\nThe struct task_struct in the Linux source code is the data\nstructure that corresponds to what the book calls a ____. Each individual\nstructure is also known as a ____. In Linux, the struct\ntask_struct has members such as:\n\n\n \n\n" }, "q7": { "type": "multiple", "question": "\n\nDuring a context switch, what information must be saved and restored\n(choose all that apply)?\n\n\n", "responses": { "files": "Open files", "pc": "Program counter", "registers": "General purpose registers", "ksp": "Kernel stack pointer", "memory": "Address space" } }, "q6": { "type": "blank", "question": "\n\n \nOn early versions of the Macintosh operating system, the OS used a ____\napproach where the OS trusts the processes of the system to behave\nreasonably. Of course, this was a terrible idea, so modern operating\nsystems now utilize a ____ to raise a CPU exception, halt the current\nprocess, and load a pre-configured ____ in the OS. When this happens, the\n____ needs to make a decision on which process to run next. If it chooses\nto execute another process, then the OS must perform a ____.\n\n" }, "q8": { "type": "multiple", "question": "\n\nUnix sockets are like normal internet sockets except that (choose all that apply):\n\n\n", "responses": { "read": "Unix sockets are file descriptors while internet sockets are not.", "unix": "Unix sockets can only be used to communicate between two remote unix systems.", "fs": "Unix sockets exist in the local filesystem namespace.", "oneway": "Unix sockets are one-way communication channels like pipes." } } }