Types of System Calls

Neso Academy
20 Mar 201811:22

Summary

TLDRThis lecture delves into the classification of system calls, categorizing them into five key groups: Process Control, File Manipulation, Device Management, Information Maintenance, and Communications. It explains the purpose of each category, providing examples of system calls such as 'End', 'Abort', 'Create file', 'Delete file', and 'Request device'. The lecture aims to clarify the roles these calls play in controlling processes, managing files and devices, maintaining system information, and facilitating inter-process communication, offering a foundational understanding for further study in operating systems.

Takeaways

  • πŸ“š System calls can be categorized into five major types: Process Control, File Manipulation, Device Management, Information Maintenance, and Communications.
  • πŸ”„ Process Control system calls are used for controlling the execution and termination of processes, including creating, ending, and aborting processes.
  • πŸ“ File Manipulation system calls deal with file operations such as creating, deleting, opening, closing, reading, writing, and setting attributes of files.
  • πŸ–₯️ Device Management system calls are involved in managing input/output devices and other system devices, including requesting, releasing, and setting device attributes.
  • πŸ—‚οΈ Information Maintenance system calls are used for maintaining system information like time, date, and system data, as well as getting and setting attributes of processes, files, and devices.
  • πŸ”— Communication system calls facilitate inter-process communication, including creating and deleting communication connections, sending and receiving messages, and transferring status information.
  • πŸ›‘ 'End' and 'Abort' are examples of system calls used to terminate processes normally or due to errors, respectively.
  • πŸ”Œ 'Load' and 'Execute' system calls are used to load and run processes within the system.
  • πŸ”„ 'Get' and 'Set' operations are common in system calls, allowing for the retrieval and modification of attributes for processes, files, and devices.
  • ⏱️ 'Wait for time' and 'Wait event' system calls are used for processes that need to wait for their turn to execute or for specific events to occur.
  • πŸ“ˆ Scheduling algorithms, which will be discussed later, are related to how processes wait for their execution time, highlighting the importance of system calls in process management.
  • πŸ”— Logically attaching and detaching devices is different from physical attachment, where the OS needs to recognize the presence and readiness of a device for use.

Q & A

  • What are the five major categories of system calls mentioned in the lecture?

    -The five major categories of system calls are Process Control, File Manipulation, Device Management, Information Maintenance, and Communications.

  • What does 'Process Control' involve in terms of system calls?

    -Process Control involves system calls used for controlling processes, including ending or aborting processes, loading and executing processes, creating and terminating processes, getting and setting process attributes, waiting for time, waiting for events, signaling events, and allocating and freeing memory.

  • Can you give an example of a system call under the 'Process Control' category?

    -An example of a system call under Process Control is 'End' or 'Abort', which are used to end a process in a normal way or halt it when an error occurs.

  • What is the purpose of 'File Manipulation' system calls?

    -'File Manipulation' system calls are used for managing and manipulating files, such as creating, deleting, opening, closing, reading, writing, and re-positioning files, as well as getting and setting file attributes.

  • What are some examples of 'File Manipulation' system calls?

    -Examples of 'File Manipulation' system calls include 'Create file', 'Delete file', 'Open', 'Close', 'Read', 'Write', and 'Re-position'.

  • What does 'Device Management' involve in the context of system calls?

    -'Device Management' involves system calls used for managing and manipulating devices, including requesting and releasing devices, reading, writing, re-positioning, getting and setting device attributes, and logically attaching and detaching devices.

  • How is 'Logically attaching' a device different from 'Physically attaching' a device?

    -Logically attaching a device means that the operating system recognizes and prepares the device for use, whereas physically attaching a device involves physically connecting it to the system, like plugging in a flash drive.

  • What is the role of 'Information Maintenance' system calls?

    -'Information Maintenance' system calls are used for maintaining and updating information about the system, such as getting or setting the time, date, system data, and attributes of processes, files, or devices.

  • What are 'Communication' system calls and what do they enable?

    -'Communication' system calls are used for enabling communication between processes or different devices, including creating or deleting communication connections, sending or receiving messages, transferring status information, and attaching or detaching remote devices.

  • Can you provide an example of a 'Communication' system call?

    -An example of a 'Communication' system call is 'Create' or 'Delete communication connection', which are used to establish or terminate a connection between two processes that need to communicate.

  • How does the lecture script help in understanding the different types of system calls?

    -The lecture script provides a structured explanation of the five major categories of system calls, along with examples for each category, helping to clarify the purpose and function of different system calls in operating systems.

Outlines

00:00

πŸ” Overview of System Call Categories

The lecture introduces the concept of system calls and categorizes them into five major groups: Process Control, File Manipulation, Device Management, Information Maintenance, and Communications. The first category, Process Control, involves system calls that manage and control processes. Examples include ending or aborting processes, loading and executing processes, creating and terminating processes, and handling process attributes and memory. This category is essential for the smooth execution and termination of processes, whether under normal or abnormal conditions.

05:03

πŸ“‚ File Manipulation System Calls

This section discusses system calls related to file manipulation or management, which is the second category. These system calls include creating, deleting, opening, and closing files, as well as reading, writing, and re-positioning file data. The lecturer uses a previous example where the contents of an input file were copied to an output file to illustrate how these system calls are applied in practice. The system calls mentioned are crucial for managing files within an operating system, ensuring proper file handling and manipulation.

10:03

πŸ’» Device Management System Calls

The third category, Device Management, involves system calls that manage and manipulate devices within the system, such as input/output devices. These include requesting and releasing devices, reading and writing data to devices, and logically attaching or detaching devices. The concept of logical attachment, distinct from physical attachment, is explained using the example of a pen-drive. This category ensures that devices are properly accessed, used, and released by processes, maintaining system stability and resource allocation.

πŸ› οΈ Information Maintenance System Calls

The fourth category, Information Maintenance, covers system calls responsible for maintaining and updating system information like time, date, and system data. Examples include getting and setting the system's time and date, as well as attributes of processes, files, and devices. These system calls are critical for ensuring that the system's information is accurate and up-to-date, which is necessary for overall system management and functionality.

πŸ“‘ Communication System Calls

The final category discussed is Communication, which includes system calls that enable communication between processes or devices. These calls are necessary for creating and deleting communication connections, sending and receiving messages, and transferring status information. Additionally, the attachment and detachment of remote devices fall under this category. These system calls are vital for ensuring that processes can interact and share information effectively, facilitating coordinated execution and resource sharing.

Mindmap

Keywords

πŸ’‘System Call

A system call is a programmatic way in which a computer program requests a service from the kernel of the operating system. It is a key concept in this video, as the lecture is focused on explaining the different types of system calls and how they enable processes to interact with the operating system. The video categorizes system calls into five main types: Process Control, File Manipulation, Device Management, Information Maintenance, and Communication.

πŸ’‘Process Control

Process Control refers to the category of system calls used to control the execution of processes in an operating system. These include operations like ending, aborting, creating, and terminating processes. For example, 'End' is a process control system call used to terminate a process normally after it completes execution, while 'Abort' halts a process abnormally in case of an error.

πŸ’‘File Manipulation

File Manipulation is a category of system calls that manage files within the operating system. These include creating, deleting, opening, closing, reading, and writing files. The video explains that these system calls are essential for tasks like copying the contents of one file to another, which requires creating, opening, reading, and writing files.

πŸ’‘Device Management

Device Management involves system calls that manage the input/output devices of a computer system. These include requesting and releasing devices, reading and writing to devices, and logically attaching and detaching devices. The video highlights how these system calls allow processes to interact with hardware devices like pen-drives, by first requesting access to the device and then releasing it after use.

πŸ’‘Information Maintenance

Information Maintenance refers to the category of system calls that manage system information, such as time, date, and system data. These calls include getting and setting the time or date, as well as getting and setting attributes of processes, files, or devices. The video explains that these system calls ensure that the system's information is properly maintained and updated, such as keeping track of the current time.

πŸ’‘Communication

Communication system calls are used for enabling communication between processes or devices within the operating system. Examples include creating and deleting communication connections, sending and receiving messages, and transferring status information. The video discusses how these system calls are crucial for processes to communicate with each other, report their status, and coordinate their activities.

πŸ’‘End

'End' is a system call under the Process Control category that terminates a process once it has completed its execution normally. The video uses this example to explain how processes are controlled within an operating system, highlighting the difference between normal termination ('End') and abnormal termination ('Abort').

πŸ’‘Abort

'Abort' is a system call used to halt a process abnormally when an error occurs during its execution. It falls under the Process Control category of system calls. The video contrasts 'Abort' with 'End', explaining that while 'End' is used for normal process termination, 'Abort' is used when the process needs to be forcibly stopped due to an issue.

πŸ’‘Logically Attach/Detach

Logically Attach/Detach refers to system calls that manage the logical connection or disconnection of devices to the system, as opposed to physically plugging or unplugging them. The video explains that logically attaching a device means the operating system recognizes the device and makes it ready for use, while logically detaching involves safely removing the device from the system, such as ejecting a pen-drive.

πŸ’‘Create/Terminate Process

'Create Process' and 'Terminate Process' are system calls within the Process Control category that handle the creation and termination of processes. The video describes how these system calls are fundamental to the management of processes in the operating system, allowing new processes to be initiated and existing ones to be properly closed.

Highlights

System calls can be categorized into five major types, each serving a distinct purpose in operating systems.

Process Control system calls are used for managing the execution and termination of processes, including normal and abnormal halting.

Examples of Process Control system calls include 'End', 'Abort', 'Load', 'Execute', 'Create Process', and 'Terminate Process'.

System calls for 'Get process attributes' and 'Set process attributes' allow for the retrieval and modification of process properties.

The 'Wait for time' system call enables processes to wait for their turn in the scheduling queue.

Communication between processes is facilitated by system calls such as 'Wait event' and 'Signal event'.

Memory management for processes is addressed by 'Allocate' and 'Free' system calls, ensuring efficient use of system resources.

File Manipulation system calls include 'Create file', 'Delete file', 'Open', 'Close', 'Read', 'Write', and 'Re-position'.

File attributes can be managed with 'Get file attributes' and 'Set file attributes' system calls, enhancing file handling capabilities.

Device Management system calls, such as 'Request device' and 'Release device', handle the allocation and deallocation of devices.

Logically attaching and detaching devices is managed by specific system calls, distinguishing it from physical attachment.

Information Maintenance system calls, like 'Get time or date' and 'Set time or date', are crucial for system information management.

System data, as well as attributes of processes, files, and devices, can be retrieved and modified through Information Maintenance system calls.

Communication system calls are essential for inter-process communication, including creating and deleting communication connections.

Processes can send and receive messages and transfer status information using Communication system calls, facilitating process interaction.

Attaching and detaching remote devices is managed through Communication system calls, highlighting their role in device connectivity.

A comprehensive overview of system calls and their categorization provides a foundational understanding for further study in operating systems.

Transcripts

play00:00

In the previous lecture we have studied the system call.

play00:03

And, in this lecture we will see the types of system calls.

play00:06

So, system calls can be grouped roughly into five major categories.

play00:11

So, we will see how can we group the system calls into five categories,

play00:16

and what are the differences between these categories of system calls.

play00:20

So, here we have the five categories of system calls.

play00:23

The first one is 'Process Control',

play00:25

second is 'File Manipulation',

play00:28

third is 'Device Management',

play00:30

fourth is 'Information Maintenance', and fifth is 'Communications'.

play00:34

So, theses are the five groups or five major categories of system calls.

play00:39

And, all the system calls that we have

play00:41

can be roughly grouped into theses five major categories.

play00:45

Now, let us see what are the meaning of these five categories

play00:49

one by one and we will see how they are different from each other.

play00:53

Alright! so, let's start with the first one , which is 'Process Control'.

play00:57

So, by process control what we mean is

play00:59

the system calls that are used for controlling the processes.

play01:04

So, we know that there are various processes running in our system

play01:07

and all these processes are need to be controlled.

play01:10

For example, when a process is running,

play01:13

it has to run and it has to terminate or halt either normally or abnormally.

play01:20

So, by normally what I mean is that

play01:22

The process should come to halt when it completes its execution.

play01:26

Otherwise, there might also be errors occurring in the process.

play01:30

So, if an error occurs in the execution of a process

play01:33

then that process has to be halted or aborted.

play01:37

So, that is what we mean by halting abnormally.

play01:40

So, the system calls sets are used for controlling the processes

play01:44

for under this category of process control system call.

play01:47

So, here are some examples,

play01:49

We have 'End' or 'Abort'.

play01:51

So, by 'End' we mean that

play01:52

to end the process in a normal way when it completes its execution.

play01:57

And, by 'Abort' we mean to halt the process when it encounters an error.

play02:02

So, that is what we mean by 'End' and 'Abort'.

play02:05

Then we have the 'Load' and 'Execute'.

play02:07

So, by 'Load' we mean to load a process and by 'Execute we mean to execute a process.

play02:12

Then we have 'Create Process' and 'Terminate Process' .

play02:15

So, for creating a process

play02:17

or for terminating a process also, we need system calls.

play02:20

They all fall under these categories of process control system calls.

play02:24

And, then we have 'Get process attributes' and 'set process attributes' for

play02:29

getting and setting the attributes of our processes.

play02:32

And then we have 'Wait for time'.

play02:34

This means that some of the processes need to wait for their time to come.

play02:40

So, that they can begin their executions.

play02:42

So, this will be clear when we will study the scheduling algorithms,

play02:45

which we will discuss later on.

play02:47

So, a process may need to wait for its time of execution.

play02:52

For that also we need a system call.

play02:54

Then we have 'Wait event' and 'signal event'.

play02:57

So, a process may need to wait for an event or need to signal an event.

play03:01

Then we have 'Allocate' and 'free' memory.

play03:04

That means when a process is going to be executed,

play03:07

it may needs access to the memory.

play03:10

So, we may have to allocate the memory for a process

play03:14

And, when the process finishes its executions,

play03:17

that memory which was allocated to the process has to be freed.

play03:21

So, that is what we mean by 'free memory'.

play03:23

So, these are all examples of system calls

play03:26

that we use for controlling the processes.

play03:29

So, they all fall under the category of process control system calls.

play03:33

So, that is the first one.

play03:34

Alright!

play03:35

So, now let's go to the second one.

play03:37

So, the second one is file manipulation or file management.

play03:40

These are the system calls that are used for

play03:44

manipulating or managing your files.

play03:46

For example, we have 'Create file' and 'Delete file'.

play03:50

That is used for creating and deleting files.

play03:52

Then we have 'Open' and 'Close' for opening and closing files.

play03:57

Then we have 'Read', 'Write', and 'Re-position'.

play04:00

Then we have 'Get file attributes' and 'Set file attributes'.

play04:04

So, in the previous lecture when we were discussing system calls

play04:07

I took an example to explain system calls.

play04:10

The example was to copy the contents of an input file to an output file.

play04:15

So, there what we did,

play04:17

We were searching for an input file,

play04:19

and then we read from the input file and created an output file,

play04:24

and we were copying the contents from the input file

play04:27

and writing in on to the output file.

play04:30

So, those system calls fall under this category of file manipulation.

play04:35

So, we see in the previous example

play04:37

we were creating the output file.

play04:39

So, we use this create file.

play04:42

And, then we open the input file,

play04:44

for that we have used the 'open'.

play04:46

Then we were reading the data from the input file, for that we can use 'Read'.

play04:50

And, then we were writing the data to the output file,

play04:53

for that, we can use the 'Write'.

play04:54

And, after everything was done, we close the files.

play04:57

So for that we can use the 'Close'.

play04:59

So, these are the examples of system calls

play05:02

that are used for file management or file manipulation,

play05:06

which falls under this category.

play05:08

Alright! so, now let's go to the third one.

play05:10

The third one is device manipulation.

play05:13

So, device manipulation or device management are the

play05:17

group of system calls that are used for

play05:20

managing and manipulating your devices.

play05:22

Devices means the input/output devices and other devices in your system.

play05:28

So, for example, we have 'Request device' and 'Release device'.

play05:32

So, a process may need access to a certain device.

play05:36

So, at that time it will need to request device.

play05:39

So, 'request device' is a system call.

play05:41

And, after that particular process finishes using the device,

play05:45

that device has to be released.

play05:47

this is what we mean by 'release device'.

play05:49

Then similarly we have 'Read', 'Write', and 'Re-position' , same as above.

play05:53

Then we also have 'get device attribute' and 'set device attribute'

play05:58

for getting and setting the device attributes.

play06:01

Then we have logically 'attach' and 'detach' devices.

play06:05

So, this means that these are the system calls that are used for

play06:08

logically attaching or detaching devices.

play06:11

Now, what is the meaning of logically attaching?

play06:14

Logically attaching is a little bit different from physically attaching.

play06:18

Physically attaching a device means,

play06:20

you physically plugged a device into your system.

play06:23

So, let me give you an example.

play06:24

So, let's say that you have a pen-drive or a flash-drive.

play06:27

Physically attaching would mean that you plug it into your system manually.

play06:32

Now, logically attaching means that,

play06:34

the operating system needs to understand that

play06:37

the device has been attached is ready for use.

play06:40

So, that is what we mean by logically attaching.

play06:43

And, then logically detaching means

play06:45

you are logically removing that device from your system.

play06:50

For example, after you use your pen-drives,

play06:53

you may right-click on the icon of the pen-drive and choose eject

play06:57

or you may choose safely remove hardware.

play07:00

So, when you do that, you can see the pen-drive is removed from your system

play07:04

though it is physically plugged in.

play07:06

So, that is an example of logically detaching the devices.

play07:10

So, that is just a simple example.

play07:12

There could also be many examples regarding this.

play07:15

So, what we need to understand is that

play07:17

all the system calls that are used for managing or manipulating these

play07:22

devices, they fall under this device manipulation system calls.

play07:27

Alright! now, let's go to the fourth one.

play07:29

So, the fourth one is information maintenance.

play07:32

So, by information maintenance what we mean is that

play07:36

all the information that we have about our system

play07:39

must be maintained and updated.

play07:41

For example, the date and the time.

play07:44

So, the system calls, used for maintaining the information of your system

play07:50

fall under this category of information maintenance system call.

play07:54

So, here we have examples like 'get time or date' and 'set time or date'.

play07:59

So, this means that we get the time or date and then we set the time or date.

play08:04

Then we have get system data and set system data.

play08:07

So, like time and date, we can get or set the system data.

play08:12

Then we have get process, file, or device attributes.

play08:16

So, we can get the attributes of the processes, the files or the devices.

play08:21

And, then we have set process, files, or device attributes.

play08:25

So, we can get the attributes of the files, processes and devices

play08:29

and we can set the attributes of the processes, files or devices.

play08:34

So, all this kinds of system calls that are related to

play08:38

maintaining the information of your system

play08:40

are fall under this category of information maintenance system call.

play08:44

Now, let's go to the last one,

play08:46

So, the last one is communication system calls.

play08:49

So, communication system calls are those system calls,

play08:52

which are used for communication between processes

play08:57

or between different devices.

play08:58

So, as I already told you, the processes need to communicate with each other.

play09:03

So, when a process is executing, it may need to access an another process.

play09:08

So, they may need to communicate with each other,

play09:10

or they may need to know the status of each other.

play09:12

So, in that way there needs to be constant communication between the processes.

play09:17

So, the system calls, related to the communications

play09:21

fall under this category.

play09:22

So, for example we have 'create' or 'delete' communication connection.

play09:26

So, when two processes are going to communicate with each other

play09:30

there need to be a connection between them.

play09:33

So, we need to create the connection,

play09:35

and after the communication is complete, we need to delete the connection.

play09:39

So, for creating and deleting the communication connections,

play09:42

we need system calls.

play09:44

And, this is an example of that.

play09:45

Then we have 'send' or 'receive' messages.

play09:48

So, as the processes communicate to each other,

play09:50

they may need to send or receive messages with each others.

play09:54

So, this is an another example of the system call.

play09:56

Then, we have transfer status information.

play09:59

that means, when the processes communicate with each other

play10:02

they may need to report the current status of that particular process.

play10:06

So, a process may need to say "yes, I have completed my execution".

play10:10

or it may have to say "I need access to this particular resource".

play10:14

So, in that way the process is transferring its status information.

play10:18

Then we have attach or detach remote devices.

play10:22

So, there may be remote devices attach to the system

play10:25

or which may have to be attach to the system.

play10:27

So, for attaching and detaching those devices,

play10:31

we need this communication.

play10:33

Because these are the remote devices,

play10:35

so, communication is require to attach or detach them.

play10:38

So, all these system calls that are related to communications

play10:43

are fall under this category of communication system call.

play10:47

Alright!

play10:48

So, those were the major five categories of system calls that we have.

play10:53

So, let's just have a recap of them.

play10:55

Process control, File manipulation, Device management,

play10:58

Information maintenance, and Communication.

play11:01

So, these are the five major categories

play11:04

in which you can group your system calls.

play11:07

So, I hope this was clear to you.

play11:08

Thank you for watching and see you in the next one.

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
System CallsProcess ControlFile ManipulationDevice ManagementInformation MaintenanceCommunicationOperating SystemsTech EducationSystem AttributesProcess SchedulingDevice Access