UNIT I INTRODUCTION TO UNIX & FILE SYSTEM
|
|
- Erik Perkins
- 6 years ago
- Views:
Transcription
1 INTRODUCTION TO UNIX & FILE SYSTEM Part A 1. What is UNIX? UNIX(Uniplexed Information Computing System) it is an operating system was developed in Early 1970 at Bell Labs. It was initially a character based operating system that provided functionality for writing high level C programming. 2. What are the central concepts of UNIX system? The entities files and processes are referred as central concepts of UNIX. 3. What are the reasons for popularity of UNIX operating system? The system is written in high level language, make it easy to read, understand, change, and move to other machines. It has a simple user interface that has the power to provide the services that users want. It provides primitives that permit complex programs to be built from simpler programs. It uses a hierarchical file system, consistent format for files, byte stream, making application programs easier to write. It provide simple and consistent interface to peripheral devices. It is a multi user multi process system, it hides the machine architecture from user. 4. Define path name and component. A path name is a sequence of component names separated by slash characters; a component is a sequence of characters that designates a file name that is uniquely contained in the previous component. 5. What are the different types of commands supported by shell? A command can be an executable file that contains object code produced by compilation of source code. A command can be executable file that contains a sequence of shell command lines. A command can be an internal shell command CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 1
2 6. What is the purpose of system calls? It instructs the kernel to do various operations for the calling program and exchange data between the kernel and the program. 7. Write down the characteristics of UNIX file system? A hierarchical structure. Consistent treatment of file data. The ability to create and delete files. Dynamic growth of files. The protection of file data. The treatment of peripheral devices as files 8. What is Kernel? The Kernel is the core or base of the Operating System. It contains a number of modules that manage hardware dependent functions. The users do not have direct access to the Kernel. They can access the Kernel only through application programs and other utility programs. 9. What is Shell and it functions? Shell is the utility layer of the operating system. It serves the following functions. It provides a user interface for interaction with the user. It is a command interpreter that interprets commands and gets appropriate utility to do the job requested. 10. Define shell programming. It a command interpreter program that users typically execute after logging into system. The shell interprets the first word of command line as a command name. For many commands the shell forks and the child process execs a command associated with the name. 11. What are the services provided by the kernel? Controlling the execution of processes by allowing their creation, termination or suspension and communication. Scheduling processes for execution on the CPU. Allocating main memory for an executing process. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 2
3 Allocating secondary memory for efficient storage and retrieval of user data. Allowing processes controlled access to peripheral devices. 12. What is the purpose of memory management? Memory management module controls the allocation of memory. If at any time the system does not have enough memory for all processes the kernel moves them between main memory and secondary memory so that all processes get a fair chance to execute. 13. What is the job done by scheduler? The scheduler module allocates the CPU to process. It schedules them to run in turn until they voluntarily relinquish the CPU while awaiting a resource until the kernel preempts them when their recent run time exceeds a time quantum. The scheduler then chooses a highest priority eligible process to run. 14. What do you mean by swapping? UNIX system transferred entire processes between primary memory and swap device, but did not transfer parts of a process independently, except for a shared text. Such a memory management policy is called swapping 15. List down the types of file Regular file, Directory file, FIFO files, Character special file, Block special file, socket file, symbolic file. 16. What is the difference between user mode and kernel mode? Processes in user mode can access their own instructions and data but not kernel instructions and data. Processes in kernel mode can access kernel and user addresses. Some machine instructions are only privileged to kernel mode. 17. Define interrupts. Interrupts are caused by events that are external to process. Interrupts are considered to happen between the execution of two instructions, and the system continues with the next instruction after servicing the interrupt. 18. Define exception. Exception refers to unexpected events caused by a process such as addressing illegal memory, executing privileged instructions, dividing by zero and so on. Exception happen in the middle of the execution of an instruction and the system attempts to restart the instruction after handling the exception. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 3
4 19. What are the different levels of operation in UNIX kernel? User Level: The user programs and the libraries are available here. Kernel level: This is the heart of UNIX operating system. All the operations related to file system, process control sub system, hardware control, and device drivers are available in this level. Hardware level: The physical components of the system are available here. 20. What is the purpose of file sub system? The file sub system accesses file data using a buffering mechanism that regulates data flow between the kernel and secondary storage device. 21. Write down the purpose of buffering mechanism? Buffering mechanism interacts with block I/O device drivers to initiate data transfer to and from the kernel. What is the job done by device drivers and block I/O devices? Device drivers are the kernel modules that control the operation of peripheral devices. Block I/O devices are random access storage devices 22. What is the purpose of process control subsystem? The process control subsystem is responsible for process synchronization, inter process communications, memory management and process scheduling. The file subsystem and process control subsystem interact when loading a file into memory for execution. The process control subsystem reads executable files into memory before executing them. 23. What are the data structures used for file processing? File table: It is a global data structure User file descriptor table: It is allocated per process When a process opens or creats a file the kernel allocates an entry from each table corresponds to the file inode. Inode: Internal representation of file is given by an inode, which contains a description of the disk layout of the file data and other information related to permission, access time, owner etc. 24. Write about file system layout Or Define the components of file system. Boot block : This occupies the beginning of a file system, typically first sector, and may contain the bootstrap code CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 4
5 Super block: describes the state of the file system. Inode list : A list of inodes that follows the super block in the file system. Data blocks: Contain file data and administrative data. 25. Describe the contents in buffer cache. The buffer consists of two parts: a memory array that contains data from the disk and a buffer header that identifies the buffer. The data in buffer corresponds to the data in a logical disk block and kernel identifies the buffer contents by examining identifier fields in the buffer header. 26. What is the information available in buffer header? The buffer header contains a device number field and block number fields that specify the file system and block number of the data on disk and uniquely identify the buffer. It also contains a pointer to a data array, status field. 27. How will you identify the status of the buffer? The buffer is currently locked. The buffer contains valid data. The kernel must write buffer contents to disk before reassigning the buffer The kernel is currently reading or writing the contents of the buffer to disk. A process is currently waiting for the buffer to become free. 28. What are the different scenarios to allocate a buffer for a disk block? The kernel finds the block on its hash queue and its buffer cache. The kernel cannot find the block o the hash queue, so it allocates a buffer from the free list. The kernel cannot find the block o the hash queue and in attempting to allocate buffer from the free list, find a buffer on a free list that has been marked delayed write. The kernel must write the delayed write buffer to disk and allocate another buffer. The kernel cannot find the block o the hash queue, and the free list of buffers is empty. The kernel finds the block on the hash queue but its buffer is currently busy. 29. What are the operations during interrupt handling? The kernel handles the interrupt with the following sequence of operations It saves the current register context and creates a new context layer. It determine the source of interrupt, type of interrupt and unit number CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 5
6 Kernel invoke the interrupt handler Restore its previous context layer 30. What is the information available in inode? A descriptor of the disk layout of the file data and other information such as the file owner, file access permissions and access times. 31. Define the components of file system. Boot block: This block occupies the beginning of the file system, typically the first sector, and may contain the bootstrap code. Super block: describes the state of file system- how large it is, how many files it can store, where to find free space on the file system and other information. Inode list: List of inodes. Data block: This block contains file data and administrative data. 32. What do you mean by stream? A stream is a full duplex connection between a process and a device driver. It consists of a set of linearly linked queue pairs, one member of each pair for input and other for output. 33. Define directory and filename A directory is a file that contains directory entries. The directory entry containing a file name along with structure of information describing the attributes of the file. The names in a directory are called filename. The only two characters that cannot appear in a file name are / and null character. 34. Define file descriptor File descriptors are nonnegative integers that the kernel uses to identify the file being accessed by a particular process. Whenever the kernel opens an existing file or creates a new file it returns the file descriptor. 35. What are the two different time values supported by UNIX? Calendar time: This value counts the number of seconds which is 00 : 00 : 00 January 1, 1970, coordinated universal time. The data type time_t hold this time values. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 6
7 Process time: It is also called CPU time and measures the central processor resources used by process. Process time is measured inc clock ticks. The data type clock_t hold these time values. 36. Define user CPU time, system CPU time. The time attributed to user instructions are referred as user CPU time. The time attributed to kernel, when it executes an behalf of the process is called system CPU time. 37. What are the kernel s data structures are used for open files? Process table entry File table entry I-node structure 38. What are the important unbuffered I/O functions? Open Read Write Seek Close 39. What are the three default file descriptors used by shell when a new program is run? Standard input - 0 Standard output - 1 Standard error Write about close function? Close function is used to close the open files. And also it releases any record locks that the process may have on the file. Syntax: int close(int filedes); 41. Explain about current file offset? It is a non-negative integer that is associated with every open file. It measures the number of bytes from the beginning of the file. This offset is initialized to 0 when a file is opened unless the 0-Append option is specified. 42. What do you mean by access permissions? CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 7
8 Access permissions are set of bits associated with each file. Access permissions can be set independently to control read, write, and execute permission for three classes of users: the file owner, a file group and every one else. 43. What is the purpose of lseek function? lseek function is used for setting the current file offset of a open file. current file offset measures the number of bytes from the beginning of the file. 44. Explain the three data structures used in file starting by the kernel? Process table File table V-node structure 45. Define atomic operation? Atomic operation refers to an operation that is composed to multiple steps. If the operation is performed atomically, either all the steps are performed, or none is performed. 46. What is the use of dup and dup2 functions? Dup and dup2 functions are used to duplicate an existing file descriptor. So that, duplicated file descriptor and the original file descriptor both are pointing to the same file table entry of the open file and their share the same file status flags(read, write, etc ) and current file offset. 47. Mention the different types of files available in Unix system? Regular file Directory file Character special file FIFO Symbolic link Block special file Socket 48. What are the macros available for identifying the file type? S_ISREG() for regular file S_ISDIR() for directory file CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 8
9 S_ISCHR() for character special file S_ISBLK() for block special file. S_ISFIFO() For FIFO file S_ISLNK() for symbolic link S_ISOCK() for socket file The argument to these macros is the st_mode member from the stat structure. 49. Define directory file? A file that contains the names of other files and pointers to information on these files. 50. Define sticky bit The bit S_ISVTX is known as sticky bit. If this bit is set for an executable program file, then the first time the program was executed a copy of the programmer s text was saved in the swap area when the process terminated. The advantage of using this is the program is loaded into memory faster the next time. 51. How will you retrieve the file status? The file status information are retrieved by using the functions stat, fstat, lstat. The stat function returns a structure of information about the named file. The fstat function obtains information about the file that is already open. The lstat function similar to stat but when the named file is a symbolic link. 52. What are the two ways to truncate a file? To empty a file, use O-TRUNC flag to open function. Two special functions to truncate a file int truncate(const char *pathname, off-t length); int ftruncate(int filedes, off-t length); 53. Write a note on rmdir function. To delete an empty directory, we can use rmdir function Syntax: int rmdir(const char *pathname); If the link count of the directory becomes 0 with this call, and no other process has the directory open, then the space occupied by the directory is freed. 54. Define sticky bit CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 9
10 The bit S_ISVTX is known as sticky bit. If this bit is set for an executable program file, then the first time the program was executed a copy of the programmer s text was saved in the swap area when the process terminated. The advantage of using this is the program is loaded into memory faster the next time. 55. Define symbolic link. A symbolic link is an indirect pointer to a file unlike the hard links. There are no file system limitations on a symbolic link and what it points to and any one can create a symbolic link to a read directory. Symbolic links are typically used to move a file or an entire directory hierarchy to some other location on a system. 56. What are the different time fields maintained for each file? Last access time of file data. Last modification time of file data. Last change time of i_node status 57. Define the purpose and format of utime function The access time and modification time of a file can be changed with the utime function. The general format is # include <sys/types.h> # include <utime.h> int utime (const char * pathname, const struct utimbuf *times); Returns 0 if OK 1 on Error 58. What are the directory routines available in POSIX.1? # include <sys/types.h> #include <dirent.h> DIR *opendir ( const char *pathname)l Returns pointer if OK NULL on error struct dirent *readdir(dir *dp); Returns pointer if OK, Null at end of directory or error void rewinddir(dir *dp); int closedir(dir *dp); Returs 0 if OK 1 on error 59. What is the major goal of buffering? CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 10
11 To use the minimum number of read and write calls. It tries to do its buffering automatically for each I/O stream 60. What are the different types of buffering is supported by UNIX? Fully buffered : In this case the actual I/ O takes place when the standard I/ O buffer is filled Line buffered: In this case the standard I/O library performs I/o when a new line character is encountered on input or output. Un-buffered: The standard I/O library does not buffer the characters. 61. Explain about fully buffered? Actual input/output takes place when the standard input/output buffer is filled. 62. Describe Line buffered? Actual input/output when a new line character is encountered on input or output. 63. When fdopen is used? fopen cannot be used to open pipes and network communication channels. So, we use special type of functions to create pipes and communication channels. These functions return file descriptors. Using fdopen, we can open special types of files by associating file descriptors with standard I/O stream. 64. Write the syntax of a function to close a stream? int fclose(file *fp); Any buffered O/P data is flushed before the file is closed. Any I/P data that may be buffered is discarded. 65. What are the functions available to write a line at a time? int fputs(const char *str, FILE *fp); int puts(const char *str); fputs writes the null terminated string to the specified stream. puts writes the null terminated string to the standard output. 66. What are the options available to determine the group ID of the new file? The group ID of the new file can be the effective group ID of the process. The group ID of the new file can be the group ID of the directory in which the file is being created. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 11
12 67. What are the system Data files? Password file Group file Hosts Networks Protocols Services 68. Describe supplementary group id? Group Ids associated with a file other than the group Id in the password file are called as supplementary Group Id. 69. What are three functions that a data file should have? A get function that reads the next record, opening the file if necessary. A set function that opens the file(if not already open) and rewinds the file. An end entry that closes the data file. 70. What are the two data files that related to login/out process? utmp maintains the details of all users currently logged in. wtmp maintains the details of all login and logouts. 71. Explain the uname function? int uname(struct utsname *name); This function return information on the current host and operating system. 72. What are the different types of unformatted I/O? Character at a time I/O Line at a time I/O Direct I/O 73. How will you position a standard I/O stream? By using the functions ftell, fseek and fgetpos and fsetpos. ftell, fgetpos: to retrieve the current byte position fseek,fsetpos: to move the file pointer to specified place 74. List down the contents of password file. User name CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 12
13 Encrypted password Numerical user ID and group ID Comment field Initial working directory Initial shell 75. What do you mean by shadow password? The duplicate copy of password file is called password file. Minimally this file has the user name and the encrypted password. Other information relating to the password is also stored here. For example system with shadow passwordsoften required to choose a new password at certain intervals. 76. What are the different functions for system s data file? A get function that reads the next record, opening the file if necessary. These functions normally return a pointer to the structure. A null pointer is returned when the end of file is reached. A set function opens the file and rewinds the file. An end entry that closes the data file. 77. How will you identify the system in POSIX.1? The system is identified by using the function uname. This function return information on the current host and operating system. 78. List down the different time conversion functions? gmtime local time mktime asctime ctime strftime 79. Write a short note on File Sharing. The kernel uses three data structures to represent an open file, and the relationships among them determine the effect one process has on another with regard to file sharing. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 13
14 1. Every process has an entry in the process table. Within each process table entry is a table of open file descriptors, which we can think of as a vector, with one entry per descriptor. Associated with each file descriptor are a. The file descriptor flags b. A pointer to a file table entry 2. The kernel maintains a file table for all open files. Each file table entry contains a. The file status flags for the file, such as read, write, append, sync, and non-blocking. b. The current file offset. c. A pointer to the v-node table entry for the file 3. Each open file (or device) has a v-node structure that contains information about the type of file and pointers to functions that operate on the file. For most files, the v-node also contains the i-node for the file. This information is read from disk when the file is opened, so that all the pertinent information about the file is readily available. For example, the i-node contains the owner of the file, the size of the file, pointers to where the actual data blocks for the file are located on disk, and so on. 80. How the system calls are executed by the kernel? All system calls are executed in the kernel mode. Typically, UNIX kernels execute the following secure seven steps on a system call: 1. Arguments (if present) for the system call are determined. 2. Arguments (if present) for the system call are pushed in a stack. 3. The state of calling process is saved in a user structure. 4. The process switches to kernel mode. 5. The system call vector is used as an interface to the kernel routine. 6. The kernel initiates the services routine and a return value is obtained from the 7. Kernel service routine. 8. The return value is converted to a c version (usually an integer or a long integer). 81. Compare and contrast the dup and fcntl function. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 14
15 Another way to duplicate a descriptor is with the fcntl function. Indeed, the call dup(filedes); is equivalent to fcntl(filedes, F_DUPFD, 0); Similarly, the call dup2(filedes, filedes2); is equivalent to close(filedes2); fcntl(filedes, F_DUPFD, filedes2); In this last case, the dup2 is not exactly the same as a close followed by an fcntl. The differences are as follows. 1. dup2 is an atomic operation, whereas the alternate form involves two function calls. It is possible in the latter case to have a signal catcher called between the close and the fcntl that could modify the file descriptors. 2. There are some errno differences between dup2 and fcntl. 82. What you mean by delayed write? Traditional implementations of the UNIX System have a buffer cache or page cache in the kernel through which most disk I/O passes. When we write data to a file, the data is normally copied by the kernel into one of its buffers and queued for writing to disk at some later time. This is called delayed write. 83. Mention the purposes of fcntl function. The fcntl function is used for five different purposes. CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 15
16 1. Duplicate an existing descriptor (cmd = F_DUPFD) 2. Get/set file descriptor flags (cmd = F_GETFD or F_SETFD) 3. Get/set file status flags (cmd = F_GETFL or F_SETFL) 4. Get/set asynchronous I/O ownership (cmd = F_GETOWN or F_SETOWN) 5. Get/set record locks (cmd = F_GETLK, F_SETLK, or F_SETLKW) 84. What are fields in password file? Description user name encrypted password numerical user ID numerical group ID comment field initial working directory initial shell (user program) user access class struct passwd member char *pw_name char *pw_passwd uid_t pw_uid gid_t pw_gid char *pw_gecos char *pw_dir char *pw_shell char *pw_class next time to change password time_t pw_change account expiration time time_t pw_expire 85. What are fields in group file? Description group name encrypted password numerical group ID struct group member char *gr_name char *gr_passwd int gr_gid array of pointers to individual user names char **gr_mem CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 16
17 CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY 17
Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions
Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions 1. What are the different parts of UNIX system? i. Programs
More informationread(2) There can be several cases where read returns less than the number of bytes requested:
read(2) There can be several cases where read returns less than the number of bytes requested: EOF reached before requested number of bytes have been read Reading from a terminal device, one line read
More informationPreview. Review. System Data Files (Password File) System Data Files (Password File) System Data Files (Password File)
Review Preview link(), unlink() System Call remove(), rename() System Call Symbolic Links Symbolic link to directory Symbolic link to a executable file symlink() System Call File Times utime() System Call
More informationFile I/0. Advanced Programming in the UNIX Environment
File I/0 Advanced Programming in the UNIX Environment File Descriptors Created and managed by the UNIX kernel. Created using open or creat system call. Used to refer to an open file UNIX System shells
More informationCS2028 -UNIX INTERNALS
DHANALAKSHMI SRINIVASAN INSTITUTE OF RESEARCH AND TECHNOLOGY,SIRUVACHUR-621113. CS2028 -UNIX INTERNALS PART B UNIT 1 1. Explain briefly details about History of UNIX operating system? In 1965, Bell Telephone
More informationRicardo Rocha. Department of Computer Science Faculty of Sciences University of Porto
Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto For more information please consult Advanced Programming in the UNIX Environment, 3rd Edition, W. Richard Stevens and
More informationFiles and Directories
Files and Directories Stat functions Given pathname, stat function returns structure of information about file fstat function obtains information about the file that is already open lstat same as stat
More informationMC1751 UNIX and Network programming. Short questions and answers
MC1751 UNIX and Network programming Short questions and answers 1. Define directory and filename A directory is a file that contains directory entries. The directory entry containing a file name along
More informationCSC 271 Software I: Utilities and Internals
CSC 271 Software I: Utilities and Internals Lecture 13 : An Introduction to File I/O in Linux File Descriptors All system calls for I/O operations refer to open files using a file descriptor (a nonnegative
More informationKINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR / ODD SEMESTER
KINGS COLLEGE OF ENGINEERING DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING ACADEMIC YEAR 2011-2012 / ODD SEMESTER Question Bank Subject Code/Name: CS1005-Unix Internals Year / Sem: IV / VII UNIT I- GENERAL
More informationSHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI
SHRI ANGALAMMAN COLLEGE OF ENGINEERING AND TECHNOLOGY (An ISO 9001:2008 Certified Institution) SIRUGANOOR, TIRUCHIRAPPALLI 621 105 DEPARTMENT OF COMPUTER SCIENCE AND ENGG. Cs 1005- UNIX INTERNALS UNIT
More informationI/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo
I/O OPERATIONS UNIX Programming 2014 Fall by Euiseong Seo Files Files that contain a stream of bytes are called regular files Regular files can be any of followings ASCII text Data Executable code Shell
More informationChp1 Introduction. Introduction. Objective. Logging In. Shell. Briefly describe services provided by various versions of the UNIX operating system.
Chp1 Objective Briefly describe services provided by various versions of the UNIX operating system. Logging In /etc/passwd local machine or NIS DB root:x:0:1:super-user:/root:/bin/tcsh Login-name, encrypted
More informationI/O OPERATIONS. UNIX Programming 2014 Fall by Euiseong Seo
I/O OPERATIONS UNIX Programming 2014 Fall by Euiseong Seo Files Files that contain a stream of bytes are called regular files Regular files can be any of followings ASCII text Data Executable code Shell
More informationFile and Directories. Advanced Programming in the UNIX Environment
File and Directories Advanced Programming in the UNIX Environment stat Function #include int stat(const char *restrict pathname, struct stat *restrict buf ); int fstat(int fd, struct stat
More informationChapter 4 - Files and Directories. Information about files and directories Management of files and directories
Chapter 4 - Files and Directories Information about files and directories Management of files and directories File Systems Unix File Systems UFS - original FS FFS - Berkeley ext/ext2/ext3/ext4 - Linux
More informationFile. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access
File File System Implementation Operating Systems Hebrew University Spring 2009 Sequence of bytes, with no structure as far as the operating system is concerned. The only operations are to read and write
More informationFile Systems Overview. Jin-Soo Kim ( Computer Systems Laboratory Sungkyunkwan University
File Systems Overview Jin-Soo Kim ( jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics File system basics Directory structure File system mounting
More informationOutline. File Systems. File System Structure. CSCI 4061 Introduction to Operating Systems
Outline CSCI 4061 Introduction to Operating Systems Instructor: Abhishek Chandra File Systems Directories File and directory operations Inodes and metadata Links 2 File Systems An organized collection
More informationLogical disks. Bach 2.2.1
Logical disks Bach 2.2.1 Physical disk is divided into partitions or logical disks Logical disk linear sequence of fixed size, randomly accessible, blocks disk device driver maps underlying physical storage
More informationSystems Programming. 08. Standard I/O Library. Alexander Holupirek
Systems Programming 08. Standard I/O Library Alexander Holupirek Database and Information Systems Group Department of Computer & Information Science University of Konstanz Summer Term 2008 Last lecture:
More informationINTERNAL REPRESENTATION OF FILES:
INTERNAL REPRESENTATION OF FILES: Every file on a UNIX system has a unique inode. The inode contains the information necessary for a process to access a file, such as file ownership, access rights, file
More informationFILE SYSTEMS. Jo, Heeseung
FILE SYSTEMS Jo, Heeseung TODAY'S TOPICS File system basics Directory structure File system mounting File sharing Protection 2 BASIC CONCEPTS Requirements for long-term information storage Store a very
More informationPROCESS CONTROL: PROCESS CREATION: UNIT-VI PROCESS CONTROL III-II R
PROCESS CONTROL: This will describe the use and implementation of the system calls that control the process context. The fork system call creates a new process, the exit call terminates process execution,
More informationCMPS 105 Systems Programming. Prof. Darrell Long E2.371
+ CMPS 105 Systems Programming Prof. Darrell Long E2.371 darrell@ucsc.edu + Chapter 3: File I/O 2 + File I/O 3 n What attributes do files need? n Data storage n Byte stream n Named n Non-volatile n Shared
More informationLinux Operating System
Linux Operating System Dept. of Computer Science & Engineering 1 History Linux is a modern, free operating system based on UNIX standards. First developed as a small but self-contained kernel in 1991 by
More informationADVANCED OPERATING SYSTEMS
ADVANCED OPERATING SYSTEMS UNIT 2 FILE AND DIRECTORY I/O BY MR.PRASAD SAWANT Prof.Prasad Sawant,Assitiant Professor,Dept. Of CS PCCCS Chichwad Prof.Prasad Sawant,Assitiant Professor,Dept. Of CS PCCCS Chichwad
More informationOperating System Labs. Yuanbin Wu
Operating System Labs Yuanbin Wu CS@ECNU Operating System Labs Project 3 Oral test Handin your slides Time Project 4 Due: 6 Dec Code Experiment report Operating System Labs Overview of file system File
More informationPROCESS STATES AND TRANSITIONS:
The kernel contains a process table with an entry that describes the state of every active process in the system. The u area contains additional information that controls the operation of a process. The
More informationLecture 23: System-Level I/O
CSCI-UA.0201-001/2 Computer Systems Organization Lecture 23: System-Level I/O Mohamed Zahran (aka Z) mzahran@cs.nyu.edu http://www.mzahran.com Some slides adapted (and slightly modified) from: Clark Barrett
More informationSystem Programming. Introduction to Unix
Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Introduction 2 3 Introduction
More informationSystem Calls. Library Functions Vs. System Calls. Library Functions Vs. System Calls
System Calls Library Functions Vs. System Calls A library function: Ordinary function that resides in a library external to the calling program. A call to a library function is just like any other function
More informationDepartment of Computer Science and Technology, UTU 2014
Short Questions 060010601 Unix Internals Unit 1 : Introduction and Overview of UNIX 1. What were the goals of Multics System? 2. List out the levels in which UNIX system architecture is divided. 3. Which
More informationFile System User API
File System User API Blunk Microsystems file system API includes the file-related routines from Standard C and POSIX, as well as a number of non-standard functions that either meet a need unique to embedded
More informationOS COMPONENTS OVERVIEW OF UNIX FILE I/O. CS124 Operating Systems Fall , Lecture 2
OS COMPONENTS OVERVIEW OF UNIX FILE I/O CS124 Operating Systems Fall 2017-2018, Lecture 2 2 Operating System Components (1) Common components of operating systems: Users: Want to solve problems by using
More informationCSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files
CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs
More informationCSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.
CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs
More informationFile Systems. What do we need to know?
File Systems Chapter 4 1 What do we need to know? How are files viewed on different OS s? What is a file system from the programmer s viewpoint? You mostly know this, but we ll review the main points.
More informationCSE 333 SECTION 3. POSIX I/O Functions
CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight Exercise 7 due Monday (out later today) POSIX Portable Operating System Interface Family of standards specified by the
More informationEECS 3221 Operating System Fundamentals
EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 General Info 3 lecture hours each week 2 assignments (2*5%=10%) 1 project
More informationEECS 3221 Operating System Fundamentals
General Info EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 3 lecture hours each week 2 assignments (2*5%=10%) 1 project
More informationCOMP 2355 Introduction to Systems Programming
COMP 2355 Introduction to Systems Programming Christian Grothoff christian@grothoff.org http://grothoff.org/christian/ 1 Processes A process is an instance of a running program. Programs do not have to
More informationCS , Spring Sample Exam 3
Andrew login ID: Full Name: CS 15-123, Spring 2010 Sample Exam 3 Mon. April 6, 2009 Instructions: Make sure that your exam is not missing any sheets, then write your full name and Andrew login ID on the
More informationUNIX Kernel. UNIX History
UNIX History UNIX Kernel 1965-1969 Bell Labs participates in the Multics project. 1969 Ken Thomson develops the first UNIX version in assembly for an DEC PDP-7 1973 Dennis Ritchie helps to rewrite UNIX
More informationCptS 360 (System Programming) Unit 6: Files and Directories
CptS 360 (System Programming) Bob Lewis School of Engineering and Applied Sciences Washington State University Spring, 2019 Motivation Need to know your way around a filesystem. A properly organized filesystem
More informationFile. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File
File File System Implementation Operating Systems Hebrew University Spring 2007 Sequence of bytes, with no structure as far as the operating system is concerned. The only operations are to read and write
More informationStandard I/O in C, Computer System and programming in C
Standard I/O in C, Contents 1. Preface/Introduction 2. Standardization and Implementation 3. File I/O 4. Standard I/O Library 5. Files and Directories 6. System Data Files and Information 7. Environment
More informationINTRODUCTION TO THE UNIX FILE SYSTEM 1)
INTRODUCTION TO THE UNIX FILE SYSTEM 1) 1 FILE SHARING Unix supports the sharing of open files between different processes. We'll examine the data structures used by the kernel for all I/0. Three data
More informationFall 2017 :: CSE 306. File Systems Basics. Nima Honarmand
File Systems Basics Nima Honarmand File and inode File: user-level abstraction of storage (and other) devices Sequence of bytes inode: internal OS data structure representing a file inode stands for index
More informationAdvanced Programming in the UNIX Environment W. Richard Stevens
Advanced Programming in the UNIX Environment W. Richard Stevens ADDISON-WESLEY PUBLISHING COMPANY Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Wokingham, England Amsterdam
More informationIntroduction. CS3026 Operating Systems Lecture 01
Introduction CS3026 Operating Systems Lecture 01 One or more CPUs Device controllers (I/O modules) Memory Bus Operating system? Computer System What is an Operating System An Operating System is a program
More informationThesis, antithesis, synthesis
Identity Page 1 Thesis, antithesis, synthesis Thursday, December 01, 2011 4:00 PM Thesis, antithesis, synthesis We began the course by considering the system programmer's point of view. Mid-course, we
More informationProcesses. Process Management Chapter 3. When does a process gets created? When does a process gets terminated?
Processes Process Management Chapter 3 1 A process is a program in a state of execution (created but not terminated) Program is a passive entity one on your disk (survivor.class, kelly.out, ) Process is
More informationPROCESS CONTROL BLOCK TWO-STATE MODEL (CONT D)
MANAGEMENT OF APPLICATION EXECUTION PROCESS CONTROL BLOCK Resources (processor, I/O devices, etc.) are made available to multiple applications The processor in particular is switched among multiple applications
More informationCSci 4061 Introduction to Operating Systems. File Systems: Basics
CSci 4061 Introduction to Operating Systems File Systems: Basics File as Abstraction Naming a File creat/open ( path/name, ); Links: files with multiple names Each name is an alias #include
More informationThis document gives a general overview of the work done by an operating system and gives specific examples from UNIX.
This document gives a general overview of the work done by an operating system and gives specific examples from UNIX. 1 Manages Resources: I/O devices (disk, keyboard, mouse, terminal) Memory Manages Processes:
More informationOperating System Labs. Yuanbin Wu
Operating System Labs Yuanbin Wu CS@ECNU Operating System Labs Project 4 (multi-thread & lock): Due: 10 Dec Code & experiment report 18 Dec. Oral test of project 4, 9:30am Lectures: Q&A Project 5: Due:
More informationCSC209 Review. Yeah! We made it!
CSC209 Review Yeah! We made it! 1 CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files 2 ... and C programming... C basic syntax functions
More informationADVANCED OPERATING SYSTEMS
ADVANCED OPERATING SYSTEMS UNIT I INTRODUCTION TO UNIX/LINUX KERNEL BY MR.PRASAD SAWANT Prof.Prasad Sawant,Assitiant Professor,Dept. Of CS PCCCS PREREQUISITES: 1. Working knowledge of C programming. 2.
More informationCS2506 Quick Revision
CS2506 Quick Revision OS Structure / Layer Kernel Structure Enter Kernel / Trap Instruction Classification of OS Process Definition Process Context Operations Process Management Child Process Thread Process
More informationCSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19
CSI 402 Lecture 11 (Unix Discussion on Files continued) 11 1 / 19 User and Group IDs Ref: Chapter 3 of [HGS]. Each user is given an ID (integer) called uid. (Most system programs use uid instead of the
More informationLecture files in /home/hwang/cs375/lecture05 on csserver.
Lecture 5 Lecture files in /home/hwang/cs375/lecture05 on csserver. cp -r /home/hwang/cs375/lecture05. scp -r user@csserver.evansville.edu:/home/hwang/cs375/lecture05. Project 1 posted, due next Thursday
More informationOperating System Review
COP 4225 Advanced Unix Programming Operating System Review Chi Zhang czhang@cs.fiu.edu 1 About the Course Prerequisite: COP 4610 Concepts and Principles Programming System Calls Advanced Topics Internals,
More informationMid Term from Feb-2005 to Nov 2012 CS604- Operating System
Mid Term from Feb-2005 to Nov 2012 CS604- Operating System Latest Solved from Mid term Papers Resource Person Hina 1-The problem with priority scheduling algorithm is. Deadlock Starvation (Page# 84) Aging
More informationFile Management 1/34
1/34 Learning Objectives system organization and recursive traversal buffering and memory mapping for performance Low-level data structures for implementing filesystems Disk space management for sample
More information(MCQZ-CS604 Operating Systems)
command to resume the execution of a suspended job in the foreground fg (Page 68) bg jobs kill commands in Linux is used to copy file is cp (Page 30) mv mkdir The process id returned to the child process
More informationThe Operating System. Chapter 6
The Operating System Machine Level Chapter 6 1 Contemporary Multilevel Machines A six-level l computer. The support method for each level is indicated below it.2 Operating System Machine a) Operating System
More informationCSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song
CSCE 313 Introduction to Computer Systems Instructor: Dezhen Song UNIX I/O Files and File Representation Basic operations: Reading / Writing Caching: File Open / Close Multiplexing: Select / Poll File
More informationUNIT III- INTER PROCESS COMMUNICATIONS Part A
UNIT III- INTER PROCESS COMMUNICATIONS Part A 1 What are the different communications supported by UNIX? Inter process communication and network communication 2 What do you mean by Inter process communication?
More informationDesign Overview of the FreeBSD Kernel CIS 657
Design Overview of the FreeBSD Kernel CIS 657 Organization of the Kernel Machine-independent 86% of the kernel (80% in 4.4BSD) C code Machine-dependent 14% of kernel Only 0.6% of kernel in assembler (2%
More informationDesign Overview of the FreeBSD Kernel. Organization of the Kernel. What Code is Machine Independent?
Design Overview of the FreeBSD Kernel CIS 657 Organization of the Kernel Machine-independent 86% of the kernel (80% in 4.4BSD) C C code Machine-dependent 14% of kernel Only 0.6% of kernel in assembler
More informationmywbut.com UNIX Operating System
UNIX Operating System 1 Lecture Notes Overview Unlike many operating systems, UNIX is not limited to specific computers using a particular microprocessor as a CPU. Instead, UNIX systems run on all sizes
More informationECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017
ECE 550D Fundamentals of Computer Systems and Engineering Fall 2017 The Operating System (OS) Prof. John Board Duke University Slides are derived from work by Profs. Tyler Bletsch and Andrew Hilton (Duke)
More informationThe UtePC/Yalnix Memory System
The UtePC/Yalnix Memory System This document describes the UtePC memory management hardware subsystem and the operations that your Yalnix kernel must perform to control it. Please refer to Handout 3 for
More informationUNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs).
UNIX: HISTORY: 1. 1969 UNIX developed (Ken Thompson). 2. 1972 UNIX rewritten using C (Dennis Ritchie). 3. 1976 UNIX (v6) released for commercial use. 4. 1978 UNIX (v7) released (ancestor of most UNIXs).
More informationwe are here Page 1 Recall: How do we Hide I/O Latency? I/O & Storage Layers Recall: C Low level I/O
CS162 Operating Systems and Systems Programming Lecture 18 Systems October 30 th, 2017 Prof. Anthony D. Joseph http://cs162.eecs.berkeley.edu Recall: How do we Hide I/O Latency? Blocking Interface: Wait
More informationSMD149 - Operating Systems - File systems
SMD149 - Operating Systems - File systems Roland Parviainen November 21, 2005 1 / 59 Outline Overview Files, directories Data integrity Transaction based file systems 2 / 59 Files Overview Named collection
More informationTypical File Extensions File Structure
CS 355 Operating Systems File Systems File Systems A file is a collection of data records grouped together for purpose of access control and modification A file system is software responsible for creating,
More informationChapter 13: I/O Systems
Chapter 13: I/O Systems Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware Operations Streams Performance 13.2 Silberschatz, Galvin
More informationFiles and Directories Filesystems from a user s perspective
Files and Directories Filesystems from a user s perspective Unix Filesystems Seminar Alexander Holupirek Database and Information Systems Group Department of Computer & Information Science University of
More informationOperating Systems. Lecture 06. System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line
Operating Systems Lecture 06 System Calls (Exec, Open, Read, Write) Inter-process Communication in Unix/Linux (PIPE), Use of PIPE on command line March 04, 2013 exec() Typically the exec system call is
More informationUNIX System Calls. Sys Calls versus Library Func
UNIX System Calls Entry points to the kernel Provide services to the processes One feature that cannot be changed Definitions are in C For most system calls a function with the same name exists in the
More informationCS 3733 Operating Systems
What will be covered in MidtermI? CS 3733 Operating Systems Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Basics of C programming language Processes, program
More informationUnix File and I/O. Outline. Storing Information. File Systems. (USP Chapters 4 and 5) Instructor: Dr. Tongping Liu
Outline Unix File and I/O (USP Chapters 4 and 5) Instructor: Dr. Tongping Liu Basics of File Systems Directory and Unix File System: inode UNIX I/O System Calls: open, close, read, write, ioctl File Representations:
More informationstructs as arguments
Structs A collection of related data items struct record { char name[maxname]; int count; ; /* The semicolon is important! It terminates the declaration. */ struct record rec1; /*allocates space for the
More informationPipes and FIFOs. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University
Pipes and FIFOs Woo-Yeong Jeong (wooyeong@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Open Files in Kernel How the Unix kernel represents open files? Two descriptors
More informationFiles. Eric McCreath
Files Eric McCreath 2 What is a file? Information used by a computer system may be stored on a variety of storage mediums (magnetic disks, magnetic tapes, optical disks, flash disks etc). However, as a
More informationUNIT I Linux Utilities
UNIT I Linux Utilities 1. a) How does Linux differ from Unix? Discuss the features of Linux. 5M b) Explain various text processing utilities, with a suitable example for each. 5M 2. a) Explain briefly
More informationFiles and Directories
Files and Directories Administrative * HW# 1 Due this week Goals: Understand the file system concepts * files, links, and directories * device independent interface Topics: * 3.0 Device independence *
More informationContents. Error Message Descriptions... 7
2 Contents Error Message Descriptions.................................. 7 3 4 About This Manual This Unify DataServer: Error Messages manual lists the errors that can be produced by the Unify DataServer
More informationADVANCED I/O. ISA 563: Fundamentals of Systems Programming
ADVANCED I/O ISA 563: Fundamentals of Systems Programming Agenda File Locking File locking exercise Unix Domain Sockets Team Projects Time File Locking Background Both high-performance and general-purpose
More informationENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS
SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Midterm Exam October 23, 2012, Duration: 80 Minutes (10 pages, 12 questions, 100 Marks) Instructor: Dr. Kamran Sartipi Question 1 (Computer Systgem)
More informationLayers in a UNIX System. Create a new process. Processes in UNIX. fildescriptors streams pipe(2) labinstructions
Process Management Operating Systems Spring 2005 Layers in a UNIX System interface Library interface System call interface Lab Assistant Magnus Johansson magnusj@it.uu.se room 1442 postbox 54 (4th floor,
More informationHyo-bong Son Computer Systems Laboratory Sungkyunkwan University
File I/O Hyo-bong Son (proshb@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Unix Files A Unix file is a sequence of m bytes: B 0, B 1,..., B k,..., B m-1 All I/O
More informationwe are here I/O & Storage Layers Recall: C Low level I/O Recall: C Low Level Operations CS162 Operating Systems and Systems Programming Lecture 18
I/O & Storage Layers CS162 Operating Systems and Systems Programming Lecture 18 Systems April 2 nd, 2018 Profs. Anthony D. Joseph & Jonathan Ragan-Kelley http://cs162.eecs.berkeley.edu Application / Service
More informationProcesses and Threads. Processes and Threads. Processes (2) Processes (1)
Processes and Threads (Topic 2-1) 2 홍성수 Processes and Threads Question: What is a process and why is it useful? Why? With many things happening at once in a system, need some way of separating them all
More informationKernel Services CIS 657
Kernel Services CIS 657 System Processes in Traditional Unix Three processes created at startup time init process 1 user-mode administrative tasks (keeps getty running; shutdown) ancestor of all of your
More informationAsynchronous Events on Linux
Asynchronous Events on Linux Frederic.Rossi@Ericsson.CA Open System Lab Systems Research June 25, 2002 Ericsson Research Canada Introduction Linux performs well as a general purpose OS but doesn t satisfy
More informationCSE 333 SECTION 3. POSIX I/O Functions
CSE 333 SECTION 3 POSIX I/O Functions Administrivia Questions (?) HW1 Due Tonight HW2 Due Thursday, July 19 th Midterm on Monday, July 23 th 10:50-11:50 in TBD (And regular exercises in between) POSIX
More informationFile I/O - Filesystems from a user s perspective
File I/O - Filesystems from a user s perspective Unix Filesystems Seminar Alexander Holupirek Database and Information Systems Group Department of Computer & Information Science University of Konstanz
More information