Estructura de Sistemas Computacionales
Transcripción
Estructura de Sistemas Computacionales
Objetivos de esta parte Recordarlaestructurabásicadeuncomputadorysu relaciónconlaasignatura. IntroducciónalosSistemas Opera4vos Escuela de Ingeniería Civil en Informática Universidad de Valparaíso, Chile Presentarydefinirelconceptodesistemasopera4vos. Hacerunrepasohistóricodeldesarrollodelossistemas computacionales,enlorela4voaldesarrollodelos sistemasopera4vos. Sedesprenderánconceptosyestructurasbásicasque seu4lizaránalolargodelcurso. http://informatica.uv.cl 1 Fecharevisión:7/3/2016 La gran figura Programas y Aplicaciones Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 2 Estructurade Sistemas Computacionales Kernel (Sistema Operativo) Hardware Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 3 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 4 Modelo tradicional CPU Memoria Modelo estándar Disco Duro Teclado Monitor USB Controladores de HW Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 5 Modelo estándar Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 6 Modelo estándar Arquitectura VonNeumann Disposi4vos Adicionales EjemploChipsetIntel875(2003) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 7 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 8 Memoria Principal Memoria Secundaria Todosistemacomputacionaldebetenerunamemoriaprincipal. Tecnologías EstadoSólido Flash SSD Pendrive Sóloenestamemoriapuedenexis4rprocesos. Problema:memoriavolá4l MediosMagné4cos Discos Cintas MediosÓp4cos CD DVD B-R Problema:Almacenargrandesvolúmenesdedatos Configuraciones Tecnologías Memoria Principal (RAM) Programas DAS(DirectAbachStorage) Data NAS(NetworkAbachStorage) SAN(StorageAreaNetwork) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 9 ¿y cuál es proceso de encendido? Verificacióndesanidaddelsistema(POST) NorthBridge,SouthBridge Enumeraciónbásicadedisposi4vos Seleccióndeldisposi4vosdearranque CargadelPRIMERsectordeldisposi4voseleccionado Conceptoasociado:CARGADOR(LOADER) Arreglosredundantes(RAID) RespaldosdeDatos Encriptación Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 10 ¿Qué es esto del cargador? EnarquitecturasderivadasdeIntel,elBIOSoperaen modoreal(límitede640KbRAM) especificacióndePCde1981 BIOSvamigrandoaEFI (ExtensibleFirmwareInterface) ElconocimientodelBIOSdelsistemaesmuylimitado Selimitaapedirelprimersector (512bytes)deldiscoduro Cualquierprogramaquecargue,debecaber en512bytes(bootloaders) TransferenciadecontrolalelementodeSWprovistoeneldisposi4vo Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 11 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 12 Boot Loaders Boot Loaders Engeneral,cualquierSOdependedeuncargadodeinicio Resumiendo:lastareasdeunbootloaderson: Darreportesalusuariodelprocesoinicialdeencendido Estosprogramashanidomejorando Casimini-sistemasopera4vos Reconocerelhardwarey“ordenarlo”lógicamente TienensistemademanejodeE/S UbicarycargalaimagendelSOeneldisposi4vodearranque Enumerandisposi4vos(nosiempreheredadodelBIOS) Tienensoporteparadis4ntossistemasdearchivos Especificarparámetrodeinicio Analizanelestadodelaúl4macarga (sugieren“modoapruebadefallos” TransferirlaejecuciónalSO Permitenlamodificacióndelosparámetrosde llamadasalkernel Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 13 Porfin!!!Laasignatura Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 14 Proceso de Inicio de un SO IniciodeunSO 1 2 3 4 [ [ [ [ 0.000000] 0.000000] 0.000000] 0.000000] Initializing cgroup subsys cpuset Initializing cgroup subsys cpu Initializing cgroup subsys cpuacct Linux version 3.10-2-686-pae ([email protected]) (gcc version 4.7.3 (Debian 4.7.3-6) ) #1 SMP Debian 3.10.7-1 (2013-08-17) ===MAPA DE MEMORIA=== 5 [ 0.000000] e820: BIOS-provided physical RAM map: 6 [ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] 7 [ 0.000000] BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] 8 [ 0.000000] BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] 9 [ 0.000000] BIOS-e820: [mem 0x0000000000100000-0x000000000ffeffff] 10 [ 0.000000] BIOS-e820: [mem 0x000000000fff0000-0x000000000fffffff] 11 [ 0.000000] BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] ===================== usable reserved reserved usable ACPI data reserved ===NX: Protección de zonas de memoria=== ===SMBIOS y DMI=== 12 [ 0.000000] NX (Execute Disable) protection: active 13 [ 0.000000] SMBIOS 2.5 present. 14 [ 0.000000] DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 15 [ 0.000000] e820: update [mem 0x00000000-0x00000fff] usable ==> reserved 16 [ 0.000000] e820: remove [mem 0x000a0000-0x000fffff] usable 17 [ 0.000000] e820: last_pfn = 0xfff0 max_arch_pfn = 0x1000000 ======================================== Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 15 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 16 Proceso de Inicio de un SO ===Cosas relacionados con memoria virtual==== 18 [ 0.000000] MTRR default type: uncachable 19 [ 0.000000] MTRR variable ranges disabled: 20 [ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106 21 [ 0.000000] CPU MTRRs all blank - virtualized system. ============================================= ====MAS INFO de MEM== 22 [ 0.000000] initial memory mapped: [mem 0x00000000-0x019fffff] 23 [ 0.000000] Base memory trampoline at [c009b000] 9b000 size 16384 24 [ 0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff] 25 [ 0.000000] [mem 0x00000000-0x000fffff] page 4k 26 [ 0.000000] init_memory_mapping: [mem 0x0fc00000-0x0fdfffff] 27 [ 0.000000] [mem 0x0fc00000-0x0fdfffff] page 2M 28 [ 0.000000] init_memory_mapping: [mem 0x0c000000-0x0fbfffff] 29 [ 0.000000] [mem 0x0c000000-0x0fbfffff] page 2M 30 [ 0.000000] init_memory_mapping: [mem 0x00100000-0x0bffffff] 31 [ 0.000000] [mem 0x00100000-0x001fffff] page 4k 32 [ 0.000000] [mem 0x00200000-0x0bffffff] page 2M 33 [ 0.000000] init_memory_mapping: [mem 0x0fe00000-0x0ffeffff] 34 [ 0.000000] [mem 0x0fe00000-0x0ffeffff] page 4k 35 [ 0.000000] BRK [0x01597000, 0x01597fff] PGTABLE 36 [ 0.000000] BRK [0x01598000, 0x01599fff] PGTABLE 37 [ 0.000000] RAMDISK: [mem 0x0edc1000-0x0f8d8fff] ===================== Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 17 Proceso de Inicio de un SO ====INICIANDO LA EJECUCION DEL KERNEL==== 73 [ 0.000000] Booting paravirtualized kernel on bare hardware 74 [ 0.000000] setup_percpu: NR_CPUS:32 nr_cpumask_bits:32 nr_cpu_ids:1 nr_node_ids:1 (...) =====KERNEL A EJECUTAR===== 79 [ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.10-2-686-pae root=UUID=34fc33f5-5a3b-4cba-8e70-a8b31c447eb4 ro quiet =====ESTRUCTURAS UTILIZADAS POR EL KERNEL=== 80 [ 0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes) 81 [ 0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) 82 [ 0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) 83 [ 0.000000] Initializing CPU#0 84 [ 0.000000] Initializing HighMem for node 0 (00000000:00000000) 85 [ 0.000000] Memory: 242196k/262080k available (3074k kernel code, 19492k reserved, 1566k data, 460k init, 0k highmem) 86 [ 0.000000] virtual kernel memory layout: 87 [ 0.000000] fixmap : 0xffd34000 - 0xfffff000 (2860 kB) 88 [ 0.000000] pkmap : 0xffa00000 - 0xffc00000 (2048 kB) 89 [ 0.000000] vmalloc : 0xd07f0000 - 0xff9fe000 ( 754 MB) 90 [ 0.000000] lowmem : 0xc0000000 - 0xcfff0000 ( 255 MB) 91 [ 0.000000] .init : 0xc1489000 - 0xc14fc000 ( 460 kB) 92 [ 0.000000] .data : 0xc1300b7c - 0xc14886c0 (1566 kB) 93 [ 0.000000] .text : 0xc1000000 - 0xc1300b7c (3074 kB) (...) 98 [ 0.000000] NR_IRQS:2304 nr_irqs:256 16 99 [ 0.000000] CPU 0 irqstacks, hard=ce806000 soft=ce808000 ====DETECTA LA CONSOLA INICIAL==== 100 [ 0.000000] Console: colour VGA+ 80x25 101 [ 0.000000] console [tty0] enabled Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 19 Proceso de Inicio de un SO ===Cosas relacionados con memoria virtual==== 18 [ 0.000000] MTRR default type: uncachable 19 [ 0.000000] MTRR variable ranges disabled: 20 [ 0.000000] x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106 21 [ 0.000000] CPU MTRRs all blank - virtualized system. ============================================= ====MAS INFO de MEM== 22 [ 0.000000] initial memory mapped: [mem 0x00000000-0x019fffff] 23 [ 0.000000] Base memory trampoline at [c009b000] 9b000 size 16384 24 [ 0.000000] init_memory_mapping: [mem 0x00000000-0x000fffff] 25 [ 0.000000] [mem 0x00000000-0x000fffff] page 4k 26 [ 0.000000] init_memory_mapping: [mem 0x0fc00000-0x0fdfffff] 27 [ 0.000000] [mem 0x0fc00000-0x0fdfffff] page 2M (...) 34 [ 0.000000] [mem 0x0fe00000-0x0ffeffff] page 4k 35 [ 0.000000] BRK [0x01597000, 0x01597fff] PGTABLE 36 [ 0.000000] BRK [0x01598000, 0x01599fff] PGTABLE 37 [ 0.000000] RAMDISK: [mem 0x0edc1000-0x0f8d8fff] ===================== == Advanced Configuration and Power Interface === 38 [ 0.000000] ACPI: RSDP 000e0000 00024 (v02 39 [ 0.000000] ACPI: XSDT 0fff0030 00034 (v01 40 [ 0.000000] ACPI: FACP 0fff00f0 000F4 (v04 41 [ 0.000000] ACPI: DSDT 0fff0410 01BF1 (v01 42 [ 0.000000] ACPI: FACS 0fff0200 00040 43 [ 0.000000] ACPI: SSDT 0fff0240 001CC (v01 ================================================= (...) VBOX VBOX VBOX VBOX VBOX ) VBOXXSDT 00000001 ASL 00000061) VBOXFACP 00000001 ASL 00000061) VBOXBIOS 00000002 INTL 20100528) VBOXCPUT 00000002 INTL 20100528) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 18 Proceso de Inicio de un SO ====INICIALIZA EL RELOJ==== 102 [ 0.000000] tsc: Fast TSC calibration failed 103 [ 0.000000] tsc: Unable to calibrate against PIT 104 [ 0.000000] tsc: using PMTIMER reference calibration 105 [ 0.000000] tsc: Detected 2692.138 MHz processor ====AHORA RECIEN HAY TIEMPO==== 106 [ 0.016001] Calibrating delay loop (skipped), value calculated using timer frequency.. 5384.27 BogoMIPS (lpj=10768552) ====DEFINE EL PID MAX Y MIN DE LOS PROCESOS==== 107 [ 0.016004] pid_max: default: 32768 minimum: 301 ====SISTEMAS DE CONTROL==== 108 [ 0.016027] Security Framework initialized 109 [ 0.016030] AppArmor: AppArmor disabled by boot time parameter 110 [ 0.016031] Yama: disabled by default; enable with sysctl kernel.yama.* 111 [ 0.016040] Mount-cache hash table entries: 512 112 [ 0.016153] Initializing cgroup subsys memory 113 [ 0.016159] Initializing cgroup subsys devices 114 [ 0.016160] Initializing cgroup subsys freezer 115 [ 0.016161] Initializing cgroup subsys net_cls 116 [ 0.016163] Initializing cgroup subsys blkio 117 [ 0.016164] Initializing cgroup subsys perf_event (...) =====¿SISTEMA MULTIPROCESADOR/MULTICORE?==== 126 [ 0.028681] smpboot: weird, boot CPU (#0) not listed by the BIOS 127 [ 0.028688] smpboot: SMP motherboard not detected 128 [ 0.028690] Enabling APIC mode: Flat. Using 0 I/O APICs 129 [ 0.032000] smpboot: SMP disabled ====NOPES :(==== Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 20 Proceso de Inicio de un SO ====INICIALIZA LOS PROCESADORES DISPONIBLES==== 130 [ 0.032000] Performance Events: unsupported p6 CPU model 58 no PMU driver, software events only. 131 [ 0.032000] Brought up 1 CPUs 132 [ 0.032000] smpboot: Total of 1 processors activated (5384.27 BogoMIPS) Proceso de Inicio de un SO ====SE INICIA LA ACTIVACIÓN DE SISTEMAS QUE SE UTILIZARÁN POR LOS USUARIOS==== 133 [ 0.032000] NMI watchdog: disabled (cpu0): hardware events not enabled 134 [ 0.032000] devtmpfs: initialized (...) 136 [ 0.032000] NET: Registered protocol family 16 137 [ 0.032000] ACPI: bus type PCI registered 138 [ 0.032000] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5 139 [ 0.032000] PCI : PCI BIOS area is rw and x. Use pci=nobios if you want it NX. 140 [ 0.032000] PCI: PCI BIOS revision 2.10 entry at 0xfda26, last bus=0 141 [ 0.032000] PCI: Using configuration type 1 for base access 142 [ 0.032000] bio: create slab <bio-0> at 0 (...) 163 [ 0.034362] PCI: root bus 00: using default resources 164 [ 0.034364] acpi PNP0A03:00: fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge. 165 [ 0.034485] PCI host bridge to bus 0000:00 ====PARA QUE EL SISTEMA OPERATIVO SE COMUNIQUE CON LOS DISPOSITIVOS, SE UTILIZAN REGIONES DE MEMORIA QUE SE DEFINEN AQUI==== 166 [ 0.034488] pci_bus 0000:00: root bus resource [bus 00-ff] 167 [ 0.034490] pci_bus 0000:00: root bus resource [io 0x0000-0xffff] 168 [ 0.034491] pci_bus 0000:00: root bus resource [mem 0x00000000-0xfffffffff] 169 [ 0.034551] pci 0000:00:00.0: [8086:1237] type 00 class 0x060000 170 [ 0.035132] pci 0000:00:01.0: [8086:7000] type 00 class 0x060100 171 [ 0.036059] pci 0000:00:01.1: [8086:7111] type 00 class 0x01018a 172 [ 0.036586] pci 0000:00:01.1: reg 20: [io 0xd000-0xd00f] 173 [ 0.037107] pci 0000:00:02.0: [80ee:beef] type 00 class 0x030000 174 [ 0.037754] pci 0000:00:02.0: reg 10: [mem 0xe0000000-0xe0ffffff pref] 175 [ 0.041464] pci 0000:00:03.0: [8086:100e] type 00 class 0x020000 176 [ 0.041820] pci 0000:00:03.0: reg 10: [mem 0xf0000000-0xf001ffff] 177 [ 0.042288] pci 0000:00:03.0: reg 18: [io 0xd010-0xd017] (...) 205 [ 0.057530] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none 206 [ 0.057532] vgaarb: loaded 207 [ 0.057533] vgaarb: bridge control possible 0000:00:02.0 (...) 213 [ 0.059026] pnp: PnP ACPI init 217 [ 0.059108] pnp 00:01: Plug and Play ACPI device, IDs PNP0200 (active) 218 [ 0.059167] pnp 00:02: Plug and Play ACPI device, IDs PNP0f03 (active) 219 [ 0.059186] pnp 00:03: Plug and Play ACPI device, IDs PNP0400 (active) 220 [ 0.059771] pnp: PnP ACPI: found 4 devices (...) 224 [ 0.095392] pci_bus 0000:00: resource 4 [io 0x0000-0xffff] 225 [ 0.095394] pci_bus 0000:00: resource 5 [mem 0x00000000-0xfffffffff] Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 21 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 22 Proceso de Inicio de un SO ====PROTOCOLOS DE RED==== 226 [ 0.095422] NET: Registered protocol family 2 227 [ 0.095549] TCP established hash table entries: 2048 (order: 2, 16384 bytes) 228 [ 0.095552] TCP bind hash table entries: 2048 (order: 2, 16384 bytes) 229 [ 0.095558] TCP: Hash tables configured (established 2048 bind 2048) 230 [ 0.095570] TCP: reno registered 231 [ 0.095571] UDP hash table entries: 256 (order: 1, 8192 bytes) 232 [ 0.095573] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) 233 [ 0.095600] NET: Registered protocol family 1 =====MÁS CANALES DE 234 [ 0.095607] 235 [ 0.095640] 236 [ 0.095677] 237 [ 0.095677] 238 [ 0.095677] 239 [ 0.095677] 240 [ 0.095677] 241 [ 0.095677] COMUNICACIÓN==== pci 0000:00:00.0: Limiting direct PCI/PCI transfers pci 0000:00:01.0: Activating ISA DMA hang workarounds pci 0000:00:02.0: Boot video device ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11 PCI: setting IRQ 11 as level-triggered ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 10 PCI: setting IRQ 10 as level-triggered PCI: CLS 0 bytes, default 64 ====HASTA AQUÍ, TODOS LOS CANALES DE COMUNICACIÓN DEL HARDWARE ESTA IDENTIFICADO Y CON SUS RESPECTIVAS REGIONES DE MEMORIA (BAJO NIVEL) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 23 Proceso de Inicio de un SO ====COMIENZA LA SEGUNDA ETAPA===== 242 [ 0.095677] Unpacking initramfs... 243 [ 0.354697] Freeing initrd memory: 11360k freed 244 [ 0.356290] platform rtc_cmos: registered platform RTC device (no PNP device found) (...) ====EL KERNEL TOMA EL CONTROL DEL HW==== ====LAS ESTRUCTURAS TLB SE VEN EN ADMINISTRACIÓN DE MEMORIA=== 247 [ 0.370491] HugeTLB registered 2 MB page size, pre-allocated 0 pages ====COMIENZA LA DETECCIÓN DE DISPOSITIVOS A TRAVÉS DE LOS CANALES DE COMUNICACIÓN DESCUBIERTOS EN LA ETAPA 1=== 248 [ 0.370558] VFS: Disk quotas dquot_6.5.2 249 [ 0.370575] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) 250 [ 0.370638] msgmni has been set to 495 251 [ 0.370770] alg: No test for stdrng (krng) 252 [ 0.370780] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) ====DEFINE SCHEDULER DE I/O=== 253 [ 0.370800] io scheduler noop registered 254 [ 0.370801] io scheduler deadline registered 255 [ 0.370804] io scheduler cfq registered (default) ====DETECTA TIPO DE 256 [ 0.370846] 257 [ 0.370856] 258 [ 0.370920] CANAL DE COMUNICACIÓN PARA CARGAR EL DRIVER RESPECTIVO=== pci_hotplug: PCI Hot Plug PCI Core version: 0.5 pciehp: PCI Express Hot Plug Controller Driver version: 0.4 GHES: HEST is not enabled! Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 24 Proceso de Inicio de un SO ====SIGUE 259 [ 260 [ 261 [ 262 [ 263 [ 264 [ 265 [ 266 [ Proceso de Inicio de un SO DESCUBRIENDO DISPOSITIVOS Y SUS CARACTERÍSTICAS=== 0.370927] isapnp: Scanning for PnP cards... 0.736255] isapnp: No Plug & Play device found 0.736322] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled 0.736685] Linux agpgart interface v0.103 0.736806] i8042: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12 0.737964] serio: i8042 KBD port at 0x60,0x64 irq 1 0.737970] serio: i8042 AUX port at 0x60,0x64 irq 12 0.738041] mousedev: PS/2 mouse device common for all mice ====EL KERNEL ASIGNA ARCHIVOS ESPECIALES A LOS DISPOSITIVOS ENCONTRADOS=== 267 [ 0.738594] input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input0 268 [ 269 [ 270 [ 271 [ (...) 274 [ 275 [ 276 [ 277 [ (...) 281 [ 282 [ 283 [ 284 [ 285 [ 286 [ 0.739178] 0.739207] 0.739228] 0.739249] rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0 rtc_cmos rtc_cmos: alarms up to one day, 114 bytes nvram Intel P-state driver initializing. Intel pstate controlling: cpu 0 0.739337] 0.739344] 0.739467] 0.739469] TCP: cubic registered NET: Registered protocol family 10 mip6: Mobile IPv6 NET: Registered protocol family 17 0.741688] 0.741751] 0.741862] 0.741885] 0.741886] 0.753371] rtc_cmos rtc_cmos: setting system clock to 2015-03-10 12:51:39 UTC (1425991899) Freeing unused kernel memory: 460k freed Write protecting the kernel text: 3076k Write protecting the kernel read-only data: 1236k NX-protecting the kernel data: 3068k systemd-udevd[49]: starting version 215 ====DESCUBRE LAS TARJETAS DE RED===== 289 [ 0.759789] e1000: Intel(R) PRO/1000 Network Driver - version 7.3.21-k8-NAPI 290 [ 0.759791] e1000: Copyright (c) 1999-2006 Intel Corporation. 291 [ 0.761829] ACPI: bus type USB registered ====INICIA EL SISTEMA USB==== 292 [ 0.761847] usbcore: registered 293 [ 0.761854] usbcore: registered 294 [ 0.765466] e1000 0000:00:03.0: 295 [ 0.766122] usbcore: registered (...) new interface driver usbfs new interface driver hub setting latency timer to 64 new device driver usb =====ASIGNA IDENTIFICADOR A LA TARJETA DE RED==== 300 [ 1.158308] e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 08:00:27:f5:dc:ea 301 [ 1.158315] e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 25 Proceso de Inicio de un SO (...) =====SIGUE CON LOS DISPOSIVOS USB==== 307 [ 1.169098] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 308 [ 1.169100] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 309 [ 1.169102] usb usb1: Product: EHCI Host Controller 310 [ 1.169103] usb usb1: Manufacturer: Linux 3.10-2-686-pae ehci_hcd 311 [ 1.169105] usb usb1: SerialNumber: 0000:00:0b.0 312 [ 1.169201] hub 1-0:1.0: USB hub found 313 [ 1.169204] hub 1-0:1.0: 8 ports detected Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 26 Proceso de Inicio de un SO ====EMPIEZA LA BUSQUEDA DE DISCOS DE ALMACENAMIENTO SECUNDARIO=== 331 [ 1.227080] scsi0 : ahci 332 [ 1.227130] ata1: SATA max UDMA/133 abar m8192@0xf0842000 port 0xf0842100 irq 11 333 [ 1.227173] ata_piix 0000:00:01.1: version 2.13 334 [ 1.227173] ata_piix 0000:00:01.1: setting latency timer to 64 335 [ 1.228313] scsi1 : ata_piix 336 [ 1.228426] scsi2 : ata_piix 337 [ 1.228453] ata2: PATA max UDMA/33 cmd 0x1f0 ctl 0x3f6 bmdma 0xd000 irq 14 338 [ 1.228454] ata3: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xd008 irq 15 339 [ 1.229214] ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 9 340 [ 1.229216] PCI: setting IRQ 9 as level-triggered (...) =====CONFIGURA RELOJ=== 342 [ 1.580949] tsc: Refined TSC clocksource calibration: 2692.234 MHz 343 [ 1.580953] Switching to clocksource tsc =====SIGUE CON ALMACENAMIENTO=== 344 [ 1.581307] ata3.00: ATAPI: VBOX CD-ROM, 1.0, max UDMA/133 345 [ 1.581745] ata3.00: configured for UDMA/33 =====ASIGNA IDENTIFICADORES DE SW A LOS DISCOS ENCONTRADOS=== 354 [ 1.693082] sd 0:0:0:0: [sda] 16777216 512-byte logical blocks: (8.58 GB/8.00 GiB) 355 [ 1.693112] sd 0:0:0:0: [sda] Write Protect is off 356 [ 1.693114] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 357 [ 1.693126] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, d oesn't support DPO or FUA 358 [ 1.695127] sr0: scsi3-mmc drive: 32x/32x xa/form2 tray 359 [ 1.695129] cdrom: Uniform CD-ROM driver Revision: 3.20 360 [ 1.695199] sr 2:0:0:0: Attached scsi CD-ROM sr0 361 [ 1.695930] sd 0:0:0:0: Attached scsi generic sg0 type 0 362 [ 1.695974] sr 2:0:0:0: Attached scsi generic sg1 type 5 ====PARTICIOINES DENTRO DEL DISCO DURO sda==== 363 [ 1.704348] sda: sda1 sda2 < sda5 > 364 [ 1.704610] sd 0:0:0:0: [sda] Attached SCSI disk (...) ====SIGUE 380 [ 381 [ 382 [ 383 [ 384 [ 385 [ 386 [ =====SIGUE CON LA TARJETA DE RED=== 346 [ 1.620264] e1000 0000:00:08.0 eth1: (PCI:33MHz:32-bit) 08:00:27:35:a1:f0 347 [ 1.620264] e1000 0000:00:08.0 eth1: Intel(R) PRO/1000 Network Connection =====SIGUE CON ALMACENAMIENTO=== 348 [ 1.689049] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) 349 [ 1.689332] ata1.00: ATA-8: VBOX HARDDISK, 1.0, max UDMA/133 350 [ 1.689337] ata1.00: 16777216 sectors, multi 128: LBA48 NCQ (depth 31/32) 351 [ 1.689541] ata1.00: configured for UDMA/133 352 [ 1.689629] scsi 0:0:0:0: Direct-Access ATA VBOX HARDDISK 1.0 353 [ 1.690105] scsi 2:0:0:0: CD-ROM VBOX CD-ROM 1.0 ====EMPIEZAN LOS SISTEMAS DE ALMACENAMIENTO=== 287 [ 0.758471] SCSI subsystem initialized 288 [ 0.759104] ACPI: bus type ATA registered ASIGNANDO 7.337209] 7.338140] 7.338145] 7.338223] 7.338226] 7.338989] 7.339022] ARCHIVOS A DISPOSITIVOS DE HARDWARE=== ACPI: AC Adapter [AC] (on-line) input: Power Button as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input1 ACPI: Power Button [PWRF] input: Sleep Button as /devices/LNXSYSTM:00/LNXSLPBN:00/input/input2 ACPI: Sleep Button [SLPF] ACPI: Video Device [GFX0] (multi-head: yes rom: no post: no) input: Video Bus as /devices/LNXSYSTM:00/device:00/PNP0A03:00/LNXVIDEO:00/input/input3 PQ: 0 ANSI: 5 PQ: 0 ANSI: 5 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 27 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 28 Proceso de Inicio de un SO ====SIGUE (...) 391 [ 392 [ 393 [ ASIGNANDO ARCHIVOS A DISPOSITIVOS DE HARDWARE=== 7.942449] usbcore: registered new interface driver usbhid 7.942451] usbhid: USB HID core driver 7.980690] input: VirtualBox USB Tablet as /devices/pci0000:00/0000:00:06.0/usb2/2-1/2-1:1.0/input/input4 394 [ 7.981809] hid-generic 0003:80EE:0021.0001: input,hidraw0: USB HID v1.10 Mouse [VirtualBox USB Tablet] on usb-0000:00:06.0-1/input0 395 [ 8.003112] input: PC Speaker as /devices/platform/pcspkr/input/input5 396 [ 8.012930] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input6 ====AGREGA MEMORIA DE INTERCAMBIO=== 397 [ 9.300333] Adding 392188k swap on /dev/sda5. Priority:-1 extents:1 across:392188k SS ====DETECTA SISTAMA DE ARCHIVOS DENTRO DE LAS PARTICIONES==== 398 [ 9.330743] EXT4-fs (sda1): re-mounted. Opts: (null) 399 [ 9.527352] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro ====CONFIGURA A BAJO NIBEL LA TAJETA DE RED==== 401 [ 10.661824] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready 402 [ 10.666369] e1000: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX 403 [ 10.666751] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready 404 [ 10.696204] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready 405 [ 10.697212] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX 406 [ 10.697617] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready 407 [ 11.291527] RPC: Registered named UNIX socket transport module. (...) 412 [ 11.330638] Key type dns_resolver registered 413 [ 11.373398] FS-Cache: Netfs 'nfs' registered for caching 414 [ 11.458928] Installing knfsd (copyright (C) 1996 [email protected]). Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 29 QuéesunSistema Opera4vo(SO) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 31 Para finalizar Enmenosde15segundos,elSOterminasutrabajodeinicializarel sistema. Ahoravienenlosprocesosquepermitenqueelsistemaseaú4l Accesoremoto(SSH) ServidorWeb(APACHE) Telefonía(Asterisk) Interfazgráfica(parasistemasdeescritorio) etc,etc,etc Estolovolvemosaretomar cuandoseveanPROCESOS Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 30 Definiciones coloquiales Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 32 Qué NO es un SO Generalidades Unsistemaopera4voesun programaquemanejalos recursosdeuncomputador. LoscomponentesdelHWproveen losrecursoscomputacionalespara lasaplicaciones. Losprogramasyaplicaciones definenquerecursos requieren. Programas y Aplicaciones Kernel (Sistema Operativo) Hardware ElSOdefinecómoesosrecursosseránu4lizadospara resolverlosproblemascomputacionesdellosusuarios Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 33 Cómo describir un SO NivelUsuario Quéseafácildeu4lizar. Quetengaunaltodesempeño. Quenuncafalle. Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 34 Objetivos de diseño de un SO NiveldeSistema ElSOdebeactuar comounadministrador derecursoscomputacionales Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 35 Conveniencia Eficiencia Escalable Facilitar el uso del hardware Utilizar los recursos en forma coherente y organizada Permitir cualquier desarrollo posterior sin afectar sus servicios Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 36 Objetivos de diseño de un SO Objetivos de diseño de un SO Ges:óndeRecursos Abstracción Conveniencia Facilitar el uso del hardware Eficiencia Escalable Conveniencia Proporcionaabstraccionesconsistentesy simplificacionesalosprocesosdelusuario ArchivosyDirectorios Facilitar el uso Utilizar los Permitir del hardware recursos en cualquier Flujosdeentradaysalida forma desarrollo coherente y posterior sin Disposi4vos,conexiones organizada afectar sus servicios Elprocesoensímismo Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 37 Por fin UnSOes: Elprincipalprogramaqueseejecutaenunsistema computacionaldepropósitogeneral. Proveeunconjuntodeabstraccionesbásicasalos programasdealtonivel Dis4ntosSOdefinendis4ntasinterfacesoabstracciones sobreelMISMOhardware Eficiencia Utilizar los recursos en forma coherente y organizada Escalable Administralosrecursosexistentesenel computador,permi4endolaejecucióna losdis4ntosprocesos Permitir Compar4rlosrecursosdel cualquier desarrollo sistemacomputacional posterior sin afectar sus Polí4casdeasignacióny servicios recuperación“justas” Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 38 Evolucióndelos SS.OO. UnSOpuedeadecuarseadis4ntasarquitecturasde hardware Ofreceunainfraestructuradeges4ónyprotección derecursos. Permitelaimplementacióndeentornosopera4vos Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 39 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 40 Sistemas “BATCH” Sistemas Batch Ciclodetrabajo 1sólotrabajoalavez. Pocaonulainteracciónconelusuario Eranú4lesconprogramascon4empode ejecuciónlargosyquenoeraninterac4vos. Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 41 Sistemas Multiprogramados Sistemas Multiprogramados Modelodefuncionamientodeprocesos AKA:Mul4tareaomul4tasking o: ric ó st Hi Seempiezanamasificarlos TO discosdealmacenamientoy HI MemoriasdeAccesoDirecto Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 42 Fin Inicio Uso Procesador Losdatosdelostrabajos (programas)sepueden almacenarparaser ocupadosposteriormente. Nacelaplanificacióndeprocesos, memoria,CPU CPU P2 P1 CPU I/O I/O CPU CPU I/O CPU Uso I/O t Cómotenervariosprogramas enmemoriayenejecución(procesos) enUNsóloprocesador Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 43 Conceptos Cambiodecontexto Mul4tareaApropia4va/Noapropia4va Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 44 Sistemas Multiprogramados Mul4tareaNoapropia4va Cadaproceso4enecontroldelCPUhastaque efectúaunallamadaalsistemaoindicaalsistema quepuedetomarelcontrol(sched_yield() ) Mul4tareaApropia4va Elrelojdelsistemainterrumpelaejecuciónde cadaprocesotransfiriendoforzosamenteelcontrol alsistemaopera4vo. Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 45 Sistemas de Tiempo Real SistemasMul4programados+QoS Sistemas de Tiempo Compartido SistemasMul4programados+Mul4usuarios BajoTiempoderespuesta Debensolucionarproblemasdeequidaden elusodelprocesadorymemoria. Debensolucionarproblemasconcurrenciay bloquesendisposi4vosdeI/O,Memoriay CPU. Eltamañodelosprocesosenmemoria puedesuperareltamañorealdela memoriaRAM ConceptodeMemoriaVirtual Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 46 Sistemas Paralelos Sistemasmul4procesador,conmemoriayrelojcomún Garan4zanlos4emposde respuestas. Normalmentesonsistemasqueinteractúanconel medioambienteoaplicacionescrí4cas. SMP CPU 1 CPU 2 CPU j CACHE CACHE CACHE MMU MMU MMU Mul4procesador AMP NUMA DATOS, DIRECCIONES CPU 1 Mul4Core CPU 2 CPU j CACHE MMU DATOS, DIRECCIONES Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 47 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 48 Sistemas Distribuídos Sistemas Distribuídos Sistemasmul4procesador,sinmemorianirelojcomún Sistemasmul4procesador,sinmemorianirelojcomún Aumentanlaconfiabilidadydisponibilidad deunsistemainformá4co Aumentanlaconfiabilidadydisponibilidad deunsistemainformá4co Tipos: Tipos: Clusters Clusters Grids Grids Cloud Cloud Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 49 Sistemas Distribuídos Computadoresconectadasaredes LANdealtavelocidad CadanodoejecutasupropioSO(intancias) yprocesosdebidamenteparcializados Equiposhomogéneos Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 50 Sistemas Distribuídos Sistemasmul4procesador,sinmemorianirelojcomún Sistemasmul4procesador,sinmemorianirelojcomún Aumentanlaconfiabilidadydisponibilidad deunsistemainformá4co Aumentanlaconfiabilidadydisponibilidad deunsistemainformá4co Tipos: Tipos: Moda Clusters Computadoresdistribuidasgeográficamente Clusters Grids CadanodoejecutasupropioSOyprocesos parcialidados Grids Cloud Equipospuedenconectarse/desconectarsedurante elcómputo Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 51 Cloud Orientadoaloutsourcingdeservicios Implementacióndeserviciosesirrelevante (procesosnegros) Relacionadocon: ServiciosWeb Plataformacomoservicio(PaaS) SoqwarecomoServicio(SaaS) InfraestructuracomoServicio(IaaS) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 52 Unpocode historia En los comienzos Babbage,Siglo19 1854:Libro“Leyesdelpensamiento”, deBoole. 1936:Turingproponeunamáquinapara losproblemasdeencriptacióndelaIIWW Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 53 1940-1950 PrimerasMáquinas: tubosyplugboard Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 54 1950-1960 Computadorestransistorizados 1958:SelanzaelIBM7090 Grandes,frágilesylentas(paraelestándardehoy) Unsólousuarioalavez En1946entreenfuncionamientoelENIAC (ElectronicNumericalIntegratorand Calculator) Sistemasmásconfiables,rápidosybaratos Elsistemadeprocesamientoclásicoesporlotes En1947BellLabsdesarrollaeltransistor En1950nacenlossistemasopera4vos Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 55 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 56 1960-1970 1970-1980 Mul4programación/Mul4usuarios Disminuyenloscostosdelasconsolasymemoria Másdeunprogramaenejecución 1962:SistemaCTSS(Compa4bleTime SharingSystem).DesarrolladoporMIT. 1964:MULTICS(MULTiplexedInforma4onandCompu4ngService). DesarrolladoporMIT,BellLabsyGeneralElectric. Tele4pooTTY Consoladetexto 1969:UNIX(???).DesarrolladoporBellLabs(KenThompson, DennisRitchieyDouglasMcllroy).BrianKernighancolaboróconla creacióndeprogramasu4litarios. Consolagráfica Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 57 1980-1990 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 58 1980-1990 Disminuyenloscostosdelasconsolasymemoria UNIXparalasmasas:Xenix,SCO,A/UX NacenlosSHELLSyGUI 1984:GénesisdelsoqwarelibreGNU(filosoua) 1973:XeroxAlto 1992:SistemaBSD/386:Primersistema UNIXdelibredistribuciónparaPC 1992:SistemaLinux:PrimersistemaUNIXlikedelibre distribuciónparaPC Empiezanamorirlas“estacionesdetrabajo”Sun,SGI,HP. 1981:XeroxStar8010 1984:Macintosh LeerBiculturalism(JoelSpolsky,2003): hbp://www.joelonsoqware.com/ar4cles/Biculturalism.html Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 59 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 60 y hoy???? Entrada/Salida SistemasdeescritorioyservidorderivadosdeIntelx86 Sistemaembedidos(ARM,etc) SistemasquenonecesitanSO(Arduinoyamigos)… Peroquepuedentener… Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 61 Recordemos Concretizemos Modelobásicodefuncionamientodeunproceso Fin Inicio Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 62 Uso Procesador Uso I/O Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 63 ¿Quérepresentalapelo4ta“UsoProcesador”? Fin Inicio Uso Procesador Uso I/O Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 64 Concretizemos Concretizemos ¿ylapelo4ta“UsoI/O”? ¿ylapelo4ta“UsoI/O”? Fin Inicio Uso Procesador Uso Procesador Uso I/O Uso I/O Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 65 Entrada/Salida (I/O) Device Driver Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 66 Entrada/Salida (I/O) Esquemageneraldetransferenciadedatos CPU Fin Inicio Disco, Buffers, red, etc Controlador de Disco CPU Haymuchosdisposi4vosconectados alBUSdelaCPU Interrupciones Datos Disponibles Memoria Disco Duro Teclado Monitor USB interrupción "j" Memoria Principal Gestor general de interrupciones INT Controladores de HW ... Pc ElDev.DriverinformaalaCPUquehaydatospara transmi4r,atravésdeinterrupciones. ISR Rutina de servicio de la interrupción j Código del SO ... Código de la aplicación Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 67 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 68 Entrada/Salida (I/O) Funcionamiento deunSO Sistema Operativo Interrupción “j” “despierta” al SO El SO “cede” el uso del procesador a otro proceso Sistema Operativo Gestor de Interrupciones ModosdeoperacióndeunSO. TiposdeSO AccesoalcódigodeunSO Rutinas de Servicio de Interrupción Interrupción “j” “despierta” al SO Función asociada a la interrupción “j” Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 69 SSOO multitarea Sedebeevitar Interferenciaentreos dis4ntosprocesos (usuarioySO). Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 70 Arquitecturas de ejecución de código Técnica SimpleLoop LoopandISRs Mul4taskKernel Mododualdeoperación Siseintentaejecutaruna instrucciónprivilegiada,seproduce unaexcepción. (Similarauninterrupción,perose resuelveenmodousuario) Modo Usuario Interrupción Modo Kernel Sepuedeejecutarcualquierinstrucciónprivilegiada. ElSOseejecutasiempreenestemodo: todo(kernelmonolí4co),partedeél(microkernel) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 71 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 72 Formas de planificar Formas de planificar Runtocomple4on Timeslicedscheduling RoundRobin Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 73 SO monolítico SistemaOpera4vo(modokernel) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 74 SO microkernel SistemaOpera4vo SistemaOpera4vo(modokernel) Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 75 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 76 ¿Que tipo? ¿Que tipo? Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 77 Modelo a estudiar en este curso Acceso al código del kernel execution environment application libraries ElcódigodelkernelesuncódigoorientadoporEVENTOS. Existentresformasclásicasdeaccederasucódigo: trap user System call interface kernel Exceptions handlers Interrupt Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 78 Kernel interface File Subsystem char block Memory Subsystem Device drivers System Services Process control subsystem protection Synchronization And deadlock Scheduler Process table Other Resources IPC 1)InterrupcionesgeneradasporHW(teclado,reloj,etc) 2)ExcepcionesgeneradasporSW hardware Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 79 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 80 Acceso al código del kernel SYSCALL 3)Llamadasdesistema(SYSCALL) Modo Usuario Interrupción Modo Kernel Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 81 Descripción SonFUNCIONESqueofreceelKERNELparaaccederasusservicios LoslenguajesofrecenunAPIdemásaltonivel: Cofrecepriny(),mientrasquelafunciónque ofreceelKERNELeswrite(). Lalibreríaseejecutaenmodousuarioynopuede accederaldisposi4vodirectamente. Ejemplos: Win32API(Windows) POSIXAPIparasistemasPOSIX Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 83 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 82 Utilización Debehaberunainstruccióndebajonivelqueprovoqueel cambiodemododeformaatómicayelsaltoalcódigodelsistema Debepoderpasarinformaciónadicional. Sedebeesperaralgúnretorno. Instruccióngenérica:TRAP Cmezclado conASM… EnIntel:INT Modo Usuario Modo Kernel main{ ... preparar_entrada_de_datos() TRAP N procesar_salida() ... } Retorno: sys_N{ ... } u4lizandoregistros sectordememoria Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 84 Utilización Utilización Bibliotecadesistema Bibliotecadesistema Programador Modo Kernel Modo Usuario Código Fuente Biblioteca de Sistema main{ ... preparar_entrada_de_datos() printf("algo") procesar_salida() ... } printf(...){ ... TRAP N ... } Código del Kernel sys_N{ ... } Modo Kernel Modo Usuario Código Fuente Biblioteca de Sistema main{ ... preparar_entrada_de_datos() printf("algo") procesar_salida() ... } Mejor Mejor Seve“bien”enelpapel Seve“bien”enelpapel Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 85 Utilización Cajanegra(API) printf(...){ ... TRAP N ... } Código del Kernel sys_N{ ... } Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 86 Utilización (vista de assembler) Bibliotecadesistema src/linux/arch/x86/boot/printf.c src/linux/arch/x86/boot/tty.c src/linux/arch/x86/boot/tty.c Con Syscalls src/linux/arch/x86/boot/tty.c Perosihayque modificaralgo... Ver:hbp://en.wikipedia.org/wiki/BIOS_interrupt_call Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 87 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 88 Utilización (vista de assembler) Sin Syscalls Funcionamiento deunSO ModosdeoperacióndeunSO. UserMode/KernelMode TiposdeSO Monolí4cos/MicroKernel AccesoalcódigodeunSO Syscall Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 89 Teoría de Sistemas Operativos – Ingeniería Civil Informáticainformatica.uv.cl 90