Estructura de Sistemas Operativos
M.C. Juan Carlos Olivares Rojas
[email protected]@hotmail.com
@jcolivareshttp://antares.itmorelia.edu.mx/~jcolivar
Enero, 2010
Agenda
1.1. Servicios del sistema operativo
1.2. Interfaz de usuario del sistema operativo
1.3. Llamadas al sistema
1.4. Tipos de llamadas al sistema
Agenda
1.5. Programas del sistema 1.6. Diseño e implementación del sistema
operativo
1.7. Estructura del sistema operativo 1.8. Máquinas virtuales
1.9. Generación de sistemas operativos 1.10. Arranque del sistema
Agenda• Trabajo de Investigación sobre tendencias
en sistemas operativos: miércoles 27 de enero.
• Investigación sobre Llamadas a sistemas en POSIX. Martes 2 de febrero
• Práctica sobre llamadas al sistema en sistemas Unix. Miércoles 3 de Febrero
• Virtualización de Sistemas Operativos. Miércoles 10 de Febrero.
Servicios del sistema operativo
El sistema operativo no es cualquier tipo de software…
Operating System DescriptionWhat’s an Operating System?
• It’s a software which control a computer, It acts like a Human-Machine Interface. It manages all the resources (hardware and software) of a Computer System.
• What’s a System?• It’s a set of elements which are
interrelated for achiving a common objective.
Introduction
Operating Systems• The objective of an Operating System is
the operation of a Computer.
• It’s the computer principal software which execute when the computer is turned on.
• Does a calculator have an Operating System? Why?
Introduction
Physical Devices
Microprogramming
Machine Language
OPERATING SYSTEM
Compilers EditorsCommand Interpreter
Bank Systems
Reservation Web Browser Application programs
Hardware
System programs
Operating Systems• The Operating System development is
influented by technological development. The Operating System premisses (objective function) are:
• Minimize the effort (human-machine frontier).
• Maximize the computer resources performance
Operating Systems
• The principal resources managed by an Operating System are:
• Process, Tasks, Applications (Process Management)
• Devices, Peripherals (I/O Management)• Memory (Memory Management)• Data (File System)
Operating Systems
Operating Systems
• The esential part of an Operating System is the Kernel.
• An Operating System is executed in supervisor mode of the microprocessor (it can access all microprocessor functions).
• The programs are executed in user mode.
Operating Systems• The Operating Systems actions depends
of the applications that run on it.
• It’s no the same resource administration for a monouser system than multiuser system, or process administration in a multitask system than time-sharing system.
• Operating Systems are totally dependent of computer architectures.
Operating Systems• This is the reason why Operating
Systems such as Windows can not be executed over Power PC Architectures, because it´s linked an x86 Intel Architecture.
• Recently 64 bits microprocessor are becoming popular, for this reason is necesary and special operating Systems for the correct resources utilization.
Operating Systems• Actually Operating System supports
multitasking and concurrence in native form on multiprocessor or multicore processors.
• For the good use of resources, Operating Systems need to use politics and control mechanism. An Operating System has to plan, control, drive and execute all the system operations.
Operating Systems• The programs can access directly to
some function in superivor mode throught a System Call.
• An operating System has an interface to users and other interface to programms (programmers).
• In UNIX this distnction doesn’t exist.
Operating Systems• As well hardware and software are not
mutually exclussive (they are a binom). Operating System are in the middle of this resources.
• Actually the trend is construct operating Systems for Emedded Devices such as: ATM, watchs, PDAs, cell phones, electrodoméstics, etc.
Operating Systems• Another Operating Systems which are
growing are Real-Time OS.
• Examples of Operating Systems are: DOS, Windows, Unix, Linux, Mac OS X, among others.
Interfaz de usuario del sistema operativo
La interface de usuario es lo que un usuario puede ver de un sistema operativo…
Llamadas al sistema
Las llamadas al sistema son una de las partes fundamentales de cualquier sistema operativo…
Operating System Basic Concepts
ACTIVITY:• The principal aspects of an Operating
Systems are: process, file, shell and system calls.
• In pairs, explain with practical exercises how we can note this concept in a OS.
• Develops a Rubric with your own metrics (5 or more) and evaluate the follow OS: Linux, Windows 7, Solaris, Mac OS X 10.6
OS Basic Concepts• Process is a program in execution.
• File: basic unit of persistent storage information
• Shell: a part in an OS which functions like an interface (front end) between programms and user with OS (back end). This term generally is focused in Command Line Interfaces (CLI).
OS Basic Concepts• System Call: is the way in how
programs can acess to supervisor mode instructions of microprocessor throught kernel.
• It’s important don’t confuse the call system and command terms; for instance, kill is a command (calling by usuers) which let to send signals to process; and kill() is system call (calling by a programm) which do the same.
Tipos de llamadas al sistema
• Las llamadas al sistema generalmente se dividen de acuerdo a la parte del sistema operativo…
• ¿entonces cuantos tipos de llamadas al sistema hay?
Programas del sistema • ¿A que se le llama programación de
sistema?
• A todo el software de base: compiladores, intérpretes, utilerías.
• ¿Qué utilerías tiene un sistema operativo?
• ¿Por que un SO no incluye software tan avanzado?
Diseño e implementación del sistema operativo
• Los Sistemas Operativos al igual que cualquier software también se modelan.
• Los sistemas operativos son software muy complejo que actualmente muy pocas compañías pueden competir en el mercado.
Estructura del sistema operativo
• Al igual que cualquier software un sistema operativo tiene una estructura bien definida, si es un sistema cerrado no se dan las explicaciones de cómo funcionan por adentro, sólo se dan las interfaces de entrada y salida…
OS Structure• Operating Systems have evolutioned in
its internal form trying to achive its performance.
• All OS have a process which fuction is load the OS and the Applications, this process is called Loader. For instance, Linux have loader like LILO (Linux LOader) and Grub.
• The loader use a boostrap to expand the OS.
OS Structure• All OS have a core process called Kernel, it
has the basic routines of an OS.
• Some OS use the microkernel concept, this have the function to coordinate to the other parts of an OS such as : I/O Devices, Process, Memory and File Systems.
• The structure of and OS could be different but in most of the time are very similar because some OS use Open Standards.
OS Architecture• The first structure for an OS was
Monolithic Structure. This doesn´t have any real structure, this is the reason why OS is only one big process called Kernel.
• Other well-know structure for OS is client-server model in where OS have server process management each one of system resources and kernel functions in base a one client making request to servers.
Monolithic Architecture
App App
System Services
Hardware
OS Procedures
User Mode
Kernel Mode
OS Architecture• This Client-Server function has to let OS
portability to another architectures such as distrubted architectures, where each service could be localizate in diferent remote machines.
• Other Architecture was Ring Architecture, where OS is structured in concentric circles called Rings. Each Ring has a well-defined structure.
OS Architecture• The most used Architecture in OS is
Layer Architecture, where Layers are divided in diferente levels like Ring Architectures. Inside each layer can exist two o more levels. Layers can interact with higher an lower levels thus in the same level.
Layer Architecture OS
Application Program
ApplicationProgram
ApplicationProgram
System Service
File System
I/O and Memory Management System
Process Management
Hardware
User Mode
Kernel Mode
Microkernel Architecture
MemoryServer
ClientApplication
NetworkServer
ProcessServer
FileServer
DisplayServer
Microkernel
Hardware
Request
Response
User Mode
Kernel Mode
Windows NT High-Level Architecture
OS/2Windows
POSIX
Environment Subsystems
User’s Application
DLL Subsystem
WindowsUser/GDI
DeviceDriver
Executive
Device Handler Kernel
Hardware Abstraction Layer (HAL)
UserMode
KernelMode
Services and System Process
Windows
Windows NT Architecture
Interfaces de Hardware(buses, Dispositivos de E/S , interrupcciones, intervalos de temporizadores, DMA, control de memoria cache , etc.)
System Dispatch System
Task Manager
Explorer
SvcHost.Exe
WinMgt.Exe
SpoolSv.Exe
Control Management
Service
LSASS
Ob
ject Han
dler
WindowsUSER,
GDI
File S
ystemC
ache
I/O Manager
Envinroments
Subsystem
User Applications
DLLs Subsystem
Procesos del Sistema Services Applications
System Thread
UserMode
KernelMode
NTDLL.DLL
File Systemand Device
Drivers
WinLogon
Session HandlerServices.Exe POSIX
Windows DLLs
Plu
g an
d P
layM
anag
er
En
ergy
Man
ager
Secu
rity R
eference
Mo
nito
r
Virtu
aM
emo
ry
Pro
cess and
T
hread
s
Lo
cal Pro
cess C
all Grpahical Manager
Kernel
Hardware Abstraction Layer (HAL)
(Kernel Mode Interfaceel)
Co
nfig
uratio
nM
anag
er (Reg
istry)OS/2
Windows
Windows NT Architecture• Kernel and Executive are located at
ntoskrnl.exe program
• Inside Executive are located File, Memory and Process Manager.
• Device Handler are located in files with *.sys management.
Windows NT Architecture• Wndows Handler is located windowsk.sys
file
• HAL is located at hal.dll
• Most of Windows Code is writed in C, some of this component are developed at C++. One of the trends is writing legacy modules in C++
• Operating System such Windows Vista has more than 20 millions of line of codes.
41
Windows NT ArchitectureCore OS components:NTOSKRNL.EXE Executive and kernelHAL.DLL Hardware abstraction layerNTDLL.DLL Internal Support Systems
Fundamentales System Process:SMSS.EXE Service Management ProcessWINLOGON.EXE System Authentication ProcessSERVICES.EXE Control Services ProcessLSASS.EXE Local Security Authority Subsystem
Windows Subsystem:CSRSS.EXE* Windows Process SubsystemWIN32K.SYS USER and GDI ComponentsKERNEL32/USER32/GDI32.DLLWindows subsystem DLLs
WoW64• Win32 over Win64 is the Windows
Subsytem which Execute Win32 applications in 64-bits environments in transparent mode.
• Other diferences implie in the word length of data and addressing memory of an OS.
• HOMEWORK: Writing a Research Document where compares Windows NT Architecture with Linux 2.6.
WoW64
64-bit ntdll.dll64-bit ntdll.dll
Wow64.dllWow64.dll Wow64win.dllWow64win.dll
Wow64cpu.dllWow64cpu.dll
Win32k.sysWin32k.sysEjecutivoEjecutivo
Modo KernelModo Kernel
Modo UsuarioModo Usuario
32-bit ntdll.dll32-bit ntdll.dll
32-bit EXE, DLLs32-bit EXE, DLLs
Homework• Show High-Level Linux Architecture and
Explain it (40%)
• Show the diferences beetwen each module and explain how it works. Detail all the modules which only exist in Linux or Windows (60%).
• Section not present (-10%). Without References 0 is the grade.
Máquinas virtuales
• Actualmente los Sistemas Operativos pueden ejecutar otros sistemas operativos totalmente distintos a través del uso de la virtualización…
OS Virtualization• Virtualization isn’t a new concept. I was
originated in 1970s by IBM in its OS VM/360.
• The “virtual” term means “a thing with simulated existence Abstraction.
• Every Problem in Computing Science can be solved by adding an indirection layer.
OS Virtualization• In Computing a lot of things are virtual:
• Virtual Reality• VLAN (Virtual LAN)• VNC (Virtual NetworkComputing) • VPN (Virtual PrivateNetwork) • Virtual Memory• Virtual Storage• JVM (Java Virtual Machine)• ….
OS Virtualization• Actual Problems in OS:
– Security (viruses)– Legacy Software– Performance – Incompatibility between applications in diferent
OS
• All these problems can be solved through Virtualization.
• Virtualization is another OS Architecture using and special core element called Exokernel.
OS Virtualization• Aproximately only 10% of time a
computer is working.
• “Virtualization = Freedom. One server can be the work of many”
• Around 20% (in 2006 10%) of server are virtualized.
OS Virtualization
OS Virtualization• Some virtualization tools are:
• Bochs and QEMU (emulation)• VMWARE, Virtual PC, Virtual Box,
Parallels Workstation (Completed Virtualization)
• Xen andUser-ModeLinux (UML) paravirtualization
• Linux V-Server and OpenVZvirtualización (OS Virtualized)
OS Virtualization
OS Virtualization
OS Virtualization
Activitie• Installing Jollyclound OS
• Use a Minix Virtualizated Image
Generación de sistemas operativos
• Los sistemas operativos han evolucionado con respecto a la historía de la computación…
Operating Systems History• Quiz1
• What was the firt OS for 32 Bits PCs?
• When was Linux OS appear?
• What was the first important OS constructed enterily in high level programming language?
• What is the most recent Linux Version?
Operating System History• In the begining Turing created the
machine…
• The Operating System History comes hand in hand with hardware and software evolution.
• The computer paradigms have changed with the pass of the times, for instance de 1950‐1970 decade the concept of “one computer many users” appears.
Operating Systems History• In1980‐1990 decade the computer
paradigm shifted to “one computer one user”.
• Finally in this decade, the paradigm shift to “one user many computers”.
Operating Systems• In the Generation 0 (1940’s) and First
Generation (1950’s) the Operating System doesn’t exist, reason why users have to configure the circuits for operating the machine.
• The second generation (1960’s) appears the first OS which principal fuction was to act like a extended machine.
Operating System History• All the OS was constructed in assembler
language, reason why it was totally dependant of the machine.
• The OS only can manipulate some peripherals. The batch processing was used to improve the resources use.
• In Third Generation (1970’s) OS was more complex because they used concepts such as multiprogramming and time-sharing.
Operating Systems• Unix was the first OS constructed in a
High-Level Language (C Languaje) with only the critical part (I/O) in assembler.
• In the Fourth Generation (1980’s) appears the first extremely-used OS in PCs: DOS and Windows. Reason why OS was more complex and more easy to use.
Operating System History• Since 1990 the computer network
utilization (overall Internet) and multimedia in OS was extended in such way than today are present in any OS.
• Activity: in personal Way write a essay with the three most important Linux commandments, describe why this three point are important for you
Introduction
55
60
65
70
75
80
85
90
95
00
03
IOCS
DOS/360
DOS/VDSE
VS
VS/ESA
OS/360
MVS/370
MVS/XA
MVS/ES
TSO
IBSYS
CTSS
CP/CM5
VM/370
VM/XA
VM/ESA
SYSTEM III
SYSTEM V
SYSTEM V.4
MULTICS
UNIX
UNIXV.7
AIX/370
AIXSUN OS
POSIX
SOLARIS 2
4.1BSD
4.2BSD
4.3BSD
4.4BSD
MACH
OSF/1
AIX/ESA
XENIX MS-DOS 1.0
CP/M
DR/DOS
OS/2WIN 3.0
WIN NT
WIN 2000
WIN 9X
WIN XP
LINUX
RSX-11M
VMS 1.0
VMS 5.4
VMS 7.3
WIN 3.1
SOLARIS 10
RT-11
LINUX 2.6
WIN Server 2003
Windows and Linux Evolution
1970 1980 1990 2000
VMS
v1.0
Win
dows NT
3.1
NT
4.0
Win
dows 20
00
Win
dows XP
Serv
er 2
003
1970 1980 1990 2000
Nac
imie
nto
de U
NIX
UNIX
púb
lico
UNIX
V6
Linu
x v1
.0v2
.0
v2.2
v2.3
v2.4
v2.6
Arranque del sistema
• El arranque (cargador del sistema operativo –boot loader-) del Sistema Operativo es la parte inicial de cualquier Sistema Operativo.
• El arranque se da en conjunto con el hardware del computador (ROM, Firmware) como de un medio de almacenamiento persistente (MBR)
• ¿qué es EFI?
Bibliografía
[1] Tanenbaum., A. “Sistemas Operativos. Diseño e Implementación”, Tercera Edición, Prentice Hall, 2009.
[2] Silberchatz, A., “Sistemas Operativos” (libro de los sistemas operativos). Septima Edición. Prentice Hall, 2004.
67
Bibliografía
[3] Tanenbaum, A., “Sistemas Operativos Modernos”, Tercera Edición, Pearson Educación
[4] Chavez-Carretero, “Sistemas Operativos”
El material proporcionado en el curso es solamente referencia. La información vista en clase también se evalúa.
¿Preguntas, dudas y comentarios?