Presentation is loading. Please wait.

Presentation is loading. Please wait.

Intro. To Operating Systems

Similar presentations


Presentation on theme: "Intro. To Operating Systems"— Presentation transcript:

1 Intro. To Operating Systems

2 What is an operating system?
Very simply, it is a piece of software that manages the resources on your computer. Various tasks of a OS: Perform basic functions Schedule tasks Execute applications Act as a medium between hardware Typically, modern OS are in the form of a GUI (graphical user interface)

3 So why do need this piece of software
So why do need this piece of software? Task 1  Need CPU  Need memory  Need access to files Task 2  Need CPU  Need memory  Need access to files Task 3  Need CPU  Need memory  Need access to files

4 Task 1: Managing tasks

5 Scenario 1: 3 processes (A, B, and C) need to complete. Process A needs to complete before process B can begin. Process B starts but never finishes. Process C needs a resource that process B is holding to complete. This results in a scenario called deadlock. Your machine is “stuck” waiting for a resource that never comes.

6 Scenario 2 3 processes (A, B, and C) need to complete. Process A finishes and starts process B. Process B finishes and starts process C. Process C finishes and starts process A. You have infinite loop. Your machine cannot reach a terminating condition for a process.

7 Scenario 3 3 processes (A, B, and C) need to complete. Process A is waiting for process B to release a resource Process B is waiting for process C to release a resource Process C is waiting for process A to release a resource This scenario is called a timeout, when your machine cannot resolve resource distribution. Process synchronization is off.

8 Task 2: Memory management
Everything sitting in memory has a physical address. Before data can be used, it’s physical address must be evaluated. Operating systems use virtual memory for operations and then use a table to reference physical memory when it is needed.

9 Task 2: Memory management
Virtual address Physical Address a 0x000001 b 0x153304 c d 0x165604 e 0x412887 f 0x985221 g 0x631475 h 0x652310

10 When memory is summoned, it is segmented into pages
When memory is summoned, it is segmented into pages. How big these pages of memory are will depend on various operating systems. For our example, let’s say a page of memory is 128 bytes. Let’s now suppose we have to summon a program that takes up 150 bytes in memory before we can execute. We will now need two pages of memory to hold this program. However, we have a problem.

11 Memory Fragmentation Two pages of memory used, each page at 128 bytes. But you only needed 150, not 256. What does this do? 106 bytes of the second page was never used. Your memory is now fragmented. 128/128 22/128

12 Memory Fragmentation 56/128 71/128 128/128 90/128 Since you have dedicated page sizes, you have chunks in memory pages that never get used. Essentially, you have fragments. 22/128

13 Task 2: Memory management
When you have fixed size memory pages, your memory will inherently become fragmented through repeated use. What if you decide you will dynamically allocate memory page sizes to avoid fragmentation? What is the challenge to that?

14 Task 3: Hardware Configurations and Interfacing
Your OS must provide a way for you to interact with your hardware. Your OS must also provide a way for you to modify existing hardware settings. All of this adds to up to what we call the OS Kernel.

15 OS Kernel An operating system kernel is the “nucleus” of the entire operating system. It is a collection of all of your programs that make an operating system run like its supposed to. A kernel is abstract. This is not a piece of hardware or software. It is all the essentials that make up your operating system. The OS kernel has full control over processes, I/O functions, memory management, and communicating with all devices connected to your OS.

16 Lab 2: OS analysis Windows Apple / MAC Linux


Download ppt "Intro. To Operating Systems"

Similar presentations


Ads by Google