Please enable JavaScript.
Coggle requires JavaScript to display documents.
CORE - Coggle Diagram
CORE
Operating System
Process Management
Program counter: :checkered_flag: Pointer to the address of the next instruction to be executed for this process.
-
Memory Management Information: The page table, memory limitations, and the segment table depending on memory used by the OS.
-
-
stack, heap, text, and data.
The text section comprises the compiled program code, read in from non-volatile storage when the program is launched.
The data section stores global and static variables, allocated and initialized prior to executing main.
The heap is used for dynamic memory allocation, and is managed via calls to new, delete, malloc, free, etc.
The stack is used for local variables. Space on the stack is reserved for local variables when they are declared ( at function entrance or elsewhere, depending on the language ), and space is freed up when the variables go out of scope. Note that the stack is also used for function return values, and the exact mechanisms of stack management may be language specific.
-
When processes are swapped out of memory and later restored, additional information must also be stored and restored.
-
-
PCB
Process **State** - Running, waiting, etc., as discussed above.
Process ID, and parent process ID.
CPU registers and Program Counter - These need to be saved and restored when swapping processes in and out of the CPU.
-
-
Accounting information - user and kernel CPU time consumed, account numbers, limits, etc.
I/O Status information - Devices allocated, open file tables, etc.
Process scheduling
-
Schedulers
-
short term schedular
CPU Scheduler, keeps cpu busy all the time.
Process Creation
Processes may create other processes through appropriate system calls, such as fork or spawn. The process which does the creating is termed the parent of the other process, which is termed its child.
On typical UNIX systems the process scheduler is termed sched, and is given PID 0.
The first thing it does at system startup time is to launch init, which gives that process PID 1
Init then launches all system daemons and user logins, and becomes the ultimate parent of all other processes.
-
-
Threads
A thread is a basic unit of CPU utilization, consisting of a program counter, a stack, and a set of registers, ( and a thread ID. )
-
-
-
-
-
memory Management
memory chips point of view, all memory accesses are equivalent.
The memory hardware doesn't know what a particular part of memory is being used for, nor does it care.
This is almost true of the OS as well, although not entirely.
-
Memory accesses to registers are very fast, generally one clock tick, and a CPU may be able to execute more than one machine instruction per clock tick.
Memory accesses to main memory are comparatively slow, and may take a number of clock ticks to complete
The basic idea of the cache is to transfer chunks of memory at a time from the main memory to the cache, and then to access individual memory locations one at a time from the cache.
User processes must be restricted so that they only access memory locations that "belong" to that particular process.
This is usually implemented using a base register and a limit register for each process,
The OS obviously has access to all existing memory locations, as this is necessary to swap users' code and data in and out of memory
It should also be obvious that changing the contents of the base and limit registers is a privileged activity, allowed only to the OS kernel.
Address Binding
symbolic names must be mapped or bound to physical memory addresses, which typically occurs in several stages:
Compile Time - If it is known at compile time where a program will reside in physical memory, then absolute code can be generated by the compiler, containing actual physical addresses. However if the load address changes at some later time, then the program will have to be recompiled. DOS .COM programs use compile time binding.
Load Time - If the location at which a program will be loaded is not known at compile time, then the compiler must generate relocatable code, which references addresses relative to the start of the program. If that starting address changes, then the program must be reloaded but not recompiled.
Execution Time - If a program can be moved around in memory during the course of its execution, then binding must be delayed until execution time. This requires special hardware,
-
Dynamic Loading
Rather than loading an entire program into memory at once, dynamic loading loads up each routine as it is called
With static linking library modules get fully included in executable modules, wasting both disk space and main memory usage
With dynamic linking, however, only a stub is linked into the executable module, containing references to the actual library module linked in at run time
-
-
-