Browsing this Thread:
1 Anonymous Users
|
Anonymous
|
Re: Memory protection
|
|||
|---|---|---|---|---|
|
Quote:
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. |
||||
|
||||
|
Re: Memory protection
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
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.
Posted on: 2004/4/19 4:17
|
|||
|
||||
|
Re: Memory protection
|
||||
|---|---|---|---|---|
|
Not too shy to talk
![]()
|
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
|
|||
|
||||
|
Re: Memory protection
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
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:
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
|
|||
|
||||
|
Re: Memory protection
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
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
|
|||
|
||||
|
Anonymous
|
Re: Memory protection
|
|||
|---|---|---|---|---|
|
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. |
||||
|
||||
|
Re: Memory protection
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
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
|
|||
|
||||
|
Re: Memory protection
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
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.
Posted on: 2004/4/18 20:09
|
|||
|
||||
|
Re: Memory protection
|
||||
|---|---|---|---|---|
|
Home away from home
![]()
|
Quote:
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
|
|||
|
||||
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.







