Welcome, Guest. Please login or register.

Author Topic: Memory Protection AGAIN  (Read 8344 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Memory Protection AGAIN
« on: April 01, 2008, 11:52:00 AM »
Quote

AeroMan wrote:
Thanks for the explanation Bloodline,

One more question:


Would it be possible to treat memory under three different areas like this:

 1) System (system structures and stuff that wasn't previously allocated) - memory has no protection and everyone can see and modify it.


BANG! You are no longer memory protected... any rogue task can take the sysetm down.

Also pretty much the entire OS would need to be shared... what kind of weird OS protects it's tasks and not the OS :lol: ;-)

Quote

 2) Code (all of it...) - only system can play around with that. Let's sacrifice self modifyable code.


That's a good one, I think OS4 does this... but without full memory protection, one naughty task and the whole system integrity is gone... BANG! No more memory protecction!


Quote

 3) Data (all allocated memory) - only tasks and sub tasks may modify it.


The Tasks don't provide enough info to the OS for it to know what needs to be shared and what doesn't... it would all have to be shared... BANG! No more memory protecction!

Quote

It is not perfect, but maybe it can improve a little bit the situation. ;-)


A little protection is more dangourus than no protection... it might hide a more serious problem with your program!!! :-(

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #1 on: April 01, 2008, 11:57:38 AM »
Quote

shoggoth wrote:
In FreeMiNT (ok, I'm from the other side of the fence, sorry), it's possible to specify the level of protection for each process through dedicated flags in the program header. In practice, this means that you can flag two apps as belonging to "global" memory, causing them to share the same address space. These two applications can then access eachothers memory freely. (Ok, it's not considered perfectly clean, but it provides some degree of compatibility for older applications). Well behaved applications can run as "private", and their memory can't be touched nor can they touch other memory belonging to other processes.

Couldn't this approach be used in AmigaOS as well?


It's easy to put Memory Protection into AmigaOS... but it will break all exisiting apps since they do not tell the OS that that want to share data...

What you seem to be sugesting is sandboxing the old apps... this is indeed the only way to add MP :-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #2 on: April 01, 2008, 12:21:37 PM »
Quote

Einstein wrote:
Quote

biggun wrote:
My 2 cents,

* Memory protection is nearly impossible to implement under the idea of AMIGA OS.


So apple fans don't regard MacOSX as Mac(OS) ?


Actually I'm a bit of an Apple fan... and I don't consider anything pre MacOSX to be MacOS :-D :lol: But then I've only ever really used and owned OSX based Macs.


Biggun has a point though, as soon as we add MP, we essentially have a new operating system... in much the same way as OSX isn't the same OS as System x.x

If we want MP, we will need to sandbox all the old apps... in the same way Apple sandboxed Classic apps in OSX :-)

Quote

Quote
* That AMIGA OS does not require memory protection gives it a VERY BIG speed boost.


What is the performance boost useful for when you will *not* use it for anything meaninful when slightest bug in any running task can destroy, say, the CD/DVD I was burning. Now it's (the CD/DVD) just useless and intended for the garbage can, and I'm now loading XP to do it the *safe* way, sheesh!


Yeah, trouble is I agree with both of you here! :crazy:


Quote
* I would like to point out that there are other ways to stabilize a system. 99% of crashed come from bad pointer arithmetic. You can try to reduce the harm cause by the bad pointer by enforcing memory protection (for a high cost) or you can use coding styles which will not cause this problem in the first place. A would like to point out that the Amiga Oberon programs did NEVER crash!

Quote

It's like saying we don't need Police Departments, only if people behave than we could rid of'em have gain an economic boost, but unfortunately this is not reality.

[/quote]

Actually I'm actinated by Managed code systems... but it's not an option for AmigaOS, unless you band the use of C/C++/ASM/E/Etc...

Quote

Quote
I agree that this topic has nothing to do with the Coldfire.
And that for continues discussion opening another thread makes good sense.


Well, claims need to be answered, on spot, sorry about that.


Well lets keep all replies in this thread now :-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #3 on: April 01, 2008, 12:55:05 PM »
Quote

Einstein wrote:
Quote

bloodline wrote:

Actually I'm a bit of an Apple fan... and I don't consider anything pre MacOSX to be MacOS :-D :lol: But then I've only ever really used and owned OSX based Macs.


Biggun has a point though, as soon as we add MP, we essentially have a new operating system... in much the same way as OSX isn't the same OS as System x.x


But users don't dwell in the OS internals :)


AmigaOS users do... it's all we have left! :-D

Quote

Quote
If we want MP, we will need to sandbox all the old apps... in the same way Apple sandboxed Classic apps in OSX :-)


I agree, it's the only way to remain truely compatible while freeing the OS from stone age technology.


Bring on AROS 2.0!! :lol:

Quote

Quote
Quote

Quote
* That AMIGA OS does not require memory protection gives it a VERY BIG speed boost.


What is the performance boost useful for when you will *not* use it for anything meaninful when slightest bug in any running task can destroy, say, the CD/DVD I was burning. Now it's (the CD/DVD) just useless and intended for the garbage can, and I'm now loading XP to do it the *safe* way, sheesh!


Yeah, trouble is I agree with both of you here! :crazy:


Well one either trades off safety or speed, I do the latter since I'm perfectly sane :-P


Well, the lack of MP (or rather AmigaOS's weird modular everything in user space kernel-type-thing) is probably the only real difference between AOS and all other OSs...

AmigaOS is a wierd beast, it's not quite one thing or the other... :-)

Quote

Quote
Well lets keep all replies in this thread now :-)


Sure thing :)


Woohoo! ~7800 posts and finally, my own thread :-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #4 on: April 01, 2008, 02:41:08 PM »
Quote

shoggoth wrote:
Quote

bloodline wrote:
Quote

shoggoth wrote:
Couldn't this approach be used in AmigaOS as well?


It's easy to put Memory Protection into AmigaOS... but it will break all exisiting apps since they do not tell the OS that that want to share data...

What you seem to be sugesting is sandboxing the old apps... this is indeed the only way to add MP :-)


Maybe I'm completely lost, but let's say there is a default state for legacy applications, identical to what I referred to as "global" in my previous post. Any application that hasn't explicitly declared itself as being memory protection aware will run in this mode. An extra hunk in the binary format could declare the protection mode for each segment. The OS treats such binaries differently compared to legacy binaries. The result is protection for "modern" apps, while keeping compatibility (and risks) with older apps.

(note - I haven't exactly fooled around with kernel design, so take this as food for debate rather than proper argumentation)


Yes, that's right. This is almost exactly as apple did it... The OS detects via the file header that the app predated MP and then that app is loaded into a sandbox environment that has no Memory protection... in AROS this is how one could use an integrated UAE :-)

But this thread isn't about how to build a sandbox, it is about ideas to retrofit MP into AmigaOS and why it isn't really possible :-)

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #5 on: April 01, 2008, 04:07:11 PM »
Quote

shoggoth wrote:
Quote

bloodline wrote:
But this thread isn't about how to build a sandbox, it is about ideas to retrofit MP into AmigaOS and why it isn't really possible :-)


Ah, sorry, my bad. I thought it was about memory protection in an AmigaOS-like environment :)


Well, I suppose it is really... But, there is nothing really to debate on the "Sandbox" issue... :-D

What is interesting is to give people a greater insight into how AmigaOS works at a fundamental level, it's a facinating topic, and one that I really enjoy thinking about... AmigaOS is the last of it's kind... a living fossil, if more people studied it they would have a better idea of operating system design, for sure!

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #6 on: April 01, 2008, 07:17:57 PM »
Quote

adonay wrote:
@bloodline whats up with the extreme doubble posting always "the higher the multiplyer the better" ? Surely you must know how to use edit ? Does not make sense to me ? :lol:


I'm sorry, I've not double posted... :-?

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #7 on: April 03, 2008, 03:21:33 PM »
Quote

warpdesign wrote:
Quote

But thats not the question, the question is how many OS9 app (or 68k apps back when PPC was introduced) were people running when the 1st switched to OSX ?

Seeing how difficult to make it run (you needed a true copy of OS9.x, etc...), I guess not that much.
And I would add to that: how long did they use it before switching to OSX native equivalent apps ?


IIRC Apple have OSX out as MacOS Server etc, 2 years before Actually releasing it to the consumer... plus it had it's NeXT heritage, so there was plenty of time to develop for it... And they put in a MacOS classic compatible API (al la Carbon - Probably quite easy due MacOS classic's simplicity), to allow easy porting of existing source code... so I doubt OS9 stuff hung around for too long... I joined the Mac brigade in 2005... so None of my software was ever OS9 or 68k... and a year later I was intel Mac :-)

Quote

And when did developer switch to OSX ? As soon as they saw the benefits from using it...


As soon as they could I expect.

Offline bloodlineTopic starter

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: Memory Protection Again
« Reply #8 on: April 04, 2008, 06:19:41 PM »
Quote

stefcep2 wrote:
!


Loosing data once every x minutes cannot be fun (?), unless one only uses the OS as a single-tasking one, that is only run one app at any given moment 8-)
Yet still, the previous app might have done something nasty, so I change it to: run one app and reboot before the next. :hammer: [/quote]

Fortunately many good programmers learned to program well enough that Amiga crashes are less common the win98se crashes (in my experience having spent years using both) but far more common than winxppro (lots of individual program crashes but NOT ONE system crash in 18 months)[/quote]

Amiga programs are not even half as complex as any program I use on my Mac... No program as big as Logic Pro 8 will be totally bug free...