0% found this document useful (0 votes)
27 views5 pages

Os Lab-01

The document provides an overview of operating systems, detailing their functions, types, and differences between Linux, Windows, and macOS. It explains the compilation process of a C program, outlining the roles of the preprocessor, compiler, assembler, linker, and loader. Key advantages and disadvantages of various operating systems are also discussed.

Uploaded by

Reshu Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views5 pages

Os Lab-01

The document provides an overview of operating systems, detailing their functions, types, and differences between Linux, Windows, and macOS. It explains the compilation process of a C program, outlining the roles of the preprocessor, compiler, assembler, linker, and loader. Key advantages and disadvantages of various operating systems are also discussed.

Uploaded by

Reshu Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

ASSIGNMENT -01

Q. What is an operating system?


ans- it is an interface between user and machine.it manages memory,processes,files and
resource allocation. so we can call it a resource manager.

Q.2 Describe different types of operating systems?


ans.-
1. batch operating system-
1.The operating system keeps the number of jobs in memory and performs them one at a
time. Jobs are processed in a first-come, first-served manner. Each job set is defined as a batch.
When a task is finished, its memory is freed, and the work's output is transferred into an output
spool for later printing or processing.
Advantage:
1. . This system can easily manage large jobs again and again.
2. When a process is finished, the next job from the job spool is run without any user
interaction.
Disadvantage:

1. When a job fails once, it must be scheduled to be completed, and it may take a long time
to complete the task.
2. Computer operators must have full knowledge of batch systems.
3. The batch system is quite difficult to debug.
4. The computer system and the user have no direct interaction.
5. If a job enters an infinite loop, other jobs must wait for an unknown period of time.

2. multiprogramming operating system-


When one application is waiting for an I/O transfer, another is ready to use the processor at all
times, and numerous programs may share CPU time. All jobs are not run simultaneously, but
there could be numerous jobs running on the processor at the same time, and parts of other
processes being executed first, then another segment, etc. As a result, the overall goal of a
multiprogramming system is to keep the CPU busy until some tasks are available in the job pool.
Thus, the numerous programs can run on a single processor computer, and the CPU is never
idle.
Advantage:

1. It provides less response time.


2. It may help to run various jobs in a single application simultaneously.
3. It helps to optimize the total job throughput of the computer.
4. Various users may use the multiprogramming system at once.
5. Short-time jobs are done quickly in comparison to long-time jobs.
6. It may help to improve turnaround time for short-time tasks.
7. It helps in improving CPU utilization and never gets idle.
8. The resources are utilized smartly.

Disadvantage:

1. is highly complicated and sophisticated.


2. The CPU scheduling is required.
3. Memory management is needed in the operating system because all types of tasks are
stored in the main memory.
4. The harder task is to handle all processes and tasks.
5. If it has a large number of jobs, then long-term jobs will require a long wait.

3. Multitasking Operating System-


1. A multitasking operating system enables the execution of two or more programs at the
same time. The operating system accomplishes this by shifting each program into and out of
memory one at a time. When a program is switched out of memory, it is temporarily saved on
disk until it is required again.
Advantages:
1. Multitasking operating systems give more flexibility to several users, and they are
happier as a result. On which each user can execute single or multiple programs
simultaneously.
2. The greatest virtual memory system is found in multitasking operating systems.
Because of virtual memory, any program does not require a long wait time to complete
its tasks; if this problem arises, those programs are moved to virtual memory.
3. All tasks are allotted a specified amount of time so that they do not have to wait for the
CPU.
4. A multitasking operating system may manage various computer resources like I/O
devices, RAM, hard disk, CPU, and others.
Disadvantages:
1. The system may run programs slowly because of the poor speed of their processors,
and their reaction time might rise when processing many programs. To solve this
problem, more processing power is required.
2. The multiple processors are busier at the same time to complete any task in a
multitasking environment, so the CPU generates more heat.
3. The computer's performance may get slow due to the multiple programs run at the same
time because the main memory gets overloaded while loading multiple programs.
Because the CPU is unable to provide different times for each program, reaction time
increases. The primary cause of this issue is that it makes use of low-capacity
RAM. As a result, the RAM capacity can be raised to provide a solution.

4. multiprocessing operating systems-


1. In operating systems, to improve the performance of more than one CPU can be used
within one computer system called Multiprocessor operating system.
2. Increased reliability: Due to the multiprocessing system, processing tasks can be distributed
among several processors. This increases reliability as if one processor fails; the task can be
given to another processor for completion.
3. increased throughput: multiple jobs can be done in less time.
4. The economy of Scale: As multiprocessors systems share peripherals, secondary storage
devices, and power supplies, they are relatively cheaper than single-processor systems.

5. Real-Time System-
1. In Real-Time Systems, each job carries a certain deadline within which the job is supposed
to be completed, otherwise, the huge loss will be there, or even if the result is produced, it will
be completely useless.
2. it can be of two types : 1) strict deadly time bounded. 2) time bounded.
3. used in aircraft,defense missiles,satellite,telecommunication.

Q.3 difference between linux os and windows os and mac os?


ans-
linux-
1. Linux is a robust open-source operating system built on the Linux kernel and distributed
under various distributions (distros) such as Ubuntu, Fedora, and Debian.
2. First developed in 1991.
3. larger number of apps compared to windows os.
4. owned by google.
5. High customization and flexibility.
6.stability and security.
7.requires more technical expertise.
8.Limited compatibility with some proprietary software.
windows-
1. it is closed source.
2. it is developed using c,c++.
3.The Windows operating system boasts a user-friendly interface with a familiar layout
3.Extensive software compatibility.
4. Strong gaming support with DirectX compatibility.
5. Frequent target for malware and viruses.
6.Limited customization options.
7. Potential stability issues.

macOS-

1. MacOS (previously called OS X) is a line of operating systems created by Apple.


2. The first version of it was released in 1984.
3. Sleek and visually appealing interface.
4. MacOS supports a significant number of popular applications, particularly those
developed by Apple and third-party software optimized for Mac systems.
5. Strong performance, stability, and security.
6. Seamless integration with other Apple devices.
7. Less customization compared to Linux.
8. Exclusive to Apple hardware, limited hardware choices.
9. Higher pricing compared to Windows or Linux.

Q.4 How a c programme is compiled?


ans-
Preprocessor
The source code is the code which is written in a text editor and the source code file is given an
extension ".c". This source code is first passed to the preprocessor, and then the preprocessor
expands this code. After expanding the code, the expanded code is passed to the compiler.

Compiler
The code which is expanded by the preprocessor is passed to the compiler. The compiler
converts this code into assembly code. Or we can say that the C compiler converts the
pre-processed code into assembly code.

Assembler
The assembly code is converted into object code by using an assembler. The name of the
object file generated by the assembler is the same as the source file. The extension of the
object file in DOS is '.obj,' and in UNIX, the extension is 'o'. If the name of the source file is
'hello.c', then the name of the object file would be 'hello.obj'.

Linker
the job of the linker is to link the object code of our program with the object code of the library
files and other files. The output of the linker is the executable file.
Loader
The loader will then load the executable file for the execution.

Output:

You might also like