@@ -335,4 +335,45 @@ \subsubsection{Flow Control}
335
335
\end {minted }
336
336
\end {example }
337
337
338
- \end {enumerate }
338
+ \end {enumerate }
339
+
340
+ \subsection {Operating System Support }
341
+
342
+ The operating system (OS) is a software that controls the execution of programs and
343
+ manages hardware resources. It allows a computer to be used efficiently and conveniently.
344
+
345
+ \textbf {Services provided by the OS }:
346
+ \begin {itemize }
347
+ \item \textbf {Program Creation } -- through compilers, assemblers, editors, debuggers etc.
348
+ \item \textbf {Program Execution } -- through loading programs into memory and preparing resources for the program
349
+ \item \textbf {I/O Access } -- through providing a uniform I/O interface while the implementation is left to the OS
350
+ \item \textbf {File System Management }
351
+ \item \textbf {System Access } -- control access to system resources to prevent unauthorised users
352
+ \item \textbf {Error Detection and Response }
353
+ \item \textbf {Accounting } -- collecting usage statistics and monitoring performance parameters
354
+ \end {itemize }
355
+
356
+ \subsubsection {OS Protection Scheme }
357
+
358
+ Most OSs uses two modes of operation: \textbf {user mode } and \textbf {kernel mode }.
359
+ The CPU will execute in different modes to facilitate protection. Some OSs may use up
360
+ to four modes. Some resources are only accessible in kernel mode.
361
+
362
+ An OS is supposed to be well-tested, while bugs may exist in user programs.
363
+
364
+ OS functions are usually accessed via special entry points called \textbf {system calls }.
365
+ Upon a system call, the CPU will switch from user mode to kernel mode.
366
+
367
+ \subsubsection {Multitasking, Time Sharing \& Process Scheduling }
368
+
369
+ To fully utilise the CPU, the CPU is shared among multiple processes. Each process
370
+ is given a time slice to execute. When it uses up its time slice, the CPU will
371
+ suspend the execution and switch to another process.
372
+
373
+ The OS maintains a queue of processes in which the order of execution depends on
374
+ several factors, such as priority, waiting time, whether the process has used up
375
+ its time slice (i.e. CPU-bound jobs), the current system load, etc.
376
+
377
+ \subsection {Processor Organisation }
378
+
379
+ \subsection {Rich Instruction Set Architecture (RISC) }
0 commit comments