Commit b7b0a54
Changed files (1)
doc
doc/1.md
@@ -0,0 +1,79 @@
+# Chapter 1
+
+> An operating system is a program that manages the computer hardware.
+
+4 high level components:
+
+* hardware
+ * CPU, memory, I/O devices provide computing resources for the system.
+* operating system
+ * controls the hardware and coordinates its use among the various applicatoin programs for the various users.
+* application programs
+ * word processors, spreadsheets, compilers, web browsers define ways to use resources to solve users' computer problems.
+* users
+
+We can also view a computer system as:
+
+* hardware
+* software
+* data
+
+The OS provides the mans for proper use of these resources in the operation of the computer system.
+The OS performs no useful function by itself.
+It provides an environment within which other programs can do useful work.
+
+## User View
+
+Most computer users sit in front of a PC that has
+
+* a monitor
+* keyboard
+* mouse
+* and system unit
+
+Another usage is where a user sits at a terminal connected to a mainframe
+or a minicomputer. Other users access the same computer through other terminals.
+These users share resources and may exchange information.
+
+The operating system is the one program running at all times on the computer - usually called the kernel.
+Along with the kernel there are systems programs, which are associated with the operating system but are not part of the kernel, and application programs, which include all programs not associated with the operation of the system.
+
+1. bootstrap program stored in ROM or EEPROM known as firmware.
+ * initializes CPU registers, device controllers, memory contents.
+ * must know how to load the operating system
+ * must load the operating system kernel
+ * execute first process known as init.
+* occurrence of an event is signaled by an interrupt from either hardware or software.
+* hardware may send signal to CPU to trigger an interrupt via the system bus.
+* software may trigger an interrupt by executing system calls.
+* when a CPU is interrupted it stops what it is doing and immediately transfers execution to a fixed location.
+The fixed location usually contains the starting address where the service routine for the interrupt is located.
+Interrupts must be handled quickly so only a predefined # of interrupts is possible.
+
+> Interrupt vector: table of interrupt addresses.
+
+The CPU can load instructions only from memory, so any programs to run must be stored there.
+All forms of memory provide an array of words. Each word has its own address.
+Interaction is achieved through a sequence of `load` or `store` instructions to specific memory addresses.
+The `load` instruction moves a word from main memory to an internal register within the CPU, whereas the
+`store` instruction moves the content of a register to main memory.
+
+von Neumann architecture:
+1. fetch instruction from memory and store that instruction in the instruction register.
+2. decode instruction. may cause operands to be fetched from memory and stored in some internal register.
+3. execute instruction
+4. store result back in register
+
+Memory unit only sees a stream of memory addresses.
+
+Ideally, we want programs and data to reside in main memory. This
+is usually not possible because:
+
+1. main memory is usually too small to store all needed programs and data permanently.
+2. main memory is a volatile storage device that loses its contents when power is removed.
+
+Most computer systems use secondary storage as an extension of main memory.
+Secondary storage must be able to hold large quantities of data permanently.
+
+The magnetic disk is a common secondary storage device.
+Most programs are stored on disk until they are loaded into memory.