Login
Username:

Password:

Remember me



Lost Password?

Register now!
Main Menu
Who is Online
9 user(s) are online (8 user(s) are browsing Forum)

Members: 0
Guests: 9

more...


Browsing this Thread:   1 Anonymous Users




« 1 (2) 3 4 5 6 »


Re: Memory protection
#42
Home away from home
Home away from home


See User information
hmm seems a lot of confusion on whether memory protection is possible/viable under AROS and the pitfalls.

my views are this....

1> No one has actually tried to implement it so it is mute to say its impossible. Most other operating systems that have a "long history" started without memory protection yet they now have it.

2> The "performance loss" required by memory protection is minimal at worst.

3> Claims of "99%" etc of programs not working is mute since again - no one has actually tried - only theorised, but most programs themselves are written in a perfectly legal way, its the underlying OS functions which would break.

4> The problem itself is to do with message passing in a protected environment - this is something that can be fixed i believe.

5> There is no need for a sandbox like environment since we dont actually run _ANY_ amigaos software.

its all compiled for aros and as such we have access to the source code.

im not aware of any third party software for aros that isnt part of the aros cvs tree so none of the offending programs cant be fixed or at worst diasabled for now.

the only need for a sandbox would be if we emulate using uae or whatever is decided. All native apps should work, or be considered broken in need of fixing.

[/views]

I agree we should implement it now rather than later since at a later date there "may be" third party apps, or the aros code base may become so huge that the task is enourmous.

It would also ensure aros is a more stable OS to develop and to develop for.

A CVS Split would be the best idea, and backport the work once it is at a stable point.

Posted on: 2004/4/20 3:46
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Anonymous
Re: Memory protection
#41
Quote:

Easy example: program A opens serial.device and queues a request for data (say to receive data from a serial graphics tablet). The IORequest is a pointer - to what? To memory allocated by, or actually part of program A. Devices use a task to handle queued data requests, so the task associated with serial.device is sticking data into a block of memory pointed to by a pointer inside another block of memory it was given a pointer to as part of the request. See the problem? The data buffer and the IORequest itself need to be allocated with MEMF_PUBLIC, but they are often just embedded in the program's data section, or if allocated, are allocated without the flag. All global structures passed to the OS must be allocated with MEMF_PUBLIC. It can be done... it's not THAT much work, but you know how lazy we programmers are


Not sure. I guess the neatest way to solve a problem like that is to design a new "safe" device architecture. Then each process that uses this pointer trick could have it's own serial.device, which talks to the new device in a safe way.

As I say, I never learned AmigaOS internals, but I think it can be possible to provide protection on a task-by-task basis, even for old apps through virtualisation.



 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Memory protection
#40
Home away from home
Home away from home


See User information
Quote:

MuMart wrote:
Could you give me an example of which apps like to pass pointers around? This problem could be easily worked around by allowing multiple processes to share address spaces if necessary.


Easy example: program A opens serial.device and queues a request for data (say to receive data from a serial graphics tablet). The IORequest is a pointer - to what? To memory allocated by, or actually part of program A. Devices use a task to handle queued data requests, so the task associated with serial.device is sticking data into a block of memory pointed to by a pointer inside another block of memory it was given a pointer to as part of the request. See the problem? The data buffer and the IORequest itself need to be allocated with MEMF_PUBLIC, but they are often just embedded in the program's data section, or if allocated, are allocated without the flag. All global structures passed to the OS must be allocated with MEMF_PUBLIC. It can be done... it's not THAT much work, but you know how lazy we programmers are.

Posted on: 2004/4/19 4:17
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Memory protection
#39
Not too shy to talk
Not too shy to talk


See User information
Maybe someone could plead with mike sinz of Mksoft (and commodore-amiga) to do a new enforcer/mungwall for aros..

http://www.sinz.org/Michael.Sinz/Amiga/

Posted on: 2004/4/19 2:17
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Memory protection
#38
Home away from home
Home away from home


See User information
Quote:

MuMart wrote:
I think AROS should have a proper virtual memory architecture. That way we solve the memory-fragmentation problem aswell (memory fragmentation used to give me more problems than protection)


The two are unrelated. Anyway with the amount of memory available on modern computers, along with the careful use of Memory pools fragmentation is not something you will notice on AROS. But VM is quite a simple thing when compared to MP.

Quote:

Could you give me an example of which apps like to pass pointers around? This problem could be easily worked around by allowing multiple processes to share address spaces if necessary.


They all do. That is why I suggest we have a non MP AROS hosted on top of an MP AROS. The Old Amiga Apps will run in the NonMP AROS sandbox... the ther MP aware apps will run in MP AROS.

If you read back through this thread, this has been disscused.

Posted on: 2004/4/18 20:54
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Memory protection
#37
Home away from home
Home away from home


See User information
Quote:

damocles wrote:
by bloodline on 2004/4/18 16:09:47

Quote:
I would enforce the use of the MEMF_PUBLIC flag when needed, and we should enforce the use of the Resource tracking features of AROS.


Are there existing flags to make apps with full blown memory protection? I am want to include the use of them in any future bounty.

Dammy


Best talk to Adam, he has the legacy compatible idea of introducing an MEMF_PROTECTED memory flag.

Personally I'm against that, but frankly Adam is right if we want to keep running AmigaOS apps in AROS.

Posted on: 2004/4/18 20:45
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Anonymous
Re: Memory protection
#36
I think AROS should have a proper virtual memory architecture. That way we solve the memory-fragmentation problem aswell (memory fragmentation used to give me more problems than protection)

Could you give me an example of which apps like to pass pointers around? This problem could be easily worked around by allowing multiple processes to share address spaces if necessary.


 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Memory protection
#35
Home away from home
Home away from home


See User information
by bloodline on 2004/4/18 16:09:47

Quote:
I would enforce the use of the MEMF_PUBLIC flag when needed, and we should enforce the use of the Resource tracking features of AROS.


Are there existing flags to make apps with full blown memory protection? I am want to include the use of them in any future bounty.

Dammy

Posted on: 2004/4/18 20:34
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Memory protection
#34
Home away from home
Home away from home


See User information
Quote:

damocles wrote:
by Lanza on 2004/4/18 15:07:40Quote:
Implement MP in AmigaOS would break compatibility with prior applications. That is the major problem. AROS has currently nearly no apps, and they need to be compiled specifically. Though, my thought was that there may be an opportunity to implement MP in AROS, before compatibility of existing apps become an issue. But this is only my humble opinion :)


Which brings up a question I have as a non-Dev: Could MP code be included in the new applications/deamons even though AROS doesn't support it yet? In other words, make all new applications MP ready for the eventual MP support? That may be the avenue to lead the horse to the stream for a nice long drink of MP. ;^)

Dammy


I would enforce the use of the MEMF_PUBLIC flag when needed, and we should enforce the use of the Resource tracking features of AROS.

Posted on: 2004/4/18 20:09
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 


Re: Memory protection
#33
Home away from home
Home away from home


See User information
Quote:

MuMart wrote:
I know nothing of how AmigaOS works, but I really don't see the problem. In UNIX, processes are completely virtualised. They can see the kernel and use shared libraies but not other applications.

I don't see why it shouldn't be possible to do the same in AROS. Each app has it's own virtual AROS system with it's own environment. Library and application code could be shared between processes (ie virtual AROSes) with a copy-on-write strategy.

Is there a problem with the way the GUI is implemented, or is it a problem with the message-passing? I just don't get it.



The problem is that amiga programs have been written which share pointers around.

If one task allocates a block of memory, then passes a pointer to the memory block to another program. Then there is no way of the system knowing who owns that memory block.

The AmigaOS design included a MEMF_PUBLIC flag to show that a particular memory block was accessable by more than one task, but since no memory blocks were ever actually protected in AmigaOS, no Amiga programmers ever bothered to use it

Also if a block of Memory is flagged as public, and the tasks using that memory both die (or are killed) the system has no way of knowing if any other task is still using that memory. So it can't be deallocated, and so will jsut sit there wasting memory until the next reboot.

It is details like this that exist in the AmigaOS API (and obviously AROS API) that cause problem when trying to implement MP.


What can we do?
I would propose that we make all memory allocations protected by default, unless they have an MEMF_PUBLIC flag. This is what is stated in the RKM

But Adam has pointed out that would break just about every program out there. Fabio has also pointed out that AROS has no way of handling a "privilage violaton" of this type.

If we were to implement Protected memory spaces, then we would probably need to have a locking mechanism of Public memory blocks, so the OS could flush them if they are unlocked. etc...

This is quite a major undertaking.

Posted on: 2004/4/18 20:07
 Top  Twitter  Facebook  Google Plus  Linkedin  Del.icio.us  Digg  Reddit  Mr. Wong 




« 1 (2) 3 4 5 6 »



You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[Advanced Search]


Search
Top Posters
1 paolone
paolone
4462
2 nikolaos
nikolaos
4206
3 magorium
magorium
4095
4 phoenixkonsole
phoenixkonsole
3942
5 deadwood
deadwood
2917
6 ncafferkey
ncafferkey
2810
7 mazze
mazze
2222
8 Kalamatee
Kalamatee
2212
9 clusteruk
clusteruk
2114
Powered by XOOPS © 2001-2025 The XOOPS Project