1 / 77

F453 – Computing Theory

F453 – Computing Theory. Chapter 13 The Function of Operating Systems. Interrupts Scheduling Memory Management Paging Segmentation Virtual memory Disk Thrashing Spooling Boot File FAT. Resource used: OCR Computing Text Book, Hodder Education. Features of operating systems.

beyla
Download Presentation

F453 – Computing Theory

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. F453 – Computing Theory Chapter 13 The Function of Operating Systems Interrupts Scheduling Memory Management Paging Segmentation Virtual memory Disk Thrashing Spooling Boot File FAT Resource used: OCR Computing Text Book, Hodder Education

  2. Features of operating systems • Hardware resources (Provide and Manage) – such as the management of memory and the jobs passing through it • Interface – provide an interface between the user and machine • Interface – provide an interface between applications software and the machine. (software and hardware) • Security – provide it for the data on the system particularly when there are lots of users. • Utility Software– provide this so that maintainence can be done! H I I S U Don’t forget: Mnemonics! – memory aids!

  3. You’re the expert… Er.. HISSU…. What did you say an operating system was? What are the main features of an operating system!? H I I S U

  4. Moving on… • INTERRUPT HANDLING

  5. Interrupt Handling • Remember our friend the Processor? (brain of the computer) • It normally functions SERIALLY – that is an instruction is collected, acted upon, next instruction… • This continues while the processor is operating or the set of instructions is completed.

  6. Interrupt Handling • That’s all well and good – if things run smoothly, but often you are going to get something causing the processor to stop what it is doing and do something else • It is the INTERRUPT that asks for this to happen….

  7. Types of Interrupt  • Hardware interrupt – (the buffer that is being used to transfer data from primary memory to secondary storage has been emptied and needs to be refilled so that data transfer can continue) • Software interrupts (such as the interrupt caused to the flow of a program by a call to an external device) • EACH INTERRUPT IS GIVEN A PRIORITY – if two occur you need to know which is more important.

  8. Example of most important interrupt • An interruption to power supply! (this is given the highest priority of all!)

  9. So what happens when an interrupt occurs – What’s the process? • 

  10. Interrupt - process • Interrupt is stored with all other jobs that the processor has to do (including current running task) • Interrupt given a priority, as is the current job, according to importance • All jobs are stored – but also stored in order of priority! • Processor finishes an instruction – it checks list for stuff to be done • As long as job it is doing is at the top of the list –It will continue with next instruction, but if an interrupt has gone to top of list, the processor will STOP the job its doing!

  11. It can’t just stop • It’s like when you’ve been working all night on an essay. • In the morning there’s a fire….you need to rush out of the house. • An important interrupt no doubt but… • Will you press save? *maybe not!

  12. Processor does save when it is interrupted • It can’t waste all the processing its done • So it stores the contents of all the special registers so that when it goes back to the job it can load the special register with these contents again and carry on from where it left off. • These values are stored in a STACK (we’ll do more on these soon)

  13. So special registers emptied • The new job then (the interrupt) can be loaded into the special registers and proccessed until it is completeed.

  14. Scheduling, Job Queues and Priorities Life requires Schedules, Priorities and Queues. Without them, things would not function.

  15. What are your priorities? • Physical • Spiritual • Mental • Emotional

  16. Scheduling • Take the exampe of a multi operating system….there are a number of jobs that must be in the memory in order of the OS to switch from one job to the other • This in turns means the OS must have a set of rules that it can use in order to determine the order in which the jobs should be handled • The use of this set of rules is known as job scheduling

  17. So what’s scheduling? • The use of a set of rules to determine the order that jobs should be handled is called Scheduling

  18. What’s scheduling????? • Set of rules • These set of rules determine the order in which jobs should be handled. • Use of these rules is called job scheduling!

  19. More about the rules… • The rules used will be largely decided by the importance applied to the different jobs to be carried out • This concept of “importance” implies that the jobs can be arranged into some sort of order and the OS can then follow this order of jobs • HOW IS THE ORDER OF JOBS DECIDED!?!?!??

  20. How do you order jobs in your brain? • Jobs that require physical strength – (interfacing with physical external objects…?) • Jobs that require emotional strength (things that require processing and brain powre)

  21. Two types of jobs! (for a processor!) • Jobs that required printers and peripherals a lot – such as a job that needs you to print gas bills • Jobs that might use the processor a lot – such as a program to calculate a prime number or square root of something. • TWO JOBS HERE ARE: I/O Bound Jobs Processor Bound Jobs

  22. Which ones are given a higher prioity? • I/O bound jobs or • Processor bound jobs?? I/O Bound jobs! Why do you think this is?

  23. Exam paper Practice! • Remember the mark scheme is a good way to memorise answers! (in a concise manner)

  24. From Spec Paper f453 (Q1)

  25. Answers!

  26. Scheduling/Round Robin Scheduling

  27. Answers!

  28. If you had loads of things to do, you might develop an unconscious algo in your head… • First Watch GLEE • Then Bully little Brother • Then do computing coursework (if time left)

  29. Parts to focus on: Write-up + Coding Take your computing coursework • Do first come, first served – as in what you’ve been asked to do – you do • Do a bit of everything – equal amounts of time spent on write-up and programming • Do the shortest bit first (as in do login screen, then move on to sorting algorithm – leave write-up for last, as its longest!) • Devise a system where you spend some time on the write-up but an alarm goes off if you spend too much time on it, and then move on to another job. Multi-level and complex

  30. Scheduling Algorithims • Some examples of Scheduling Algorithims: • FCFS • RR • SJF • SRT • MFQ – Multilevel feedback queues – a very complex algorithm involving a number of queues set up according to rules and acting like a set of league tables. As jobs are given lots of peripheral time, they drop Down the league table, some getting relegated. When a job is finished it leaves the system another job can then get promoted. In this way JOBS CANNOT SPEND TOO MUCH TIME MONOPOLISING THE PROCESSOR

  31. Scheduling Algorithims • Some examples of Scheduling Algorithims: • FCFS • RR • SJF • SRT –Shortest Remaining Time – similar to SJF – jobs will obviously get shorter and hence nearer the top of the queue as they are processed. Jobs are returned to the queue when they have to stop for some reason like waiting for some input from a keyboard. The major problem with this scheduling algorithm is…..? • MFQ LONGER JOBS MAY NEVER GET STARTED!

  32. Scheduling Algorithims • Some examples of Scheduling Algorithims: • FCFS • RR • SJF –Shortest Job first. When new jobs are added it is important to make sure they are placed in the right place in the queue by the OS making an estimate of the length of time required to carry out the task • SRT • MFQ

  33. Scheduling Algorithims • Some examples of Scheduling Algorithims: • FCFS • RR – Round Robin! The concept of every user getting a small amount of time with the processor betfore it goes on to the next user. (used in Multi-access OS’s) It uses time slices of various lengths to ensure that all jobs get a share of processor time! • SJF • SRT • MFQ

  34. Scheduling Algorithims • Some examples of Scheduling Algorithims: • FCFS: First Come, First Served • RR • SJF • SRT • MFQ

  35. Parts to focus on: Write-up + Coding Take your computing coursework • You do what you’ve been asked to do – in the order you are given it! • Do a bit of everything – equal amounts of time spent on write-up and programming • Do the shortest bit first (as in do login screen, then move on to sorting algorithm – leave write-up for last, as its longest!) • Devise a system where you spend some time on the write-up but an alarm goes off if you spend too much time on it, and then move on to another job. Multi-level and complex Poor example perhaps – but can you match the types of Scheduling Algorithms to the examples provided above?

  36. So what is the purpose of Scheduling? • It is used in order to try and maximise the use of the computer and all its peripherals. It should do this while being “fair” to all the user and ensuring that there is a reasonable response time for all! • It should ensure, above all, that the algorithm is robust so that the system will not fail either through ovberloading or by becoming blocked!!

  37. So Scheduling prevents • (or should prevent) • OVERLOADING of system • BLOCKAGE of System

  38. Looking more closely at the processor and the ability of a computer to have a number of jobs in different stages of processing……. We need to know how a processor treats jobs…!

  39. How does a processor treat jobs!

  40. Any job can be one of three states: • Think of your coursework projects!!! Jose’s coursework project is READY!

  41. Any job can be one of three states: • Think of your coursework projects!!! Napoleons coursework is RUNNING (getting there)

  42. Any job can be one of three states: • Think of your coursework projects!!! Darwin’s coursework project is – incomplete. His brain is incapable of completing it! BLOCKED!

  43. Jobs can be in three states • READY • RUNNING • BLOCKED

  44. JOB ENTERS THE SYSTEM READY RUNNING BLOCKED JOB LEAVES THE SYSTEM

  45. Three cool things you need to know about • There is an important thing in the processor that controls jobs around the processor is is called the: • THE SCHEDULER!

  46. The Scheduler is made up of: • THE HIGH LEVEL SCHEDULER • THE LOW LEVEL SCHEDULER • And the Medium Level Scheduler…

  47. The SCHEDULER! • The part of the OS that controls jobs around the processor is called the SCHEDULER • There are a number of tasks that have to be done and they are carried out by different parts of the scheduler. • When a job wants to be processed it must enter the system and be placed in a queue of jobs waiting for processing called the READY QUEUE

  48. High Level Scheduler • This is the thing that loads the job into the Ready queue HLS = Loads job into Ready queue 

  49. Low level scheduler • When the job that is currently running has had to stop then the job at the top of the ready queue is loaded into the processor and is run. • THIS IS DONE BY THE LOW LEVEL SCHEDULER (LLS) • Jobs may leave the “running” state for one of three reasons

  50. Three states • Ready • Running • Blocked (can you think of three reasons that jobs might leave the running state?)

More Related