CS609 Final Term Subjective Paper Solved with references March (2014)

Similar documents
CS609 FINAL TERM CURRENT 2014 SUBJECTIVE PAPERS

CS609 Final Term Subjective Paper Solved with references March (2014)

CS609 - Final Term Papers Fall 2012

CS609 Final Term Solved MCQs with References Without Repetitions 14/02/2013

Hard Disk Organization. Vocabulary

Initial Bootloader. On power-up, when a computer is turned on, the following operations are performed:

Question: How to generate.com file? Answer: For BorlandC 3.1: 1- copy myfile.c into BIN folder of BORLANDC. 2- From command prompt goto BIN

CS609 - System Programming FAQs By

CS609 - System Programing Final-Term Papers Solved MCQS with Reference (1 to 45 lectures) by Arslan Arshad (Zain Nasar)

File System: Interface and Implmentation

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

Hard facts. Hard disk drives

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

File System Implementation. Sunu Wibirama

Hong Kong Polytechnic University Department of Electronic and Information Engineering. Experiment On DOS File system

Advanced Operating Systems

Computer Systems. Assembly Language for x86 Processors 6th Edition, Kip Irvine

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Older geometric based addressing is called CHS for cylinder-head-sector. This triple value uniquely identifies every sector.

makes floppy bootable o next comes root directory file information ATTRIB command used to modify name

Long-term Information Storage Must store large amounts of data Information stored must survive the termination of the process using it Multiple proces

COMP091 Operating Systems 1. File Systems

FILE SYSTEM IMPLEMENTATION. Sunu Wibirama

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

Operating Systems. Operating Systems Professor Sina Meraji U of T

ECE 598 Advanced Operating Systems Lecture 14

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

Chapter 12: File System Implementation

Windows File System. File allocation table (FAT) NTFS - New Technology File System. used in Windows 95, and MS-DOS

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. One OS function is to control devices

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

Chapter 11: File System Implementation. Objectives

Typical File Extensions File Structure

WINDISK: A File and disk Editor

Guide to Computer Forensics and Investigations Fourth Edition. Chapter 6 Working with Windows and DOS Systems

File system internals Tanenbaum, Chapter 4. COMP3231 Operating Systems

Chapter Two File Systems. CIS 4000 Intro. to Forensic Computing David McDonald, Ph.D.

Introduction. Operating Systems. Outline. Hardware. I/O Device Types. Device Controllers. (done)

There is a general need for long-term and shared data storage: Files meet these requirements The file manager or file system within the OS

CS370 Operating Systems

CS370 Operating Systems

File System Management

Frequently asked questions from the previous class survey

Introduction. Secondary Storage. File concept. File attributes

Lecture S3: File system data layout, naming

Chapter 11: Implementing File Systems. Operating System Concepts 8 th Edition,

File Systems Forensics

Summer 2003 Lecture 26 07/24/03

CS3600 SYSTEMS AND NETWORKS

File Management By : Kaushik Vaghani

UNIX File Systems. How UNIX Organizes and Accesses Files on Disk

NTFS Recoverability. CS 537 Lecture 17 NTFS internals. NTFS On-Disk Structure

Chapter 12: File System Implementation

e-pg Pathshala Subject: Computer Science Paper: Operating Systems Module 35: File Allocation Methods Module No: CS/OS/35 Quadrant 1 e-text

File System Interpretation

Disk Scheduling COMPSCI 386

Project 3 Help Document

OPERATING SYSTEMS CS136

CISC 7310X. C11: Mass Storage. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 4/19/2018 CUNY Brooklyn College

Microsoft File Allocation Table

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS)

Chapter 11: File System Implementation

Process size is independent of the main memory present in the system.

Physical Representation of Files

File System Case Studies. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018

Chapter 11: Implementing File Systems

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

A file system is a clearly-defined method that the computer's operating system uses to store, catalog, and retrieve files.

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

OPERATING SYSTEM. Chapter 12: File System Implementation

CS333 Intro to Operating Systems. Jonathan Walpole

File Management. Ezio Bartocci.

Disk Geometry and Layout

Organization of a Surface

Secondary Storage (Chp. 5.4 disk hardware, Chp. 6 File Systems, Tanenbaum)

Chapter 11: Implementing File

Lecture 29. Friday, March 23 CS 470 Operating Systems - Lecture 29 1

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 420, York College. November 21, 2006

File Systems Management and Examples

Time Left. sec(s) Quiz Start Time: 12:13 AM. Question # 5 of 10 ( Start time: 12:18:29 AM ) Total Marks: 1

A+ Guide to Hardware: Managing, Maintaining, and Troubleshooting, 5e. Chapter 6 Supporting Hard Drives

File Directories Associated with any file management system and collection of files is a file directories The directory contains information about

Da-Wei Chang CSIE.NCKU. Professor Hao-Ren Ke, National Chiao Tung University Professor Hsung-Pin Chang, National Chung Hsing University

CS370 Operating Systems

File System Implementation

White Paper Western Digital Comments on Sector Sizes Larger than 512 Bytes

Chapter 11: Implementing File Systems. Operating System Concepts 9 9h Edition

A+ Guide to Managing and Maintaining your PC, 6e. Chapter 8 Hard Drives

A+ Guide to Hardware, 4e. Chapter 7 Hard Drives

File Systems. Martin Děcký. DEPARTMENT OF DISTRIBUTED AND DEPENDABLE SYSTEMS

Chapter 10: File System Implementation

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

OPERATING SYSTEMS II DPL. ING. CIPRIAN PUNGILĂ, PHD.

CS720 - Operating Systems

Table 12.2 Information Elements of a File Directory

ECE 650 Systems Programming & Engineering. Spring 2018

The Device Driver Interface. Input/Output Devices. System Call Interface. Device Management Organization

Transcription:

CS609 Final Term Subjective Paper Solved with references March (2014) Solved by: Saher/Aqualeo www.freeittips.com Q:1 How large file contents can be managed using FAT? 2 marks Larger files would be comprised of numerous clusters. The first Cluster # can be read from FCB for rest of the Cluster, a chain is maintained within the FAT. As large files would be composed of many clusters the first Cluster number is obtained from FCB and the subsequent clusters can be obtained from FAT by using the previous cluster Number to obtain the next cluster number and so on. Q:2 When we talk about FAT32, what is the size of FS Info block? 2 marks On a FAT32 volume, the FAT can be a large data structure, unlike on FAT16 where it is limited to a maximum of 128K worth of sectors and FAT12 where it is limited to a maximum of 6K worth of sectors. FS Info block contains information required at the time of allocation/de-allocation to the file. Size of FAT 32 is huge at allocation/de-allocation time so calculating these values is not feasible, therefore these are stored in FS Info block. Q:3 Which control information PSP contains? 2 marks is situated before the start of a process. contains control information like DTA ( Disk Transfer Area) and command line parameters. Q:4 Which is the location of timer count in BIOS data area? 2 Marks Timer location in BIOS data area is 40:6CH. Q:5 Explain the purpose of file control block(fcb)? 3 Marks Control information about files are maintained in a data structure called the File control block (FCB). The FCB for each file is created and stored in the disk. We can get information about the file such as size, date time of creation, data time of last modification etc from FCB. Further we can also impose restrictions on file such as read only, archived etc using FCB Q:6 In NTFS, where the backups of boot block are stored and why? 3 Marks

The NTFS "Backup Boot Sector" isn't really part of the NTFS Volume; it's actually stored in a sector immediately following the last sector of the Volume, which makes an NTFS Volume's partition size 1 sector larger than its Volume size! Q:7 What are three different kinds of computer viruses? 3 Marks Types of Viruses Partition Table Virus Boot Sector Virus File Viruses Q:8 Write a C program that should print your name using int 21H with the help of int86 function See Page#19 for idea solution detail Idea solution: #include <dos.h> union REGS regs; main() { regs.h.ah = 0; regs.h.al = 1; int86( 0x10, &regs, &regs ); printf("fourty by Twenty-Five color mode."); } Q:9 What will be the impact of placing E5 in place of first character of file name? 5 marks DOS perform file deletion by placing 0xE5 at the first byte of it FCB entry and placing 0 s (meaning available) in the entries for the file clusters in the FAT. Q:10 How partition table virus fools DOS about conventional memory? 5 marks At 40:13H a word contains the amount of KBs in Conventional Memory which is typically 640. If the value at 40:13H is somehow reduced to 638 the transient part of Command.Com will load itself such that its last byte is loaded at the last byte of 638KB mark in Conventional RAM. In this way last 2KB will be left unused by DOS. This amount of memory is used by the Virus according to its own size. Q:11 Write down a TSR program, when ever user presses a key it displays it thrice. For example if user has pressed A it will display AAA? 5 marks

#include <dos.h> void interrupt (*old)( ); void interrupt newfunc( ); void main( ) { old = getvect(0x09); setvect(0x09,newfunc); keep(0,1000); } void interrupt newfunc ( ) { (*old)( ); (*old)( ); (*old)( ); } This program simply intercepts the keyboard interrupt and places the address of newint in the IVT. The newint simply invokes the original interrupt 9 thrice. Therefore the same character input will be placed in the keyboard buffer thrice i.e three characters will be received for each character input. Q: 12 Find the root directory sector. Where reserved sector = 1 and sector per FAT = 9. Use appropriate assumption where needed? 5 Marks Root DIR Sector: reserved sectors +2 * (size of FAT) = 1 + 2 * 9 = 19 -------------------------------------------------------------------------------- Paper no : 2 -------------------------------------------------------------------------------- Q:1 how the descriptor table describes as many segments and what are the attributes of segments? Descriptor table describes the memory segment by storing its attributes related to that memory segment and their significant attributes are: Base address, length and limit, right access. Q:2 Write down autonomy of NTFS file system?

In NTFS based system. The FAT and root Directory has been replaced by the MFT. It will generally have two copies the other copy will be a mirror image of the original. Rests of the blocks are reserved for user data. In the middle of the volume is a copy of the first 16 MTF record which are very important to the system. Q:3 Write the limitation of bios disk()? Large sized disk are available now with thousands of tracks But this BIOS routine only is capable of accessing a max. of 1024 tracks. Hence if a large disk is being used not whole of the disk can be accessed using this routine This function uses the int 13H services. The parameter sizes provided by these services may not be sufficient to hold the track number of block to be accessed. Q:4 How DMA works in Block transfer mode? In block transfer mode the DMA is programmed to transfer a block and does not pause or halt until the whole block is transferred irrespective of the requests received meanwhile. Q:5 How cross reference of clusters can be detected? Cross references can be detected easily by traversing through the chain of all files and marking the cluster # during traversal. If a cluster is referenced more than once then it indicates a cross reference. Q:6 LSN = 0 and LBA = 0 are same things? Why if yes or no?

LBA = 0 is not the same as LSN=0. The LBA=0 block is the first block on disk. Whereas each logical partition has LSN=0 block which is the first block in logical drive and is not necessarily the first block on physical drive. Q:7 Major enhancements on FAT 32 comparing with FAT 12 and FAT 16? The major difference between FAT 16 and FAT 32 is of course the FAT size. FAT32 evidently will contain more entries and can hence manage a very large disk whereas FAT16 can manage a space of 2 GB maximum practically. Q:8 In DMA what is purpose of count register? Number of bytes to be loaded is placed in the count register. Q:9 Difference between COM file and DOS EXE? The main difference in COM File and DOS EXE File is that the COM File starts its execution from the first instruction, whereas the entry point of execution in EXE File can be anywhere in the Program. Q:10 Which file system keeps the backup of its boot block? Q:11 Calculate the sector no for the following I C H we have the following info blocks per cluster = 8 first user block number = 20 Sector No. = (Clust_no 2)* Blocks per Clust + First User Block # Sector No. = (2)* 8 +20=36 Q:12 Find the root directory sector where reserved sector = 1 and sector per FAT = 9, use appropriate assumption?

Root dir sector=reserved sector+2 *(sector per FAT)=1+2*9=19 2) Suppose we read the contents of Drive parameter block and get the following information. Number of reserved blocks=2 Number of blocks in FAT= 7 Number of blocks in root directory=32 Find the number of systems blocks. make the appropriate assumptions when needed. Now in the example sector per FAT is unknown. No. of System Area Blocks = Reserved Block + Sector per FAT * No. of FAT s + No. of entries * Root dir =reserved sector+2*sector per FAT 2*sector per FAT= Root dir - reserved sector=32-2=30 Sector per FAT=30/2=15 No. of System Area Blocks = 2 + 15 * 7 + 32=151 1)Write three Data Structures for Memory DOS use? MCB ( Memory Control Block ) EB ( Environment Block ) PSP ( Program Segment Prefix ) 2)Scan Disk Surface Scan for Bad Sectors It attempts to write a block. After write it reads back the block contents. Performs the CRC test on data read back. If there is an error then the data on that block is not stable and the cluster of that block should be marked bad. The cluster is marked bad by placing the appropriate code for bad cluster so that they may not be allocated to any file. 3) How Accessing NTFS volume in DOS? NTFS volume cannot be accessed in DOS using DOS based function like absread( ) etc. DOS device drivers does not understand the NTFS data structures like MFT etc. If NTFS volume is accessed in DOS, it will fire the error of Invalid Media.

4) How to recovered a Deleted Files? 0xE5 at the start of file entry is used to mark the file as deleted. The contents of file still remain on disk. The contents can be recovered by placing a valid file name, character in place of E5 and then recovering the chain of file in FAT. If somehow the clusters used by deleted file have been overwritten by some other file, it cannot be recovered. 5) Structure of Partitioning Table Total size of Partition Table is 512 bytes. First 446 bytes contains code which loads the boot block of active partition and is executed at Boot Time. Rest of the 66 bytes is the Data part. Last two bytes of the Data part is the Partition table signature. 6)Find root dir if reserved sector = 1 and size of fat is 9? Root DIR Sector: Reserved sectors +2 * (size of FAT) = 1 + 2 * 9 = 19 Write the functionality of abs read and abs write? abs read( ) is used to read a block given its LSN abs write( ) is used to write a block given its LSN absread(int drive, int nsects, long lsec, void *buffer); abswrite(int drive, int nsects, long lsec, void *buffer); File size is 12k and cluster size is 4 is k shyd blocks find krne thy 2 marks Number of blocks within a cluster is in power of 2=4 2 =16 1st sector no formula 2 marks

Write the formula of Direct addressing?2 marks segment*10h+offset 1st user block no given, Blocks per cluster is given find the sector. Sector No. = (Clust_no 2)* Blocks per Clust + First User Block # Name three descriptor table 3 marks 1. Global descriptor table(gdt) 2. Local descriptor table(ldt) 3. Interrupt descriptor table(idt) If LSN given then how to read a block 3 marks If the LSN address is known the absread() function can be used to read a block and abswrite() can be used to write on it What is the purpose of control register in DMA 3 marks Address translation from logical to physical 3 marks seg * 10H + offset for Logical to Physical address translation Ntfs file system 5 marks

In NTFS based system. The FAT and root Directory has been replaced by the MFT. It will generally have two copies the other copy will be a mirror image of the original. Rests of the blocks are reserved for user data. In the middle of the volume is a copy of the first 16 MTF record which are very important to the system. Modem controller register? Keyboard writing protocol...5 marks Wait till input buffer is full Write on buffer Wait till output buffer is full Check the acknowledgement byte Repeat the process if it was previously unsuccessful. Mathematical translation for LBA translation? LBA address = (C * H +H)* S + S 1 Where C = Selected cylinder number H = No. of heads H = Selected head number S =Maximum Sector number S= Selected Sector number Boot block structure,

jmp code part OSName BIOS Parameter Block codepart: --------------------- -------------------- Find root dir sector.5 marks Formula Root Dir Sector= reserved sectors +2 * (size of FAT) -------------------------------------------------------------------- Paper no 3 -------------------------------------------------------------------- 1. How large file contain can be managed using FAT? Larger files would be comprised of numerous clusters. The first Cluster # can be read from FCB for rest of the Cluster, a chain is maintained within the FAT. Answer in simple words is in green As large files would be composed of many clusters the first Cluster number is obtained from FCB and the subsequent clusters can be obtained from FAT by using the previous cluster Number to obtain the next cluster number and so on. What do you mean by mirroring in FAT32? The FAT and root directory has been replaced by the MFT. It will generally have two copies the other copy will be a mirror image of the original. Rests of the blocks are reserved for user data. In the middle of the volume is a copy of the first 16 MTF record which are very important to the system. 3. Enlist all the activities that are to be performed when interrupt 9 occurs?

Write a Formula to transfer the cluster # in LSN for FAT32 file System. No of System area blocks= reserved block+ fat per sector*no of FAT+no of enteries*32 First user block NO. = No of system area blocks Sector No. =(clust_no_2)*blocks per cluster first user block no Can we send the data to keyboard yes or not? Yes we can. How many maximum possible entries are there in FAT32 and FAT16? FAT32 evidently will contain more entries and can hence manage a very large disk whereas FAT16 can manage a space of 2 GB maximum practically. Anatomy of FAT32?

TSR program that sets the caps lock bit in the keyboard status bytes whenever interrupt 8 occurs. What is difference between tracks and sectors Tracks are the circular division of the disk and the sectors are the longitudinal division of the disk. Q# Write down procedure to convert a cluster number into sector number - NTFS simply the following formula will be used to translate the sector number into cluster number. Sector # = Cluster # * Sector Per Cluster Q: In FAT32, what is the size of FSInfo? - On a FAT32 volume, the FAT can be a large data structure, unlike on FAT16 where it is limited to a maximum of 128K worth of sectors and FAT12 where it is limited to a maximum of 6K worth of sectors. In which storage media head touches the surface of disk and in which does not and why it is so? Pg 205-206 The head is touching the surface of floppy disk which rotates at a low speed of 300 RPM. The head is not touching the surface of hard disk which run at high speeds up to 9600 RPM but is at a few microns distance from the surface What is difference b/w Primary and extended Partition? pg 222-223 Partition defined in the MBR (Master Boot Record) is primary partition. Each Primary Partition contains information about its respective O.S. However if only one O.S. is to be installed then extended partitions. The extended partition may again be divided into a number of partitions, information about further partitions will be kept in extended partition table which will be the first physical block within extended partition (i.e. it will not the first block of primary partition.). Moreover there can be extended partitions

within extended partitions and such that in then end there are number of logical partitions this can go on till the last drive number in DOS. Suppose a disk is divided into two partition and we have read MBR at LBA=0 to get information about primary partition a) How many bytes of code part we need to skip to get information about primary partition? b) How many bytes of code part we need to read information? Question: - Define the following terms relating to HDD (Hard Disk Drive). Solution: - (1) Block: - Blocks are the sectors per track, smallest addressable unit in memory; address of block is specified as a unique combination of three parameters. (2) Sector: - Each track can hold many thousands of bytes of data. It would be wasteful to make a track the smallest unit of storage on the disk, since this would mean small files wasted a large amount of space. Therefore, each track is broken into smaller units called sectors. (3) Track: - All information stored on a hard disk is recorded in tracks, which are concentric circles placed on the surface of each platter, much like the annual rings of a tree. The tracks are numbered, starting from zero, starting at the outside of the platter and increasing as you go in. A modern hard disk has tens of thousands of tracks on each platter (4) Cluster: - Cluster is the collection of contiguous blocks. User data is divided into cluster, number of blocks within a cluster is in power of 2. Cluster size can be varying depending upon the size of the disk. (5) Cylinder: - Cylinder is a collection of corresponding tracks if track on platter changes so will the tracks on rest of the platters as all the heads move simultaneously

(6) Seek Time: - While accessing a selected block Time required by the head to reach the particular track/cylinder is called seek time (7) Access Time: - The accumulative time that is required to access the selected block is called access time (8) LBA (Logical Block Addressing): - LBA is the address of relative to the start of physical drive i.e. (absolute). (9) LSN (Logical Sector Number): - If the blocks are indexed from the boot block such that the boot block has index = 0. Then this index is called LSN. LSN is relative index from the start of logical drive not the physical drive. (10) DAP (Disk Address Packet): - Disk Address Packet is data structure used by extended in 13H services to address a block and other information for accessing the block. (11) BPB (BIOS Parameter Block): - BIOS Parameter Block is a data structure maintained by DOS in the boot block for each drive. The boot block is typically a 512 byte block it contain some code and data. The data part constitutes the BPB. (12) DPB (Drive Parameter Block): - Beside the BPB there is another data structure can be used equivalently called the DPB. The operating system translates the information in BPB on disk into the DPB which is maintained main memory. This data structure can be accessed using the undocumented services 21H/32H. ==================================================================