OperatingSystems
COEN-283
FALL2016
Assignment5-FileSystems&I/O
1. Isthe“open”systemcallinUNIXabsolutelyessential?Whatwouldbetheconsequences of not having it?
Ans :-
- If there is no “Open” system call then for every read operation we have to specify the name of the file to be accessed.
- The system would have to fetch the i-Node for it, although it could be cached
- In this situation one issue may arise which is when to flush the iNode back to disk. That can be done by timeout, but it would be clumsy.
- Overall, it may work but with much more overhead involved
2. In some systems it is possible to map part of a file into memory. What restrictions must such systems impose? How is this partial mapping implemented?
Ans :-
-It is possible to map part of a file into memory instead of entire file. But in this situation,
A part of file which needs to be mapped is required to begin from a page boundary.
-Hence a restriction on such system is that the pages should have a length of an integral number.
-Each mapped page uses the file itself as a backing store. Unmapped memory uses a scratch file or partition as backing store.
3. Name one advantage of hard links over symbolic links and one advantage of symbolic links over hard links.
Ans :-
Advantage of Hard links over Symbolic links :
- Hard link contains direct reference to the object. Hence it is faster, whereas symbolic link contains a path name to the object which must be resolved to find the object.
- Hard links do not
For the testing a complex system unlike a complicated system it cannot be broken down into smaller
makes it difficult for programs to interface. Quite frequently data is just lost and not retrievable.
can usefuly be shared. Give examples of their sharing as it ocurs in practice in distributed
Irregular Access memory is inside the PC which store the information and work with capacity memory to make lessen less and influence space for essential things to like record and documents in light of the fact that for individual protection.
c) The memory chip reply with the data from the demanded memory position on the data bus.
a File or space on the hard drive where data from RAM is "swapped" in order to preserve space.
12. Which of the following answers are true about an internal hard disk drive (HDD) as it is
The advantages of interrupt driven I/O over programmed I/O is that in interrupt driven I/O the interrupt mechanisms free I/O devices quickly.
Sequential file organizations access data sequentially from the beginning [1], i.e. to reach file 27, the 26 preceding files must be accessed first. They are much slower to access compared to random access [1]. Sequential files are stored on a sequential access device [2]. The records contained in sequential files are stored in a predetermined order [2], according to the value of a search key [1], and are stored one after the other [2] as they are inserted into the file. Records can only be accessed (read from and written to) sequentially (i.e. in the same order that they were entered) [3]. Sequential files are designed for efficient processing [1]). Records stored in sequential files cannot be deleted,
Blocks are the logical records which breaks the area used by a partition; clusters are physical bodies of a hard disk. Hard disk is usually broken in to cylinders and cylinders are broken down in to clusters. Most HDD arrive from the factory with a low level pattern where, block size = 512 bytes. The NTFS file system can produce cluster sizes of a multiple of 512 having a default of 8 blocks for every cluster. Size of a block is multiple of size of cluster, such that a logical block will fit a definite number of physical clusters “one file one cluster”. That is, in every cluster will be installed information belonging at most to a single file. As an aftermath, when scripting a file in a hard disk, some cluster remains incompletely filled or fully unused. As the operating system can only write an entire block, it pursues that the idle space should be fit with some strings of bytes that can be used by others. It should be remembered that these data are saved in a disk because of the operating system curbs to write only on an entire block, they could be detected by locating
Virtual to physical address translation - Virtual address consists of a virtual page number, index and offset. To get the physical page number (frame), we first check TLB to see if the requested address is there. If the address is not there, we check the page table. If the requested address is in the page table, we get the physical page number. If the requested address is not in the page table, page fault occurs and the page is eventually loaded into memory and TLB and we get the physical page number.
Buffer Overflow is where a program over runs the buffer’s boundary in RAM and over writes the adjacent memory. “This can be triggered by inputs that are designed to execute or alter the way the program operates. This may result in erratic program behaviour, including memory access errors, incorrect results, a crash, or a breach of system security. Thus, they are the basis of many software vulnerabilities and can be maliciously exploited.” [Accessed
Flash memory is a solid-state drive (SSD) that maintains data storage without moving parts, even
This would mean programmers would have to edit their code every time they changed machines or added more memory (Lemley, 1999). Early computers had small amounts of RAM because storage technology was very expensive. Programmers had to store master copies of programs on a secondary storage system and pull pieces into RAM as needed. The process of deciding which pieces to pull and which parts of RAM to replace was called “overlaying” (Denning, 2012). “It was estimated that most programmers spent half to two-thirds of their time planning overlay sequences. A reliable method of automating it had potential to increase programmer productivity and reduce debugging by several fold” (Denning, 2012). Thus, the concept of virtual memory was born. This concept makes use of the computer’s hard drive when main memory runs out. However, the hard drive is significantly slower than RAM so we want to keep most of the program functioning in RAM thus specialized hardware and software is needed to give the illusion of unlimited available fast memory (Lemley, 1999). This hardware converts a “virtual” address to a physical address in memory. Aside from virtually increasing memory size, virtual memory also provided three additional benefits, “it isolated users from each other, it allowed dynamic relocation of program pieces within RAM, and it provided read – write access control to individual pieces” (Denning, 2012). It is for these