2 – Operating Systems



Marian Marinov     Borislav Varadinov
CEO of 1H Ltd.   System Administrator
mm@1h.com             bobi [ at ] itp.bg
What is Operating System?
➢ To manages hardware resources.

➢ To provides common services for
the application developers.

➢To acts as an intermediary
between the user(s) and the
computer system. From a user’s
point of view, the operating system
is there to execute programs.
➢Non-interrupted execution

➢Interrupted execution
Arduino example
Arduino example
Kernel architecture

     l space
Kerne

            e
  User spac
Monolithic kernels
Micro kernels
Hybrid kernels
Kernel architectures
Kernel software
➢   CPU Handling
➢   Memory Manager
➢   Interrupt handler
➢   Device drivers
➢   File systems
➢   Network
➢   CPU Scheduler
➢   I/O Scheduler
➢   Network Scheduler
➢   Security mechanisms
Multi-platform
➢   27 CPU Architectures
➢   x86 / x86_64
➢   RISC / PA-RISC
➢   SPARC
➢   ARM
➢   24 x86 CPU types
➢   486/586/K5...
➢   Athlon/Opteron
➢   Cyrix
➢   AMD Elan
➢   Winchip
➢   Intel Pentium*, Atom, Core*
Memory Manager (MM)

➢ Does the physical memory allocation
➢ Implements Physical Address Extension
(PAE)

➢   Linux specific allocation
➢   SLAB – per cpu and per node queues
➢   SLUB – faster and default
➢   SLOB – fragmentation
➢   Memory compaction
➢   Huge pages
Interrupt Manager




➢This code is a simple
 dispatcher of events
Device drivers....
File Systems
➢ The Virtual File System(VFS) layer is the
'One ring to rule them all' system in terms of
file systems.
➢ It is responsible for the main file system
cache
➢ Devices
                   Network           Et
                                  W he
                                W i F i rn
                              G iM         et
➢ Drivers                    A PR ax
                              m S
                               at /H
➢ Protocols                      eu S
                                   r R DP
                                      ad A
                                        io

                   ARP
                     IP
                       MP
                    IC P
                      UD
     SC                TCP
   DC TP
 RD CP




                                   Tu AN es
B. S




                                     VL idg
  A.




                                     nn s
                                          s
    T.M




                                       el
                                      Br
        .A
          .N
               .
Types of Operating Systems

➢   Single/Multi-platform
➢   Single/Multi-processing
➢   Single/Multi-tasking
➢   Cooperative
➢   Preemptive
➢   Single/Multi-threading
➢   Single/Multi-user
➢   Real-time
Thread scheduling
➢ Windows

➢ Linux
  - Completely Fair Scheduler (CSF)
  - Niceness
          CPU Core 0       CPU Core 1

          Level 00
           Level 0         Level -19
                            Level 00
            Level 0
          PIDLevelTICKS
                             Level 0
           PID TICKS       PIDLevelTICKS
                            PID TICKS
            PID    TICKS     PID    TICKS
          21426 185TICKS
             PID 185
           21426           31512 132TICKS
                              PID
            21426 185       21426 185
          64723 200185
             21426           21426 185
           64723 200       34231 94 185
                              21426
                            64723 200
            64723 200        64723 200
             64723 200        64723 200
I/O scheduling

➢Linux I/O schedulers
➢ Completely Fair Queuing - per-process
queues and then allocates time slices for
each of the queues to access the disk
➢ Anticipatory - "anticipating" synchronous
read, good for video streaming
➢ Deadline - imposing a deadline on all I/O
operations to prevent starvation of requests
➢ Noop - simple FIFO queue and implements
request merging
Network scheduling
➢ Windows

➢ Linux
➢ Traffic queuing with
 different 23 different QoS
 mechanisms
➢ INGRESS and
 EGRESS queuing
Hardware




http://academy.telerik.com/student-courses/software-technologies/os-windows-linux/
Free Trainings @ Telerik Academy

   C# Programming @ Telerik Academy
       csharpfundamentals.telerik.com
 Telerik Software Academy

       academy.telerik.com
 Telerik Academy @ Facebook

       facebook.com/TelerikAcademy
 Telerik Software Academy Forums

       forums.academy.telerik.com

2. operating systems

  • 1.
    2 – OperatingSystems Marian Marinov Borislav Varadinov CEO of 1H Ltd. System Administrator mm@1h.com bobi [ at ] itp.bg
  • 4.
    What is OperatingSystem? ➢ To manages hardware resources. ➢ To provides common services for the application developers. ➢To acts as an intermediary between the user(s) and the computer system. From a user’s point of view, the operating system is there to execute programs.
  • 5.
  • 6.
  • 7.
  • 8.
    Kernel architecture l space Kerne e User spac
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
    Kernel software ➢ CPU Handling ➢ Memory Manager ➢ Interrupt handler ➢ Device drivers ➢ File systems ➢ Network ➢ CPU Scheduler ➢ I/O Scheduler ➢ Network Scheduler ➢ Security mechanisms
  • 14.
    Multi-platform ➢ 27 CPU Architectures ➢ x86 / x86_64 ➢ RISC / PA-RISC ➢ SPARC ➢ ARM ➢ 24 x86 CPU types ➢ 486/586/K5... ➢ Athlon/Opteron ➢ Cyrix ➢ AMD Elan ➢ Winchip ➢ Intel Pentium*, Atom, Core*
  • 15.
    Memory Manager (MM) ➢Does the physical memory allocation ➢ Implements Physical Address Extension (PAE) ➢ Linux specific allocation ➢ SLAB – per cpu and per node queues ➢ SLUB – faster and default ➢ SLOB – fragmentation ➢ Memory compaction ➢ Huge pages
  • 16.
    Interrupt Manager ➢This codeis a simple dispatcher of events
  • 17.
  • 18.
    File Systems ➢ TheVirtual File System(VFS) layer is the 'One ring to rule them all' system in terms of file systems. ➢ It is responsible for the main file system cache
  • 19.
    ➢ Devices Network Et W he W i F i rn G iM et ➢ Drivers A PR ax m S at /H ➢ Protocols eu S r R DP ad A io ARP IP MP IC P UD SC TCP DC TP RD CP Tu AN es B. S VL idg A. nn s s T.M el Br .A .N .
  • 20.
    Types of OperatingSystems ➢ Single/Multi-platform ➢ Single/Multi-processing ➢ Single/Multi-tasking ➢ Cooperative ➢ Preemptive ➢ Single/Multi-threading ➢ Single/Multi-user ➢ Real-time
  • 21.
    Thread scheduling ➢ Windows ➢Linux - Completely Fair Scheduler (CSF) - Niceness CPU Core 0 CPU Core 1 Level 00 Level 0 Level -19 Level 00 Level 0 PIDLevelTICKS Level 0 PID TICKS PIDLevelTICKS PID TICKS PID TICKS PID TICKS 21426 185TICKS PID 185 21426 31512 132TICKS PID 21426 185 21426 185 64723 200185 21426 21426 185 64723 200 34231 94 185 21426 64723 200 64723 200 64723 200 64723 200 64723 200
  • 22.
    I/O scheduling ➢Linux I/Oschedulers ➢ Completely Fair Queuing - per-process queues and then allocates time slices for each of the queues to access the disk ➢ Anticipatory - "anticipating" synchronous read, good for video streaming ➢ Deadline - imposing a deadline on all I/O operations to prevent starvation of requests ➢ Noop - simple FIFO queue and implements request merging
  • 23.
    Network scheduling ➢ Windows ➢Linux ➢ Traffic queuing with different 23 different QoS mechanisms ➢ INGRESS and EGRESS queuing
  • 24.
  • 25.
    Free Trainings @Telerik Academy  C# Programming @ Telerik Academy  csharpfundamentals.telerik.com  Telerik Software Academy  academy.telerik.com  Telerik Academy @ Facebook  facebook.com/TelerikAcademy  Telerik Software Academy Forums  forums.academy.telerik.com

Editor's Notes

  • #15 SLAB – Simple List of allocated blocks SLUB – Unqueued slab allocator SLOB – simple list of blocks Normal page - 4k Huge page - 4MB
  • #18 It was introduced to the Linux Kernel in the 2.2 series It provides abstraction layer above the actual file system code