Educational Blog Sites

Wednesday, August 2, 2017

System Calls and System Program (2)

Lesson 2 : System Calls and System Program

2.2.2. File Manipulation
The file system will be discussed in more detail in unit 7. We first need to be able to create and delete files. Once the file is created, we need to open it and use it. We may also read, write, and reposition (rewinding it or skipping to the end of the file). Finally, we need to close the file, indicating that we are no longer using it.
We may need these same sets of operations for directories if we have a directory structure in the file system. In addition, for either files or directories, we need to be able to determine the values of various attributes, and perhaps reset them if necessary. File attributes include the file, name a file type, protection codes, accounting information, and so on. Two system calls, get file attribute and set file attribute are required for this function.
2.2.3. Device Management
Files can be thought of a abstract or virtual devices. Thus many of the system calls for files are also needed for devices. If there are multiple users of the system, we must first request the device, to ensure that we have exclusive use of it. After we are finished with the device, we must release it. Once the device has been requested (and allocated to us), we can read, write, and (possibly) reposition the device, just as with files.
2.2.4. Information Maintenance
Many system calls are used transferring information between the user program and the operating system. For example, most systems have a system call to return the current time and date. Other system calls may return information about the system, such as the number of current users, the version number of the operating system, the amount of free memory or disk space, and so on.
In addition, the operating system keeps information about all of its jobs and processes, and there are system calls to access this information. Generally, there are also calls to reset it (get process attributes and set process attributes).
The following summarizes the types of system calls normally provided by OS.
i). Process Control
a) End, Abort
b) Load
c) Create Process, Terminate Process
d)  Get Process Attributes, Set Process Attributes
e) Wait for Time
f) Wait Event, Signal Event.
ii). File Manipulation
a)  Create File, Delete File
b)  Open, Close
c)  Read, Write, Reposition
d) Get File Attributers, Set File Attributes.
iii). Device Manipulation
a) Request Device, Release Device
b)  Read, Write, Repositionc
c)  Get Device Attributes, Set Device Attributes.
iv). Information Maintenance
a) Get Time of Date, Set Time or Data
b) Get Data System, Set System Data
c) Get Processes, File or Device Attributes, Set Process, File Device Attributes.
System calls to the operating system are further classified according to the type of call. There are :
a) Normal Termination
b) Abnormal Termination
c) Status Request
d) Resource Request and
e) I/O Requests.
Share:

0 comments:

Post a Comment

Translate

Total Pageviews

Search This Blog

Blog Archive

Recent Posts