Featured Post

Post #5 – Computers in the Workplace

"In Post #5, you will describe the functions of computers in your chosen industry, based on your current understanding of IT, your exp...

Monday, November 26, 2018

CPT304- W5 - Final Assignment

Mechanisms Necessary to Control Access
For our first interactive assignment we were asked to begin our concept map, and address the following topics about operating system structures and features: “Categorize, describe, and give examples of the major functions of operating systems.” To begin answering question of an operating systems functions, we have to know what an operating system is, our text describes an operating system as “a program that manages a computer’s hardware. It also provides a basis for application programs and acts as an intermediary between the computer user and the computer hardware.” (Silberschatz, Galvin, & Gagne, 2014 CH1.)  The operating system is further described as a management system as well as “resource allocator”, delegating tasks and problem solving for the CPU, other devices, file memory/storage and others to execute them properly, and maintain full functionality of the device hardware. “ An operating system provides the environment within which programs are executed.” (Silberschatz, Galvin, & Gagne, 2014 CH 1.4).
In addition to the explanation of OS structures and features, we were to Illustrate the hierarchy of subsystems, components, or subcomponents of operating systems and explain how they interact with one another. The hierarchy of an operating system includes; user interface, process management, memory management, storage management, and distribution of systems. All working together to maintain a balance. I have further illustrated these key points in my first concept map, which can be found using the following link; Link to my concept Map:
https://drive.google.com/file/d/1o3-WHoXSMTozFB5SYKznzXRmGMltWO2K/view?usp=sharing
For our second interactive assignment, we were asked to complete a Theory Concept Map which addresses the following three topics on how operating systems enable processes to share and exchange information: “Describe process, process state, and process control block.”
A program currently in execution is also known as a process or a job, it is the current task at hand.. "A process is the unit of work in a modern time-sharing system."(Silberschatz, Galvin, & Gagne, 2014 CH 3.1). Process state is the changes to a process as it runs or is executed. Process state changes from: 
*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.
(Silberschatz, Galvin, & Gagne, 2014 CH 3.1.2). Process control block or task control block is simply all the information pertaining to the current job or process. Process control block includes: Process state, Program counter, CPU registers, CPU -scheduling information, Memory-management information, Accounting information, and I/O status information. 
Compare single- and multi-threaded motivations and models.
Secondly, we needed to describe Single and multithreaded processes are similar in they will both code, data, files, register and stack, however a single thread can only run one register and stack, where as a multi thread can run several. Our text gives the example of a web search, such as google. When you enter text into google, it will search using multiple threads to bring up results. For instance, google will give you text, video, pictures, news, and even shopping results, all sorted, or you can simply get them all together in their “all” section. 
Lastly, we needed to describe the critical-section problem and explain a software solution that resolves this problem. The critical section problem is portion of code a process gets to when it is in execution. During this time a process can change common variables and write them to the table of the code, updated it. "The important feature of the system is that, when one process is executing in its critical section, no other process is allowed to execute in its critical section." This means there can not be multiple programs executing at the critical-section simultaneously. Peterson’s Solution is a software solution to this problem. "Peterson’s solution is restricted to two processes that alternate execution between their critical sections and remainder sections." (Silberschatz, Galvin, & Gagne, 2014 CH 5.3). These two processes will share two data items, and alternate the critical-section state. Link to my concept map to further show these explanations.
https://drive.google.com/file/d/1NvaW7Tp14JbrHnpo66ZhU79RR3JtNPbo/view?usp=sharing
As we start week three, we are focusing on Main memory and virtual memory, and their functions within an operating system. We were asked in this interactive assignment to continue building on our OS Theory Concept Map, and address the topics “concerning controlling and coordinating computer memory”. Specifically, we were asked to: “Outline the objectives and functions of memory management in operating systems. “The memory is ultimately responsible for the correct execution of the process or program in a correct and timely manner. Once purchased either digitally or physically, the instructions will be copied and saved, loaded into the computer's memory for later use when called upon. Depending on where/how the address is stored will depend on the type of process instructions. Things like the OS, and other non user programs will be stored with lower addresses being accessed directly and more swiftly by the Kernel. Others, like perhaps Microsoft office, or PC games will be stored with Higher addresses, and accessed by the user, when they click a desktop link for example initiating the process to start running.     
Secondly we were asked to “Compare and contrast the physical address space with the virtual address space as they relate to different memory mapping techniques in operating systems.” A physical address is the address that is logical, (logical address or virtual address.) but now stored in the computer's memory, it is the address that is created by the CPU and stored locally. "An address generated by the CPU is commonly referred to as a logical address, whereas an address seen by the memory unit—that is, the one loaded into the memory-address register of the memory—is commonly referred to as a physical address." (Silberschatz, Galvin  & Gagne, 2014 CH 7.1.3). A virtual address is the logical address, the one created by the CPU, prior to being stored in the register for later use.  Dynamic Loading is a mapping technique used to improve the speed of physical memory. "With dynamic loading, a routine is not loaded until it is called. All routines are kept on disk in a relocatable load format. The main program is loaded into memory and is executed." (Silberschatz, Galvin  & Gagne, 2014 CH 7.1.4). Since only what is needed will be loaded when it is needed, this will speed up the process, saving time and memory space. Link to my Concept Map which can further illustrate this section. 
https://drive.google.com/file/d/19m8C3kfd5n5uZbVLr0lLJb5paW6trhHF/view?usp=sharing
To start off week four, we explored Mass-Storage Structures, File System Interfaces, and File System implementations, in addition to our concept map and details learned this week, we were also asked to complete a few practice exercises from chapters 9 and 10. To complete week fours interactive assignment, we were asked to continue building the OS Theory Concept Map by addressing the following topics concerning files, mass storage, and I/O: Outline the objectives and functions of file systems management and the supported operations, including their reliability and performance. I cannot better explain the file structure, so I have taken directly from tutorialspoint: “A File Structure should be according to a required format that the operating system can understand.
-A file has a certain defined structure according to its type.
-A text file is a sequence of characters organized into lines.
-A source file is a sequence of procedures and functions.
-An object file is a sequence of bytes organized into blocks that are understandable by the machine.
-When operating system defines different file structures, it also contains the code to support these file structure. Unix, MS-DOS support minimum number of file structure.”
In week four, we learned the importance of Scheduling Models, and how disk drives function. To better understand, we were tasked with a scenario, using a disk drive, to explain how various scheduling models work. The disk drive in this scenario has 300 cylinders, numbered 0 to 299. The drive is currently serving a request at cylinder 51, and the previous request was at cylinder 56. The pending requests are received in the following order: 72, 56, 103, 111, 17, 189, 236, 198, and 88. If we were using the FCFS (First-come first-serve) scheduling model, the order which the requests were received would be the order to which they are handled. from cylinder 51, it would move down the list next to 72, then 56, 103 and so on, ending at 88. Should we choose another algorithm, such as SSFT, the requests would be handled in the shortest arm movements to the next cylinder, "shortest-seek-time-first ( SSTF ) algorithm. The SSTF algorithm selects the request with the least seek time from the current head position. In other words, SSTF chooses the pending request closest to the current head position." (Silberschatz, Galvin & Gagne, 2014 CH 9.4.2). Since we started at 51, we would then go to 56, 72, 88, 103 and so on. lastly, for SCAN, if we are starting and 51 head, the arm will continue to move heading the the same direction, servicing the requests that fall within its movement, once it reaches the end, it will reverse and service requests again for which it might have missed. "In the SCAN algorithm, the disk arm starts at one end of the disk and moves toward the other end, servicing requests as it reaches each cylinder, until it gets to the other end of the disk. At the other end, the direction of head movement is reversed, and servicing continues."(Silberschatz, Galvin & Gagne, 2014 CH 9.4.3). with SCAN, if we start at 51 and the previous was 56, I will assume our next will be 17, once it reaches the end, of 0 it will go back, picking up the first one now at 56 (again) 88, 103, 111 and so on, until it reaches cylinder 299, and back the opposite direction it will head, picking up any additional requests until it hits 0, and returns back again. 
Comparing the above three algorithms SSTF gives us a cylinder count of 455, FCFS has a cylinder count of 584, and SCAN will bring us a count of 236 (if we assume the disk arm was already on it’s return trip from 299 heading to 0). Looking at the outcomes of these three methods, the best choice is to use SCAN, as it has the fairest for the processes in the que. I feel this is the fairest, as it will serve all of them in the quickest most efficient time, allowing to continue moving to new cylinders, before either of the first two have finished the first stream of requests in this scenario. The only time I could see this method not being the fairest, was if we needed the request at say 103 to run before the other lower requests could be completed, and they needed to run in order using SSTF. FCFS seems to me to be the logical one to choose, being if you are the first in line, and 20 more people come in, I would want to be served first, and not wait based on the amount of my order, or how long it was going to take to cook. FCFS works great for printers, but is not fair or logical when it comes to completing requests in a fair and timely fashion. In addition to these algorithms, it seems like priority based scheduling would also be most efficient. “Priority scheduling is a non-preemptive algorithm and one of the most common scheduling algorithms in batch systems. Each process is assigned a priority. Process with highest priority is to be executed first and so on. Processes with same priority are executed on first come first served basis.Priority can be decided based on memory requirements, time requirements or any other resource requirement.” (tutorialspoint.com ) With assigning priority, this ensures the requests are handled in the most efficient order, combining the three above. Link to my Concept Map for week four can be found here. 
https://drive.google.com/file/d/1jO6PopcZTr7-Fq4PWwMJE-UamnvR3wEk/view?usp=sharing
For our final interactive assignment, we were tasked with addressing the following topics concerning mechanisms necessary to control the access of programs, processes, or users: 
Outline the goals and principles of domain- and language-based protection in a modern computer system, and describe how an access matrix is used to protect specific resources a process can access. An access matrix can be used to protect specific resources a process can access by each entry in the matrix consisting of a set of access rights."The access-matrix scheme provides us with the mechanism for specifying a variety of policies. The mechanism consists of implementing the access matrix and ensuring that the semantic properties we have outlined hold."(Silberschatz, Galvin & Gagne 2014 CH 13.4).Language-Based protection allows the high-level description of policies for the allocation and use of resources. "Capability-based protection relies on the fact that the capabilities are never allowed to migrate into any address space directly accessible by a user process (where they could be modified). If all capabilities are secure, the object they protect is also secure against unauthorized access."(Silberschatz, Galvin & Gagne 2014 CH 13.5.3).
We were also asked to Describe how security is used to protect programs, systems, and networks from threats. Security features used to protect programs, networks, systems and even users range from software, password protection, as well as the OS itself, which provides. There are four levels of security they should me maintained, the first being Physical. “The site or sites containing the computer systems must be physically secured against armed or surreptitious entry by intruders." (Silberschatz, Galvin & Gagne 2014 CH 14.1)the second is Human. "Human. Authorization must be done carefully to assure that only appropriate users have access to the system."(Silberschatz, Galvin & Gagne 2014 CH 14.1). Third is the Operating system, and lastly we have the Network. "Security at the first two levels must be maintained if operating-system security is to be ensured. A weakness at a high level of security (physical or human) allows circumvention of strict low-level (operating-system) security measures."(Silberschatz, Galvin & Gagne 2014 CH 14.1). Link to my final Concept Map can be found here. In addition, there are screenshots for all concept maps posted at the end of this paper. https://drive.google.com/file/d/1CVSiGyCYQm7oDIiYy2fJDZaevE8VJZl4/view?usp=sharing
 
References
Carlos Páscoa and José Tribolet (2015). Procedia Computer Science, Volume 64,, pp. 180-187. Retrieved from https://www-sciencedirect-com.proxy-library.ashford.edu/science/article/pii/S187705091300567
Disk Scheduling Algorithms. (2018, September 07). Retrieved November 14, 2018, from https://www.geeksforgeeks.org/disk-scheduling-algorithms/
Does multithreading always yield better performance than single threading? (n.d.). Retrieved October 31, 2018, from https://stackoverflow.com/questions/27319446/does-multithreading-always-yield-better-performance-than-single-threading
Multithreading in Java. (2018, September 05). Retrieved October 31, 2018, from https://www.geeksforgeeks.org/multithreading-in-java/
Operating system – File system (Links to an external site.)Links to an external site.. (n.d.). Retrieved from https://www.tutorialspoint.com/operating_system/os_file_system.htm
Operating system – I/O hardware (Links to an external site.)Links to an external site.. (n.d.) Retrieved from https://www.tutorialspoint.com/operating_system/os_io_hardware.htm
Operating system – I/O softwares (Links to an external site.)Links to an external site.. (n.d.). Retrieved from https://www.tutorialspoint.com/operating_system/os_io_software.htm
Operating system – Memory management (Links to an external site.)Links to an external site.. (n.d.). Retrieved from https://www.tutorialspoint.com/operating_system/os_memory_management.htm
Operating system – Processes (Links to an external site.)Links to an external site.. (n.d.). Retrieved from https://www.tutorialspoint.com/operating_system/os_processes.htm
Operating system – Virtual memory (Links to an external site.)Links to an external site.. (n.d.). Retrieved from https://www.tutorialspoint.com/operating_system/os_virtual_memory.htm
Pinto, R. S., Nobile, P., Mamani, E., Júnior, L. P., Luz, H. J., & Monaco, F. J. (2013). Operating System from the Scratch: A Problem-based Learning Approach for the Emerging Demands on OS Development. Procedia Computer Science, 18(2013 International Conference on Computational Science), 2472-2481. doi:10.1016/j.procs.2013.05.424
Tutorials Point. (n.d.). Operating system - Multi-threading (Links to an external site.)Links to an external site.. Retrieved from http://www.tutorialspoint.com/operating_system/os_multi_threading.htm
Tutorialspoint.com. (n.d.). Operating System Scheduling algorithms. Retrieved November 13, 2018, from https://www.tutorialspoint.com/operating_system/os_process_scheduling_algorithms.htm
Silberschatz, A., Galvin, P. B., & Gagne, G. (2014). Operating system concepts essentials (2nd ed.). Retrieved from https://www.vitalsource.com





No comments:

Post a Comment