Operating Systems Overview - PowerPoint PPT Presentation

1 / 67
About This Presentation
Title:

Operating Systems Overview

Description:

Operating Systems Overview Operating System * Threads and SMP Operating system routines can run on any available processor Different routines can execute ... – PowerPoint PPT presentation

Number of Views:595
Avg rating:3.0/5.0
Slides: 68
Provided by: Mario205
Category:

less

Transcript and Presenter's Notes

Title: Operating Systems Overview


1
Lecture 2
  • Operating Systems Overview

2
?? ??
  • ????? ??
  • ????? ?? ??
  • 1) ?? ?? ???
  • 2) ?? ???? ???
  • 3) ?? ???? ???? ???
  • 4) ??? ???
  • ?? ????? ??
  • ??? ??
  • ????? ??

3
Operating System
  • ?? ????? ??? ???? ????
  • OS? ???? ??? ??? ?? ????? ??? ??? ????
  • OS? ??? ?? ???? ??? ???? ?? ??? ????
  • ???? ???? ??? ?????
  • ?? ????? ???? ??? ?? ????? ??? ?? ??? ???
    (Masking)
  • ? ????? ???, ??? ?? ?
  • OS? ????? ???? ??? ????? ??

4
  • ??? ???? ??? ??

5
OS Services(1)
  • ???? ?? ?? ??
  • editors, compilers, linkers, and debuggers
  • ???? ??
  • loading in memory, I/O and file initialization
  • I/O ? ??? ?? ??
  • ?? ??? ?? ??? ? ?? ???
  • ??? ??
  • ??? ?? ? ???? ?? ?? ??
  • ??? ?? ?? ?? ??

6
OS Services(2)
  • ?? ??
  • ?? ? ?? ???? ??
  • memory error
  • device failure
  • ????? ??
  • arithmetic overflow
  • access forbidden memory locations
  • ???? ??
  • ?? ??
  • ??? ?? ???
  • ?????? ???
  • ?? ???? ??

7
OS Services(3)
  • ?? ??
  • ??? ?? ??? ?? ?? ??
  • ??? ?? ???? (eg response time)
  • ??? ?? ?? ??
  • ?? ?? ?? (on multiuser systems)

8
????? ??
  • OS? ????? ???? ? ??? ??? ????? ??? ????? ??
  • Character vs graphic terminals
  • paging hardware ?
  • OS? ??? ???? ????? ??
  • ? internet support ?
  • OS? ?? ? ?? ??? ?? ??? ???
  • modular construction with clean interfaces
  • object oriented methodology

9
????? ?? ??
  • ?? ?? ???(Serial Processing)
  • ?? ???? ???(Simple Batch Processing)
  • ?? ???? ?? ?? ??? (Multiprogrammed Batch
    Processing)
  • ??? ???(Time-Sharing Systems)
  • Modern Operating Systems
  • ?? ???(Parallel Systems) SMP
  • ?? ???(Distributed Systems)
  • ??? ???(Real-Time Systems)
  • ??? ???(Embedded Systems)

10
?? ?? ???(Serial Processing)
  • ?? ??? ??? ??? ??
  • (late 1940smid 1950s)
  • ?????? ?? ??? ????? ??
  • ????? ??
  • ?? ???
  • Scheduling ????? job scheduling
  • Setup time ??? job? ???? ?? setup time? ??? ??

11
?? ?? ?? ??? (1)
  • ??? ?? ?? (mid-1950s)
  • ?? ??
  • ???? ?? ??? ??? ??(job)? ??? ???? ????
  • ??? ???? ??? ??? ??? ?? ????(batch)? ???? ????
  • ???(Monitor) ????? ????? ? ??? ???? ????
  • ?? ???(Resident monitor)? ?? ???? ?? ?????? ????
  • ??? ????? ??? ?? ?????? ????(loading)

12
?? ?? ?? ??? (2)
  • 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

13
(No Transcript)
14
???(Monitor)
  • ???? ????(?????)?? ? ??(??? ????)? ??? ?? ??
    ?????? ????(loading)
  • ??? ???? ?? ??? ???? ??? ????
  • ??? ????? ?? ?? ?? ????
  • end-of-program ???
  • ?? ??
  • ??? ??? ????? ???? ?? ???? ????.

15
Job Control Language (JCL) (1)
  • ????? ?? ??? ??? ??? ?? ?? ??
  • what compiler to use
  • what data to use
  • ?? ??? ? -----------------gtgt
  • FTN ? ????? ?? ?? ???? ??? ?? ??? ??
  • LOAD? ??? ?? ??? ?????? ???(loading)
  • RUN ? ??? ????? ????

JOB FTN ... FORTRAN program ... LOAD RUN ...
Data ... END
16
Job Control Language (JCL) (2)
  • Structure of a typical FMS job 2nd generation

17
?? ?? ????
  • CPU ? ?? ??? ??? ????? ??
  • ??? ????? ???? ???? ??? CPU? ??? ??? ??? ??? idle
    ??? ???
  • ??? ????? ??? ????? ??? ????
  • ????? ?? ?? ????? ???? ?? ???? ???? ???? ??? ???
    ??

18
???? ?? ??(1)
  • ??? ??
  • ??? ????? ??? ??? ???? ??? ? ??? ??? ?? ?? ??
  • ???
  • ??? ??? ???? ???? ?? ???
  • ??? ??? ??? ????? ????

19
???? ?? ??(2)
  • ?? ???
  • ??? CPU ??? ?? ??
  • ??? ??
  • ??? ??(?? ?????(Supervisor) ??)
  • ???? ???? ???? ???
  • ??? ????? ???? ???? ??
  • ????
  • ??? ????? ??? ??? ??? ??? ????? ? ? ??? ??

20
?? ???? ???? ???(1)
  • I/O ??? ????? ?? ???? ??? ??? ???
  • I/O ???? ?? ????? ???? ??? ???? ????? ????
  • ??? ?????? ??? ????? ?? ??(uniprogramming)?? CPU?
    ???? ????

21
?? ???? ???? ???(2)
  • ?? ?????? ?? ?? ????? ?? ??, ??? ????? ??? ???
    ???? ?? CPU ? ?? ????? ??? ? ??.
  • multitasking (multiprogramming)

22
?? ???? ???? ???(3)
23
?? ? ?? ????? ?? (1)
  • ??

24
?? ? ?? ????? ?? (2)
25
?? ? ?? ????? ?? (3)
26
?? ????? ?? ??
  • Hardware support
  • I/O interrupts and (possibly) DMA
  • Memory management
  • Memory protection (data and programs)
  • Software support from the OS
  • Scheduling (which program is to be run next)
  • To manage resource contention

27
??? ???(Time Sharing Systems)(1)
  • ?? ???? ???? ???? ???? ??? ??? ???? ???
  • ? ?? ?? ??(Job Turnaround Time)
  • ???? ?? ??? ??? ??? ????? ?? 2? ???? ?? ??????
    ????
  • ??? ??? ?? 30?? ???? ???? ??? ? ??

28
??? ???(Time Sharing Systems)(2)
  • ??? ???? ??? ??? ??? ???? ??? ?? ????? ??? ???
    ?????
  • ??? ????? ???? ??? ????? ??
  • Time Slice ??? ??? ????? ???? ??
  • ?? ?? ??(Respone Time)
  • ??? ???? ????? ??? ???? ??? ? ??(??? ?? ??)
  • ?? ??? ?? ????? ??

29
??? ???(Time Sharing Systems)(3)
?
30
Batch Multiprogramming vs. Time Sharing
31
Early Example CTSS
  • Compatible Time-Sharing System (CTSS)
  • Developed at MIT as project MAC
  • Time Slicing
  • When control was passed to a user
  • User program and data loaded
  • Clock generates interrupts about every 0.2 sec
  • At each interrupt OS gained control and could
    assign processor to another user

32
CTSS Operation
33
Problems and Issues
  • ??? ??
  • Multiple jobs in memory must be protected from
    each others data
  • ????? ??
  • File system must be protected so that only
    authorised users can access
  • ?? ?? ??
  • Contention for resources must be handled
  • Printers, storage etc

34
Modern Operating Systems? ??(1)
  • ??? ????? ??? ????? ?? ?? ??
  • ??? ????? ??
  • multiprocessor machines
  • high-speed networks
  • faster processors and larger memory
  • ??? ????? ???
  • multimedia applications
  • Internet and Web access
  • Client/Server applications

35
Modern Operating Systems? ??(2)
  • Microkernel Architecture
  • Multithreading
  • Symmetric Multiprocessing
  • Distributed Systems
  • Embedded Systems
  • Object-Oriented Design

36
Microkernel architecture
  • ???? ?? ???? ???? ??
  • primitive memory management (address space)
  • Interprocess communication (IPC)
  • basic scheduling
  • ?? OS ???? ??? ?? ????(servers) ?? ??
  • device drivers, file system, virtual memory
  • More flexibility, extensibility, portability
  • ?? ????? microkernel ??? ???? ?? ??(? Window-NT
    ?)

37
Multithreading
  • ??? ????? ??? ?? ??? thread ?? ????
  • ????? ??? ??? ?? task? ????? ?? ????? ?? ????
  • ?? ???? ??? ???? ?
  • ??? ????? ???? thread? ??? ???? ??? ????

38
Symmetric Multiprocessing (SMP)
  • ??? ????? ?? ???
  • ? ????? ??? ??? ??? ?????? I/O ???
    ????(symmetric)
  • ????? ????/???? ?????? ??????(real parallelism)
  • Incremental growth
  • just add another CPU!
  • Robustness
  • a single CPU failure does not halt the system,
    only the performance is reduced

39
Example of parallel execution on SMP
40
Distributed Systems
  • ??? ????? ?? ???? ?? ???? ?? ?? ??? ??? ???
  • Loosely-coupled multiprocessor systems
  • Clustered Systems
  • ?? ????? ??
  • ?? ?? ??????? ?
  • ???? ?? ????(load balancing) ?
  • ???(reliability) HA(High Availability) ?

41
Embedded Systems
  • ??, ?? ?? ?? ??? ?? ?? ??? ???? ?? ??? ???
  • PDA, ?????, ???? ?? ??? ???? ??? ???? ???
  • ??? ??? ??
  • ??, ??? ? ?? ??? ?? ??? ??
  • ???? ???? ??
  • RTOS(Real-time Operating System)- pSos etc
  • Window-CE, Embedded Window-XP
  • Embedded Linux

42
Object-Oriented Design
  • ?? ??? ???? ???? ?? ??
  • ?? ?? ?? ??? ?? ??? ?? ?? ??? ????? ??? ? ??? ??
  • ?????? ???? ???? ??? ???? ??? ??? ?? ????? ??? ?
    ??
  • ?? ?? ? ??? ??? ??????? ??? ???? ??

43
??? ?? (1)
  • ??? ??(System Calls)
  • ??? ????? ???? ?? ?????
  • ?? ????? ??? ?? ??
  • ????? ????? ?? ??
  • ??? ?? ?? ? ?? ?? ????
  • ?? ?? ?? ? ?? ?? ??? ?? ???
  • ?? ?? ?? / ?? ?? ??
  • ?? ?? / ?? ??
  • ?? ??
  • ??? ??
  • ???? ??

44
??? ?? (2)
??? ????
??? ??
????
????? ??
45
??? ?? ?? ??
  • There are 11 steps in making the system call read
    (fd, buffer, nbytes)

46
??? ?? ?? (1)
  • ???? ??(Process Control)
  • ???? ?? ? ??
  • ???? ?? ? ??
  • ???? ?? ?? ? ?? ?

47
??? ?? ?? (2)
  • A stripped simple 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 /

48
??? ?? ?? (3)
  • ?? ??(File Management)
  • ?? ?? ? ??
  • ?? ?? ? ??
  • ?? ?? ? ??
  • ?? ?? ?? ? ??

49
??? ?? ?? (4)
  • ???? ??(Directory Management)
  • ???? ?? ? ??
  • ???? ??
  • ????? Mounting

50
??? ?? ?? (5)
  • ?? ??? ??
  • ?? ??(Device Management)
  • ?? ?? ? ??
  • ??, ??, ???
  • ?? ?? ?? ? ??
  • ?? ?? ??(Information Maintenance)
  • ??, ?? ?? ??
  • ??? ?? ?? ?
  • ??(Communication)
  • ?? ?? ?? ? ??
  • ?? ??? ?

51
??? ?? ?? (6)
52
??? ?? ?? (7)
  • Some Win32 API calls

53
???? ??(1)
  • ??? ????
  • ??? ??? ????
  • ???? ??? ?? ?? ??
  • ??? ?? ?? ??
  • ?? ?? ?? ??
  • ??? ??? ?? ??? ????? ??
  • ? ????, ??? ???, ???, ??? ?

54
???? ??(2)
55
UNIX OS ??
56
Modern UNIX Kernel
57
Modern UNIX Systems
  • System V Release 4 (SVR4)
  • Solaris 9
  • 4.4BSD
  • Linux

58
Windows Architecture
  • Modular structure for flexibility
  • Executes on a variety of hardware platforms
  • Supports application written for other operating
    system

59
(No Transcript)
60
Operating System Organization
  • Modified microkernel architecture
  • Not a pure microkernel
  • Many system functions outside of the microkernel
    run in kernel mode
  • Any module can be removed, upgraded, or replaced
    without rewriting the entire system

61
Kernel-Mode Components
  • Executive
  • Contains base operating system services
  • Memory management
  • Process and thread management
  • Security
  • I/O
  • Interprocess communication
  • Kernel
  • Consists of the most used components

62
Kernel-Mode Components
  • Hardware abstraction layer (HAL)
  • Isolates the operating system from
    platform-specific hardware differences
  • Device drivers
  • Translate user I/O function calls into specific
    hardware device I/O requests
  • Windowing and graphics systems
  • Implements the graphical user interface (GUI)

63
Windows Executive
  • I/O manager
  • Cache manager
  • Object manager
  • Plug and play manager
  • Power manager
  • Security reference monitor
  • Virtual memory manager
  • Process/thread manager
  • Configuration manager
  • Local procedure call (LPC) facility

64
User-Mode Processes
  • Special system support processes
  • Ex logon process and the session manager
  • Service processes
  • Environment subsystems
  • User applications

65
Client/Server Model
  • Simplifies the Executive
  • Possible to construct a variety of APIs
  • Improves reliability
  • Each service runs on a separate process with its
    own partition of memory
  • Clients cannot not directly access hardware
  • Provides a uniform means for applications to
    communicate via LPC
  • Provides base for distributed computing

66
Threads and SMP
  • Operating system routines can run on any
    available processor
  • Different routines can execute simultaneously on
    different processors
  • Multiple threads of execution within a single
    process may execute on different processors
    simultaneously
  • Server processes may use multiple threads
  • Share data and resources between process

67
Windows Objects
  • Encapsulation
  • Object consists of one or more data items and one
    or more procedures
  • Object class or instance
  • Create specified instances of an object
  • Inheritance
  • Support to some extent in the Executive
  • Polymorphism
Write a Comment
User Comments (0)
About PowerShow.com