Chapter 5 Operating System

0 views
Skip to first unread message

Breogan Heflin

unread,
Aug 5, 2024, 6:40:16 AM8/5/24
to itrerepwai
Theoperating system is a set of special programs that run on a computer system that allows it to work properly. It performs basic tasks such as recognizing input from the keyboard, keeping track of files and directories on the disk, sending output to the display screen, and controlling peripheral devices.

Welcome to Operating Systems: Three Easy Pieces (now version 1.10 -- seebook news for details), a free online operating systemsbook! The book is centered around three conceptual pieces that arefundamental to operating systems: virtualization, concurrency, and persistence. In understanding the conceptual, you will also learn thepractical, including how an operating system does things like schedule theCPU, manage memory, and store files persistently. Lots of fun stuff! Ormaybe not so fun?


INSTRUCTORS: If you are using these free chapters, please just link tothem directly (instead of making a copy locally); we make little improvementsfrequently and thus would like to provide the latest to whomever is using it.Also: we have made our own class-preparation notes available to those of youteaching from this book; please drop us a line at ostep...@gmail.com if youare interested.


PROJECTS: While the book should provide a good conceptual guide to keyaspects of modern operating systems, no education is complete withoutprojects. We are in the process of making the projects we use at theUniversity of Wisconsin-Madison widely available; an initial link to projectdescriptions is available here:PROJECTS. Comingsoon: the automated testing framework that we use to grade projects.


OTHER SYSTEMS BOOKS: Interested in other systems books? Good!Of course, we assume some background in The C Programming Language, so that's a good investment. And Advanced Programming in the UNIX Environment is a must for any shelf. On top of that, here are some OS books that could be worth your time:Operating Systems: Principles and Practice-Operating System Concepts-Operating Systems: Internals and Design Principles (8th Edition)-Modern Operating Systems (4th Edition)-Linux Kernel Development (3rd Edition)-Understanding the Linux Kernel-The Design and Implementation of the FreeBSD Operating System-Solaris Internals: Solaris 10 and OpenSolaris Kernel Architecture-Mac OS X Internals: A Systems Approach-The Design of the UNIX Operating System-UNIX: The Textbook-The Linux Programming Interface: A Linux and UNIX System Programming Handbook.


OTHER BOOKS: So you're looking down here? Well, how about reading something other than tech books all day long? Honestly, you need to be more balanced. Here are some awesome books you should most definitely read. Fiction:Cloud Atlas: A Novel-Life of Pi-A Prayer for Owen Meany: A Novel-All the Light We Cannot See-The Book Thief-The Fault in Our Stars-Tenth of December: Stories-If I Don't Six-A Game of Thrones-To Kill a Mockingbird-The Kite Runner-Ender's Game-Foundation-Slaughterhouse-Five-The Shadow of the Wind-Flowers for Algernon-Holes-Atonement-The Name of the Wind-Beloved-For Whom the Bell Tolls-Different Seasons-Neuromancer-Snow Crash-Cryptonomicon-Shantaram-A Room with a View-Jude the Obscure-Illusions: The Adventures of a Reluctant Messiah-A Canticle for Leibowitz-A Wizard of Earthsea-Black Swan Green-The Stars My Destination-Ancillary Justice-My Brilliant Friend-Crossing to Safety-Possession-The Selected Works of T.S. Spivet-Essential Ellison-The Demolished Man- The Nightingale- The Overstory- The Windup Girl- The Water KnifeNon-fiction:Seabiscuit: An American Legend-Unbroken-Surely You're Joking, Mr. Feynman!-On Intelligence-The Language Instinct-Flow-Guns, Germs, and Steel-The Selfish Gene-A Heartbreaking Work of Staggering Genius-Lies My Teacher Told Me-Freakonomics-How the Irish Saved Civilization-Cod-The Devil in the White City-The Swerve: How the World Became Modern-The Drunkard's Walk-The Visual Display of Quantitative Information-Eats, Shoots & Leaves-The Elements of Style-The Design of Everyday Things-Mountains Beyond Mountains-The Soul of A New Machine-Alan Turing: The Enigma-Consider the Lobster-The Vintage Guide to Classical Music


ACKS: The authors wish to acknowledge all the sources offunding for their research over the years. In particular, the authorsappreciate the strong support from the National Science Foundation (NSF), which is an essential part of themodern research and educational infrastructure of the USA.


Writing these posts is a past-time right now as my full time job is educating (mostly) undergraduate college students. I will alwaysdeliver content, but I could really use your help. If you're willing, please support me at Patreon (sgmarz)


RISC-V ("risk five") and the Rust programming language both start with an R, so naturally they fit together. In this blog, we will write an operating systemtargeting the RISC-V architecture in Rust (mostly). If you have a sane development environment for RISC-V, you can skip the setupparts right to bootloading. Otherwise, it'll be fairly difficult to get started.


This tutorial will progressively build an operating system from start to something that you can showyour friends or parents -- if they're significantly young enough. Since I'm rather new at this I decidedto make it a "feature" that each blog post will mature as time goes on. More details will be added andsome will be clarified. I look forward to hearing from you!


I changed the github to use tags to mark each chapter. Unfortunately, this was very late into the game. Chapters 1 through 9 are in a directory called chapters. Chapters 10 and 11 are tags in the github repo. Perhaps one day I'll make all chapters a tag.


When finished, you will have an operating system using the RISC-V architecture that schedulesuser-space programs from a filesystem, including shell, ls (list files), cd (change directory),and so forth.


The document provides an overview of operating system concepts, including:- The four main components of a computer system: hardware, operating system, applications, and users. - What operating systems do, such as managing resources and controlling programs.- Computer system organization involving CPUs, memory, I/O devices, and interrupts. - Operating system structures like processes, memory management, and storage management.Read less


Processes constitute a thread of control in an address space. Mechanisms for creating, terminating, and otherwise controlling processes are described in Chapter 4. The system multiplexes separate virtual-address spaces for each process; this memory management is discussed in Chapter 5.


The user interface to the filesystem and devices is similar; common aspects are discussed in Chapter 6. The filesystem is a set of named files, organized in a tree-structured hierarchy of directories, and of operations to manipulate them, as presented in Chapter 7. Files reside on physical media such as disks. 4.4BSD supports several organizations of data on the disk, as set forth in Chapter 8. Access to files on remote machines is the subject of Chapter 9. Terminals are used to access the system; their operation is the subject of Chapter 10.


Communication mechanisms provided by traditional UNIX systems include simplex reliable byte streams between related processes (see pipes, Section 11.1), and notification of exceptional events (see signals, Section 4.7). 4.4BSD also has a general interprocess-communication facility. This facility, described in Chapter 11, uses access mechanisms distinct from those of the filesystem, but, once a connection is set up, a process can access it as though it were a pipe. There is a general networking framework, discussed in Chapter 12, that is normally used as a layer underlying the IPC facility. Chapter 13 describes a particular networking implementation in detail.


Sections 2.3 through 2.14 present introductory material related to Chapters 3 through 14.We shall define terms, mention basic system calls, and explore historical developments.Finally, we shall give the reasons for many major design decisions.


The kernel is the part of the system that runs in protected mode and mediates access by all user programs to the underlying hardware (e.g., CPU, disks, terminals, network links) and software constructs (e.g., filesystem, network protocols).The kernel provides the basic system facilities; it creates and manages processes, and provides functions to access the filesystem and communication facilities.These functions, called system calls appear to user processes as library subroutines.These system calls are the only interface that processes have to these facilities.Details of the system-call mechanism are given in Chapter 3, as are descriptions of several kernel mechanisms that do not execute as the direct result of a process doing a system call.


The 4.4BSD kernel is not partitioned into multiple processes.This basic design decision was made in the earliest versions of UNIX.The first two implementations by Ken Thompson had no memory mapping, and thus made no hardware-enforced distinction between user and kernel space [Ritchie, 1988].A message-passing system could have been implemented as readily as the actually implemented model of kernel and user processes.The monolithic kernel was chosen for simplicity and performance.And the early kernels were small; the inclusion of facilities such as networking into the kernel has increased its size.The current trend in operating-systems research is to reduce the kernel size by placing such services in user space.


Users ordinarily interact with the system through a command-language interpreter, called a shell, and perhaps through additional user application programs.Such programs and the shell are implemented with processes.Details of such programs are beyond the scope of this book, which instead concentrates almost exclusively on the kernel.


The machine-dependent aspects of the kernel are isolated from the mainstream code.In particular, none of the machine-independent code contains conditional code for specific architecture.When an architecture-dependent action is needed, the machine-independent code calls an architecture-dependent function that is located in the machine-dependent code.The software that is machine dependent includes

3a8082e126
Reply all
Reply to author
Forward
0 new messages