write a C program to print perfect numbers from 1 to 100
write a C program to print perfect numbers from 1 to 100
Perfect number – C program
Perfect number is a positive number which sum of all positive divisors excluding that number is equal to that number. For example 6 is perfect number since divisor of 6 are 1, 2 and 3.
The Operating System’s View of File Management
the operating system abstracts (maps) from the physical properties of its storage devices to define a logical storage unit i.e., the file. The operating system provides various system calls for file management like creating, deleting files, read and write, truncate operations etc.
View of the file system
The operating system allows users to define named objects called files which can hold interrelated data, programs or any other thing that the user wants to store/save.
Disk Cache
Disk caching is an extension of buffering. Cache is derived from the French word cacher, meaning to hide. In this context, a cache is a collection of blocks that logically belong on the disk, but are kept in memory for performance reasons.
RAID
Disks have high failure rates and hence there is the risk of loss of data and lots of downtime for restoring and disk replacement. To improve disk usage many techniques have been implemented. One such technology is RAID (Redundant Array of Inexpensive Disks). Its organization is based on disk striping (or interleaving), which uses a group of disks as one storage unit.
Disk Scheduling
The disk is a resource which has to be shared. It is therefore has to be scheduled for use, according to some kind of scheduling system. The secondary storage media structure is one of the vital parts of the file system.
Disk Organization
Disks come in different shapes and sizes. The most obvious distinction between floppy disks, diskettes and hard disks is: floppy disks and diskettes consist, of a single disk of magnetic material, while hard-disks normally consist of several stacked on top of one another.
I/O Buffering
A buffer is an intermediate memory area under operating system control that stores data in transit between two devices or between user’s work area and device. It allows computation to proceed in parallel with I/O
Organization of the I/O function
The range of I/O devices and the large variation in their nature, speed, design, functioning, usage etc. makes it difficult for the operating system to handle them with any generality. The key concept in I/O software designing is device independence achieved by using uniform naming
Combined Systems
The combined systems are of two types. They are Segmented Paging and Paged Segmentation
Demand Segmentation
Programs generally divide up their memory usage by function. Some memory holds instructions, some static data, some dynamically allocated data, some execution frames. All of these memory types have different protection, growth, and sharing requirements. In the monolithic memory allocation of classic Virtual Memory systems, this model isn’t well supported.
Thrashing
Thrashing occurs when a system spends more time processing page faults than executing transactions. While processing page faults it is necessary to be in order to appreciate the benefits of virtual memory, thrashing has a negative effect on the system.
Page replacement policies
When a process needs a non-resident page, the operating system must decide which resident page is to be replaced by the requested page. The part of the virtual memory which makes this decision is called the replacement policy.
What is demand paging?
In virtual memory systems, demand paging is a type of swapping in which pages of data are not copied from disk to RAM until they are needed.
keep looking »