Week 25
CST-334 Week 1
This week we started a new class, CST-334: Operating Systems.
This class discusses the ideas behind operating systems, why we use them, what they are for, and how they work.
Operating Systems: Three Easy Pieces
In CST-334 we will be reading Operating Systems: Three Easy Pieces, which is available for free on the book's website.
Chapter 2: Introduction to Operating Systems
This week we read chapter two of Operating Systems: Three Easy Pieces. This chapter discussed the basics of virtualization, concurrency, and persistence.
Virtualization is the way in which operating systems share physical resources with processes. This includes giving each process its own virtual CPU, and its own portion of memory.
Concurrency relates to the problems operating systems face when running multiple processes at the same time. How do operating systems allow multiple processes to run in a way that prevents errors or conflicts?
Persistence relates to storing data in a more permanent way. RAM is volatile, it looses its data after being powered down. How do operating systems allow for the storage of data on more persistent hardware, such as hard drives?
The C Language
In CST-334 we will be mainly working with C. C is well known for being fast and having direct access to memory. Operating systems require both of these to function optimally. Because of this, C is the primary language used for operating systems.
Some important things to note about C:
- C is quick because it does not automatically perform many things like other programming languages, such as tracking the size of arrays or their positions in memory. This makes C prone to errors that other programming languages are not.
- C is not object-oriented. While one can create structs within C, which resemble objects, structs do not come with associated functions.
- C is pass-by-value, to modify a variable one needs the memory address where it is located.
- Related to the above bullet point, a common type of variable in C are pointers. Pointers, well, point to a specific location in memory. It is common to pass pointers between functions, allowing for the modifying of a variable across multiple locations in a program.
- C does not have a built in boolean type. Instead 0 is used to represent 0, and any other integer represents 1.
Comments
Post a Comment