TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Eddy Thilleman
from: Herbert Rosenau
date: 1999-01-07 12:51:34
subject: more power

Hi Eddy,

 you wrote at 04.01.99  11:39 to me:

 ET> Hi Herbert,

 ET> 30 Dec 98, Herbert Rosenau of 2:2476/493 wrote to Eddy Thilleman:

HR>>   3,5GB +-------------------------------+
HR>>         |       reserved for            |
HR>>         :       feature use by          :
HR>>         |       32 bit apps             |
HR>>   512MB +-------------------------------+
HR>>         |       memory for DOS,         |
HR>>         |       OS/2 16/32 bit apps     |
HR>>     0MB +-------------------------------+

 ET> Denis Tonn told me that the reserved memory (in OS/2 v2 and v3
 ET> GA) is located from 448 MB to 512 MB in the virtual address space.

Yes - but not SYSTEM-wide. The table above describes the system addressspace.
It is the whole address room a CPU like I80x86, Pentium... can address. Ths
space is hidden from each application.

There are kernel, driver, .........

An application addressroom looks like:

	512MB +------------------------------+
	      |    shared system addresses   |
	      :	Both system and application  :
	      |	have access to		     |
	448MB +------------------------------+ (not realy fixed)
	      |     nonshared Application    |
              :		code and data	     :
	      |				     |
	      +------------------------------+
	xxxMB |     shared Application       |
              :     code and data            :
	      |				     |
	  0MB +------------------------------+



HR>> The reserved area is used by NEW 32 bit apps in Aurora.

 ET> According to Denis that the reserved (protected) memory is
 ET> doesn't exist anymore in OS2 Warp 3 with recent fixpacks and also
 ET> not in Warp 4 so all OS/2 applications can use the memory between
 ET> 448 MB and 512 MB.

No. But the border of 448 ist not a static one. The space from 512 to 448
MB contains system code, data and the callgate. The needed space is like
system address space calculated in descending order. The real under limit
my be differ from release to releas, from fixpack to fixpack, So the 448 MB
border is a limit to give you - the application programmer - a hit of how
many memory you will have available. For 16 bit applications you have the
same addressrom based on address 0 up to about 448 MB tiled memory. 

HR>> A DLL is nothing than a trick to become more shareable code
HR>> pages and to have the code reuseable.

 ET> Also the same drive:\path\exefile 

No. No for ALL loaded *.exe they will link to, Code in an *.exe is shared
by all instances of that specific program. The same code in different *.exe
can not shared by default. A programmer must do some explicit tricks to
become shared pages and becomes unmaintetanceable code.

A dll has its code shared by default for all instances they link to. This
kind of linking is known as late linking. 

HR>> Loading a page is a difficult process. It may be
HR>> - nowhere               the freed page is zeroed

 ET> Explain this please?

You have (as programmer) the ability to define discardable pages which
containing constant 0 at startup. Such pages are good for short temporary
use. If the memory is unattached for long enough it will be discarded if
any other memory request (start of a program, swapping) needs real memory.
A new access will simply allocate a free page in RAM and fill it again with
0 (zero). So data goes lost.
So knowing the way OS/2 does its memory management it my be a good idea to
have quick access temporary data while memory (RAM) is low. But this kind
of page must be handled very carefully so nearly nobody uses it.

HR>> - discard it            in case of code or empty page

 ET> Empty page? An memory page can be freed when it is allocated and
 ET> this memory is de-allocated (pointers to it destroyed and this
 ET> memory marked as free)?

No. The pointer to the page is NOT lost. Only the page itself. The entry in
page descriptor says that page is not really existant and must be created.

A page descriptor contains flags for each page:

- is in memory: address ok.
- is NOT in memory, swapable, writeable: must reload from swapper
- is NOT in memory, swapable, readonly: must reload from original space
- is NOT in memory, discardable: is nowhere,
				 find or make free page in memory for it

The CPU reads ths flag for each access to an address inside the page. If
the page is NOT in memory it throws an exeption to Operatingsystem to
become the page accessable.

Other flags are set/written by CPU until each access to a page:
- usage counter
- usage time (relative)

The OS will find the least used page in RAM and if it is
- swapable, writeable: write it into swapper, 
- swapable, readonly:  is discardable,
- dicardable: nothing special,

and flag it in its description as NOT in memory. Then it will change to the
page the CPU requests it and fill the now epmty page with the requested
contens (swap in, read form *.exe, *.dll or simply zero it). Then the page
is flagged as in memory and the exeption is quit. So the CPU repeats the
last page access successfully.

You my wounder. Each exception contains an context switch, so the CPU
changes its context from application code to system code to work on the
exeption and back if the exeption is quit. A context switch exchanges *all*
registers (including all special registers) and a flush of all pipes.


Tschau/Bye

Herbert


--- Sqed/32 1.14/development  72:
* Origin: Als Atomkraftgegner benutze ich nicht einmal Kernseife! (2:2476/493)
SEEN-BY: 396/1 632/0 371 633/260 262 267 270 371 635/444 506 728 639/252
SEEN-BY: 670/218
@PATH: 2476/493 480 2410/200 2432/200 2433/1200 225 270/101 396/1 633/260
@PATH: 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.