Monday, October 19, 2020

Operating Systems Theory and Design

 Section 1:

The main purpose of an Operating System is to allow application programs access to the systems hardware resources. This access is done through the Operating system by providing resource utilization and allocation, the Operating System is constantly waiting on an event in the form of an interrupt which can be sent from both hardware and software. When software triggers an interrupt it is done in the form of a system call.

Operating Systems can come in many variations and may or may not have a user interface depending on what the system is designed to accomplish. For example, you might have a vehicle that could have several different computer systems with each built to handle specific functions. One might just handle operations for the engine controlling the air and fuel intake and adjust the timing depending on certain variables that are constantly being monitored; in this case there most likely would not be any user interface for the operating system controlling the hardware for this system. But then you have your traditional PC that has more standard and well-known Operating Systems allowing the user access to much of the hardware available within the system such as file storage, CPU, and GPU controls such as overclocking and controlling the power limits, etc. All Operating Systems manage the hardware of that specific system which consists of the CPU, Memory (RAM, ROM, EEPROM), Storage as well as any other I/O that could vary significantly depending on the underlying system.




Section 2:

A process is a program that is currently running/executing, and within the process, there can be single or multiple threads within the process, programs might also have multiple processes associated with them.

The process state is defined by the current activity of a process, the different Process States are;

  • New: The process is being created
  • Running: Instructions are being executed
  • Waiting: The process is waiting for some event to occur
  • Ready: The process is waiting to be assigned to a processor
  • Terminated: The process has finished execution

 Processes are represented within the Operating System by the Process Control Block or PCB. The PCB contains a wide range of data for each process such as process id, process state, program counter, registers, memory limits, CPU scheduling, etc.

A traditional process utilizes a single thread allowing the ability to perform a single task, however, if a process has multiple threads it can then perform multiple tasks at the same time

The critical-section problem deals with different processes trying to access or use a specific resource at the same time. For example, if you have two different processes and they are both trying to access the same .txt file in order to write to it at the same time, the critical-section, in this case, would be the text trying to be written to the file. 

Peterson’s Solution preserves all three conditions :

  • Mutual Exclusion is assured as only one process can access the critical section at any time.
  • Progress is also assured, as a process outside the critical section does not block other processes from entering the critical section.
  • Bounded Waiting is preserved as every process gets a fair chance.

Section 3:

The main objective within memory management of any system to create the most efficient and productive use of the CPU, there are different methods used within memory management in an OS to help accomplish this task including swapping, paging, use of virtual memory, etc. Swapping for example takes the process currently stored within the main memory / RAM and will swap it out with a process currently stored in secondary storage / HDD in order to allow execution of the second process. Virtual memory in contrast will be used to allow programs that require more space than is physically allowed within the main memory by creating this virtual space within the secondary memory.

Within a computer system anytime a program is called and executed becoming a process running on the CPU an address will be bound to this process, for both the compile-time and load-time methods of address-binding an identical address is created for both the logical (virtual) and physical address. In contrast within the execution-time method of address-binding, a different logical and physical address is created. The process of mapping a logical / virtual address to a physical address if performed by the memory-management unit or MMU.


Section 4:

File systems management is responsible for managing all of the secondary storage within a computer system which includes all present physical disks. These can range from several different types of devices and physical interfaces such as SCSI, IDE, and SATA. These physical disks are each represented as physical partitions within the computer system and can also be broken up into multiple logical partitions allowing the operating system to view them as separate partitions as well. Within each of the partitions whether they be physical or logical there are file directories that contain all the files within that partition. Some of the operations that can be done on a directory can be seen below;

  • Search for a file
  • Create a new file
  • Delete a file
  • List a directory
  • Rename a file
  • Browse the file system


    Within file-system management, there are also different types of directories including;

Single-Level Directory – All of the files are contained within the same directory and each file must have a unique name.

Two-Level Directory – A directory is created for each user.

Tree-Structural Directories – The user is allowed to create their own sub-directories and organize them as they see fit, where the path is the route from the root down through all the sub-directories to specific files.

General Graph Directory – When links are added to a tree-structured directory it is destroyed and results in a general graph directory.

Acyclic-Graph Directories – This can be useful when the same files need to be accessed or shared by more than one user or process.


Section 5:

With Domain-based Protection the use of a domain which is a collection of access rights on objects within the Operating System between both Hardware objects and Software objects. Using an access matrix, you can see in the below example of how domain-based protection would allow access to individual objects and what particular access is allowed for each object within the different domains which can consist of users, processes, or procedures within the system.



Language-based Protection is a specification of protection within a programming language allowing a high-level description of policies for both the allocation and use of the resources, this implementation can provide software protection, when hardware supported checking, may otherwise be unavailable. Within Java for example this protection is handled within the Java Virtual Machine (JVM) where a class is assigned a protection domain when loaded by the JVM. This protection domain then handles what operation the class can and cannot perform.

Security in contrast to protection is used to specifically deal with external threats to a system by using things such as firewalls to help protect against outside systems and networks and security measures like biometrics or similar methods to secure against unwanted physical human access.






Final Concept Map -  Concept Map


References:


Silberschatz, A., Galvin, P. B., & Gagne, G. (2014). Operating system concepts essentials (2nd ed.). Retrieved from https://redshelf.com/


Geeks for Geeks (2019) Introduction of Process Synchronization. Retrieved from https://www.geeksforgeeks.org/introduction-of-process-synchronization/#:~:text=Peterson's%20Solution%20is%20a%20classical,to%20enter%20the%20critical%20sectionLinks to an external site..