• Uncategorized

    C program for gallons that converts in cubic feet.

    Q29.  Assuming that there are 7.481 gallons in a cubic foot, write a C program that asks the user to enter the number of gallons, and then displays the equivalent in cubic feet. Ans. #include<stdio.h> #include<conio.h>   //for clrscr() void main() { float gallon, cbft; clrscr();  //for clear screen printf(“\n Enter the number of gallons: “);

  • Uncategorized

    File Types

    Q1. What are the types of file? Ans.When we design a file system—indeed, an entire operating system—we always consider whether the operating system should recognize and support file types. If an operating system recognizes the type of a file, it can then operate on the file in reasonable ways.   A common technique for implementing file types is to include the type as part of the file name. The name is split into two parts—a name and an extension,usually separated by a period character (Figure 10.2). In this way, the user andthe operating system can tell from the name alone what the type of a file is.   File name…

  • Uncategorized

    File Operations

    Q1. What all operations are performed on a file? Ans. A file is an abstract data type. Following are the operations performed by on a file:   Creating a file Two steps are necessary to create a file. First, space in thefile system must be found for the file. Second, an entry for the new file must be made in the directory.   Writing a file To write a file, we make a system call specifying both thename of the file and the information to be written to the file. Given the name of the file, the system searches the directory to find the file’s location. The system must keep…

  • Uncategorized

    File Attributes

    Q1. What are File Attributes? Ans.A file’s attributes vary from one operating system to another but typically consist of these: Name The symbolic file name is the only information kept in human readableform,. Identifier This unique tag, usually a number, identifies the file within thefile system; it is the non-human-readable name for the file. Type This information is needed for systems that support different types of files. Location This information is a pointer to a device and to the location ofthe file on that device. Size The current size of the file (in bytes, words, or blocks) and possiblythe maximum allowed size are included in this attribute. Protection Access-control information…

  • Uncategorized

    File Concept

    Q1. Explain File Concept. Ans. Computers can store information on various storage media, such as magnetic disks, magnetic tapes, and optical disks. So that the computer system will be convenient to use, the operating system provides a uniform logical view of information storage. The operating system abstracts from the physical properties of its storage devices to define a logical storage unit, the file. Files are mapped by the operating system onto physical devices. These storage devices are usually nonvolatile, so the contents are persistent through power failures and system reboots.

  • Uncategorized

    I/O Interlock

    Q1. Explain I/O Interlock. Ans.When demand paging is used, we sometimes need to allow some of the pages to be locked in memory. One such situation occurs when I/O is done to or from user (virtual) memory. I/O is often implemented by a separate I/O processor.   For example, a controller for a USB storage device is generally given the number of bytes to transfer and a memory address for the buffer. When the transfer is complete, the CPU is interrupted.

  • Uncategorized

    TLB Reach

    Q1. Explain TLB Reach. Ans.The TLB reach refers to the amount of memory accessible from the TLB and is simply the number of entries multiplied by the page size.   TLB Reach = Number of entries X Page Size   Ideally, the working set for a process is stored in the TLB. If not, the process will spend a considerable amount of time resolving memory references in the page table rather than the TLB. If we double the number of entries in the TLB, we double the TLB reach.  

  • Uncategorized

    Translation Look Aside Buffer (TLB)

    Q1. Explain Translation Look Aside Buffer (TLB). Ans.Translation look aside buffer is a special, small, fast-lookup hardware cache. The TLB is associative, high-speed memory. Each entry in the TLB consists of two parts: A key (or tag) and A value. When the associative memory is presented with an item, the item is compared with all keys simultaneously. If the item is found, the corresponding value filed is returned. The search is fast, the hardware, however, is expensive. Typically, the number of entries in a TLB is small, often numbering between 64 and 1,024. The TLB is used with page tables in the following way. The TLB contains only a few…

  • Uncategorized

    Purpose of Using Cache Memory

    Q1. Explain the purpose of using Cache Memory. Ans. Information is normally kept in some storage system such as main memory. As it is used, it is copied into a faster storage system—the cache—on a temporary basis. When we need a particular piece of information, we first check whether it is in the cache. If it is, we use the information directly from the cache; if it is not, we use the information from the source, putting a copy in the cache under the assumption that we will need it again soon.   In addition, internal programmable registers, such as index registers, provide a high-speed cache for main memory.