1 / 51

Introduction

Chapter 1. Introduction. 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5 Operating system concepts 1.6 System calls 1.7 Operating system structure. Introduction. A computer system consists of hardware

tonyav
Download Presentation

Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 1 Introduction 1.1 What is an operating system 1.2 History of operating systems 1.3 The operating system zoo 1.4 Computer hardware review 1.5 Operating system concepts 1.6 System calls 1.7 Operating system structure

  2. Introduction • A computer system consists of • hardware • system programs • application programs

  3. What is an Operating System • It is an extended machine • Hides the messy details which must be performed • Presents user with a virtual machine, easier to use • System calls • It is a resource manager • Each program gets time with the resource • Each program gets space on the resource

  4. Resource Manager • Tempo • CPU, impressora, usuarios • Espaco • Disco, memoria

  5. History of Operating Systems (1) Early batch system • bring cards to 1401 • read cards to tape • put tape on 7094 which does computing • put tape on 1401 which prints output

  6. History of Operating Systems (2) • First generation 1945 - 1955 • vacuum tubes, plug boards • Second generation 1955 - 1965 • transistors, batch systems • Third generation 1965 – 1980 • ICs and multiprogramming • Fourth generation 1980 – present • personal computers

  7. 2nd geration • Structure of a typical FortranMonitorSystem job – 2nd generation; desperdicio de CPU

  8. 3rd generation • Multiprogramming system, many jobs in memory • Time sharing • MULTICS (multiplexed information and computing service) → UNICS,

  9. 4th generation • Personal computers • Graphical user interface: Windows • Minix (microkernel) → Linux (monolitco, GNU, X-windows)

  10. The Operating System Zoo • Mainframe operating systems • Server operating systems • Multiprocessor operating systems • Personal computer operating systems • Real-time operating systems • Embedded operating systems • Smart card operating systems

  11. Computer Hardware Review (1) Monitor • Components of a simple personal computer Bus

  12. 1) Processador ciclo de busca, execucao registradores: PC, SP, PSW (CPSR) modo kernel/user; kernel = supervisor TRAP pipeline (RISC), varias unidades de execucao

  13. Computer Hardware Review (2) (a) A three-stage pipeline (b) A superscalar CPU

  14. 2) Memoria memoria volatil x nao volatil multiprogramacao: Varios processos na memoria Como obter memoria grande e barata? Como proteger os processos uns dos outros? Como tratar a realocacao do codigo?

  15. Typical memory hierarchy numbers shown are rough approximations

  16. Hierarquia de memoria Cache: quando coloca e remove dado no cache? Chaveamento de processo e cache miss.

  17. Structure of a disk drive

  18. Protecao e realocacao de codigo One base-limit pair and two base-limit pairs b) codigo compartilhado

  19. Protecao e realocacao de codigo MMU - Memory Management Unit Ao chavear processos, cache vira lixo

  20. 3) Dispositivos de Entrada/Saida HW: controladora, dispositivo controladora: acesso via portas pode ser complexo (calcular onde estah setor do disco) interface padronizada: ex: IDE SW: Drivers fabricante ou engenharia reversa instalacao: kernel ou modulo

  21. I/O é lerdo Como a CPU pode trabalhar enquanto I/O nao fez leitura ou escrita?

  22. Interrupcao (a) Steps in starting an I/O device and getting interrupt (b) How the CPU is interrupted (a) (b)

  23. Interrupcao, exemplo 1. CPU programa controladora de disco para leitura 2. Disk controller avisa dados lidos 3. interrupcao (alguem interrompeu). 4. mostra quem interrompeu

  24. Vetor de interrupcao ARM

  25. Computer Hardware Review (7) Structure of a large Pentium system

  26. Processes . Program in execution . Address space: code, data, stack . Process table: • list of open files, state, UID . Communication • sinais (divisao por zero), mensagens . scheduling

  27. Processes • A process tree (fork, exec, wait; UID, GID) • A created two child processes, B and C • B created three child processes, D, E, and F

  28. Processes (a) A potential deadlock. (b) an actual deadlock.

  29. Main memory Holds executing programs Multiple programs - protection Large programs - virtual memory system calls para compartilhar memoria, mapear arquivos em memoria.

  30. File Systems File system for a university department

  31. Files . Abstract model of device independent files . Hierarchy, directories, operations . Absolute, relative paths; . root and working direcotry . special files (I/O devices): block, character . security (rwx,)

  32. Operating System Concepts (4) • Before mounting, • files on floppy are inaccessible • After mounting floppy on b, • files on floppy are part of file hierarchy

  33. Operating System Concepts (5) Two processes connected by a pipe

  34. Steps in Making a System Call There are 11 steps in making the system call read (fd, buffer, nbytes)

  35. System calls . interface user process to kernel . machine dependant, but in procedure libraries (POSIX)

  36. Some System Calls For Process Management pid = fork() pid = waitpid(pid, &statlock, opts) s = wait(&status) s = execve(name, arg, envp) exit(status) pid = getpid()

  37. Signals s=sigaction(sig,&act,&oldact) s=sigreturn(&context) s = sigpending(set) s = sigsuspend(sigmask) s = kill(pid, sig) residual = alarm(seconds) s = pause()

  38. Some System Calls For File Management

  39. Some System Calls For Directory Management

  40. Some System Calls For Miscellaneous Tasks s = chdir(dirname) s = chmod(name, mode) s = kill(pid, signal) seconds = time(&seconds)

  41. System Calls (1) • A stripped down shell: while (TRUE) { /* repeat forever */ type_prompt( ); /* display prompt */ read_command (command, parameters) /* input from terminal */ if (fork() != 0) { /* fork off child process */ /* Parent code */ waitpid( -1, &status, 0); /* wait for child to exit */ } else { /* Child code */ execve (command, parameters, 0); /* execute command */ } }

  42. System Calls (2) • Processes have three segments: text, data, stack

  43. System Calls (3) (a) Two directories before linking/usr/jim/memo to ast's directory (b) The same directories after linking

  44. System Calls (4) (a) File system before the mount (b) File system after the mount

  45. System Calls (5) Some Win32 API calls

  46. Operating System Structure (1) Simple structuring model for a monolithic system

  47. Operating System Structure (2) Structure of the THE operating system • camadas bem delimitadas, • Multix - aneis concentricos - traps entre as camadas

  48. Operating System Structure (3) Structure of VM/370 with CMS • CMS - Conversational Monitor System • VM: Virtual Machine Monitor • MS-DOS / Pentium • JVM

  49. Operating System Structure (4) The client-server model microkernel mecanismo x politica MINIX

  50. Microkernel x monolitico - Por que microkernel é bom? • Tanenbaum: codigo limpo - Por que microkernel é ruim? • Linus Torvalds: perfomance sofrivel. • Experiencia pessoal

More Related