Memory Protection

From SpareMiNT Wiki

Jump to: navigation, search

This is an edit of mp.txt and mp_list.txt . It's not an independent file in freemint's doc directory

Memory protection works on a per-process basis. Unless it uses the specialmode bits in Mxalloc(), a process' entire text+data+bss and any memory it allocates will be of the same type. There are four types of memory:

Private
This is the default protection mode and most programs works as intended in this mode. In this mode the program's memory space is under a very restrictive protection: No one can access the area taken by the program, except the program itself and the operating system. Even interrupt handlers, if any are installed by the program, cannot do that.
Private/Readable
Here the protection is less restrictive: Still, noone can write to the program's area (except the program itself and the operating system), but everybody can safely read data from it. You should set this mode for GEM programs that use the AV protocol, but are not written with the memory protection in mind. ST Guide} is one of good (bad) examples here.
Super
The full name is "Supervisor accessible": The program's area can be accessed by noone (again, except the program itself and the operating system) as long as the "intruder" runs in the CPU user mode. However, any code running in the CPU supervisor mode (as an interrupt handler for example) can access the program's memory space freely. You should set this mode for software, that installs own interrupt handlers. The Dump!module player is a good example.
Global
This mode can be set, if a program does not run under any of the aforementioned protection modes. The program's space is unprotected and anyone can freely access it.

By default, all processes load into private memory. If a program terminates and remains resident with the Ptermres() system call, then its private memory will be converted to Super memory; that's because TSRs won't work in private memory.

Some TSRs may in fact need to be set to load into global memory (if they provide services for user mode programs). There are other programs which need to grant wider access to their memory space: for example, the Gulam CLI is one, because Gulam's children can call Gulam through a pointer found in the system variable space. But Gulam is a bad choice of shell anyway, because you can't run more than one of them. Current versions of STeno also must grant wider access, because it passes data to STalker using shared memory; private/readable is adequate for that.

Programs that load before MiNT does (i.e. in the AUTO folder) will find themselves in global memory. This is the easiest way to be sure that your TSRs will go on working: RAMdisks, FOLDR100, CACHE080, etc. all work when loaded that way.

Notice that a process can grant wider access to its own address space, but it can't change the access permissions of any other process' space. If you set the PRGFLAGS of some process so it loads into global memory, that doesn't mean it can access anybody else's memory, it just means that anybody can access ITS memory.

[edit] FreeMiNT Memory Protection Compatibility list

This list here is not complete. Fell free to update and correct it if something is wrong.

Program Version Flags Reason / Comment
papyrus 7.0x demo global if you use OLGA inplace ext.
CAB 2.7 demo global if you use OLGA inplace ext.
amail 1.05 global if you use OLGA inplace ext.
wdialog.prg 2.04 global (coding)
st-guide 15 readable (AV protocol)
finder 1.10 readable (AV protocol)
RSC-View 1.00 readable (AV protocol)
slay 0.1 readable (AV protocol)
1st-guide 16.01.1997 readable (AV protocol)
clock.acc 1.9e readable (AV protocol)

These programs seems to work without problems:

Program Version Reason / Comment
Thing 1.29 display broken AV clients(!)
CALAMUS SL 98 demo nice :-)
CAT 4.10 also nice :-)
HDDriver 7.70 also older versions work fine
Diskus 3.61 also older versions work fine
SysInfo 4.50 also older versions work fine
BoxKite 2.13 also older versions work fine
CHKDSK 3.0 it's from ATARI
LHarc Shell 3.10
STZip 2.6
Esscode 6.4
MiNT-Setter .6 nice FreeMiNT 1.15 tool
FSetter 0.6 nice FreeMiNT 1.15 tool
BreakOut 1.11 it's from ATARI
N.AES
all ported unix tools from F. Naumann
all supported software for FreeMiNT by F. Naumann like fnramfs, MinixFS & tools, ext2fs & tools, mkfatfs
the MiNT system software like MiNT-Net, NE2000.xif, GlueSTiK, xconout2.xdd, SPIN!, ...

This is a little outdated list: (feel free to clean up the text and enter better version)

Program Version Save Responsible
7Up 2.32 no Michael Thaenitz
Alert-Acc. yes
ApplList 0.4 yes dl1fdt@amsat.org
Artworx 1.4 no Christian_Witt@n.maus.de
BoxKite 1.80 yes Harald_Becker@k.maus.de
CAB 2.6 yes Alexander_Claus@of2.maus.de
Chatwin 3.08b yes Dirk_Haun@lb.maus.de
Clix 3.60 no Steffen_Engel@pe2.maus.de
Clock-Acc. 1.0 yes W. Klaren
COPS 1.07 yes Behne & Behne Systemsoftware GbR
Cypress 1.73 no
DirSort 1.1 yes Christoph Zwerschke
Diskus 3.11 yes us@bruker.de
E-Backup 2.01 yes
Everest 3.6D yes Oliver Schmidt
FED 1.70 yes
Fiffi 1.05 no Juergen_Koneczny@m4.maus.de
Finder 1.10 no Holger_Weets@ol.maus.de
freeBase 1.01 no Holger_Weets@ol.maus.de
GEMar 3.06 no Steffen_Engel@pe2.maus.de
GEM-Graph 1.0D yes ABC Software
GEMGS 5.10 yes hristian_Felsch@hh.maus.de
Gemini 1.a yes jr@ms.maus.de
GEM-init 0.77 yes U_Kaiser@t-online.de
GEMJing 1.06 yes
Interface 2.32 yes Olaf Meisiek
yesnE 1.52 yes Harald_Becker@k.maus.de
jinnee 1.0 yes Manfred_Lippert@n.maus.de
Kandinsky 2.5 no Ulrich Rossgoderer (1)
Les Yper Sound 0.1 yes Dirk_Haun@lb.maus.de
lps.ttp 1.24 no uereder@cip.informatik.uni-erlangen.de
MultiStrip 1.3 yes tommi@linguistik.uni-erlangen.de
MStrip-Config 1.3 no tommi@linguistik.uni-erlangen.de
MultiTex 5.2 yes
Newsie 0.69a yes
no!Desk 3.04 no no! (2)
NovaVDI 2.67 yes Computerinsel
NVDI 4.11.8 yes Behne & Behne Systemsoftware GbR
OLGA-Manager 1.3 yes Thomas_Much@ka2.maus.de
OLGA-Tools 1.0 yes Thomas_Much@ka2.maus.de
papyrus 5.11 no R.O.M.
Phoenix 5.0 yes Gebrueder Geiss/ASH
qed 4.5 yes Christian_Felsch@hh.maus.de
RCS 2.1 no ATARI Corp.
RCS 3.0 yes ATARI Corp.
RSM 2.15 yes A.Diedering@t-online.de
Scripter r1 no Holger_Weets@ol.maus.de
smurf 1.0 yes
SpeedUp 1.91a yes tommi@linguistik.uni-erlangen.de
ST-CAD 1.03 yes MKrutz@t-online.de
Start Me Up! 7.02 yes Thomas_Much@ka2.maus.de
SysInfo 4.30 yes Thorsten_Bergner@b.maus.de
TeraDesk 1.01 yes W. Klaren
TOSWIN2 2.2 yes Christian_Felsch@hh.maus.de
TWSM/2 2.0 yes tommi@linguistik.uni-erlangen.de
ZControl 0.24 yes dl1fdt@amsat.org
Personal tools
Resources