TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Eddy Thilleman
from: Herbert Rosenau
date: 1998-12-30 12:22:32
subject: more power

Hi Eddy,

 you wrote at 27.12.98  14:41 to Denis Tonn:
 
DT>> Memory is virtualized in OS/2. 

 ET> Memory = virtual memory?

Yes. Differ between

real memory	= RAM in your computer, can accessed by CPU
virtual memory	= Addressspace useable by OS, includes real memory as a subset

The virtual addresspace is in OS/2 2.x separated in

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

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

An other different use is:

tiled memory:	shared between 16 and 32 bit apps. Used to interchange
		data between programs of different bit type.
		to become compatibility it can only allocated by
		reserving 64MB RAM of an allocation block.

shared memory:	memory shared between 32 bit applications
		data/code

private memory: memory private to a process. private data

A 32 bit process contains at least:
	tiled memory:	for communication to 16 bit code
	shared memory:  code (program, dlls)
			data for communication between 32 bit code
	private memory:	data

A program/dll shares its codepage with all loaded programs linked to it
(shared memory). In default all data pages are allocated per process, It is
possible to link/allocate shared memory for interprocess communication.

Each code is loaded single and shared between each process used it. E.g. a
program "binkley.exe" can run multiple using singe code pages,
multiple data pages. Where the datas pages exists for each PID the code
pages only once.
Binkley.exe does not use shared memory.

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

 ET> So pointers to shared code/data don't have to be changed? So
 ET> pointers to a DLL don't have to be swapped when process switching
 ET> occurs, keeping speed as high as possible?

Yes. Altough the processor can only address physical RAM it sends an
interrupt to the OS if it finds a page not in memory. The OS will remove
the least used pages from memory an load the missing page in.

Loading a page is a difficult process. It my be 
- in swapper.dat 	then the page can simply transfered into memory
- in *.exe		the missing page is reloaded (with address translation)
- nowhere		the freed page is zeroed

In all cases the memory page is included in the allocation tables so the
processor can succesfull retake the instruction.

The processor records the number of access and the sequence to each page.
So the OS uses this information to become the least used page to 

- discard it		in case of code or empty page
- write it into swapper in case of data page


Tschau/Bye

Herbert


--- Sqed/32 1.14/development  54:
* Origin: Windows: A cute clown suit for DOS. (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™.