Thursday 28 January 2016

OS notes

This semester will be end in the next week, there I clear up a lot of notes for Operating System.

History:

Why so differents?
-Because computing power is limited,more computing power,more complexity forces OS designers and vendors to simplify and reuse more components.




The possible hardware architectures: Asymmetric Multi-Processing and Symmetric Multi-Processing.An AMP system has multiple CPUs, each of which may be a different architecture (but can be the same. Like AMP, an SMP system has multiple CPUs, but in this case each has exactly the same architecture .
In AMP mode, each core has its own copy of a kernel, which could be different (heterogeneous operating systems) from, or identical (homogenous operating systems) to, the one the other core is executing.

In SMP mode, a single operating system (OS) runs on all processors, which access a single image of the OS in the memory. The OS is responsible for extracting parallelism in the application. It dynamically partitions tasks across the processors, manages the ordering of task completion, and controls the sharing of all resources between the cores.


Inside OS
1. Kernel: basic functionalities, syscalls
 2.Services: Accounts (login, nsswitch), Display Service
 3.Libraries: support functions, APIs (libc, libm, OpenGL)
 4.Applications: Web browser, Text Editor
 5.Support Applications: Terminal Emulator


Process

program: static object that contain code
processus: program in execution
context: address espace, registers, etc..


Communication between proccesses
Explicit communication
-automatic created by system
-uni or bidirectional link
-2 processes per link

Implicit communication
-link etablished with processes sharing the same port
-multipe processes per link
-uni or bidirectional link




Thread


a link note the difference between thread and process, in chinese:

http://blog.csdn.net/mxsgoden/article/details/8821936


Scheduling  



differents type of schedulers
-long term: which determines which programs are admitted to the system for execution and when, and which ones should be exited.(FCFS, Priority schemes)
-short term: which determines which of the ready processes can have CPU resources, and for how long.
-middle term: which determines when processes are to be suspended and resumed.(swapping)
-Cooperative:only block or terminated processes
-Preemptive:all type of events, needs for hardware support

When to schedule
-blocked processes
-terminate a process
-new process spawn
-blocked a process and becomes ready

Criteria
different criteria to consider when trying to select the "best" scheduling algorithm
○ CPU utilization
○ Throughput
○ Turnaround time
○ Waiting time
○ Response time


Differents scheduling algo
-FCFS:SCHED_FIFO, better for sharing time,
-Round Robin:
-Multiple priority queue
-Lottery scheduling:random ticket
-Completely Fair scheduling:
-Real Time scheduling

Memory Virtualization
In the cpu
-memory management unit
-page table/page directory: contains memory mappings
-page direction base pointer (PDBP): address to an address space
In the OS
-1 PDBP per task (isolated address space), 4096kb per page.




No comments:

Post a Comment