Operating Systems Courseworks 2023-2024
Course Number: INFR100792023 Semester Number: 2 Score Out of 100: 50%
Authors: ,
Edinburgh, March 19, 2024
Copyright By PowCoder代写 加微信 powcoder
1 Introduction 1
1.1 AimsoftheCoursework ………………………………. 1
1.2 Timeline………………………………………. 1
1.3 RequiredBackground ……………………………….. 1
1.4 GuidelinesandRules………………………………… 2
1.4.1 LateCoursework&ExtensionRequests …………………… 2
1.4.2 DeclarationofOwnWork ………………………….. 2
1.4.3 GuidetothePrincipledCode………………………… 3
1.5 TechnologyStack………………………………….. 4
1.5.1 Linux ……………………………………. 5
1.5.2 QEMU …………………………………… 5
1.5.3 GDB…………………………………….. 5
2 Environment Setup 6
2.1 Introduction…………………………………….. 6
2.2 UsingDICEServers ………………………………… 6
2.2.1 LabMachinesinAppletonTower………………………. 6
2.2.2 RemoteDesktopAccess …………………………… 6
2.2.3 DICEFileSystem ……………………………… 7
2.3 GettingReadyYourWorkspace…………………………… 7
2.4 RunningYourVM …………………………………. 8
2.5 ConfiguringandCompilingtheLinuxKernel ……………………. 9
2.5.1 DownloadingLinuxKernel …………………………. 9
2.5.2 CreatingtheDefaultConfigurationFile …………………… 9
2.5.3 AdjustingConfigurationforaKVMGuest………………….. 9
2.5.4 DisablingUnrelatedDeviceDrivers……………………… 9
2.5.5 CompilingtheKernel ……………………………. 9
2.5.6 OutputofCompilation……………………………. 9
2.6 UsingQEMUMonitor ……………………………….. 10
2.7 DebuggingtheLinuxKernel…………………………….. 10 2.7.1 BuildingKernel……………………………….. 11
2.8 RunningtheVMwithQEMUforDebugging ……………………. 11
2.9 SettingBreakpointsandDebuggingwithGDB …………………… 11
2.10StoppingYourVM:…………………………………. 11
3 Coursework 0 12
3.1 GoaloftheCoursework ………………………………. 12
3.2 Background…………………………………….. 12
3.3 Tasks………………………………………… 13
3.3.1 Task1:ShowingBootMessage ……………………….. 13
3.3.2 Task2:WritingandLoadingaKernelModule ……………….. 13
3.4 Skeleton………………………………………. 14
4 Coursework 1: Scheduling Policies 15
4.1 Introduction…………………………………….. 15
4.2 Overview ……………………………………… 15 4.2.1 Scoring …………………………………… 15
4.3 Instructions…………………………………….. 15 4.3.1 BaseKernel…………………………………. 15 4.3.2 Submission …………………………………. 15 4.3.3 UntamperableSegments…………………………… 16
4.4 Specification…………………………………….. 16 4.4.1 BaseKernel…………………………………. 16 4.4.2 Task1:AgingScheduler…………………………… 17 4.4.3 Task2:VruntimeTransferPolicyPair……………………. 17
4.5 TestingandConfiguringfromUserSpace ……………………… 19
Operating Systems Coursework
4.5.1 DebugFS ………………………………….. 19 4.5.2 SystemCalls ………………………………… 20 4.5.3 Tracing …………………………………… 20
4.6 HintsandExamples ………………………………… 20 4.6.1 Spinlocks ………………………………….. 20 4.6.2 UsefulLinuxAPIsandMacros ……………………….. 21 4.6.3 CFSStatistics,Load,andWeights ……………………… 21
4.7 EssentialReading………………………………….. 21
5 Coursework 2: Memory Subsystem 22
5.1 Introduction…………………………………….. 22
5.2 Scoring ………………………………………. 22
5.3 Specification…………………………………….. 22
5.3.1 BaseKernel…………………………………. 22 5.3.2 Task1:SharedMemory …………………………… 22 5.3.3 Task2:MemoryAnalyzer………………………….. 23
5.4 Skeleton………………………………………. 24
6 Coursework 3: Manipulating Filesystem Functionalities 25
6.1 Introduction…………………………………….. 25
6.2 Scoring ………………………………………. 25
6.3 Instructions…………………………………….. 25
6.3.1 RelevantFiles………………………………… 25
6.3.2 Submission …………………………………. 25
6.4 Specification…………………………………….. 26 6.4.1 FilesystemExtendedAttributes……………………….. 26 6.4.2 Task1:ReadCensor…………………………….. 26 6.4.3 Task2:FilterlsOutput ………………………….. 26 6.4.4 SystemCallReturnValueandErrorHandling ……………….. 27
6.5 EssentialReading………………………………….. 27
1 | Introduction
Welcome to INFR100792023 – Operating Systems in the Spring semester of the academic year 2023-24. In this course, you shall dive head-first into the exciting and complex world of operating systems, gaining both a strong theoretical foundation and hands-on expertise. This document contains information about the coursework assignments which account for half of your total grade in this course. There are four assignments – Coursework 0, 1, 2, and 3.
This Chapter shall outline the aims, expectations, guidelines, and rules we (the course faculty) expect you (the students taking this course) to abide by, along with the necessary background and skills we expect you to possess beforehand or develop as the course progresses. Chapter 2 will describe the environment setup on which you shall do the coursework. Chapters 3, 4, 5, and 6 pertain to Coursework 0, 1, 2, and 3
respectively.
1.1 | Aims of the Coursework
The goal of the coursework is to complement the theoretical side of the course (which will be covered in lectures and evaluated in the final exam) with a practical side. The lectures will imbibe you with an abstracted-out view of how an operating system (OS) is structured, and how its various parts interplay with each other. While doing the coursework, however, you shall perceive how this conceptual design is fleshed out into a real implementation. Your understanding of an Operating System will be complete as you will be able to map the implementation to the concepts, and vice-versa.
As an Operating Systems developer, you must be able to navigate through large code bases with many connected and interacting components. The OS is the most privileged software on any computer system, and it directly manages and controls access to the physical resources on a system, such as memory, processor cores, and storage. When you try to implement a seemingly small modification to an existing OS, you must first understand how the relevant parts interact, because a misunderstanding may result in a kernel that does not boot or crashes unexpectedly. A buggy OS can be catastrophic if deployed in a real-world use-case.
On the other hand, the OS is a very extensive and complex piece of software. The Linux kernel, which you shall use for your coursework, has over 28 million lines of code spread out over 169 thousand files. Comprehending the purpose of every line in the entire source code is a futile effort, and ultimately unnecessary if you just want to modify some part of this kernel. Thus, you must be able to judge what to explore and what to ignore, what is relevant to your task and what is secondary, what must be perceived comprehensively and what can be safely set aside as an abstraction. This is a very subtle yet critical skill that differentiates an amateur programmer from a seasoned veteran of systems programming. Doing the coursework with due diligence shall nudge you to the latter class.
1.2 | Timeline
The below table outlines the schedule for each coursework. Coursework 0, focusing on preparation, is not marked, but its completion is strongly recommended. Please note that regulations for late submissions can be found in Section 1.4.1, and all assignments have a deadline of 12 PM.
Assignment
CW0 CW1 CW2 CW3
Score Effort
0% N/A 17% 16 Hours 17% 16 Hours 16% 16 Hours
Release Date
30/01/2024
13/02/2024
05/03/2024
19/03/2024
13/02/2024
05/03/2024
19/03/2024
02/04/2024
Feedback By
N/A 19/03/2024 02/04/2024 16/04/2024
Table 1.1: Coursework Schedule
Operating Systems Coursework
1.3 | Required Background
The coursework for this Operating Systems class demands a strong foundation in the C programming language. As we delve into the intricacies of the Linux kernel, which is predominantly written in C, a high level of fluency in this language is essential. While it is not a prerequisite to have prior experience with
the Linux Operating System itself, even as a user, the key requirement is a robust capability in expressing complex programming concepts in C.
To support your learning curve, we will provide some basic tutoring in C programming. However, it’s important to recognize that this assistance will have its boundaries in terms of how comprehensively a language can be taught within the constraints of the course. The nature of the coursework is such that it will inherently enhance your proficiency in C. This practical approach to learning through direct engagement with the Linux source code is designed to solidify your understanding and skills.
However, if you are at the very beginning of your journey with the C language, particularly if concepts such as pointers are challenging for you, and if you doubt your ability to rapidly acquire a deep understanding of these concepts, it is crucial to carefully consider your participation in this course. This course is intensive and assumes a certain level of pre-existing knowledge and comfort with C. For those who are not confident in their current level of proficiency in C, especially in handling advanced programming constructs, it might be advisable to seek additional preparation before embarking on this course.
This course is not just about learning how to use the Linux kernel; it is about understanding and modifying its very foundation. This requires not only a theoretical understanding of programming concepts but also the practical ability to apply these concepts in a complex, real-world environment. If you are ready for this challenge and confident in your C programming skills, we welcome you to a journey of deep learning and practical application in the world of operating systems.
1.4 | Guidelines and Rules
This course operates under three key guidelines and rules: ”Late coursework & extension requests,” ”Declaration of Own Work,” and ”Guide to the Principled Code.” Adherence to these guidelines is critical for the successful completion of the course. Late submissions and extension requests are governed by specific rules, academic integrity is paramount in all submissions, and the ability to produce compilable and runnable code is essential. Each of these aspects will be detailed in their respective subsections, outlining the expectations and standards required for your coursework.
1.4.1 | Late Coursework & Extension Requests
This course enforces specific policies for late submissions and extension requests. Assignments should be submitted by the set deadline. However, understanding that unforeseen circumstances can arise, each coursework has defined late submission rules. These rules, outlining the possibilities for late submissions, incurred penalties, maximum extension lengths, and other relevant information, are available on the Course LEARN Page.
In instances impacting your ability to complete coursework on time where late submissions are permitted, you may request an extension through the online Assessment Support Tool. These requests are reviewed by the University Extensions and Special Circumstances Service (ESC) team. Due to the time taken for decision-making, it’s advisable to request extensions as early as possible.
Students registered with the Disability & Learning Support Service with entitlements for extra time on coursework should apply these adjustments for late submissions. For circumstances preventing timely submission, you may need to apply for Special Circumstances.
The School of Informatics follows a Late Submission Rules and Penalties Policy in line with the University Taught Assessment Regulations. For example, Rule 1 allows for a 3-day extension and a 7-day Extra Time Adjustment (ETA), both combinable. Late submissions without an approved extension incur a 5% penalty per calendar day for up to 7 days post-deadline, after which a zero score is assigned.
Marks are typically returned within 28 calendar days of the submission deadline. For detailed information on late submission rules, penalties, and scenarios involving extensions and ETAs, visit https://web.inf.ed. ac.uk/node/4533.
1.4.2 | Declaration of Own Work
By submitting assignments in this course, you affirm that your work complies with the University’s code of conduct and the Student Conduct and Assessment regulations. This declaration confirms that, except where indicated, all submitted work is your own and that you have:
Operating Systems Coursework
■ Read and understood the University’s regulations concerning academic misconduct.
■ Where relevant to the assessment style:
□ Clearly referenced/listed all sources.
□ Correctly referenced and marked all quoted text (from books, web, etc.) with quotation marks. □ Cited the sources of all images, data, etc., not created by you.
■ Not communicated about the work with other students, either electronically, verbally, or through any other means, nor allowed your work to be seen by other students.
■ Not used any assessment material from other students, past or present.
■ Not submitted work previously presented for this or any other course, degree, or qualification.
■ Not incorporated work from or sought assistance from external professional agencies, except for attributed source extracts where appropriate.
■ Complied with all examination requirements as outlined in the examination paper and course/pro- gramme handbooks.
■ Understood that the University of Edinburgh and TurnitinUK may electronically copy your submitted work for assessment, similarity reporting, and archival purposes.
■ Understood that it is a violation of the Code of Student Conduct to:
□ Use or assist in using unfair means in any University examination.
□ Engage in any action that disrupts the integrity of the examination process. □ Impersonate another student or allow another student to impersonate you.
■ Understood that cheating is a grave offence. Any student found to have cheated or attempted to cheat in an examination may face severe penalties, including failing the examination or the entire examination diet, or any other penalty deemed appropriate by the University.
For further guidance on plagiarism, you are encouraged to:
■ Consult your course organiser or supervisor for personalized advice and clarification.
■ Visit the University of Edinburgh’s Institute for Academic Development website for resources on referencing and citations: Referencing and Citations Resources.
■ Refer to the University’s guidelines on academic misconduct to understand what constitutes plagia- rism and how to avoid it: Academic Misconduct Guidelines.
1.4.3 | Guide to the Principled Code
In this course, the emphasis on producing principled and functional code is critical. Adherence to the
following guidelines is essential for a successful evaluation of your coursework:
■ Compilability: The primary requirement is that your code must compile without errors. Submis- sions that fail to compile will automatically receive a zero score. It is your responsibility to ensure that your code is free of compilation errors before submission.
■ Adherence to Skeleton: Each assignment comes with a provided code skeleton which you are required to follow. Non-compliance with the provided skeleton will lead to an automatic score of zero. This policy is strict, and no objections to the score will be entertained on grounds of non-adherence.
■ Code Readability: Your code must be neat, clean, and well-organized. Proper formatting, consistent naming conventions, and logical structuring are expected. Readability is key to both effective coding practices and ease of assessment.
■ Commenting: Ambiguous or complex sections of code should be accompanied by clear comments. These comments should explain the rationale behind the chosen approach or clarify complex parts of the code. The goal is to make your code as understandable as possible.
Operating Systems Coursework
■ Functional Completeness: Beyond just compiling, your code should correctly implement the required functionalities as outlined in the assignment brief. Functional completeness will be a significant factor in the assessment.
Adhering to these principles is not only crucial for your success in this course but also forms the foundation of good software development practices.
1.5 | Technology Stack
The diagram presented in Figure 1.1 illustrates a high-level design of a computer system. It encapsulates the multi-layered architecture that defines the interaction between user applications and the physical hardware of a computer. At the foundation, there is the hardware layer, composed of the essential physical components such as the CPU, memory, and storage devices. Building upon this, the operating system layer takes precedence, providing essential services such as process management, memory allocation, and I/O operations. Further abstracted, the standard library offers a set of predefined functions for performing fundamental tasks, like file handling and process control, which are utilized by the utilities layer to furnish tools and applications for end-user interaction.
Figure 1.1: Computer System Diagram
In the context of a virtualized system, the depicted model extends by incorporating additional layers to represent the virtualization aspect (see Figure 1.2). Atop the hardware layer resides the host operating system, which is responsible for the direct management of the hardware resources. The virtualization layer, typically provided by software like QEMU, allows for the creation and management of virtual machines (VMs). Each VM encapsulates a complete set of the layers described above, including its own guest operating system that operates oblivious to the virtualized nature of the underlying hardware. This encapsulation allows multiple isolated operating system instances to coexist on a single physical machine, optimizing resource utilization and providing robust environment isolation.
Operating Systems Coursework
User Interface
Library Interface
System Call Interface
(shell, editors, filters, etc.)
Standard Library
(open, close, read, write, fork, etc.)
Operating System
(process, memory, filesystem, I/O, etc.)
(CPU, memory, disks, networks, etc.)
Kernel Mode
Operating Systems Coursework
GDB Utility
Standard Library
(open, close, read, write, fork, etc.)
Hypervisor
(QEMU/KVM, XEN, etc.)
(process, memory, filesystem, I/O, etc.)
VNC Utility
Standard Library
(open, close, read, write, fork, etc.)
(CPU, memory, disks, Networks, etc.)
Figure 1.2: Virtualized System Diagram
The coursework in this course involves the use of a technology stack consisting of three essential components: Linux, QEMU, and GDB. Detailed familiarity with these tools is crucial for developing and testing your code effectively.
1.5.1 | Linux
For your coursework, you will be working with the Linux kernel version 6.1,
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com