Home >>Computer Fundamental Tutorial >Basics of Computers Functions of OS

Basics of Computers Functions of OS

Basics of Computers Functions of OS

As you learn, the operating system is essential for computer system functioning. To do so, it performs these three broad categories of activities−

  • Essential Functions − Ensures optimal and efficient use of resources
  • Monitoring functions − Monitor and gather system performance information
  • Service Functions − Includes user services

Let's look at some of the main roles connected with such operations.

Processor management

Managing a computer's CPU is called processor control to maintain the maximum use. Processor management essentially means allocating processor time to the activities which need to be done. This is known as job arranging. Jobs will be organized in such a way that –

  • CPU efficiency is maximum
  • The turnaround time, that is to suggest the time needed to complete each task, is minimum
  • Waiting is minimal
  • Each job gets the rapidest response time possible
  • Power benefit is achieved, where the average time consumed is
  • Fulfill any task

There are two work scheduling methods that operating systems do –

  • Preemptive scheduling
  • Non-Preemptive scheduling

Preemptive Scheduling

With this method of scheduling it is possible to schedule next work to be completed by the processor before finishing the current job. If a high priority job arrives, the processor may be forced to release the current job and take up the next job. There are two planning techniques which use preventive scheduling –

$$\frac{Elapsed \: Time}{Execution \: time \: received}$$

A job that requires a shorter response period is granted greater priority. So even if it was requested earlier than the shorter program, a larger program may have to wait. This increases CPU performance.

  • Round robin scheduling − A small-time slice called time slice is defined and each program only gets one slice of time at a time. If it is not completed during that time, then in the end it must join the job queue and wait until all programs have one slice of time. The advantage here is that there is fair access for both programs.
  • Scheduling response ratio − Defines the response ratio as

Non-preemptive Scheduling

For this method of scheduling, work scheduling choices are only made upon completion of the current job. A work that gives importance to higher priority employment is rarely interrupted. Scheduling techniques employing non-preemptive scheduling are –

  • First come first serve to schedule − This is the easiest technique where you first complete the first program to execute a request.
  • Shortest job next schedule − Next is planned the work that takes the least time for execution.
  • Deadline scheduling − The work scheduled for execution next is with the earliest deadline.

Memory Management

Memory management is called the process of regulating computer memory and using optimization techniques to improve overall system performance. For modern computing environments, memory space is very important, and resource management is an important role for operating systems.

Computers, as you learn, have two memory types-main and secondary. Primary memory is costly but fast and secondary memory is inexpensive but slower. OS must find a compromise between the two to ensure that system output does not damaged due to much less primary memory, or system costs due to too much primary memory do not shoot up.

For high system performance, input and output data, user commands, and interim data for program execution must be processed, accessed, and efficiently retrieved. If a request for a system has been accepted, OS allocates the primary and secondary storage areas as needed. The resource space assigned to it will be freed until execution is complete.

Contiguous Storage Allocation

It is the easiest method for allocating storage space, where every program is allocated contiguous memory locations. Prior to allocation, OS will determine the amount of memory needed for the full operation.

Non-contiguous Storage Allocation

As the name indicates, the program and associated data should not be stored in contiguous locations. The program is split into smaller parts and each part is placed in a different location. A table keeps a list of where each program component is kept. When access to any part is provided by the processor, OS provides access using this table of allocations.

Primary memory capacity could not be enough in a real-life situation to hold the whole program. In this case, OS takes advantage of the Virtual Storage technique, where the file is physically placed in secondary memory but seems to be housed in primary memory. This causes a little time gap in accessing the components of the system. Digital storage approaches still exist –

  • Paging program − A program is split down into a fixed size document and placed in the secondary memory. The logical address or virtual address given to the pages is 0 to n. A page table maps the logical addresses to the actual addresses required for accessing the pages when necessary.
  • Segmentation of the program − A program is broken down into logical units called segments, assigned the logical address from 0 to n and stored in secondary memory. For loading segments from secondary memory to primary memory, a section tab is used.

Operating systems usually use a page-to-program segmentation mix to optimize memory use. A wide portion of the program may be split into sections, or more than one specific section may be processed as one page.

File Management

Information and knowledge are processed in file form on computers. Managing the file system to allow users to keep their data safe and accurate is an important operating system function. OS management of filesystems is called file management. Data security software for these computer-based operations –

  • Create new data-saving files
  • Update
  • Share
  • Securing and encrypting the data by passwords
  • Recovery for system failures

Device Management

The process of an operating system implementing, managing, and maintaining a device is called device management. The operating framework utilizes the device's User Driver utility software as an interface.

If several processes view the devices or order access to the devices, the OS handles the devices in a manner that spreads the devices effectively among all processes. Processes devices connect by way of system call control, a programming interface supported by the OS.