Reklama

Logona organization virtualno pam’at

Virtual memory- the addressing scheme of the computer memory, in which memory is presented to software continuous and homogeneous, while in reality for the actual data storage are separate (bursting) different types of memory, including short-term (operational) and long-term (hard drives, SSDs).

Paged virtual memory:

Method discontinuous placement of tasks in memory in which all the fragments of the tasks of the same size multiple of powers of two is called a page, and the fragments pages. In this case, the memory is split into physical pages (frames, frames). And the program is broken into a virtual page. Virtual pages are placed in RAM, and the part in external memory. Space on hard drive, hosting virtual pages called the swap file or page file (SWAP-file).

The physical address of the memory cell is determined by a pair (Pp, i), and virtual (Pv, i). Pv is the virtual page number, Pp – number of physical pages, and I is the cell number (index) inside page. To display the virtual address space to physical memory for each task, you must have a page table for the broadcast address space. To describe each page the memory Manager of the operating system gets the corresponding descriptor. The virtual page number in the descriptor table of the current task there is a corresponding element (the handle). If the presence bit is equal to one, this page is in RAM and in the descriptor is the number of the physical page, reserved for this virtual page.

The main advantage of page organization is the smallest possible fragmentation, because each task may have one free page.

6

Disadvantages:

1) Overhead, ie. page table must be placed in memory and need to edit them.

2) Programs are randomly split into pages without regard to logical relations, available in program code. Therefore, inter-page transitions are carried out more often than Intersegment and hard to provide sharing of software modules between running programs.

Segmented-paging virtual memory:

Virtual memory each program is divided into parts, called segments, with the independent addressing of bytes within each part. In this case the virtual address is added extra digits to the left of the page number. These bits determine the segment number.

There's a certain hierarchy in the organization of programs, consisting of four stages: program segment-page-bytes. This hierarchy of programs corresponds to the hierarchy of tables, servants to translate virtual to physical addresses. Program table for each program, loaded into the system, specifies the starting address of the corresponding segment table. Segment table lists the segments of this program indicating the start address of a page table, relevant to this segment. The page table defines the layout of each page of the segment in memory. Segment pages can be located not in a row – part of the pages of this segment may be in OP, remaining in the external memory.

Virtual memory in MP 386:

At the organization of virtual memory in use three types of addresses:

1. Logical address LA ∈ VAP.

2. The physical address FA ∈ FAP.

3. A linear address is a combination of the base address of the segment and of offset within segment.

Any description of segment consists of two parts: software- available, called the selector of the segment and placed in one of the segment registers, and hidden, called a descriptor segment, which is located in one of the special structures in the OP, called the tables of descriptors. Considered, the handle after the sample is placed in a hidden part of the register segments, in memory.

7

The basic segment fields placed in various parts of the descriptor: 32-bit base of the segment is posted in three parts and defines its place within the 4-Gbyte linear address space, 20-bit boundary of the segment is posted in two parts and defines its length, the remaining bits of the descriptor form field attributes. The length of the segment, depending on bit granularity, (G), is specified either in bytes, or in pages:

1. 0, bytes;

2. 1, page (C = 4Kb) 220 * 215 = 232 (4GB).

D bit specifies a data type, placed in the segment:

1. D = 0 – 16-bit data,

2. D = 1 – 32-bit data.

AVL – bit, available to the user (available). Bit P – bit presence: 0 – on the drive, 1 – memory Bits DPL – privilege level descriptor (Descriptor Privilege Level), protecting access. When accessing the segment, the requested privilege level, or RPL current privilege level CPL (corresponds to the privilege level of the descriptor code perform now program) must be greater than DPL (in a logical sense; for comparison of their numerical values must be less than). Bit S bit mode segment: user or system (User / Supervisor). Bits type say, is a segment of program or data and determine the access mode. Bit And – bit reference to the segment, is set when accessing the segment and after some time reset the operating system (provides discipline-replacement segments).

Reklama