1 / 51

Chapter 3: Operating Systems

Chapter 3: Operating Systems. Computer Science: An Overview Tenth Edition by J. Glenn Brookshear. Chapter 3: Operating Systems. 3.1 The History of Operating Systems 3.2 Operating System Architecture 3.3 Coordinating the Machine’s Activities 3.4 Handling Competition Among Processes

annajenkins
Télécharger la présentation

Chapter 3: Operating Systems

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 3: Operating Systems Computer Science: An OverviewTenth Edition by J. Glenn Brookshear

  2. Chapter 3: Operating Systems • 3.1 The History of Operating Systems • 3.2 Operating System Architecture • 3.3 Coordinating the Machine’s Activities • 3.4 Handling Competition Among Processes • 3.5 Security

  3. Functions of Operating Systems • Oversee operation of computer • Store and retrieve files • Schedule programs for execution • Coordinate the execution of programs

  4. Famous OSs • Microsoft Windows • Unix based - Mac OS (Apple Mac) - Solaris (SunMicro system) - Linux - Antroid

  5. Evolution of Shared Computing • (1)Batch processing - the executing jobs without interaction with users - Payroll system, print monthly report job • (2)Interactive processing • there’s interaction between users and computer • Requires real-time processing, normally 3-5 seconds response time is acceptable • Choosing curriculum

  6. Figure 3.1 Batch processing

  7. Figure 3.2 Interactive processing

  8. (3)Time-sharing/Multitasking • Implemented by Multiprogramming • Time is divided into intervals and executing each job at one interval • take turn to execute each job until all the jobs are executed • If used in a single-user environment is called multitasking

  9. (4)Multiprocessor machines - assign different tasks to different processors - load balancing (dynamically allocating tasks to the various processors so that all processors are used efficiently) - scaling ( breaking tasks into a number of subtasks compatible with the number of processors available)

  10. Network-wide operating system • As the computer network popular, a network of individual OS can share the loading of a big tasks- cloud computing

  11. 雲端運算(cloud computing),是分散式計算技術的一種,其最基本的概念,是透過網路將龐大的運算處理程序自動分拆成無數個較小的子程序,再交由多部伺服器所組成的龐大系統經搜尋、運算分析之後將處理結果回傳給用戶。 • 透過這項技術,網路服務提供者可以在數秒之內,達成處理數以千萬計甚至億計的資訊,達到和「超級電腦」同樣強大效能的網路服務。

  12. The trend is to develop a single network-wide OS rather than a network of individual OS. • Yet, developing of OS for hand-held computing is needed • The challenge are limited data storage capability and power conservation requirements • Palm OS, Windows CE, Window Mobil, Antroid

  13. Types of Software • Application software • Performs specific tasks for users • System software • Provides infrastructure for application software • Consists of operating system and utility software

  14. Figure 3.3 Software classification

  15. Operating System Components • Shell: Communicates with users • Text based • Graphical user interface (GUI) -- Window manager • Kernel: Performs basic required functions • File manager • Device drivers • Memory manager • Scheduler and dispatcher

  16. Figure 3.4 The shell as an interface between users and the operating system

  17. Window manager • allocate blocks of space on the screen • Keeps track of which appilcation is associated with each window • When a mouse button is clicked, it compute the mouse’s location and notifies the appropriate application of the mouse action

  18. File Manager • It keeps records of all the files stored in mass storage, including where each file is located, which users are allowed to access the various file and which portions of storage are available for news files…etc • Directory (or Folder): A user-created bundle of files and other directories (subdirectories) • Directory Path: A sequence of directories within directories

  19. Figure 2.13 Controllers attached to a machine’s bus

  20. Device drivers • The software communicate with the controllers to carry out operations on the peripheral devices • Each device driver is uniquely designed for its particular type of device e.g. a printer driver can read and decode the particular printer’s status word and handshaking details.

  21. Memory Manager • Allocates space in main memory • May create the illusion that the machine has more memory than it actually does (virtual memory) by playing a “shell game” in which blocks of data (pages) are shifted back and forth between main memory and mass storage

  22. Getting it Started (Bootstrapping) • Bootstrap: Program in ROM (example of firmware) • Run by the CPU when power is turned on • Transfers operating system from mass storage to main memory • Executes jump to operating system

  23. Figure 3.5 The booting process

  24. BIOS • Software routines for performing fundamental input/ output activities. • Stored in the ROM as well.

  25. Special purpose computers • The functions are fixed, so they store all the program in their main memory where it is readily available each time the device is turned on. • Turnkey system

  26. Processes • Process: The activity of executing a program • Process State: Current status of the activity • Program counter • General purpose registers • Related portion of main memory

  27. Figure 2.4 The architecture of the machine described in Appendix C

  28. Figure 3.6 Time-sharing between process A and process B

  29. Process Administration- Scheduler • Keep track of all the processes in the process table which reside in main memory. • Process table • Memory area assigned to a process • The priority of a process • Process status (ready, waiting) ready- the process can continue waiting- the process is waiting for external events occurs

  30. Adds new processes to the process table • removes completed processes from the process table

  31. Dispatcher • Controls the allocation of time slices to the processes in the process table • The end of a time slice is signaled by an interrupt. • Select the process from process table that has the highest priority among the ready processes to execute

  32. Virtual reality • CNN beams up virtual correspondent • Star war • hologram

  33. Handling Competition for Resources • An important task of an operating system is the allocation of the machine’s resources to the processes in the system. • Resource: CPU、main memory, mass storage, peripherals… • E.g. file manager allocates mass storage space for new files,scheduler allocates space in the process table…

  34. flag • OS use a flag to keep track of whether the printer has been allocated. • Flag: a bit in memory whose states are set or clear. Set flag means it is taken, clear flag indicates it is available. • the process can use the resource only when the flag is ‘clear’.

  35. Test and possibly setting problem • Process A is testing and finding that the flag is “clear”.. And about to change the flag to “set”.. An interrupt occurs • Process B requests the same resource and since the flag is clear, so it got the permission to use it. • When the time slice is up, an interrupt occurs, the status of computer restores, process A proceed to change the flag to set and start to print….both process A and B are using printer

  36. Solutions • A. make the rule that during the test-possibly setting, the interrupt is disabled. • B. use “test-and-set” instruction to execute the it • C. Spooling

  37. Semaphore: A “control flag”

  38. Critical Region: A group of instructions that should be executed by only one process at a time • Mutual exclusion: Requirement for proper implementation of a critical region

  39. Regulation of semaphore • To enter the critical region, a process must find the semaphore clear and set the semaphore before entering the critical region; then upon exiting the critical region, the process must clear the semaphore.

  40. Figure 3.7 A deadlock resulting from competition for nonshareable railroad intersections

  41. Deadlock • Processes block each other from continuing • Conditions required for deadlock 1. Competition for non-sharable resources 2. Resources requested on a partial basis 3. An allocated resource can not be forcibly retrieved The deadlock problem can be removed by attacking any one of the three.

  42. Deadlock detection and correction scheme • An allocated resource can not be forcibly retrieved • E.g. A process requires to create new process to perform subtasks while the process table is full. • OS detects the deadlock and KILL some processes in the process table

  43. Deadlock avoidance scheme Condition 2: Resources requested on a partial basis e.g. To require each process to request all its resources at one time.

  44. Competition for non-sharable resources • E.g. printer • Solution : spooling

  45. 手機也面臨病毒侵襲 • 專家稱有500種手機病毒 功能越接近電腦 威脅愈大 • 據聖荷西信使報報導,當電腦正在遭受越來越多的病毒侵襲之際,手機也和電腦一樣成為病毒攻擊的對象,而且受到的威脅越來越大。 • 報導認為,手機和電腦一樣,也面臨著各種病毒的威脅,特別是當手機功能越接近電腦功能時,其遭受病毒襲擊的可能性就越大。報導說,最著名的手機病毒也許是2005年發現的彩信木馬病毒commwarrior-a,它是全球第一個通過移動多媒體信息服務傳播的手機病毒。自那時以來,手機病毒迅猛增加。目前,網絡安全專家發現的手機病毒已經有500種左右。

  46. 報導援引網絡安全專家的話說,駭客利用病毒攻擊手機的目的多種多樣,比如盜取手機內保存的信息、假冒手機用戶訂閱付費信息服務等等。今後駭客可能還會通過像「snoopware」這樣的病毒,開啟手機上的全球定位系統功能以定位手機用戶所在地區,或打開手機的麥克風與攝影機來偷聽手機用戶對話,窺視手機用戶周邊環境。

  47. Questions • A. Why a computer virus can attack Mobil phone? • B. How can a computer virus attack a Mobil phone? • C. Guess what system can be attacked most?

  48. Security • Attacks from outside • Problems • Insecure passwords • Sniffing software-the software when left running on a computer records activities and reports them to a would-be intruder • Counter measures • Auditing software- record and analyze the activities taking place within the computer system

  49. Password problem • What is a ‘good’ password?

  50. Security (continued) • Attacks from within • Problem: Unruly processes- may try to trick MM into allowing a process to access MM cells outside it’s allocated area or retrieving files whose access should be denied. • OS designs a special register to keep the upper limit and lower limit of memory address of a process. • But then the unruly program may change the contents of the special register

More Related