|
This
is both easier and harder than you think that it is.
1.
virtual memory on AS/400 is virtual. Virtual storage is allocated in
contiguous addresses. In virtual space, byte 4095 is adjacent to byte
4096. Every time. The machine protects you from the unpleasant
physical implementation.
2.
There is a mapping between virtual and physical memory that is maintained by the
hardware and the storage management code. When physical pages are loaded
into main storage, their virtual and physical addresses are stored into a
physical area called the primary directory. This space is organized as a
hash table. Each row in the table contains virtual address, physical
address, a referenced bit, a dirty bit, the pointer tags, and perhaps some
authority information. [There is also a high-speed cache called the
"translation lookaside buffer" or TLB. This device has no effect on
function, only on performance, so I will ignore it.] If your program
refers to an address, the hardware looks in the primary directory to see if that
virtual address is currently present in memory. It looks not for the
entire byte address, just the 4k page. I will call this the "virtual
page". If the virtual page address is present in physical memory, the byte
offset into the 4k page is appended to the physical address and the combined
value is used for the operation. If the virtual address is not present in
the table, a page fault is signaled and the current program is suspended while
VLIC storage management code is invoked to bring the virtual page into main
storage. When the page fault operation has completed, the hardware
instruction that previously failed with the page fault is executed again.
In the process of moving the page into memory, an entry is made in the primary
directory indicating that virtual page such-and-such is currently located in
physical-memory-frame thus-and-so; its reference and dirty bits are off and
pointer tags are set.
3.
Pointers always contains virtual addresses. Since the translation to
physical addresses occurs in the hardware using a translation table maintained
by the hardware, the physical non-contiguity of the addresses is not
material. When your program adds 1 to the pointer, you are incrementing
the virtual address stored in there. The physical address cannot be known
without examining the hardware tables that perform address translation.
This
is a combination of conventional virtual memory management and AS/400
single-level storage concepts. I hope that this is helpful.
Richard Jackson
|
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.