You are on page 1of 19

Look up in iOS

Look Up now presents you with results from the App Store, Apple Music, websites, and Wikipedia. To use the Look Up feature,
select some text in an app, such as a web browser or an email app and then tap “Look Up” on the popup.

Allocation of frames in Operating System


An important aspect of operating systems, virtual memory is implemented using demand paging. Demand paging necessitates the
development of a page-replacement algorithm and a frame allocation algorithm. Frame allocation algorithms are used if you have
multiple processes; it helps decide how many frames to allocate to each process.

There are various constraints to the strategies for the allocation of frames:

You cannot allocate more than the total number of available frames.

At least a minimum number of frames should be allocated to each process. This constraint is supported by two reasons. The first
reason is, as less number of frames are allocated, there is an increase in the page fault ratio, decreasing the performance of the
execution of the process. Secondly, there should be enough frames to hold all the different pages that any single instruction can
reference.

Frame allocation algorithms –


The two algorithms commonly used to allocate frames to a process are:

Equal allocation: In a system with x frames and y processes, each process gets equal number of frames, i.e. x/y. For instance, if the
system has 48 frames and 9 processes, each process will get 5 frames. The three frames which are not allocated to any process can be
used as a free-frame buffer pool.

Disadvantage: In systems with processes of varying sizes, it does not make much sense to give each process equal frames. Allocation
of a large number of frames to a small process will eventually lead to the wastage of a large number of allocated unused frames.

Proportional allocation: Frames are allocated to each process according to the process size.
For a process pi of size si, the number of allocated frames is ai = (si/S)*m, where S is the sum of the sizes of all the processes and m is
the number of frames in the system. For instance, in a system with 62 frames, if there is a process of 10KB and another process of
127KB, then the first process will be allocated (10/137)*62 = 4 frames and the other process will get (127/137)*62 = 57 frames.

Advantage: All the processes share the available frames according to their needs, rather than equally.
Global vs Local Allocation –
The number of frames allocated to a process can also dynamically change depending on whether you have used global
replacement or local replacement for replacing pages in case of a page fault.

Local replacement: When a process needs a page which is not in the memory, it can bring in the new page and allocate it a frame from
its own set of allocated frames only.

Advantage: The pages in memory for a particular process and the page fault ratio is affected by the paging behavior of only that
process.

Disadvantage: A low priority process may hinder a high priority process by not making its frames available to the high priority
process.

Global replacement: When a process needs a page which is not in the memory, it can bring in the new page and allocate it a frame
from the set of all frames, even if that frame is currently allocated to some other process; that is, one process can take a frame from
another.

Advantage: Does not hinder the performance of processes and hence results in greater system throughput.

Disadvantage: The page fault ratio of a process can not be solely controlled by the process itself. The pages in memory for a process
depends on the paging behavior of other processes as well.

Operating System Structure


An operating system is a construct that allows the user application programs to interact with the system hardware. Since the operating
system is such a complex structure, it should be created with utmost care so it can be used and modified easily. An easy way to do this
is to create the operating system in parts. Each of these parts should be well defined with clear inputs, outputs and functions.

Simple Structure

There are many operating systems that have a rather simple structure. These started as small systems and rapidly expanded much
further than their scope. A common example of this is MS-DOS. It was designed simply for a niche amount for people. There was no
indication that it would become so popular.

An image to illustrate the structure of MS-DOS is as follows −


It is better that operating systems have a modular structure, unlike MS-DOS. That would lead to greater control over the computer system and its
various applications. The modular structure would also allow the programmers to hide information as required and implement internal routines as
they see fit without changing the outer specifications.

Layered Structure
One way to achieve modularity in the operating system is the layered approach. In this, the bottom layer is the hardware and the topmost layer is
the user interface.

An image demonstrating the layered approach is as follows −


As seen from the image, each upper layer is built on the bottom layer. All the layers hide some structures, operations etc from their upper layers.

One problem with the layered structure is that each layer needs to be carefully defined. This is necessary because the upper layers can only use
the functionalities of the layers below them.
Structure of Unix Operating System

As seen in the image, the main components of the Unix operating system structure are the kernel layer, the shell layer and the application layer.
Details about these are given as follows −

Kernel
The kernel provides a bridge between the hardware and the user. It is a software application that is central to the operating system. The kernel
handles the files, memory, devices, processes and the network for the operating system. It is the responsibility of the kernel to make sure all the
system and user tasks are performed correctly.

Shell
The program between the user and the kernel is known as the shell. It translates the many commands that are typed into the terminal session.
These commands are known as the shell script. There are two major types of shells in Unix. These are Bourne shell and C Shell. The Bourne shell
is the default shell for version 7 Unix.

The character $ is the default prompt for the Bourne shell. The C shell is a command processor that is run in a text window. The character % is the
default prompt for the C shell.

Applications
The applications and utility layer in Unix includes the word processors, graphics programs, database management programs, commands etc. The
application programs provide an application to the end users.
For example, a web browser is used to find information while gaming software is used to play games. The requests for service and application
communication systems used in an application by a programmer is known as an application program interface (API).

Proc Internals
Proc file system (procfs) is virtual file system created on fly when system boots and is dissolved at time of system shut dow n.
It contains useful information about the processes that are currently running, it is regarded as control and information center for kernel.
The proc file system also provides communication medium between kernel space and user space.
Below is snapshot of /proc from my PC.
The proc file system also provides communication medium between kernel space and user space.
...
proc file system in Linux.

directory description

/proc/PID/mem Memory held by this process.

/proc/PID/root Link to the root directory of this process.

/proc/PID/stat Process status.


/proc/PID/statm Process memory status information.

Optimization in OS
Operating system optimization

In OS, program optimization, code optimization, or software optimization, is the process of modifying a software system to make
some aspect of it work more efficiently or use fewer resources.

Optimize Windows OS for Better Performance


Contrary to popular belief, the Windows operating system is not any less in regard to performance compared to its contemporar y like
macOS and Linux. In this article, we will look into various ways you can optimize the performance of your Windows 10 machine .
Here are 13 ways you can optimize the performance of your Windows 10 computer.
1. Upgrading Windows
Updating Windows contains new features, better security, eliminate bugs, and also included performance enhancements. To updat e
Windows, follow these steps –
1. Open Settings.
2. Click on Update & Security.
3. Click on Windows Update.
4. Click the Check for updates button and download the updates.
2. Updating Device drivers
A device driver is a computer program that operates or works intermediate between the operating system and particular devices to
communicate. So, it is necessary to update device drivers by using these steps :
1. Open Start.
2. Search for Device Manager.
3. Expand the branch for the device you want to update.
4. Right-click the device, and select the Update Driver option.

3. Optimize your Hard Drive


Fragmentation occurs when the allotted memory is larger than the memory requested by the program, then the difference between
allotted and requested memory is known as fragmentation. So, we need to run a disk defragmenter to rearrange fragmentation which
makes drives work more efficiently. To do so follow the below steps:
1. Select the search bar on the taskbar and enter defrag.
2. Select Defragment and Optimize Drives.
3. Select the disk drive you want to optimize.
4. Select the Optimize button.
4. Disk Clean-up
Disk Clean-up is a computer maintenance utility tool used to remove temporary files, files in the recycle bin, and other items that you no
longer need. To do so follow the below steps:
1. Type Disk clean-up in the search bar on the taskbar.
2. Select the drives you want to clean.
3. Select the folder or file types to get rid of.
4. Select OK.
To claim more space, you can also delete system files as follows:
1. In Disk Clean-up, select Clean up system files.
2. Select the file types to get rid of. To get a description of the file type, just click on it.
3. Select OK.
5. Adjust for Best Performance
Lowering or customizing the settings of Windows visual effects will increase the performance of your devices. Follow the below steps to
achieve so:
1. Search “System” in the search bar on the taskbar.
2. Click Advanced system settings and it will open the System Properties menu.
3. On the Advanced tab under Performance, click Settings and it will open Performance Options.
4. Click on the Visual Effects tab, either choose to adjust for best performance or go for Custom.

6. Turn off Transparency Effects


Transparency effects will make your Windows device slow as it consumes resources. You can disable transparency to reclaim tha t
resources by the following steps:
1. Open the Settings by right-clicking on Start from the taskbar.
2. Go to Personalization.
3. Go to Colors.
4. Turn off Transparency effects.
7. Uninstall Programs you never use
Reclaim the hard disk space by uninstalling the programs which are not in use for a long time. To reclaim your memory on the hard disk,
follow the below steps:
1. In the search box on the taskbar, type Control Panel.
2. After opening the Control Panel, select Programs and Features.
3. Select the program you want to remove and select Uninstall or Uninstall/Change.
4. Then follow the directions on the screen.
8. Disable Background Apps
There may be some bloatware (pre-installed applications) on your Windows device which runs in the background even if you are using
them. You can even disable the background applications by following the below steps:
1. Search the “Background applications” on the search bar.
2. Disable the application which is not required.
9. Limit Start-up programs
Start-up programs are the programs that are configured to start when you log in. In most cases, apps will start minimized or may on ly
start in background tasks. To disable start-up programs, follow the below steps:
1. Right-click on Start and open Settings.
2. Go to Apps.
3. Go to Startup and disable the application which causes more impactful task in the background.
10. Check for Viruses and Spyware
Virus and spyware can not only slow down your device but even can corrupt your data and do identity theft. So, it’s better to scan for
viruses and spyware to remove it by using Windows Defender/Security or other anti-spyware programs. To use Windows Security follow
the below steps:
1. Select the search bar on the taskbar and enter Windows Security.
2. Select Virus and threat protection and click on the Scan option.
3. Select one of the scan options like Quick Scan, Full Scan, and Custom Scan.
4. Press Scan now button.
11. Change the size of Virtual Memory
A paging file is an area on the hard disk that Window uses as if it were RAM. We can adjust this paging file size to improve window
performance. To change the size of virtual memory follow the below steps:
1. Select the search bar on the taskbar and open View advanced system settings, which will open System Properties.
2. In System Properties, select the Advanced tab.
3. Then select Settings under Performance.
4. In Performance Options, select the Advanced tab.
5. Then select Change under the Virtual memory.
6. By default, Windows automatically manage paging file size for all drives check box is checked we can uncheck it to makes changes.
7. Under Paging file size for each drive, click on the drive that contains the paging file to change the paging file size.
8. Click Custom size, type a new size in megabytes in the Initial size (MB) or Maximum size (MB) box, click Set, and then click OK.
9. Restart your device.
12. Close running applications that are not in use
Every running application consumes resources like CPU and memory. So, it is necessary to close all the application which is n ot used to
reclaim the allocated resources.
13. Turn Off Tips and Notifications
We can also stop some background services that provide tips and suggestions to use Windows. To do that follow these steps:
1. Search the “Notifications and actions” in the search bar on the taskbar.
2. Uncheck Get tips, tricks, and suggestions as you use windows.
14. Improve Hardware
To improve the performance of Windows PC we can also upgrade the hardware. Adding better technology hardware will definitely
improve the read and write speed of your device.
1. Add more RAM.
2. Use solid-state disk.

You might also like