diff options
| author | mo khan <mo@mokhan.ca> | 2021-02-08 14:06:59 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-02-08 14:06:59 -0700 |
| commit | 707ab72bf2f02e6413db6290536a74c2e388e941 (patch) | |
| tree | 6f35b65c6aa2797208cdb87ddd7a977c65db0da7 /doc/assignment1.md | |
| parent | f591f89ae06893a311e4a53ea0d6c4a51b2f145e (diff) | |
fill in the blanks
Diffstat (limited to 'doc/assignment1.md')
| -rw-r--r-- | doc/assignment1.md | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/doc/assignment1.md b/doc/assignment1.md index c544bd3..ca89755 100644 --- a/doc/assignment1.md +++ b/doc/assignment1.md @@ -34,7 +34,7 @@ Instructions: Please answer the following questions in complete sentences. Your ``` Programs can also trap a signal and handle them. In the following example - the Ruby program is trapping the `SIGUSR1` signal to reload a configuration + the Ruby program is trapping the `SIGUSR1` signal to exit the program. file. ```ruby @@ -66,35 +66,18 @@ Instructions: Please answer the following questions in complete sentences. Your 1. How does a computer system with von Neumann architecture execute an instruction? - * fetch instruction from memory and store that instruction in the instruction register. - * decode instruction. may cause operands to be fetched from memory and stored in some internal register. - * execute instruction - * store result back in register + The first step is to fetch the next instruction to execute and put it + into memory. The instruction is given to the CPU and the program counter + is incremented. + The second step is for the CPU to decode the instruction and prepare to execute. + The third step is to execute the instruction. This may require the CPU to + utilize the ALU and control unit. + The fourth step is to store the result in a register or memory. - ```plaintext - ------------- - | --------- | - | | CPU | | - | | ----- | | - | | |CU | | | - | | ----- | | - ---------- | | ----- | | ---------- - | Input | | | |ALU| | | ----> | Output | - | Device |----> | | ----- | | | Device | - ---------- | --------- | ---------- - | | A | - | V | | - | --------- | - | | MU | | - | --------- | - ------------- - - CPU: Central Processing Unit - CU: Control Unit - ALU: Arithmetic/Logic Unit - MU: Memory Unit - ``` - [source][wiki-von-neumann] + 1. Fetch + 2. Decode + 3. Execute + 4. Store 1. What role do device controllers and device drivers play in a computer system? @@ -132,8 +115,8 @@ Instructions: Please answer the following questions in complete sentences. Your 1. Describe an operating system's two modes of operation. - kernel mode: executes tasks on behalf of the operating system. - user mode: executes tasks on behalf of the user. + * kernel mode: executes tasks on behalf of the operating system. + * user mode: executes tasks on behalf of the user. Whenever the operating system gains control of the computer, it is in kernel mode. The dual modes of operation provides a way for protecting the operating system @@ -185,13 +168,21 @@ Instructions: Please answer the following questions in complete sentences. Your 1. Describe some requirements and goals to consider when designing an operating system. - 1. Provide a system call interface for user mode programs to use. - 2. Provide compilers, linkers etc to build user mode programs. - 3. Provide consistent abstractions to shield user mode programs from needing to know the details of each piece of hardware. - 4. Can execute multiple tasks concurrently - 5. Can operate against different combinations of hardware without impact to user mode programs. - 6. Process management - 7. Memory management + When designing an operating system it is important to consider the needs of + the runtime environment. Some questions to consider are: + + 1. Will there be a need to run multiple programs simultaneously? + 2. Will there be a need to isolate programs from one another? + 3. Will there be a need to build user mode programs to access privileged instructions? + 4. Will there be a need for high availability and guaranteed uptime? + 5. What types of hardware will the operating system need to work with? + + These questions will help guide the design of a system call interface, + compilers, linkers and other build tools. It will help identify + the types of abstractions that the operating system may need to + provide and whether or not it will need to process multiple + tasks simultaneously or not. Finally, this will identify constraints + for process and memory management. 1. Explain why a modular kernel may be the best of the current operating system design techniques. @@ -245,6 +236,14 @@ Instructions: Please answer the following questions in about 1-2 pages each. ``` [source][wiki-von-neumann] + In the von Neumann architecture an input device may trigger + a signal to be handled by the operating system. The control + unit will need to fetch the privileged instruction to place + into a register or the memory unit to provide to the CPU to execute. + The ALU will decode the instruction and then the instruction will + be executed. The result is then stored in a register or the main + memory unit to be written to the output device. + * Input device: Includes keyboard, mouse, camera, microphone etc. * CPU: Contains the control unit, arithmetic logic unit and main memory * CU: Control unit handles all processor control signals. It directs I/O flow, fetches code for instructions and controls how data moves around. |
