OPERATING SYSTEMSOS Linux

5) Process Management | UNIX LINUX History, Basic Shell Commands: ps aux,ef, S, R, s, use of &, init

System Calls:
getpid() and getppid() are system calls used to get the process ID (PID) of the calling process and the PID of the parent of the calling process, respectively.
fork() is used to create a new process, which is a copy of the process that called it.
Orphan & Zombie Processes:

An orphan process occurs when the parent process finishes before its child process.
A zombie process is created when a child process finishes, but its parent process has not yet called wait() to read its exit status.
System Calls for File Operations:

fread()/fscanf() and fwrite()/fprintf() are library functions used to read from and write to files, respectively.
Data Access Synchronization:

Illustrates the potential problems that can occur when multiple processes or threads access shared data concurrently without proper synchronization.
System Call Wrappers:

Wrappers like fork(), pipe(), etc., in unistd.h provide a higher-level interface to system calls.
They abstract away the complexities of making system calls directly, such as dealing with low-level binary interfaces or embedded assembly code.
POSIX:

POSIX stands for Portable Operating System Interface, a family of standards for compatibility between operating systems.
It was initiated around 1985, and Richard Stallman suggested the name.
Direct System Call Invocation:

While wrapper functions are common, it’s possible to invoke system calls directly using the syscall() function for unsupported or custom system calls.
System Call Numbers:

Each system call has an associated number, like SYS_exit, SYS_fork, etc., which are used when invoking system calls directly.
Register Usage in System Calls:

Different architectures use different registers to pass arguments to system calls, as shown in the provided tables.
Example Code:

The example C code demonstrates how to use syscall() to invoke system calls directly, bypassing the wrapper functions.

✷This channel,My College NIT Durgapur, is a showcase of the lectures that were delivered in the National Institutes of Technology Durgapur.🔥🔥🔥

✷The motive of this channel is to store lectures 😍😍😍 for future online reference ❤️❤️❤️which can be accessed by everyone😍🔥 and some inside view of the campus🔥 to keep a memory❤️❤️❤️ of us.
✷Website: https://nitdgp.ac.in
✷If any one miss any lecture, can attend these to overcome his/her backlog. 🔥🔥🔥

✷This channel is NOT meant for Advertising.❤️❤️❤️

✷Search By:
Engineering
Nit
nit
Dgp
dgp
durgapur
#nitdurgapur
#nitdgp
#nit
#mylearningnitdgp
#mycollegenitdurgapur

source

by My College NIT Durgapur

linux foundation