0% found this document useful (0 votes)
38 views4 pages

Os Experiment Number 1

The lab session focuses on studying the hardware and software requirements of various operating systems, including UNIX, LINUX, and Windows versions. It involves executing UNIX system calls related to process management, file management, and input/output operations, as well as basic UNIX commands for file handling and system monitoring. The conclusion highlights the practical experience gained in managing processes and files within UNIX/Linux environments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views4 pages

Os Experiment Number 1

The lab session focuses on studying the hardware and software requirements of various operating systems, including UNIX, LINUX, and Windows versions. It involves executing UNIX system calls related to process management, file management, and input/output operations, as well as basic UNIX commands for file handling and system monitoring. The conclusion highlights the practical experience gained in managing processes and files within UNIX/Linux environments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Lab Practical: Study of Hardware/Software Requirements of Various Operating Systems &

UNIX System Calls

Objective

The objective of this lab session is to:

1. Study the hardware and software requirements of different operating systems


(UNIX, LINUX, Windows XP, Windows 7/8).

2. Execute various UNIX system calls, including:

o Process Management

o File Management

o Input/Output System Calls

3. Execute basic UNIX commands for file handling, system monitoring, and process
control.

Part I: Study of Hardware & Software Requirements of Various Operating Systems

1. Study of Different Operating Systems

Analyze the hardware and software requirements, compatibility, security, and GUI of:

 UNIX

 LINUX (Ubuntu, Fedora, etc.)

 Windows XP

 Windows 7/8

Part II: UNIX System Calls Execution

1. Process Management System Calls

System
Description Command Example
Call

fork() Creates a child process echo $$ (prints current process ID)

exec ls (replaces current shell with ls


exec() Replaces the current process image
command)
System
Description Command Example
Call

Waits for a child process to finish wait <PID> (replace <PID> with an actual
wait()
execution process ID)

exit() Terminates a process kill -9 <PID>

getpid() Retrieves process ID echo $$

getppid() Retrieves parent process ID echo $PPID

Example Commands to Execute:

2. File Management System Calls

System Call Description Command Example

open() Opens a file touch myfile.txt (creates an empty file)

read() Reads from a file cat myfile.txt (displays contents)

write() Writes to a file echo "Hello World" > myfile.txt

close() Closes a file exit (closes the terminal session)

unlink() Deletes a file rm myfile.txt

Example Commands to Execute:

3. Input/Output System Calls

System Call Description Command Example

printf() Outputs formatted text echo "Hello, World!"

scanf() Takes formatted input read var; echo $var

getchar() Reads a single character read -n 1 var; echo $var

putchar() Writes a single character echo "A"

fopen() Opens a file nano myfile.txt

fclose() Closes a file CTRL + X (to exit nano editor)

Example Commands to Execute:


Part III: Execution of UNIX Commands

1. File Management Commands

Command Description Example

ls List files in a directory ls -l

cd Change directory cd /home/user

mkdir Create a new directory mkdir mydir

rmdir Remove an empty directory rmdir mydir

cp Copy a file cp file1 file2

mv Move/Rename a file mv old new

rm Delete a file rm file.txt

Example Commands to Execute:

2. Process Management Commands

Command Description Example

ps Show active processes ps -aux

kill Terminate a process kill -9 <PID>

top Show real-time process info top

who Show logged-in users who

Example Commands to Execute:

3. System Information & Utility Commands

Command Description Example

uname Show system info uname -a

df Show disk space usage df -h

man Show manual pages man ls

cal Show calendar cal 2025

date Show current date/time date


Command Description Example

echo Print text echo "Hello"

grep Search for patterns in files grep "word" file.txt

Example Commands to Execute:

Conclusion

This lab covered:


Study of hardware/software requirements of different operating systems.
Execution of process, file, and I/O system calls in UNIX/Linux.
Hands-on Linux commands for file management, process control, and system monitoring.

You might also like