Está en la página 1de 76

Sistemas de Operación I

Prof. Fernando Torre Mora Prof. Yudith Cardinale


🏢 MyS 217-A 🏢 MyS 220-A
☎ (0212)906-3257 ☎ (0212)906-3251
📬 ftorremora@usb.ve 📬 ycardinale@usb.ve
Registro de clase

 Este trimester grabaremos las


clases para procesamiento
posterior
 Levanten la mano para
intervenir en clase, si quieren
que su voz quede grabada
 La cámara no los enfocará
 Si no quieren quedar grabados,
no levanten la mano

2
Características del curso

 Material complejo
 Requiere pensar a varios
niveles
 Deben planificar su tiempo de
𝑚𝑒𝑛𝑡𝑒
estudio 𝑝𝑟𝑜𝑐𝑟𝑎𝑠𝑡𝑖𝑛𝑎𝑐𝑖ó𝑛 = 𝑚𝑎𝑡𝑒𝑟𝑖𝑎
 Proyectos trabajosos
 Altas posibilidades de errores 𝑚𝑎𝑡𝑒𝑟𝑖𝑎 × 𝑝𝑟𝑜𝑐𝑟𝑎𝑠𝑡𝑖𝑛𝑎𝑐𝑖ó𝑛 = 𝑚𝑒𝑛𝑡𝑒
 Prohibido procrastinar
𝑚𝑒𝑛𝑡𝑒
 Clases densas 𝑚𝑎𝑡𝑒𝑟𝑖𝑎 = 𝑝𝑟𝑜𝑐𝑟𝑎𝑠𝑡𝑖𝑛𝑎𝑐𝑖ó𝑛
 Trataremos de usar las dos
horas completas
 Deben leer el libro

3
¿Qué tan difícil es esta materia?

*tos* Organización del Computador *tos*

4
Recursos

 Profesor
 Consultas con cita
 Libros
 Stallings
 Bib: 19 ES, 9 EN
 Tannenbaum
 Bib: 24 ES, 8 EN, 10 RES
 Silberachatz
 Bib: 5 ES, 5 EN, 6 RES

 Libro virtual en Moodle


 Clases

5
Medidas de Contingencia

 Lecturas según Cronograma


 Publicación de laboratorios en
Moodle
 Clases solo consulta
 Resolución de ejercicios
 Actividades de Ejemplo

6
Plan de Evaluación

 Teoría:
 Primer Examen: 30 pts
Tradicionalmente Sem 6
 Segundo Examen: 30 pts
Tradicionalmente Sem 12
 Laboratorio: (40%)
 Tarea: 5 pts
Tradicional Entrega Sem 4
 Proyecto 1: 20 pts
Tradicional Entrega Sem 8
 Proyecto 2: 15 pts
Tradicional Entrega Sem 11

7
(Ver Cronograma)

8
Sobre el Laboratorio

 Proyectos en parejas
 Libros
 Kernighan & Ritchie. El Lenguaje de
Programación C
 Bib: 13 ES, 7 EN, 8 RES

 Kernighan & Pike. El Entorno de Programación


UNIX
 BIB: 1 ES, 1 EN, 3 RES

 Primeras 2 clases: BYOC (Bring Your


Own Computer)
 Windows
 GitHub Desktop OR
 MinGW (Minimalist GNU for Windows)
 Linux/Mac
 GCC (GNU C Compiler)
 Android
 CPP Droid

 o tomen muy buenos apuntes

9
10

Moral, Ética y Valores

 Honestidad:  Responsabilidad:
 Integridad  Un deber u obligación de
 Veracidad realizar satisfactoriamente
 Completar una actividad que
 Sinceridad
hay que cumplir
 Laboriosidad:
 Paz:
 Gusto por trabajar y esforzarse
 Tranquilidad
 Conseguir objetivos sin rendirse
 No permanencia de conflictos
 No tener temor

10
Reglamento de Sanciones y Procedimientos Disciplinarios

 Artículo 9. Serán faltas muy graves:


 La falta de probidad en el ejercicio de sus obligaciones; las vías de hecho
ejecutadas, la ofensa grave y la injuria proferida contra autoridades,
profesores, trabajadores administrativos y técnicos, obreros y estudiantes
de la Universidad, así como la insubordinación contra autoridades o
profesores.
 Artículo 13. Las sanciones aplicables a las faltas cometidas por los alumnos
serán:
 De las faltas consideradas muy graves: expulsión de la Universidad.

11
12
Actividad:
¿En qué consiste esta materia?

 Como ese conecta el hardware con el software – Jean


 Cómo están diseñados, ventajs cada diseño –Marcos Lerones
 Como diseñar Sistemas Operativos Seguros

13
En qué no consiste esta materia (Mitos)

 Porque hay tantos sistemas operativo


 Conocer TODO lo que la computadora hace
 Esto es una materia de Computación, no de Tecnología de la Información
 No enseñamos cómo “arreglar” computadoras “lentas”
 No practicarán técnicas de instalación de sistemas operativos
 No van a crear una nueva distribución de Linux
 No aprenderán los últimos avances en
 Windows 10
 Mac OS X
 Android Nougat
 etc.

14
Avances rápidos en Sistemas Operativos

Pantallas Múltiples Escritorios Múltiples Hibernación Discos SSD

Procesadores multi- Procesamiento Límites de archivos Potencia


core multi-hilo dispositivos
Portátiles

15
En qué consiste esta materia
(Programa)
1. Qué es un Sistema Operativo
2. Estructura y llamadas de los Sistemas
Operativos
3. Procesos e Hilos
4. Planificación de procesos (scheduling)
5. Comunicación entre procesos
6. Interbloqueo (deadlock)
7. Memoria Principal
8. Memoria Virtual
9. Sistemas de Archivo
10. Administración de memoria
secundaria
Actividad:
¿Qué creen que es un Sistema Operativo?

 Cjto Softare Ordenado para


usario para manejar hardware
– Jesus Kauze
 Programa que conecta
software con Hardware para
permisos –Wilfredo
 Capa admin. Recursos
Computadpr –David

17
Breve repaso de Organización del Computador

18
¿Qué es un Sistema Operativo?

 Un sistema operativo
indica al CPU cómo
 Arrancar
 Operar las unidades de
disco
 Ejecutar el Software
(David Macaulay)
 Un programa que actúa como
intermediario entre un usuario y el
hardware de una computadora
(Definición más general)

Operating System Concepts – 9th Edition 1.19 Silberschatz, Galvin and Gagne ©2013
Componentes de un Sistema de Computación

 Hardware – provides basic computing resources


 CPU, memory, I/O devices
 Operating system
 Controls and coordinates use of hardware among various applications
and users
 Application programs – define the ways in which the system resources are
used to solve the computing problems of the users
 Word processors, compilers, web browsers, database systems, video
games
 Users
 People, machines, other computers

Operating System Concepts – 9th Edition 1.20 Silberschatz, Galvin and Gagne ©2013
Sistemas Multi-usuario

Operating System Concepts – 9th Edition 1.21 Silberschatz, Galvin and Gagne ©2013
Operating System Definition (Cont.)
 No universally accepted definition
 “Everything a vendor ships when you order an operating system” is a good
approximation
 But varies wildly
 “The one program running at all times on the computer” is the kernel.
 Everything else is either:
 a system program (ships with the operating system) , or
 an application program.

Operating System Concepts – 9th Edition 1.22 Silberschatz, Galvin and Gagne ©2013
Sin Sistemas Operativos

Sistema de Tarjetas Similar a Cartuchos ¿Los sistemas


basados en cartuchos
no tienen OS?

Operating System Concepts – 9th Edition 1.23 Silberschatz, Galvin and Gagne ©2013
Computer Startup
 bootstrap program is loaded at power-up or reboot
 Typically stored in ROM or EPROM, generally known as firmware
 Initializes all aspects of system
 Loads operating system kernel and starts execution

Operating System Concepts – 9th Edition 1.24 Silberschatz, Galvin and Gagne ©2013
What Operating Systems Do
 Operating system goals:
 Execute user programs and make solving user problems easier
 Make the computer system convenient to use

Use the computer hardware in an efficient manner
 Users want convenience, ease of use and good performance

Don’t care about resource utilization
 But shared computer such as mainframe or minicomputer must keep all
users happy
 Users of dedicate systems such as workstations have dedicated resources
but frequently use shared resources from servers
 Handheld computers are resource poor, optimized for usability and battery
life
 Some computers have little or no user interface, such as embedded
computers in devices and automobiles

Operating System Concepts – 9th Edition 1.25 Silberschatz, Galvin and Gagne ©2013
Operating System Definition

 OS is a resource allocator
 Manages all resources
 Decides between conflicting requests for efficient and fair resource use
 OS is a control program
 Controls execution of programs to prevent errors and improper use of
the computer

Operating System Concepts – 9th Edition 1.26 Silberschatz, Galvin and Gagne ©2013
Chapter 1: Introduction

Operating System Concepts – 9th Edit9on Silberschatz, Galvin and Gagne ©2013
PROCESSES

Operating System Concepts – 9th Edition 1.28 Silberschatz, Galvin and Gagne ©2013
Process
• A unit of activity characterized by
– A single thread (sequence of commands) of
execution
– A current state
– An associated set of system resources

29
Process Management
 Process
 A process is a program in execution. It is a unit of work within the
system. Program is a passive entity, process is an active entity.
 Process needs resources to accomplish its task
 CPU, memory, I/O, files
 Initialization data
 Process termination requires reclaim of any reusable resources
 Program Counter
 Single-threaded process has one program counter specifying
location of next instruction to execute
 Process executes instructions sequentially, one at a time, until
completion
 Multi-threaded process has one program counter per thread
 Typically system has many processes, some user, some operating
system running concurrently on one or more CPUs
 Concurrency by multiplexing the CPUs among the processes /
threads

Operating System Concepts – 9th Edition 1.30 Silberschatz, Galvin and Gagne ©2013
Process Management Activities

The operating system is responsible for the following activities in


connection with process management:
 Creating and deleting both user and system processes
 Suspending and resuming processes
 Providing mechanisms for process synchronization
 Providing mechanisms for process communication
 Providing mechanisms for deadlock handling

Operating System Concepts – 9th Edition 1.31 Silberschatz, Galvin and Gagne ©2013
HISTORICAL CONTEXT

Operating System Concepts – 9th Edition 1.32 Silberschatz, Galvin and Gagne ©2013
History of Operating Systems

Generations:

• (1945–55) Vacuum Tubes


• (1955–65) Transistors and Batch Systems
• (1965–1980) ICs and Multiprogramming
• (1980–Present) Personal Computers

33
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
34
IBM Type 285 tabulators in use at U.S. Social Security Administration
En Venezuela, el usuario principal es la
Creole Petroleum Corporation

Llegada de la IBM 650 Centro de Procesamiento de datos

36
36
IBM 1401, 1402, 1403

37
Batch Systems (4)
Regresar máquina
a estado original

Fijar estado de
máquina
Figure 1-4. Structure of a typical FMS job.
38
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Resident monitors
Ejemplo de un Sistema con
1955 tres porgramas en memoria

39
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Protection and Security

 Protection – any mechanism for controlling access of processes or


users to resources defined by the OS
 Security – defense of the system against internal and external attacks
 Huge range, including denial-of-service, worms, viruses, identity
theft, theft of service
 Systems generally first distinguish among users, to determine who
can do what
 User identities (user IDs, security IDs) include name and
associated number, one per user
 User ID then associated with all files, processes of that user to
determine access control
 Group identifier (group ID) allows set of users to be defined and
controls managed, then also associated with each process, file
 Privilege escalation allows user to change to effective ID with
more rights

Operating System Concepts – 9th Edition 1.40 Silberschatz, Galvin and Gagne ©2013
True Multiprogramming
Tom Kilburn and the
1962 Atlas Computer

41
Operating System Structure
 Multiprogramming (Batch system) needed for efficiency
 Single user cannot keep CPU and I/O devices busy at all times
 Multiprogramming organizes jobs (code and data) so CPU always has one
to execute
 A subset of total jobs in system is kept in memory
 One job selected and run via job scheduling
 When it has to wait (for I/O for example), OS switches to another job

Operating System Concepts – 9th Edition 1.42 Silberschatz, Galvin and Gagne ©2013
Circuitos integrados permiten
disponibilidad comerical
IBM 360 1965 – 1978

43
Time-Shared interactive
systems
1975 First True Mainframe

44
Operating System Structure
 Timesharing (multitasking) is logical extension in which CPU switches jobs
so frequently that users can interact with each job while it is running, creating
interactive computing
 Response time should be < 1 second
 Each user has at least one program executing in memory process
 If several jobs ready to run at the same time  CPU scheduling
 If processes don’t fit in memory, swapping moves them in and out to run
 Virtual memory allows execution of processes not completely in memory

Operating System Concepts – 9th Edition 1.45 Silberschatz, Galvin and Gagne ©2013
Computadoras Personales

1977 – 1983 Varios proveedores

46
Diseño centrado en usuarios

1984 Macintosh

47
Estandarización multiplataforma
de controladores
1995 – 2010

48
Sistemas Operativos
multiplataforma
2010 – ?

49
Avances de los últimos años

Pantallas Múltiples Escritorios Múltiples Hibernación Discos SSD

Procesadores multi- Procesamiento Límites de archivos Potencia


core multi-hilo dispositivos
Portátiles

51
¿Qué caracteriza la época actual?

 Cambio –Manuel
 Internet of Things –Simone
 Almacenamniento en la nube Jesús De Aguiar
 3D Jesús Kauze

52
COMPUTER SYSTEM ORGANIZATION

53
Computer System Organization

 Computer-system operation
 One or more CPUs, device controllers connect through common
bus providing access to shared memory
 Concurrent execution of CPUs and devices competing for
memory cycles

Operating System Concepts – 9th Edition 1.54 Silberschatz, Galvin and Gagne ©2013
Buses

Figure 1-12. The structure of a large Pentium system


55
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Operating-System Operations (cont.)
 Dual-mode operation allows OS to protect itself and other system components
 User mode and kernel mode
 Mode bit provided by hardware
 Provides ability to distinguish when system is running user code or
kernel code
 Some instructions designated as privileged, only executable in kernel
mode
 System call changes mode to kernel, return from call resets it to user

Operating System Concepts – 9th Edition 1.56 Silberschatz, Galvin and Gagne ©2013
Transition from User to Kernel Mode
 Timer to prevent infinite loop / process hogging resources
 Timer is set to interrupt the computer after some time period
 Keep a counter that is decremented by the physical clock.
 Operating system set the counter (privileged instruction)
 When counter zero generate an interrupt

Set up before scheduling process to regain control or terminate program
that exceeds allotted time
 Increasingly CPUs support multi-mode operations
 i.e. virtual machine manager (VMM) mode for guest VMs

Operating System Concepts – 9th Edition 1.57 Silberschatz, Galvin and Gagne ©2013
INTERRUPTS

Operating System Concepts – 9th Edition 1.59 Silberschatz, Galvin and Gagne ©2013
Interrupts
• Interrupt the normal sequencing of the
processor
• Most I/O devices are slower than the
processor
– Processor must pause to wait for device

60
Classes of Interrupts

61
Interrupt Handling

 The operating system ⋮


Thread t = new Thread(handler);
preserves the state of the t.start();
CPU by storing registers while(t.isAlive() && !list.isEmpty()){
and the program counter workOn(list.removeFirst());
}
 Determines which type of try{
interrupt has occurred: t.join();
}catch(InterruptedException e){
 polling checkStatus(t,e);
 vectored interrupt system }
getResult(handler);
 Separate segments of ⋮
code determine what
action should be taken for
each type of interrupt
polling example in Java

Operating System Concepts – 9th Edition 1.62 Silberschatz, Galvin and Gagne ©2013
Common Functions of Interrupts
 Interrupt transfers control to
the interrupt service routine
generally, through the
interrupt vector, which
contains the addresses of
all the service routines
 Interrupt architecture must
save the address of the
interrupted instruction
 A trap or exception is a
software-generated
interrupt caused either by
an error or a user request
 An operating system is
interrupt driven
Sample Interrupt Vector, Dr. Jim Plusquellic

Operating System Concepts – 9th Edition 1.63 Silberschatz, Galvin and Gagne ©2013
Interrupt Timeline

Operating System Concepts – 9th Edition 1.64 Silberschatz, Galvin and Gagne ©2013
Transfer of Control via Interrupts

65
Program Flow of Control

66
Program Flow of Control

67
Program Flow of Control

68
I/O Devices

Current instruction
Next instruction
3
3. Return
1. Interrupt
1 4 2

2. Dispatch
to handler

Figure 1-11. (a) The steps in starting an I/O device and


getting an interrupt. 69
Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved. 0-13-6006639
Programmed I/O
• I/O module performs the
action, not the processor
• Sets the appropriate bits in
the I/O status register
• No interrupts occur
• Processor checks status until
operation is complete
Interrupt-Driven I/O
• Processor is interrupted when
I/O module ready to exchange
data
• Processor saves context of
program executing and begins
executing interrupt-handler
• No needless waiting
• Consumes a lot of processor
time because every word read
or written passes through the
processor
Direct Memory Access
• Transfers a block of data
directly to or from memory
• An interrupt is sent when
the transfer is complete
• More efficient
How a Modern Computer Works

A von Neumann architecture


Direct Memory Access Structure
 Used for high-speed I/O devices able to transmit information at close to
memory speeds
 Device controller transfers blocks of data from buffer storage directly to
main memory without CPU intervention
 Only one interrupt is generated per block, rather than the one interrupt per
byte

Operating System Concepts – 9th Edition 1.74 Silberschatz, Galvin and Gagne ©2013
End of Chapter 1

Operating System Concepts – 9th Edit9on Silberschatz, Galvin and Gagne ©2013
Qué cubrimos esta clase

 Lean el capítulo 1 de
cualquiera de los libros:
 Stallings: §1.1 – 1.7 (pp. 8 –
32 en 7ª ed.)
 Tannenbaum: §1 –1.5 (pp.
1 – 50 en 4ª ed.)
 Silberschatz: §1 – 1.9; 2 –
2.2 (pp. 3 – 30; 49 – 55 en 8ª
ed.)
 No cubriremos §1.10 – 1.14

 Video Sugerido: Crash


Course Operating
Systems

76
Para la próxima clase

 Procesos (Jueves Sem 1)


 Stallings: §1.8, 3–3.3
 Tannenbaum: §1.6, 2.1
 Silberschatz: §2.3–2.4, 3.1–3.3
 Para el laboratorio (Viernes sem 1)
 Kernighan & Ritchie: Capítulos 1 y 4
(pp. 5 – 34; 67 – 93 en la edición en inglés)
 Instalar compilador de C

77

También podría gustarte