Storage Management
First, the basic concept:
What is a storage device? : Popular is the device that stores files, data, or other things in a computer.
What is storage management ? : Even if the "main memory device" of the computer is managed, assign it according to the requirements of the user program
The main memory space and the implementation of relocation, while also protecting the user stored in the primary storage program and data is not destroyed. Will
If you can provide virtual storage technology, expand the main memory space, to provide users with a larger than the actual capacity of virtual storage empty
Room
Classification of Memory:
1, register: The price is most expensive, small capacity, each register only one word length information.
Instruction Register: Current read-out instruction
General Register: The current participating operation
Control Register: Store control information
PSW Register
Base Address Register
Boundary Register
2, main memory and high-speed buffer memory (high speed buffer is mainly to improve the execution speed): Large capacity to
A byte unit address (a number of itself composed of one word, mainly in the current execution of the program and data, etc.). )
3, Secondary Memory: (the processor to live under the input and output control management to access)
Information can be stored for a long time, to read or execute a program must first read the program into the main memory.
Attention:
1, register to run the temporary program, which morning to occupy the processor, register for which process services.
2. System Area: The operating system must occupy a portion of the storage space of the main storage. such as storage System program, data, management
Information (PCB), OS and hardware interface information and other system areas, the rest is called the user area.
Second, partition: fixed partition, variable partition
1, how to partition? To be transferred to the job when partitioning, how to load all the storage in the operation? In a fixed partition
and variable partitioning, so we introduced: relocation.
before we learn about relocation, let's start by understanding what an absolute address is, what is a logical address?
Absolute Address : main memory space address by physical number called Absolute address (in order number of real address), this empty
is called the physical space.
Logical Address : The address used in the user program (we think of the address).
2. What is relocation? : The logical address is converted to an absolute address called relocation, also called address translation.
Classification:
Static relocation : ( cannot move position) address translation is done in one place before the job executes, and the job
Line is no need for address translation.
Dynamic Relocation : The dynamic address translation of the hardware address translation mechanism, the logical address and the base address are only added to the absolute
The address--the positioning in the instruction process is called dynamic relocation.
3. Single-user continuous storage Management (single-channel operation system)
1), Personal computer use
2), at any time the main memory at most only one job
3), the use of static relocation method address conversion, the operation of the time slice rotation method is swapped out substitution.
4), the processor executes the instructions to check
Maximum address >= Absolute address >= boundary address, otherwise an "address out of Bounds" interrupt event is generated.
4. Fixed Partition management
1) What is partition ? The assignable user area in the main memory is divided into several contiguous zones, each continuous zone is called
a partition. (in a fixed partition, there is an upper register, the lower limit, because the partition is fixed.) )
2) multi-Channel program design system : before we introduced the single-channel program design system is actually in single-user continuous storage
The use of storage management. Multi-channel program design system is that each partition can only be loaded into one job, do not allow multiple jobs in the same
Management of a district management system.
3)
allocation and recycling:
allocation : is to manage the memory, how to allocate, in the fixed partition when the job to mount the partition, first check "partition
Allocation table ", flag" 0 "is empty, not 0 is occupied.
The job length < partition length can be mounted (allocated).
Recycling : And the end of the job. The partition occupancy mark is set to "0".
4)
How to allocate efficiently? --Fixed partitioning method
1, according to the regular occurrence of job size, the number of divided areas
2, divided by the size of the partition order, low address in the smaller partition, high-address divided in the larger partition.
3, according to the operation of main memory space requirements into a number of operational teams, (multi-job queue fixed partition method)
5.
variable partition Storage Management : (Dynamic relocation)
(1), Variable partitioning principle:
1) According to the job needs "main memory space size" and then "main memory space usage" is the assignment partition for the job.
2) The length and number of partitions are not predetermined but are determined by the actual demand and the number of loading jobs.
(2), allocation and recycling: the job length < space area is loaded, the remainder is still registered in the table, if "="
The status is "empty", ">" is not loaded.
For ease of administration, set up a "spare area table"
Allocation method:
Recycle : The job execution is finished, the occupied main memory space is recovered, and the registration status "Empty" is set to "unregistered".
Note : The recovery check whether there is an adjacent area of the idle area, if there should be merged adjacent areas, there are adjacent areas, the next neighborhood, and have a neighboring
And the next neighbor.
6. Storage protection:
1), dynamic relocation loading job, to have the hardware address translation mechanism support (convert the logical address to absolute
Address): Base register, limit register, add first, compare lines.
Add the logical address in the command to the contents of the base register = Absolute.
2), to the memory job has more need to change storage location, from one storage area to another storage
area of work call to move.
The purpose of moving to the technology: 1, the concentration of scattered idle area 2, facilitate the group dynamic expansion of main memory.
3), the disadvantage of moving:
1. Increase the system overhead, the OS takes up the processor time required by the system resources, and moves to the job churn process.
2. The move is conditional (the running job cannot be moved)
So: With two loading jobs, you can reduce the number of jobs, the amount of information.
Operating System (vii)--Storage management