Professional Documents
Culture Documents
Practical File
Operating System Lab
BCA-401P
Submitted To Submitted By
Mr. Dhanish Tandon SUYASH SHARMA
ASSOCIATE PROFESSOR Roll No-220031150040
INDEX
( this) ( to this )
Example-
C:\cd SUYASH
5. COPY COMMAND - The COPY command is used to copy the file and
move the file to another location or folder or drive.
Syntax-
C: \> Copy <File Name><New Name>
C: \> Copy <Path File Name><Target Drive>
Example-
C:> Copy C:\ABC*.* D:\sonu and Press enter.
C:\>date
The current date is: 10/12/2021
Enter the new date: (dd-mm-yy) 09/12/2021
0- Black 8- Gray
Syntax-
color (attribute)
Example-
C:\Users\SUYASH>color a
1. FORMAT:
Syntax: FORMAT [drive:] [/V:label] [/Q] [/F:size] [/S] [/U] [/C]
Explanation: Formats a disk or drive.
2. CHKDSK:
Syntax: CHKDSK [drive:] [/F] [/R]
Explanation: Checks a disk for errors and attempts to fix them.
3. DISKCOPY:
Syntax: DISKCOPY [drive1: [drive2:]] [/V] [/B]
Explanation: Copies the entire contents of one disk to another.
4. ATTRIB:
Syntax: ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H] [drive:][path][filename]
Explanation: Modifies file attributes such as Read-only, Archive, System, and
Hidden.
5. XCOPY:
Syntax: XCOPY source [destination] [/E] [/S] [/V] [/P] [/Q]
Explanation: Copies files and directories, including subdirectories.
6. EDIT:
Syntax: EDIT [filename]
Explanation: Opens a simple text editor.
7. DEBUG:
Syntax: DEBUG
Explanation: A debugging tool that allows low-level programming and editing
of binary files.
8. TREE:
Syntax: TREE [drive:][path]
Explanation: Displays a graphical representation of the directory structure.
9. FDISK:
Syntax: FDISK
220031150040 SUYASH SHARMA
P a g e | 10
10. DELTREE:
Syntax: DELTREE [/Y] [drive:][path]
Explanation: Deletes a directory and all its contents.
11. MOVE:
Syntax: MOVE [drive:][path]filename1 [drive:][path]filename2
Explanation: Moves a file from one location to another.
12. FIND:
Syntax: FIND "string" [drive:][path]filename
Explanation: Searches for a specific string in a file or set of files.
13. SORT:
Syntax: SORT [drive:][path]filename [/O outputfile]
Explanation: Sorts the contents of a text file and displays the result or saves it
to another file.
14. COMP:
Syntax: COMP [drive1:][path1]filename1 [drive2:][path2]filename2 [/A] [/L]
Explanation: Compares the contents of two files byte by byte.
15. FC:
Syntax: FC [drive1:][path1]filename1 [drive2:][path2]filename2 [/A] [/L] [/N]
[/C]
Explanation: Compares two files or sets of files and displays the differences
between them.
Hardware Requirements:
2. Memory (RAM): The minimum RAM requirement varies, but typically a UNIX
system can run with 512 MB to 1 GB of RAM. However, for better performance
and to accommodate more processes, it is recommended to have at least 2-4
GB of RAM.
Software Requirements:
2. Boot Loader: The UNIX distribution will typically come with a boot loader,
such as GRUB or LILO, which allows you to select the operating system to boot
when you start your computer.
3. File System: UNIX supports various file systems, including ext4, XFS, ZFS,
and UFS. The specific file system you use will depend on the UNIX distribution
and your requirements.
Hardware Requirements:
Processor: Linux supports a wide range of processors, including x86, x86-64, ARM,
SPARC, and PowerPC. The specific requirements will depend on the distribution and
the software packages you plan to use.
Memory (RAM): The minimum RAM requirement varies, but most Linux distributions
can run with 1 GB to 2 GB of RAM. However, for smoother performance and to
accommodate more demanding applications, it is recommended to have at least 4 GB
of RAM.
Storage: Linux distributions typically require several gigabytes of disk space for
installation. The actual disk space needed will depend on the distribution and the
software packages you choose to install. A minimum of 10-20 GB of disk space is
generally recommended.
Network Interface: A network interface card (NIC) is required if you want to connect
your Linux system to a network.
Software Requirements:
Linux Distribution: Choose a specific Linux distribution based on your needs and
preferences. Some popular Linux distributions include Ubuntu, Fedora, CentOS,
DEBIAN, and Linux Mint. Each distribution has its own hardware and software
requirements, so it's important to consult the specific documentation for the
distribution you choose.
Boot Loader: Linux distributions typically come with a boot loader, such as GRUB or
LILO, which allows you to select the operating system to boot when you start your
computer.
File System: Linux supports various file systems, including ext4, XFS, and BTRFs. The
specific file system you use will depend on the distribution and your requirements.
Graphical Environment (Optional): If you prefer a graphical user interface (GUI), you
may need to install a desktop environment, such as GNOME, KDE, or XFCE, along
with the required display drivers.
Again, it's important to note that these are general requirements, and the specific
hardware and software requirements can vary depending on the Linux distribution
you choose and the intended use of your system. Always refer to the documentation
or system requirements provided by the specific Linux distribution for accurate and
up-to-date information.
Hardware Requirements
Software Requirements
1. Operating System: Windows 7 is the operating system itself.
2. Display: A monitor capable of at least 800x600 resolution (higher resolutions
are recommended)
3. Internet Connection: Some features of Windows 7, such as Windows Update,
require an internet connection.
4. Optional: DVD/CD drive if you plan to install Windows 7 from a disc.
It's important to note that these are the minimum recommended requirements,
and for optimal performance, it's often beneficial to have more powerful
hardware, such as a faster processor, more RAM, and a larger hard disk space.
Additionally, some software applications or games may have their own specific
requirements that go beyond the minimum system requirements of Windows 7.
Hardware Requirements:
1. Processor: 1 GHz or faster processor with at least 2 cores (64-bit)
2. Memory (RAM): 4 GB RAM or more
3. Storage: 64 GB of available hard disk space or more
4. Graphics: DirectX 9 or later with WDDM 2.0 driver
5. Display: A monitor capable of at least 800x600 resolution (higher resolutions
are recommended).
Software Requirements:
1. Operating System: Windows 10 is the operating system itself.
2. Internet Connection: Some features of Windows 10, such as Windows
Update and online services, require an internet connection.
3. Microsoft Account: While not mandatory, having a Microsoft account can
enable access to additional features and cloud-based services.
It's important to note that these are the recommended requirements, and the
actual hardware and software requirements may vary depending on the
specific usage scenario and software applications you intend to run. Certain
resource-intensive applications or games may have their own specific
requirements beyond the minimum system requirements of Windows 10
Hardware Requirements:
1. Processor: 1 GHz or faster with at least 2 cores on a 64-bit compatible
processor.
2. Memory (RAM): 4 GB RAM or more.
3. Storage: 64 GB of available storage or more.
4. System Firmware: UEFI firmware with Secure Boot capability.
5. TPM Version: TPM version 2.0.
6. Graphics: DirectX 12 or later with a WDDM 2.0 driver.
7. Display: A high-definition (720p) display, 9" or larger diagonally, with 8 bits
per color channel.
Software Requirements:
1. Operating System: Windows 11 is the operating system itself.
2. Internet Connection: Some features and updates in Windows 11 require an
internet connection.
3. Microsoft Account: While not mandatory, having a Microsoft account can
enable access to additional features and cloud-based services.
In this article, you will learn about the system calls in the operating system
and discuss their types and many other things.
Here are some common Unix system calls for process management:
exec() family: Replaces the current process with a new process image.
execl(const char *path, const char *arg0, ..., const char *argn, (char *)
NULL): Executes a new program from the given file path with a variable
number of command-line arguments.
wait() and waitpid(): Used to wait for the termination of child processes.
wait(int *status): Suspends the current process until one of its child processes
terminates. It can retrieve the termination status of the child process.
waitpid(pid_tpid, int *status, int options): Suspends the current process until
the child process with the specified process ID terminates.
exit(): Terminates the current process and returns the exit status to the
parent process.
open(const char *path, int flags, mode_t mode): Opens a file specified by the
file path, with specified flags indicating the file's intended use (e.g., read,
write, create, etc.) and the file mode (permissions) if the file is being created.
read(intfd, void *buf, size_t count): Reads data from the file associated with
the file descriptor fd into the buffer buf of size count.
write(intfd, const void *buf, size_t count): Writes data from the buffer buf of
size count to the file associated with the file descriptor fd.
lseek(intfd, off_t offset, int whence): Changes the file offset (position) of the
file associated with the file descriptor fd. The whence parameter specifies how
the offset is calculated (e.g., from the beginning, current position, or end of
the file).
unlink(const char *path): Deletes (unlinks) the file specified by the file path.
Syntax:
dup (filedes).
Characteristics of SJF:
As SJF reduces the average waiting time thus, it is better than the
first come first serve scheduling algorithm.
SJF is generally used for long term scheduling
Disadvantages of SJF:
Problem :- Consider the set of 5 processes whose arrival timeand burst time
are given below-
If the CPU scheduling policy is SJF pre-emptive, calculate the average waiting
time and average turnaround time.
Solution-
Gantt Chart-
Now, we know-
• Turn Around time = Exit time – Arrival time
• Waiting time = Turn Around time – Burst time
Now,
• Average Turn Around time = (1 + 5 + 4 + 16 + 9) / 5
= 35 / 5
= 7 unit
• Average waiting time = (0 + 1 + 2 + 10 + 6) / 5
= 19 / 5
= 3.8 unit
Characteristics of FCFS:
FCFS supports non-preemptive and pre-emptive CPU scheduling algorithms.
Tasks are always executed on a First-come, First-serve concept.
FCFS is easy to implement and use.
This algorithm is not much efficient in performance, and the wait time is
quite high.
Advantages of FCFS:
Easy to implement
First come, first serve method
Disadvantages of FCFS:
FCFS suffers from Convoy effect.
The average waiting time is much higher than the other algorithms.
FCFS is very simple and easy to implement and hence not much efficient.
Convoy Effect
• In convoy effect, Consider processes with higher burst time arrived before the
processes with smaller burst time.
• Then, smaller processes have to wait for a long time for longer processes to
release the CPU.
Problem-Consider the set of 6 processes whose arrival time and burst time are given
below-
If the CPU scheduling policy is FCFS and there is 1 unit of overhead in scheduling the
processes, find the efficiency of the algorithm.
Solution-
Gantt Chart-
Priority Scheduling
Pre-emptive Priority CPU Scheduling Algorithm is a pre-emptive method of CPU Scheduling
algorithm that works based on the priority of a process. In this algorithm, the editor sets
the functions to be as important, meaning that the most important process must be done
first. In the case of any conflict, that is, where there are more than one processor with
equal value, then the most important CPU planning algorithm works on the basis of the
FCFS (First Come First Serve) algorithm.
Problem :- Consider the set of 5 processes whose arrival time and burst time are given
below-
If the CPU scheduling policy is priority preemptive, calculate the average waiting time and
average turn around time. (Higher number represents higher priority)
Solution-
Gantt Chart-
Now, we know-
• Turn Around time = Exit time – Arrival time
• Waiting time = Turn Around time – Burst time
Round Robin
Round Robin is a CPU scheduling algorithm where each process is cyclically assigned
a fixed time slot. It is the pre-emptive version of First come First serve CPU
Scheduling algorithm. Round Robin CPU Algorithm generally focuses on Time
Sharing technique.
Problem :-Consider the set of 6 processes whose arrival time and burst time are
given below-
If the CPU scheduling policy is Round Robin with time quantum = 2, calculate the
average waiting time and average turnaround time.
Solution :-
Gantt Chart-
Ready Queue- P5, P6, P2, P5, P6, P2, P5, P4, P1, P3, P2, P1
Now, we know-
Turn Around time = Exit time – Arrival time
Waiting time = Turn Around time – Burst time
Now,
Average Turn Around time = (8 + 17 + 4 + 6 + 17 + 13) / 6
= 65 / 6
= 10.84 unit
Average waiting time = (4 + 12 + 2 + 5 + 11 + 10) / 6
= 44 / 6
= 7.33 unit