In: Computer Science
Q1.Explain how an operating system protects main memory in a computer system.
Ans. Operating systems protect memory to prevent a process from accessing memory that has not been allocated to it. This prevents a bug or malware within a process from affecting other processes, or the operating system itself. Protection may encompass all accesses to a specified area of memory, write accesses, or attempts to execute the contents of the area. An attempt to access unauthorized memory results in a hardware fault, e.g., a segmentation fault, storage violation exception, generally causing abnormal termination of the offending process. Memory protection for computer security includes additional techniques such as address space layout randomization and executable space protection. It is a way to control memory access rights on a computer.
There are two methods to handle memory protection. The first method is known as unprotected and uses voluntarily enforced software control routines to manage rules for task interaction. The second method is known as protected and uses hardware and software to enforce rules for task interaction. In a protected system the hardware protects areas of memory by generating an abort when access permission is violated and software responds to handle the abort routines and manage control to memory-based resources.
Q2.Discuss three responsibilities that an operating system has for file management in a computer system.
Ans. Operating System acts as a communication bridge (interface) between the user and computer hardware. The purpose of an operating system is to provide a platform on which a user can execute programs in a convenient and efficient manner. Here, I am going to mention 3 file managemnet functions that are controlled by operating system.
One of the most basic responsibilities are File Creation and deletion. File creation is very important because data can't be stored in an efficient manner unless arranged in some form of file structure.File deletion is also important because permanent storage would quickly fill up if files were not deleted and the space occupied by them reallocated to new files.
Operating systems need to be able to map files and folders to their physical location on permanent storage in order to be able to store and retrieve them. This will be recorded in some form of disk directory which varies according to the file system or systems that the operating system uses. The operating system will include a mechanism to locate the separate file segments where it has divided a file.
I think Backup is the most awesome OS functions in file management.Files represent a considerable investment in time, intellectual effort and often money as well, thus their loss can have a severe impact. Computer's permanent storage devices generally contain a number of mechanical devices which can fail, and the storage media itself may degrade. A function of operating systems is to obviate the risk of data loss by backing files up on additional secure and stable media in a redundant system.
Q3. Clearly distinguish between interrupt and trap. Give examples to illustrate your answer.
Ans. A trap is an exception in a user process. It's caused by division by zero or invalid memory access. It's also the usual way to invoke a kernel routine (a system call) because those run with a higher priority than user code. Handling is synchronous (so the user code is suspended and continues afterwards). In a sense they are "active" - most of the time, the code expects the trap to happen and relies on this fact. An interrupt is something generated by the hardware (devices like the hard disk, graphics card, I/O ports, etc). These are asynchronous (i.e. they don't happen at predictable places in the user code) or "passive" since the interrupt handler has to wait for them to happen eventually.
Let's say you write a program in which you declare a variable having divide by zero value then it is treated as a trap.Whenever you run this program it will throw same error at the same time.System call is a special version of trap in which a program asks os for its required service. In case of interrupt like an i/o error,the cpu is interrupted at random time and off course it is not the fault of our programmers.It is the hardware that brings them up.
Q4.Describe time-sharing systems and give an example to illustrate your answer.
Ans.Time-sharing is a technique which enables many people, located at various terminals, to use a particular computer system at the same time. Time-sharing or multitasking is a logical extension of multiprogramming. Processor's time which is shared among multiple users simultaneously is termed as time-sharing.The time sharing system provides the direct access to a large number of users where CPU time is divided among all the users on scheduled basis. The OS allocates a set of time to each user. When this time is expired, it passes control to the next user on the system. The time allowed is extremely small and the users are given the impression that they each have their own CPU and they are the sole owner of the CPU. The Multics & Unix operating systems are time sharing Operating Systems. Although, The term ‘Time Sharing’ is no longer commonly used, it has been replaced by ‘Multitasking System’.
Q5.Discuss the 4 categories in which work concerning information security and protection relating to Operating Systems are grouped.
Ans.The security systems covers the safety of their system resources (saved data, memory, disks, etc) across malignant alteration, illegal access, and disparity or inconsistency. The security gives a mechanism (authentication and encryption) to analyze the user to permit for using the system.protection deals with the access to the system resources. It determines that what files can be accessed or permeated by a special user. The protection of the system should confirm the approval of the process and users. Due to this, these licensed users and processes will care for the central processing unit, memory and alternative sources. The protection mechanism ought to provide a path for specifying the controls to be obligatory, beside how of implementing them. The main goal of protection is to prevent unauthorized access to a program; improve the reliability by detecting latent errors. In other words, the security requirements are different in which they are supposed to operate. Some of the common goals of security are Secrecy, Privacy, Authenticity, Integrity