Welcome, Guest. Please login or register.

Author Topic: How to move AROS forward  (Read 10767 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: How to move AROS forward
« Reply #119 from previous page: July 29, 2008, 08:09:20 PM »
Quote

Hans_ wrote:
Quote

bloodline wrote:
Quote

Ok, now you've lost me. On all OSes, function calls to libraries are simple jumps.


I'm not talking about libraries, I'm talking about how you make a system cal to the Kernel. On AmigaOS Kernel calls are simple jumps the same as a library, but on a Real OS, that has a separate kernel space, you then need to use an interrupt to jump into Kernel space...


Ok.

Quote

Quote

Sending messages between processes require an interrupt. However, that's exactly the same in Amiga OS. Amiga OS programs don't just suddenly start executing each other's code within their own task/process. If a message is sent, one task/process is put to sleep (at the interrupt), and the other is woken up by the OS so that it can respond.


But calling the message function does not trigger a reschedule, AFAIR... thus does not interrupt...


The other task won't receive the message until a context switch (requiring an interrupt) occurs.


Of course :-) But the actual message passing does not trigger one.. I could be wrong, here it's not really very important, we are just arguing semantics, so hopefully Henry will ignore this part of the thread.. I'll check the RKMs later and confirm.

Quote

Quote

Anyway, my point was to show how separate address spaces actually work... Henry is missing a fundamental point of MP. It is this point we need to address.

There's no need for separate address-spaces. Full memory-protection can be achieved without it.


Lets not confuse Henry anymore, please :-) We need to present the simplest example, since that gives the clearest example of why AmigaOS can't have MP...

Offline HenryCase

  • Hero Member
  • *****
  • Join Date: Oct 2007
  • Posts: 800
    • Show only replies by HenryCase
Re: How to move AROS forward
« Reply #120 on: July 29, 2008, 09:02:21 PM »
Quote
Hans_ wrote:
In theory it's all possible simply because we know that humans can do it.


I think that's one of the factors that is driving me on.

Quote
bloodline wrote:
In an MP OS, one would define that the pointer returned by AllocMem() is for the use of the calling task only.
In AmigaOS the pointer returned by AllocMem() is free for any task to use, this is defined behaviour.


Okay, so Amiga software expects to be able to use pointers defined by other Amiga software. So there is almost a pool of memory pointers. Can we put these memory pointers in an OS controlled environment and control which programs we'd like to use these pointers?

In the place of the pointers in the application code we put a 'port' to the shared pointer area. When a program then wants to access the data or instruction in memory a request to the OS goes to through that port. The OS then uses the pointer itself, and the outcome of this action is stored in a 'quarantine' area in memory. The OS then tries to determine (based on past experience and/or user preference) whether that data should be given to the application.

Way I see it, if a program causes a computer to crash, we should be able to determine when it crashed, and what was the last value (data or instruction) to be passed for processing, right? If we can do this, we have options when it comes to crash protection (which is the main benefit of MP IMO), as long as we catch the value before it is passed for execution (or maybe before storage in its designated memory location).

Or maybe we don't have those options... can you give me typical low level examples of what causes a computer to crash?

Quote
Hans_ wrote:
What exactly is wrong with allowing old software to be fully-allocated in shared-memory and run in a sand-box?


I want to see the AmigaOS 3.1 API succeed as much as possible as I see it as a bridge between different Amiga-based OSs. A sandbox is okay, but it would split the community again as there would be a new 'native' API. AROS is in the unique position to bring the Amiga world together, and I don't want to see it lose that.

Quote
Hans_ wrote:
Henry is suggesting getting the compiler to insert the MEMF_SHARED flag (and/or whatever else woulld be used) whenever it's necessary. The problem is that finding out when it's necessary is incredibly complex.


Correct, I'm advocating making memory private by default. The 'finding out when sharing is neccessary' task I am trying to pass to humans.

Quote
bloodline wrote:
He needs to understand that the messages and message passing are not the problem, it's the contents that's the problem.

So I would prefer it if we could keep a examples as simple as possible.


bloodline, I appreciate your approach here. I agree it is best to keep the information you are all giving me as simple as possible, I do feel like I am slowly getting my head around the larger issues here, thank you for your patience (and everyone elses). The thing is I'm finding this discussion rather interesting, and as I'm getting more information it's throwing up more questions and possibilities in my head. Please forgive/understand my curiosity!
"OS5 is so fast that only Chuck Norris can use it." AeroMan
 

Offline itix

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2380
    • Show only replies by itix
Re: How to move AROS forward
« Reply #121 on: July 29, 2008, 10:19:44 PM »
@HenryCase

Quote

Correct, I'm advocating making memory private by default. The 'finding out when sharing is neccessary' task I am trying to pass to humans.


The problem is, you dont get true memory protection. You only get partial memory protection which is already available for Amiga: Enforcer and MuForce tools.

Again everything which is passed between applications and kernel must be public memory. Using private memory in Amiga is useless because such memory can not be passed to kernel calls because you dont know what kernel does with it. You can not trust that library calls can handle private memory.

These topics have been discussed at least 15 years and yet nobody, ever, not even the best developers, could ever introduce anykind of solid idea for true memory protection. Amiga has its limits and we have to live with it.

My Amigas: A500, Mac Mini and PowerBook
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: How to move AROS forward
« Reply #122 on: July 29, 2008, 10:37:15 PM »
Quote

HenryCase wrote:
Quote
Hans_ wrote:
In theory it's all possible simply because we know that humans can do it.


I think that's one of the factors that is driving me on.

Quote
bloodline wrote:
In an MP OS, one would define that the pointer returned by AllocMem() is for the use of the calling task only.
In AmigaOS the pointer returned by AllocMem() is free for any task to use, this is defined behaviour.


Okay, so Amiga software expects to be able to use pointers defined by other Amiga software.


Right. Data structures (which the pointers point to) can be shared between tasks and system libraries.  In an MP OS you can't share the data structures.

Quote

So there is almost a pool of memory pointers.


No, memory pointers are nothing but the address of the data structure in memory. For example on a real Amiga I know that $DFF180 always points to colour register 0, so I can write to that address if I want to alter that colour register... you see a pointer is nothing but a number, a programmer could allocate some memory, and then write anywhere he chooses within that area, a pointer to which would be an arbitrary number. If a program needed to share that pointer it could use that arbitrary number in a function call or pass it to another program... the OS has no way to know that that arbitrary number is a pointer... does that make sense?

Quote

Can we put these memory pointers in an OS controlled environment and control which programs we'd like to use these pointers?


No, there is nothing special about these pointers.

The nearest thing to what you are suggesting is a sandbox...

Quote

In the place of the pointers in the application code we put a 'port' to the shared pointer area.


No, the CPU doesn't use 'ports'... it just pushes numbers around, a pointer is just a number that points to a data structure.

Quote


When a program then wants to access the data or instruction in memory a request to the OS goes to through that port. The OS then uses the pointer itself, and the outcome of this action is stored in a 'quarantine' area in memory. The OS then tries to determine (based on past experience and/or user preference) whether that data should be given to the application.


The program doesn't make a request. The program tells the CPU to load some data. No requests are made, the CPU just does it.

But you still miss the point. If you know you have a pointer then find there are ways and means to trap it, etc, its very slow... but the take home point here is that there is NO WAY TO KNOW WHAT IS A POINTER and WHAT IS JUST DATA :-)

Quote

Way I see it, if a program causes a computer to crash, we should be able to determine when it crashed, and what was the last value (data or instruction) to be passed for processing, right? If we can do this, we have options when it comes to crash protection (which is the main benefit of MP IMO), as long as we catch the value before it is passed for execution (or maybe before storage in its designated memory location).


When an Amiga program goes wrong, it can randomly write anywhere in the memory. This puts the computer in an unknown state, once the machine is in an unknown state you can't recover, unless you have a full backup of the Memory.

Memory protection means, that when the program goes wrong, it can only destroy it's own data/code... Only that task is in an unknown state.

Quote

Or maybe we don't have those options... can you give me typical low level examples of what causes a computer to crash?


If the programmer has made a mistake, then the CPU might write some data over some important operating system code.

Quote

Quote
Hans_ wrote:
What exactly is wrong with allowing old software to be fully-allocated in shared-memory and run in a sand-box?


I want to see the AmigaOS 3.1 API succeed as much as possible as I see it as a bridge between different Amiga-based OSs. A sandbox is okay, but it would split the community again as there would be a new 'native' API. AROS is in the unique position to bring the Amiga world together, and I don't want to see it lose that.


The AmigaOS 3.1 API is common to all AmigaOS clones.. so that's that...

Quote

Quote
Hans_ wrote:
Henry is suggesting getting the compiler to insert the MEMF_SHARED flag (and/or whatever else woulld be used) whenever it's necessary. The problem is that finding out when it's necessary is incredibly complex.


Correct, I'm advocating making memory private by default. The 'finding out when sharing is neccessary' task I am trying to pass to humans.


But nothing would work if memory was private by default, because  MEMF_PRIVATE was never enforced on AmigaOS it was ignored... not just by app programers but the operating system designers too.


Quote

Quote
bloodline wrote:
He needs to understand that the messages and message passing are not the problem, it's the contents that's the problem.

So I would prefer it if we could keep a examples as simple as possible.


bloodline, I appreciate your approach here. I agree it is best to keep the information you are all giving me as simple as possible, I do feel like I am slowly getting my head around the larger issues here, thank you for your patience (and everyone elses). The thing is I'm finding this discussion rather interesting, and as I'm getting more information it's throwing up more questions and possibilities in my head. Please forgive/understand my curiosity!


My big concern is that you are attempting to solve a problem, without having an understanding of basic operating system design or even a simple grounding in assembler.

I think though you are missing the point, because you don't understand how a computer actually works. I think you really need to learn assembler, 68k is very easy and really fun... there are loads of good books both online and in good computer stores.

Offline HenryCase

  • Hero Member
  • *****
  • Join Date: Oct 2007
  • Posts: 800
    • Show only replies by HenryCase
Re: How to move AROS forward
« Reply #123 on: July 29, 2008, 11:04:19 PM »
Quote
itix wrote:
Again everything which is passed between applications and kernel must be public memory. Using private memory in Amiga is useless because such memory can not be passed to kernel calls because you dont know what kernel does with it. You can not trust that library calls can handle private memory.


So in an MP protected OS like, for example, FreeBSD, how do instructions/data get passed between applications and kernel?
"OS5 is so fast that only Chuck Norris can use it." AeroMan
 

Offline koaftder

  • Hero Member
  • *****
  • Join Date: Apr 2004
  • Posts: 2116
    • Show only replies by koaftder
    • http://koft.net
Re: How to move AROS forward
« Reply #124 on: July 29, 2008, 11:14:09 PM »
Quote

HenryCase wrote:
Quote
itix wrote:
Again everything which is passed between applications and kernel must be public memory. Using private memory in Amiga is useless because such memory can not be passed to kernel calls because you dont know what kernel does with it. You can not trust that library calls can handle private memory.


So in an MP protected OS like, for example, FreeBSD, how do instructions/data get passed between applications and kernel?


There are a ton of ways to do this.

Signals
Shared memory segments
IPC
TCP

With the exception of the SYS V shared memory segment thing, which is hardly ever used in my experience, all the intra process data sharing consists of passing messages from the process through the kernel and to the other process.
 

Offline Hans_

Re: How to move AROS forward
« Reply #125 on: July 29, 2008, 11:34:48 PM »
Quote

HenryCase wrote:
Quote
itix wrote:
Again everything which is passed between applications and kernel must be public memory. Using private memory in Amiga is useless because such memory can not be passed to kernel calls because you dont know what kernel does with it. You can not trust that library calls can handle private memory.


So in an MP protected OS like, for example, FreeBSD, how do instructions/data get passed between applications and kernel?


What Itix wrote may be a bit confusing because the kernel can actually read/write to whatever memory it likes (it's running in supervisor mode, not user mode), so that is not an issue. The issue is how to pass data to non-kernel OS modules. For example, much of the x-windows system on Linux runs in user-mode, and hence cannot access memory that it doesn't own. Someone else can correct me if I'm wrong, but my understanding is that Linux/BSD copies a message's content from one process' memory space to another. As a consequence, there can be no pointers to other memory in that message.

Full memory-protection means that all the data in a message (including data referenced by pointers) has to be shared with (or copied to) the other process. Thus, if an Amiga OS program passes messages to others with pointers to it's internal data, that data would have to be in shared memory (or temporarily shared); therefore, this program wouldn't be protecting its internal data. Changing such an application to use full memory-protection would essentially be a redesign of its internals, not a quick change in memory flags.

Hans
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project.
 

Offline Trev

  • Zero
  • Hero Member
  • *****
  • Join Date: May 2003
  • Posts: 1550
  • Country: 00
    • Show only replies by Trev
Re: How to move AROS forward
« Reply #126 on: July 30, 2008, 01:39:53 AM »
Quote
So in an MP protected OS like, for example, FreeBSD, how do instructions/data get passed between applications and kernel?


Memory protection and a distinction between "kernel" and "user" spaces are not dependent upon one another. You can have one without the other.

Some operating environments / operating systems / virtual machines use invalid opcodes and exception handlers to pass data between user and kernel environments or between subsystems. For example, Virtual PC uses opcode 0Fh,0C7h,0C8h and two bytes of data representing the API function to allow guest systems to communicate with the host environment.

The subsystem/sandbox approach is widely implemented in other operating systems, including consumer products, e.g. NTVDM (Virtual DOS Machine) and WoW (Windows on Windows) on 32-bit Windows NT, WoW64 on 64-bit Windows NT, FX!32 on Windows NT/Alpha, many Unixes which allow binaries from other Unixes to run natively, and Amithlon (I'm grossly oversimplifying, but it could be viewed as an Amiga subsystem on Linux).

The problem you're trying to solve is essentially the same one Microsoft solved to allow DOS and 16-bit Windows applications to run on 32-bit Windows NT. They run in either a shared or stand-alone memory space and communicate with the operating system and hardware through a transparent abstraction layer that converts software interrupts and 16-bit Windows API calls to an appropriate 32-bit Windows NT analog.

It's possible for DOS and 16-bit Windows applications to communicate natively with applications and hardware outside their sandbox by using custom modules that expose interfaces on both sides of the wall.
 

Offline warpdesign

  • Sr. Member
  • ****
  • Join Date: Feb 2008
  • Posts: 256
    • Show only replies by warpdesign
    • http://www.warpdesign.fr
Re: How to move AROS forward
« Reply #127 on: July 30, 2008, 01:52:31 AM »
Quote

Amiga has its limits and we have to live with it.

Why should we have to live with it ?

Especially now that we have a true memory protected kernel with Quark ?

Why...
 

Offline koaftder

  • Hero Member
  • *****
  • Join Date: Apr 2004
  • Posts: 2116
    • Show only replies by koaftder
    • http://koft.net
Re: How to move AROS forward
« Reply #128 on: July 30, 2008, 01:57:05 AM »
Wouldn't it be nice to have Aros hosted under L4 and extend from there...
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: How to move AROS forward
« Reply #129 on: July 30, 2008, 11:39:23 AM »
Quote

warpdesign wrote:
Quote

Amiga has its limits and we have to live with it.

Why should we have to live with it ?


Because this is as far as the AmigaOS API can go.

Quote

Especially now that we have a true memory protected kernel with Quark ?


:-? Quark isn't AmigaOS, it's modern microkenel. It's also proprietory, if we wanted to move the Amiga platform forward I would prefer an opensource solution. L4 is a cool system, but if you really want a MicroKernel, then I would probably choose something like Darwin, which has more real world useage and is being activly developed by comercial interests.

Quote

Wouldn't it be nice to have Aros hosted under L4 and extend from there...


What is the problem with using the Linux Kernel? It's far better supported than L4, I think it was Staf who proposed a minimal Linux with AROS-Hosted on top. You've never know Linux was there and you get all of Linux's Driver support... nice idea really.

Offline Louis Dias

Re: How to move AROS forward
« Reply #130 on: July 30, 2008, 12:05:42 PM »
Back on topic...

How to improve AROS:
Instead of the wants and desired being separate, come together, form a consortium, pool the bounty money and decide in order which bounties AROS NEEDS and prioritize them.  Then let programmers bid on only the top one.  They declare how much money it would take them to code it...  Then onto the next bounty if their is money left over...  Etc...  So 3 coders offer to code the top bounty, coder 1 says he'll do it for $3,000, #2 for @$2,500 and #3 for $2,750.  Bids can be private, bounty is publicly assigned to #2...
 

Offline cicero790

  • Sr. Member
  • ****
  • Join Date: Mar 2008
  • Posts: 322
    • Show only replies by cicero790
Re: How to move AROS forward
« Reply #131 on: July 30, 2008, 12:39:09 PM »
Bloodline wrote about using the Linux kernel.
Defender of the faith about using the L4.

To Defender of the faith: What is your vision for the advantages of using L4?
A1200 030 40MHz: 2/32MB Indivision AGA MkII
A600 7 MHz: 2MB
AROS 600 MHz
PC 13600 MHz: quad core i7 2600K 3.4GHz: 16GB RAM: ATI HD6950 2GB   (Yes I know)

WINUAE AmiKit ClassicWB AmigaSYS UAE4Droid  

 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: How to move AROS forward
« Reply #132 on: July 30, 2008, 12:43:41 PM »
Quote

lou_dias wrote:
Back on topic...

How to improve AROS:
Instead of the wants and desired being separate, come together, form a consortium, pool the bounty money and decide in order which bounties AROS NEEDS and prioritize them.  Then let programmers bid on only the top one.  They declare how much money it would take them to code it...  Then onto the next bounty if their is money left over...  Etc...  So 3 coders offer to code the top bounty, coder 1 says he'll do it for $3,000, #2 for @$2,500 and #3 for $2,750.  Bids can be private, bounty is publicly assigned to #2...


A bounty doesn't work like that. If I put $10 into a bounty it's for a spcific task, for something that I want.

Perhaps we could set up a GeneralBounty, that people can submit to, and let a "board of directors" decide where the Money goes depending upon what is considered most important. But honestly, I doubt it will be as sucessful as what we have now. There is no money in the Amiga platform anymore, what we do now is totally for fun... that includes funding bountys and developing for the various AmigaOS Clones.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: How to move AROS forward
« Reply #133 on: July 30, 2008, 12:46:38 PM »
Quote

cicero790 wrote:
Bloodline wrote about using the Linux kernel.
Defender of the faith about using the L4.

To Defender of the faith: What is your vision for the advantages of using L4?


From a geeky point of view, I'd prefer L4 as well, it has some great and unusual concepts... If we were setting up a company, that had investment and was going to produce our own hardware (i.e. of known configuration, and specific hardware) then I'd be keen to use L4.

But Linux has the advantage of software/hardware support and has been proven in the real world, plus AROS is already running quite happily on it, and integrated with it. :-)

Of course the advantage of this approach is that you can even swap out the underlying kernel, put something else there and all the AROS software would still run fine... or even lose the kernel altogether and let AROS run on it's own :-)

Offline cicero790

  • Sr. Member
  • ****
  • Join Date: Mar 2008
  • Posts: 322
    • Show only replies by cicero790
Re: How to move AROS forward
« Reply #134 on: July 30, 2008, 01:34:47 PM »
To Bloodline:  I see.  It's very interesting to hear great programmers talk about this, and I think the Aros will gain a substantially larger support the moment it gets modern browser support.  That's all it takes.  On Google you have a complete office and mail and it will be possible to use it in daily life. That will draw the old Amiga users back and the supporter base will grow bigger.
A1200 030 40MHz: 2/32MB Indivision AGA MkII
A600 7 MHz: 2MB
AROS 600 MHz
PC 13600 MHz: quad core i7 2600K 3.4GHz: 16GB RAM: ATI HD6950 2GB   (Yes I know)

WINUAE AmiKit ClassicWB AmigaSYS UAE4Droid