Operating Systems and Memory Management


Published on

Made by Jaysee Pingkian. Note: may have Filipino expressions. Used in my CSCI 06 report.

Published in: Technology
  • Microsoft Windows 10 Home 64 Bit System Builder OEM | PC Disc --- http://amzn.to/1RXWWfE
    Are you sure you want to  Yes  No
    Your message goes here
  • Operating Systems: Principles and Practice --- http://amzn.to/1TYT449
    Are you sure you want to  Yes  No
    Your message goes here
  • Windows 7 Professional SP1 64bit (OEM) System Builder DVD 1 Pack (For Refurbished PC Installation) --- http://amzn.to/1R7NbPL
    Are you sure you want to  Yes  No
    Your message goes here
  • good work
    Are you sure you want to  Yes  No
    Your message goes here
  • how to download this presentation?
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Operating Systems and Memory Management

  1. 5. Windows 7 Windows Vista
  2. 9. <ul><li>OS are responsible for everything from starting up the computer when you push the &quot;on&quot; button to high level system security. </li></ul><ul><li>The type of operating system a computer has also determines what types of software can be run on it. </li></ul>
  3. 10. <ul><li>to organize and control hardware and software so that the device it lives in behaves in a flexible but predictable way. </li></ul>
  4. 12. <ul><li>It manages the hardware and software resources of the system. </li></ul><ul><li>In a desktop computer, these resources include such things as </li></ul><ul><ul><li>the processor (is an electronic circuit that can execute computer programs),  </li></ul></ul><ul><ul><li>memory, </li></ul></ul><ul><ul><li>disk space and </li></ul></ul><ul><ul><li>more (On a cell phone, they include the keypad, the screen, the address book, the phone dialer, the battery and the network connection). </li></ul></ul>
  5. 13. <ul><li>It provides a stable, consistent way for applications to deal with the hardware without having to know all the details of the hardware. </li></ul>
  6. 14. <ul><li>OS performs a variety of functions, including </li></ul><ul><ul><li>determining what types of software you can install </li></ul></ul><ul><ul><li>coordinating the applications running on the computer at any given time </li></ul></ul><ul><ul><li>making sure that individual pieces of hardware, such as printers, keyboards, and disk drives, all communicate properly </li></ul></ul><ul><ul><li>allowing applications such as word processors, email clients, and web browsers, to perform tasks on the system </li></ul></ul><ul><ul><li>reporting errors </li></ul></ul>
  7. 15. <ul><li>The OS also determines how you see information and perform tasks. Some operating systems utilize a graphical user interface (GUI), which presents information through pictures (icons, buttons, dialog boxes, etc.) as well as words. </li></ul>
  8. 16. <ul><li>The first task, managing the hardware and software resources, is very important, as various programs compete for the attention of the  central processing unit  (CPU). </li></ul>
  9. 17. <ul><li>In this capacity, the OS plays the role of the good parent, making sure that each application gets the necessary resources while playing nicely with all the other applications, </li></ul><ul><li>as well as husbanding the limited capacity of the system to the greatest good of all the users and applications. </li></ul>
  10. 18. <ul><li>The second task, providing a consistent application interface, </li></ul><ul><li>is especially important if there a lot of types of computer using the operating system, </li></ul><ul><li>or if the hardware making up the computer is always open to change. </li></ul>
  11. 19. <ul><li>A consistent  application program interface  (API) allows a software developer to write an application on one computer and have a high level of confidence that it will run on another computer of the same type, even if the amount of memory or the quantity of storage is different on the two machines. </li></ul>
  12. 20. <ul><li>Even if a particular computer is unique, an operating system can ensure that applications continue to run when hardware upgrades and updates occur. </li></ul><ul><li>One of the challenges facing developers is keeping their operating systems flexible enough to run hardware from the thousands of vendors manufacturing computer equipment. </li></ul>
  13. 21. <ul><li>Today's systems can accommodate thousands of different printers, disk drives and special peripherals in any possible combination. </li></ul>
  14. 23. <ul><li>Within the broad family of operating systems, there are generally four types, categorized based on the types of computers they control and the sort of applications they support. The categories are: </li></ul><ul><ul><li>*Real-time operating system  (RTOS) </li></ul></ul>
  15. 24. <ul><li>RTOS are used to control machinery, scientific instruments and industrial systems. </li></ul>
  16. 25. <ul><li>An RTOS typically has very little user-interface capability, and no end-user utilities, since the system will be a &quot;sealed box&quot; when delivered for use. </li></ul><ul><li>A very important part of an RTOS is managing the resources of the computer so that a particular operation executes in precisely the same amount of time, every time it occurs. </li></ul><ul><li>In a complex machine, having a part move more quickly just because system resources are available may be just as catastrophic as having it not move at all because the system is busy. </li></ul>
  17. 26. <ul><li>As the name implies, this operating system is designed to manage the computer so that one user can effectively do one thing at a time. </li></ul>
  18. 27. <ul><li>The Palm OS for Palm handheld computers is a good example of a modern single-user, single-task operating system. </li></ul>
  19. 28. <ul><li>  This is the type of operating system most people use on their desktop and laptop computers today. </li></ul>
  20. 29. <ul><li>Microsoft's Windows and Apple's MacOS platforms are both examples of OS that will let a single user have several programs in operation at the same time. </li></ul><ul><li>For example, it's entirely possible for a Windows user to be writing a note in a word processor while downloading a file from the Internet while printing the text of an e-mail message. </li></ul>
  21. 30. <ul><li>A multi-user operating system allows many different users to take advantage of the computer's resources simultaneously. </li></ul><ul><li>The operating system must make sure that the requirements of the various users are balanced, and that each of the programs they are using has sufficient and separate resources so that a problem with one user doesn't affect the entire community of users. </li></ul>
  22. 31. <ul><li>Unix, VMS and mainframe operating systems, are examples of multi-user operating systems. </li></ul>
  23. 33. <ul><li>Scheduling refers to the way processes are assigned to run on the available CPUs. </li></ul><ul><li>This assignment is carried out by software known as a scheduler. </li></ul>
  24. 35. <ul><li>Also called “admission” </li></ul><ul><li>decides which jobs or processes are to be sent to the ready queue; </li></ul><ul><li>Process is an instance of a computer program. A computer program itself is just a collection of instructions, while a process is the actual execution of those instructions.  </li></ul><ul><li>A &quot; ready “ process has been loaded into main memory and is awaiting execution on a CPU </li></ul><ul><li>Queue line of waiting processes </li></ul>
  25. 36. <ul><li>that is, when an attempt is made to execute a program, its admission to the set of currently executing processes is either authorized by the long-term scheduler. </li></ul>
  26. 37. <ul><li>Thus, this scheduler dictates what processes are to run on a system, and the degree of concurrency to be supported at any one time </li></ul>Concurrent all happening at one time
  27. 38. <ul><li>In modern OS's, this is used to make sure that real time processes get enough CPU time to finish their tasks. </li></ul><ul><li>Without proper real time scheduling, modern GUI interfaces would seem sluggish . </li></ul>GUI Graphical User Interface. Everything you see on the screen. Real time actual events happening at this moment Sluggish moving slowly
  28. 39. <ul><li>Long-term scheduling is also important in large-scale systems such as batch processing systems, computer clusters , supercomputers and render farms . </li></ul>Batch processing is execution of a series of programs on a computer without human interaction. A computer cluster is a group of linked computers, working together closely so that in many respects they form a single computer. A supercomputer is a computer that is at the frontline of current processing capacity, particularly speed of calculation. A render farm is a computer cluster built to render computer-generated imagery (CGI), typically for film and television visual effects, using off-line batch processing.
  29. 42. <ul><li>referred to as &quot;swapping out&quot; or &quot;swapping in&quot; </li></ul><ul><li>present in all systems with virtual memory , </li></ul><ul><li>temporarily removes processes from main memory (RAM) and places them on secondary memory (such as a disk drive) or vice versa. </li></ul>With virtual memory , the computer can look for areas of RAM that have not been used recently and copy them onto the hard disk. This frees up space in RAM to load the new application. MORE WILL BE DISCUSSED LATER.
  30. 43. <ul><li>The mid-term scheduler may decide to ‘swap out’ </li></ul><ul><li>a process which has not been active for some time, </li></ul><ul><li>or a process which has a low priority, </li></ul><ul><li>or a process which is taking up a large amount of memory </li></ul>
  31. 45. <ul><li>also known as the “dispatcher” </li></ul><ul><li>decides which of the ready, in-memory processes are to be executed </li></ul>
  32. 46. <ul><li>makes scheduling decisions much more frequently than the long-term or mid-term schedulers because a decision will be made after every time slice , and these are very short. </li></ul>time slice time para sa each program para iprocess sa CPU
  33. 47. <ul><li>This scheduler can be preemptive , implying that it is capable of forcibly removing processes from a CPU when it decides to allocate that CPU to another process. </li></ul>Preemptive characteristic of securing something before someone else.
  34. 49. <ul><li>It is a term used to describe how the OS handles the available RAM. It is managed at multiple levels. </li></ul>
  35. 50. <ul><li>The most basic level </li></ul><ul><li>Its size is the sum of all the capacities of all RAM. </li></ul>
  36. 51. <ul><li>For example, when you have two 512 MB SDRAM* modules installed in your system, the OS will have 1 GiB of physical memory at its disposal. </li></ul>*512 Megabytes Synchronous Dynamic RAM
  37. 52. <ul><li>If someone asks you how much memory your computer has, they're  not  talking about  hard drive space.  </li></ul><ul><li>They're asking you how much  RAM  your computer has. </li></ul>
  38. 54. <ul><li>Just as with your computer, when you want to write a letter or work on some project, you need to open programs and spread them out within your computer's memory—it's RAM. </li></ul><ul><li>If you have a simple note to write, you might use a little program like Notepad. </li></ul><ul><li>If it's a more involved project, maybe you'll open Word or some special stationary program. </li></ul>
  39. 55. <ul><li>The bigger the program, the more RAM will be needed and subsequently used. </li></ul>
  40. 56. <ul><li>If you have a large dining room table, just like a lot of RAM, you'll find you don't have much difficulty getting the job done because you have lots of room on that table to work. </li></ul><ul><li>Just as your computer has lots of RAM to allow programs to work quickly. </li></ul>
  41. 58. <ul><li>An imaginary memory area supported by some OS in conjunction with the hardware. </li></ul>
  42. 59. <ul><li>You can think of virtual memory as an alternate set of memory addresses. </li></ul>
  43. 60. <ul><li>Programs use these virtual addresses rather than real addresses to store instructions and data. </li></ul>
  44. 61. <ul><li>The purpose of virtual memory is to enlarge the address space, the set of addresses a program can utilize. </li></ul>
  45. 63. <ul><li>On top of the physical memory is the segmented memory. </li></ul><ul><li>is one of the most common ways to achieve memory protection </li></ul>
  46. 64. <ul><li>An  address space   logically  divided into sections, called  segments.   </li></ul>Address space Memory allocated to an application by the operating system. Logically related
  47. 65. <ul><li>A segment has a set of permissions, and a length, associated with it. </li></ul><ul><li>If the currently running process is allowed by the permissions to make the type of reference to memory that it is attempting to make, the reference is permitted. </li></ul>
  48. 66. <ul><li>Segmented Memory is the additional 64 KB of RAM for early computers. </li></ul><ul><li>But most operating systems today don't use a segmented memory model, with the advent of paging. </li></ul>
  49. 67. <ul><li>A technique used by virtual memory operating systems to help ensure that the data you need is available as quickly as possible. </li></ul>
  50. 68. <ul><li>the OS retrieves data from secondary storage in same-size blocks called  pages . </li></ul>
  51. 69. <ul><li>The operating system copies a certain number of pages from your storage device to main memory. </li></ul><ul><li>When a program needs a page that is not in main memory, the operating system copies the required page into memory and copies another page back to the disk. </li></ul>
  52. 70. <ul><li>When a program needs a page that is not in main memory, the operating system copies the required page into memory and copies another page back to the disk. </li></ul>
  53. 71. <ul><li>To replace pages or segments of data in memory. </li></ul><ul><li>Swapping is a useful technique that enables a computer to execute programs and manipulate data files larger than main memory. </li></ul><ul><li>The operating system copies as much data as possible into main memory, and leaves the rest on the disk. </li></ul>
  54. 72. <ul><li>When the operating system needs data from the disk, it exchanges a portion of data (called a page or segment ) in main memory with a portion of data on the disk. </li></ul>
  55. 73. <ul><li>Swapping is when an entire process is swapped out.  </li></ul><ul><li>Paging is normal. </li></ul><ul><li>Paging refers to making individual pages of memory. </li></ul><ul><li>Swapping happens when the resource load is heavy and the entire process is written out to disk. </li></ul>
  56. 74. <ul><li>With paging, memory is managed in 4 KB-sized chunks. </li></ul><ul><li>Most applications require the ability to be able to get only a fraction of that size, to store data. </li></ul>
  57. 75. <ul><li>The memory allocator gets a big chunk of memory </li></ul><ul><li>For example 4 pages, or 4 * 4 KB = 16 KB and divides this into much smaller chunks which it gives to the applications when requested. </li></ul>
  58. 76. <ul><li>In programming, an area of memory reserved for data that is created at runtime. </li></ul>
  59. 77. <ul><li>an area of memory reserved for data when the program actually executes. </li></ul><ul><li>an area of memory reserved for data whose size can be determined when the program is compiled. </li></ul>
  60. 78. <ul><li>begins by building a  heap   out of the data set, and then removing the largest item and placing it at the end of the sorted array. </li></ul><ul><li>After removing the largest item, it reconstructs the heap and removes the largest remaining item and places it in the next open position from the end of the sorted array. This is repeated until there are no items left in the heap and the sorted array is full. </li></ul>
  61. 79. <ul><li>To divide memory or mass storage into isolated sections. </li></ul>
  62. 80. <ul><li>In addition, partitioning on Windows machines can improve disk efficiency. </li></ul>
  63. 81. <ul><li>Buffer A temporary storage area, usually in RAM. </li></ul>
  64. 82. <ul><li>For example, word processors employ a buffer to keep track of changes to files. </li></ul><ul><li>Then when you save the file, the word processor updates the disk file with the contents of the buffer. </li></ul>
  65. 83. <ul><li>This is much more efficient than accessing the file on the disk each time you make a change to the file. </li></ul>
  66. 84. <ul><li>Another common use of buffers is for printing documents. </li></ul><ul><li>When you enter a PRINT command, the operating system copies your document to a print buffer (a free area in memory or on a disk) from which the printer can draw characters at its own pace. </li></ul><ul><li>This frees the computer to perform other tasks while the printer is running in the background. Print buffering is called spooling. </li></ul>
  67. 85. <ul><li>Most keyboard drivers also contain a buffer so that you can edit typing mistakes before sending your command to a program. </li></ul>