Introduction Course Outline Why Does This Fail? Lectures Tutorials
Total Page:16
File Type:pdf, Size:1020Kb
Course Outline • Prerequisites – COMP2011 Data Organisation • Stacks, queues, hash tables, lists, trees, heaps,…. Introduction – COMP2021 Digital Systems Structure • Assembly programming • Mapping of high-level procedural language to assembly COMP3231/9201/3891/9283 language – or the postgraduate equivalent (Extended) Operating Systems – You are expected to be competent Kevin Elphinstone programmers!!!! • We will be using the C programming language – The dominant language for OS implementation. – Need to understand pointers, pointer arithmetic, explicit 2 memory allocation. Why does this fail? Lectures • Common for all courses (3231/3891/9201/9283) void func(int *x, int *y) • Wednesday, 2-4pm { • Thursday, 5-6pm *x = 1; *y = 2; – All lectures are here (EE LG03) – The lecture notes will be available on the course web site } • Available prior to lectures, when possible. void main() – The lecture notes and textbook are NOT a substitute for { attending lectures. int *a, *b; func(a,b); } 3 4 Tutorials Assignments • Assignments form a substantial component of • Start in week 2 your assessment. • A tutorial participation mark will • They are challenging!!!! – Because operating systems are challenging contribute to your final assessment. • We will be using OS/161, – Participation means participation, NOT – an educational operating system attendance. – developed by the Systems Group At Harvard – Comp9201/3891/9283 students excluded – It contains roughly 20,000 lines of code and comments • You will only get participation marks in your enrolled tutorial. 5 6 1 Assignments Assignments • Assignments are in pairs • Don’t under estimate the time needed to do the – Info on how to pair up available soon assignments. • We usually offer advanced versions of the – ProfQuotes: [About the midterm] "We can't keep you working assignments on it all night, it's not OS.“ Ragde, CS341 – Available bonus marks are small compared to amount of • If you start a couple days before they are due, you will be late. effort required. • To encourage you to start early, – Student should do it for the challenge, not the marks. – Bonus 10% of max mark of the assignment for finishing a – Attempting the advanced component is not a valid excuse week early for failure to complete the normal component of the – To iron out any potential problems with the spec, 5% bonus assignment for finishing within 48 hours of assignment release. • Extended OS students (COMP3891/9283) are – See course handout for exact details • Read the fine print!!!! expected to attempt the advanced assignments 7 8 Assignments Assignments • Four assignments • Late penalty – due roughly week 3, 6, 9,13 – 4% of total assignment value per day • The first one is trivial • Assignment is worth 20% • You get 18, and are 2 days late – It’s a warm up to have you familiarize • Final mark = 18 – (20*0.04*2) = 16 (16.4) yourself with the environment and easy marks. • Assignments are only accepted up to – Do not use it as a gauge for judging the one week late. 8+ days = 0 difficulty of the following assignments. 9 10 Assignments Plagiarism • To help you with the assignments • We take cheating seriously!!! – We dedicate a tutorial per-assignment to • Penalties include discuss issues related to the assignment – Copying of code: 0 FL – Prepare for them!!!!! – Help with coding: negative half the assignment’s max marks – Originator of a plagiarised solution: 0 for the particular assignment – Team work outside group: 0 for the particular assignments 11 12 2 Cheating Statistics Exams Session 1998/S1 1999/S1 2000/S1 2001/S1 2001/S2 2002/S1 2002/S2 2003/S1 2003/S2 enrolment 178 410 320 300 107 298 156 333 133 • There is NO mid-session suspected cheaters 10(6%) 26(6%) 22(7%) 26(9%) 20(19%) 15(5%) ???(?%) 13 (4%) ???(?%) • The final written exam is 2 hours full penalties * * * * 2 6 9 14 109521 reduced penalties 7157754229 • Supplementary exams are oral. cheaters failed 4 101616101254 ? cheaters – Supplementaries are available according to suspended 001 001 000 school policy, not as a second chance. *Note: Full penalty 0 FL not applied prior to 2001/S1 13 14 Assessment 3891/9201/9283 • Exam Mark • Class Mark • No tutorial participation component Component Component • Assignment marks scaled to 100 – Max mark of 100 – Max mark of 100 • Based solely on the • 10% tutorial final exam participation • 90% Assignments 15 16 Undergrad Assessment Postgrads (9201/9283) • Maximum of a 50/50 weighted harmonic • The final assessment is the harmonic mean and a 20/80 harmonic mean mean of the exam and class – Can weight final mark heavily on exam if you can’t commit the time to the assignments component. – You are rewarded for seriously attempting the • If E >= 40, assignments 2EC • if E >= 40, 2EC 5EC M = M = max E+C, E+4C E + C ³ ´ 17 18 3 Harmonic Mean (Class Mark = 100 - Exam Mark) Assessment 100 90 • If E < 40 80 70 60 Harm 50/50 Arith 50/50 50 Arith 20/80 2EC Final Mark 40 Harm 20/80 M = min44, 30 20 E + C 10 0 0 102030405060708090100 Exam Mark 19 20 Final Mark = 50 100 Assessment 90 80 • You need to perform reasonably 70 consistently in both exam and class 60 Harm 50/50 components. 50 Harm 20/80 40 • Harmonic mean only has significant 30 effect with significant variation. 20 Exam Mark Required to Pass to Exam Required Mark • Reserve the right to scale, and scale 10 0 courses individually if required. 0 102030405060708090100 – Warning: We have not scaled in the past. Class Mark 21 25 Textbook References • Andrew • A. Silberschatz and P.B. Galvin, Operating System Concepts, 6th ed., Addison Wesley (2001) Tanenbaum, • William Stallings, Operating Systems: Internals and Design Modern Operating Principles, 4th edition, 2001, Prentice Hall. nd • A. Tannenbaum, A. Woodhull, Operating Systems--Design and Systems, 2 Implementation, Prentice Hall, ??? Edition, Prentice • John O'Gorman, Operating Systems, MacMillan, 2000 Hall • Uresh Vahalla, UNIX Internals: The New Frontiers, Prentice Hall, 1996 • McKusick et al., The Design and Implementation of the 4.4 BSD Operating System, Addison Wesley, 1996 26 27 4 Consultations/Questions Course Outline • Questions should be directed to the forum. • Processes and threads • Admin related queries to Charles Gray [email protected] • Concurrency control • Personal queries can be directed to me [email protected] • Memory Management • We reserve the right to ignore email sent directly to • File Systems us (including tutors) if it should have been directed to the forum. • I/O and Devices • Consultation Times • Security – TBA • Scheduling 28 29 What is an Operating System? Introduction to Operating Systems Chapter 1 – 1.3 31 Viewing the Operating System as an Abstract Machine • Extends the basic hardware with added functionality • Provides high-level abstractions – More programmer friendly – Common core for all applications • It hides the details of the hardware – Makes application code portable 32 33 5 Disk Users Viewing the Operating System as a Resource Manager Memory • Responsible for allocating resources to users and processes • Must ensure CPU – No Starvation – Progress Network – Allocation is according to some desired policy Bandwidth • First-come, first-served; Fair share; Weighted fair share; limits (quotas), etc… – Overall, that the system is efficiently used 34 35 Dated View: the Operating The Operating System is System as the Privileged Privileged Privileged Mode Component • Applications should not be able to interfere or bypass the operating system Operating System – OS can enforce the “extended machine” – OS can enforce its resource allocation policies – Prevent applications from interfering with each other Requests Applications • Note: Some Embedded OSs have no privileged (System Calls) component, e.g. PalmOS User Mode – Can implement OS functionality, but cannot enforce it. Applications Applications • Note: Some operating systems implement significant OS functionality in user-mode, e.g. User-mode Linux 36 37 Why Study Operating (A brief) Operating System History Systems? • Largely parallels hardware • There are many interesting problems in development operating systems. • First Generation machines • For a complete, top-to-bottom view of a – Vacuum tubes system. – Plug boards • Programming via wiring • Understand performance implications of • Users were simultaneously application behaviour. designers, engineers, and programmers • Understanding and programming large, • “single user” complex, software systems is a good skill to • difficult to debug (hardware) acquire. – No Operating System 38 39 6 Second Generation Machines Batch System Batch Systems Operating Systems • IBM 7094 • Sometimes called “resident job monitor” – 0.35 MIPS, 32K x 36-bit memory • Managed the Hardware – 3.5 million dollars • Simple Job Control Language (JCL) • Batching used to more efficiently use the – Load compiler hardware – Compile job – Share machine amongst many users – Run job – One at a time – End job – Debugging a pain • Drink coffee until jobs • No resource allocation issues finished 40 – “one user” 41 Problem: Keeping Batch Third Generation Systems - Systems Busy Multiprogramming • Divided memory among several • Reading tapes or punch cards was time Memory consuming loaded jobs • Expensive CPU was idle waiting for input • While one job is loading, CPU works on another Job 1 • With enough jobs, CPU 100% busy Job 2 • Needs special hardware to isolate memory partitions from each other Job 3 – This hardware was notably absent on early 2nd gen. batch systems OS 42 43 Multiprogramming Example Job turn-around