Memory Protection

trekiej · 3094

trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
on: October 23, 2019, 06:26:57 PM
When should it be added?
Now or later?



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #1 on: October 23, 2019, 06:58:19 PM
and how do you think it might work?



trekiej

  • Member
  • ***
    • Posts: 190
    • Karma: +5/-0
Reply #2 on: October 23, 2019, 09:14:19 PM
Ugh, you got me. I have no idea.



jacko

  • Newbie
  • *
    • Posts: 36
    • Karma: +1/-0
Reply #3 on: October 24, 2019, 04:16:34 AM
There is a new allocmemprotect call which allocates memory which is protected fron other task/processes and which gets freed when the process ends or gets killed. All system task like intuition, dos and exec have full access to it. Access from all other is restricted depending on allocmemprotect protection parameter

Just as first idea



Samurai_Crow

  • Junior Member
  • **
    • Posts: 88
    • Karma: +32/-0
  • Hobby coder
Reply #4 on: October 24, 2019, 01:42:59 PM
On OS4 there's already a MEMF_PRIVATE flag that does something like what you describe.  It doesn't do much for crash protection though.

SafeC as managed code would make a bigger difference without straining the MMU muscles.  Maybe that would be a wiser alternative to memory paging.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #5 on: October 24, 2019, 01:45:39 PM
we do have that flag as well as far as i recall.



miker1264

  • Legendary Member
  • *****
    • Posts: 1827
    • Karma: +84/-6
Reply #6 on: October 24, 2019, 02:04:50 PM
we do have that flag as well as far as i recall.

I believe I have seen it as well. Not sure if there is much benefit in using it though.



jacko

  • Newbie
  • *
    • Posts: 36
    • Karma: +1/-0
Reply #7 on: October 25, 2019, 10:36:23 AM
1. nearly no program uses this flag because it's too restrictive, you cant use it for system functions (remember what I wrote, Intuition/dos and so on should have full access)
2. it does not track memory, if the program crashes you cant "remove" these memory areas
3. it certainly needs some more functions like change access parameter, check access
4. it needs memory pooling (like AllocPooled) because of the MMU pagesize (usually 4k)
5. SafeC and managed code does prevent nothing without MMU  protection as long you are not the only program in memory (the memory manager in managed code can have the same errors, and one not safeC/managed code program can destroy all other)
6. it's would be start and better as current situation