O
O
Old Odessa2015-11-16 20:12:34
Iron
Old Odessa, 2015-11-16 20:12:34

I can not understand what is the essence of the segment and page organization of memory?

Sorry, but I continue to ask stupid questions
this time what is the difference between segment and paging memory organization,
which means the smaller the page, the less internal fragmentation.
How does this fragmentation even happen?
do not swear, thanks)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey Polyntsev, 2015-11-16
@The_Chemis

In the implementation of paged virtual memory, the virtual address space is divided into parts of the same fixed size, called virtual pages. If a process's virtual address space is not a multiple of the page size, then the last page is padded with a dummy area. Physical RAM is also divided into parts of the same size, called physical pages. The page size is chosen as a multiple of a power of two. A copy of all virtual pages is stored on disk.
Paging memory provides only mechanical paging, it does not allow you to organize work with pages containing commands and data in various ways. With segmented memory allocation, the virtual address space is divided into parts called segments, the size of which is determined by the semantic meaning of the information contained in them. The maximum segment size is determined by the processor bit size, for a 32-bit processor it is 4 GB. The segments are not ordered relative to each other. The virtual address is given by a pair of numbers: the segment number and the offset within the segment. When a process is loaded, only a part of its segments is placed in RAM, the full image of the virtual address space is on disk.

R
Rsa97, 2015-11-16
@Rsa97

Segment addressing on x86 is a heavy legacy of 16-bit processors. Since the values ​​of the registers did not allow indirectly addressing more than 64Kb of memory through them, four segment registers were additionally introduced - CS (Code segment), DS (Data segment), ES (Extended Segment) and SS (Stack segment). The first one was used in conjunction with CS:IP (Instruction Pointer) as a point of the current program execution, the next two with the standard DS:SI (Source Index) and ES:DI (Destination Index) for multibyte view/copy commands, SS:SP (Stack Pointer) - pointer to the current stack position. At the same time, there were no special prohibitions on the use of segment registers in other combinations; it was quite possible to use CS:AX or DS:DX. The real memory address was calculated as segment*0x10+offset, thus addressing 1Mb of memory.

S
smt31, 2015-11-18
@smt31

The bottom line is the ability of several programs to work simultaneously with the same address space located in different places of physical addressing. 5884907ab79949a997e4cda985e64d64.gif962ad087335b4b758fbab42d992abf52.gif
You can read in more detail - Tanenbaum E. "Computer Architecture"
or see pictures and read pages with pictures you
like /search?q=%D0%B2%D0%B8%D1%80%...
https://www.google.ru/search?q=%D1%81%D0%B5%D0%B3%.. .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question