2nd CHP Osy
2nd CHP Osy
2nd CHP Osy
1. Program Execution
The purpose of computer system is to allow the users to execute programs in an efficient manner. The
operating system provides an environment where the user can conveniently run these programs. The
user does not have to worry about the memory allocation or de-allocation or any other thing because
these things are taken care of by the operating system. To run a program, the program is required to be
loaded into the RAM first and then to assign CPU time for its execution. Operating system performs
this function for the convenience of the user. It also performs other important tasks like allocation and
de-allocation of memory, CPU scheduling etc.
2. I/O Operations
Each program requires an input and after processing the input submitted by user it produces output.
This involves the use of I/O devices. An I/O system in a computer manages communication between
the computer and devices like printers or scanners. To do this, the computer uses **device drivers**,
which are special programs. These drivers help the computer understand how to talk to the device
and send data in a way the device can understand. This allows the computer to control devices
without needing to know how the hardware works. The drivers also handle signals from the device
when it needs the computer's attention.
10. **Protection and Security**: Makes sure only the right people can use the computer by asking for
things like a username and password.
3. what is system calls explain any two types
A system call is a mechanism used by programs to request services from the operating system (OS).
In simpler terms, it is a way for a program to interact with the underlying system, such as accessing
hardware resources or performing privileged operations.
System calls provide an interface between a user program and Operating System .
The system calls expose the services offered by the operating system to user programs.
These are set of functions methods. Most system calls are written in assembly language and are
machine
dependent.
Numerous higher level languages such as ‘C’ also permit to make system calls directly.
1. Information Maintenance
System calls like `get process attributes()` and `set process attributes()` allow user programs to
interact with the operating system to gather or change details about a running process.
- **get process attributes()**: This call retrieves information about a process, such as its priority, state
(running, sleeping, etc.), memory usage, and other relevant details.
- **set process attributes()**: This call modifies certain properties of a process, like changing its
priority or limiting its resources (e.g., CPU or memory usage).
These system calls help in managing and optimizing processes in a system.1. get time or date, set time
or date
2. get system data, set system data
3. get process, file, or device attributes
4. set process, file, or device attributes
2. Process Control
Processes need to be controlled as in a running process must be able to halt its execution either
normally or
abnormally.Also one process may need to run some other process to complete its own execution. So
all these
system calls come under this category.
1. end, abort
2. load, execute
3. create process, terminate process
4. get process attributes, set process attributes
5. wait for time, wait event, signal event
6. allocate and free memory
B) File Management
To work with files, we need to perform several actions:
1. **Create** and **delete** files: We need to provide the file's name and possibly some details
about it.
2. **Open** a file: After creating a file, we need to open it to use it.
3. **Use the file**: We can read, write, or move around in the file (like rewinding or skipping to the
end).
4. **Close the file**: When we're done using the file, we close it.
If we organize files into folders, we need similar actions for those folders too. We also need to check
and change file details, like the name, type, or security settings. To do this, we use system calls like
**get file attributes** (to check details) and **set file attributes** (to change details). Some systems
have additional calls for tasks like moving or copying files. Other systems might offer programs or
tools that perform these tasks, which can be used by other programs like an API.
1. create file, delete file
2. open, close
3. read, write, reposition
4. get file attributes, set file attributes
File Management
A file is a collection of related information made by a user. Computers store files on disks (long-term
storage). Examples of storage are magnetic tapes, magnetic disks, and optical disks. Each type has
different speeds, storage sizes, and ways to get the data.y
Files are usually kept in folders to keep them organized. These folders can have files and other folders
inside them.
1. The creation and deletion of files.
2. The creation and deletion of directions.
3. The support of primitives for manipulating files and directions.
4. The mapping of files onto secondary storage.
5. The back up of files on stable storage media.
Origins Linux was developed in the 1990s by Linus Unix was developed in the 1970s at Bell Labs
Torvalds as a free and open-source alternative to
Differences Linux Unix
Unix.
Linux, on the other hand, is open-source software Unix is a proprietary operating system, meaning that it requires a
Licensing and can be used freely without any licensing fees. license to use.
Linux provides two GUIs, KDE and Gnome. But Initially, Unix was a command-based OS, however later a GUI was
there are many other options. For example, LXDE, created called Common Desktop Environment. Most distributions now
Xfce, Unity, Mate, and so on. ship with Gnome.
Graphical User Interface
Source Code Availability The source is accessible to the general public. The source is not accessible to the general public.
Some Linux versions Some Unix versions are SunOS, Solaris, SCO UNIX, AIX, HP/UX, ULTRIX,
Operating System Versions are Ubuntu, Debian GNU, Arch Linux, etc. etc.
2. When there are more parameters than registers, parameters can be stored in a block and the
block address
3. Parameters can also be pushed on or popped off the stack by the operating system.
10. Describe activities of I/0 system
An I/O system in a computer manages communication between the computer and devices like
printers or scanners. To do this, the computer uses **device drivers**, which are special programs.
These drivers help the computer understand how to talk to the device and send data in a way the
device can understand. This allows the computer to control devices without needing to know how
the hardware works. The drivers also handle signals from the device when it needs the computer's
attention.
Activities:
Managing devices
Transferring data