Page 46 - DCAP104_EXPOSURE_TO_COMPUTER_DISCPLINES
P. 46
Unit 3: Using Operating System
The Unix File System is a high-level organization of the resources available to processes Notes
and users. The Unix File System is organized as an acyclic directed graph with nodes
representing files and arcs representing a containment relation. Directories are nodes with
children, so contain files. Processes move around and modify the structure:
• chdir : moving to a new directory
• getcwd : get the current working directory
• opendir, closedir : open and close a directory
• readdir : read from a directory
• stat, fstat : Retrieving file status information
• link, unlink : create and release a hard link (an alias for a file.)
• symlink : create a soft link (a pointer to another file)
3. The Operating System: I/O Operation
Unix uses a uniform device interface that allows the same I/O calls to be used for terminals,
disks, audio and network communication. Unix provides a universal interface for I/O:
• open : open a file or device for I/O operations
• close : close a file or device from I/O operations
• read : read from a file or device
• write : write to a file or device
• Refined I/O control:
— fcntl : getting and setting attributes of an open file
— ioctl : getting device status information and setting device control options
— poll,select : handling I/O from multiple sources
4. The Operating System: Interprocess Communication
Concurrently running processes need to communicate to work together effectively. Unix
provides a variety of means for processes to communicate with each other:
• pipe : a one-way data stream between related processes.
• mkfifo : a one-way data stream between unrelated precesses (called a named pipe or
FIFO)
• System V IPC: refined communication channels for unrelated processes
— Message Queues : Linked lists of messages stored in the operating system
— Shared Memory : Allows two processes to share a given region of memory
— Semaphores : Provides controlled access to a shared object
• Sockets : Two-way data stream, used to establish Network connections.
5. The Operating System: System Information
Unix provides means for accessing information about the system for process use or
accounting:
• Special directories which provide Start-up and Run-time information. Some of thefiles
are specially configured, so provide special functions to retrieve information.
LOVELY PROFESSIONAL UNIVERSITY 39