Computer Fundamentals : Basics of Operating System ,Virtual Memory, File Systems

By Abhinav Gupta|Updated : July 1st, 2021

­An operating system (OS) is a set of software that manages computer hardware resources and provides common functions to programs. In a computer system, the operating system is a vital component of the system software.

An operating system (OS) is a software program that connects a computer user to its hardware. An operating system is a piece of software that manages files, manages memory, manages processes, handles input and output, and controls peripheral devices like disc drives and printers, among other things.

Some popular Operating Systems include Linux Operating System, Windows Operating System, VMS, OS/400, AIX, z/OS, etc.

byjusexamprep

Following are some of the important functions of an operating system.

  • Memory Management
  • Processor Management
  • Device Management
  • File Management
  • Security
  • Control over system performance
  • Job accounting
  • Error detecting aids
  • Coordination between other software and users

Applications of Operating System

Following are some of the important activities that an Operating System performs−

Security − By means of passwords and similar other techniques, it prevents unauthorized access to programs and data.

Control over system performance − Recording delays between requests for a service and responses from the system.

Job accounting − Keeping track of time and resources used by various jobs and users.

Error detecting aids − Production of dumps, traces, error messages, and other debugging and error detecting aids.

Coordination between other software and users − Coordination and assignment of compilers, interpreters, assemblers, and other software to the various users of the computer systems.

What are the types of Operating Systems?

  • Batch Operating System
  • Time-Sharing Operating System
  • Distributed Operating System
  • Embedded Operating System
  • Real-time Operating System

Virtual Memory:

More memory can be addressed by a computer than is physically installed on the machine. This additional memory is known as virtual memory, and it is a part of a hard disc configured to simulate the computer's RAM.

This scheme's most obvious benefit is that programs can be larger than physical memory. Virtual memory serves two purposes. First, it allows us to extend the use of physical memory by using the disk. Second, because each virtual address is converted to a physical address, we can have memory protection.

When the complete program does not need to be loaded into the main memory, the situations listed below apply.

  • Only when an error in the data or computation occurs, user-written error management algorithms are employed.
  • A program's choices and functionalities may only be used once in a while.
  • Even though just a small portion of the table is used, many tables are given a set amount of address space.
  • The ability to execute a program that is only partially in memory would counter many benefits.
  • Less number of I/O would be needed to load or swap each user program into memory.
  • A program would no longer be constrained by the amount of physical memory that is available.

Each user program would use less physical memory, allowing more programs to execute at the same time, increasing CPU utilization and throughput.

A memory management unit, or MMU, is incorporated into the circuitry of modern general-purpose microprocessors. It is the function of the MMU to convert virtual addresses to physical addresses. The following is a simple example:

Demand paging is a typical way to implement virtual memory. It can be used in a segmentation system as well. Virtual memory can also be provided using demand segmentation.

File

A file is a named grouping of linked data stored on secondary storage devices such as disks, magnetic tapes, and optical disks. A file is a collection of bits, bytes, lines, or records whose meaning is determined by the creator and user of the file.

File Structure

A File Structure should be according to a required format that the operating system can understand.

  • A file has a certain defined structure according to its type.
  • A text file is a sequence of characters organized into lines.
  • A source file is a sequence of procedures and functions.
  • An object file is a sequence of bytes organized into blocks that are understandable by the machine.
  • When the operating system defines different file structures, it also contains the code to support these file structures. Unix, MS-DOS support a minimum number of file structures.

File Type

The capacity of the operating system to discriminate between distinct types of files, such as text files, source files, and binary files, is referred to as file type. Many operating systems can handle a wide range of file types. The following file types are found in operating systems such as MS-DOS and UNIX:

Ordinary files

  • These are the files that contain user information.
  • These may have text, databases, or executable programs.
  • The user can apply various operations on such files like add, modify, delete or even remove the entire file.

Directory files

  • These files contain a list of file names and other information related to these files.

Special files

  • These files are also known as device files.
  • These files represent physical devices like disks, terminals, printers, networks, tape drives, etc.

These files are of two types −

  • Character special files − data is handled character by character as in the case of terminals or printers.
  • Block special files − data is handled in blocks as in the case of disks and tapes.

File Access Mechanisms

The method by which the records in a file can be accessed is referred to as the file access mechanism. Files can be accessed in a variety of ways.

  • Sequential access
  • Direct/Random access
  • Indexed sequential access

Sequential access

Sequential access is one in which the records are accessed in a specific order, that is, the information in the file is processed one record at a time. This is the most basic mode of access. Compilers, for example, frequently use this method to retrieve files.

Direct/Random access

  • Random access file organization provides, accessing the records directly.
  • Each record has its own address on the file with the help of which it can be directly accessed for reading or writing.
  • The records need not be in any sequence within the file and they need not be in adjacent locations on the storage medium.

Indexed sequential access:

  • This mechanism is built upon a base of sequential access.
  • An index is created for each file which contains pointers to various blocks.
  • The index is searched sequentially, and its pointer is used to access the file directly.

Space Allocation

The operating system assigns disc space to files. To allocate disc space to files, operating systems use one of three methods.

  • Contiguous Allocation
  • Linked Allocation
  • Indexed Allocation

Contiguous Allocation

  • Each file occupies a contiguous address space on a disk.
  • The assigned disk address is in linear order.
  • Easy to implement.
  • External fragmentation is a major issue with this type of allocation technique.

Linked Allocation

  • Each file carries a list of links to disk blocks.
  • The directory contains a link/pointer to the first block of a file.
  • No external fragmentation
  • Effectively used in sequential access file.
  • Inefficient in case of direct access file.

Indexed Allocation

  • Provides solutions to problems of contiguous and linked allocation.
  • An index block is created having all pointers to files.
  • Each file has its own index block which stores the addresses of disk space occupied by the file.
  • The directory contains the addresses of index blocks of files.

 

Comments

write a comment

Follow us for latest updates