|
Register or have you forgotten your password?
|
|
|
| Amiga community support ideas This forum is for the open discussion of new thoughts and ideas intended to help the Amiga community. What do we need? What do we want? |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#46 | ||||||||||||||||||||||||||
|
Master Sock Abuser
|
Quote:
Quote:
Quote:
Quote:
Google and wikipedia are your friends here... I don't have to hold you hand the whole way? Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
You really must read about how virtual memory works as, this statement shows that you don't understand it at all! Quote:
Quote:
Quote:
Quote:
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
||||||||||||||||||||||||||
|
|
|
|
|
#47 | ||||||||||
|
Master Sock Abuser
|
Quote:
If you allow a system structure to be shared between apps, then it only takes one app to to accidentally or maliciously destroy that data structure to take that component down and the system is now broken... But shared memory areas are not a problem, and most OSs do allow a shared memory space, but their use is very carefully defined in the OS design, and nothing mission critical can be put there. With AmigaOS, you have NO way to monitor what is being passed between programs/system functions... this is a design feature of AmigaOS... it is defined by the way AmigaOS works! As soon as you add memory protection, the programs and functions will be passing rubbish between each other... and there is nothing you can do about that, because of the design of AmigaOS!!! If you add MP, you will be altering so much of the system that you will end up with a new operating system that is totally incompatible with AmigaOS 3.1... and if you are going to that much trouble, why not just take an existing system that already has the design features you want... In 1998 Apple had the same problem, MacOS was not able to have MP or multitasking by design... 6 years of attempting to retrofit them was fruitless... so they brought in a new system and then put an Emulator to run the old Apps... that would have been the only solution for AmigaOS too.
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
||||||||||
|
|
|
|
|
#48 | |||||||||
|
Technoid
![]()
Join Date: Dec 2007
Posts: 344
|
Quote:
Thanks for your vision on VmwAROS, I'm really happy it has been well received by the community. But VmwAROS is in first place an example of my "take action" motto: I felt AROS needed a modern, complete distribution since AROS-MAX was dead, and I simply MADE it. I'm neither a C developer nor a IT graduate, I'm simply what someone would call "power user". VmwAROS demonstrates that everyone of us, instead of simply whining or struggling in a stupid poor men's war, has the strenght to actually do something. It requires just a lot of will and some spare time. |
|||||||||
|
|
|
|
|
#49 | ||||||||||
|
Premium Member
|
Quote:
The problem with memory protection is that it is limited to memory granularity of the page size of the MMU which is usually 4k. If the assign command is only a couple hundred bytes long and you add memory protection to it it becomes 4k for the code, 4k for the stack, and 4k for any global data. That's 12k for the smallest program to run. That eliminates all of the streamlined efficiency of the AmigaOS when it needs more memory than it allocates just to run a small command. |
||||||||||
|
|
|
|
|
#50 | |||||||||||
|
Cult Member
![]()
Join Date: May 2006
Posts: 649
|
Quote:
Let me put it this way, while programming languages/compilers could theoretically generate safe code, there's nothing to stop someone from deliberately generating nasty code. Being able to compromise the whole system with a few trivial instructions is not acceptable. Sure, you may say, just don't run code from people you don't trust. Ok, how do you know who to trust? Protecting the system is part of a modern OS' job. Hans
__________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project. |
|||||||||||
|
|
|
|
|
#51 | ||||||||
|
Cult Member
![]()
Join Date: Oct 2007
Posts: 800
|
@bloodline
Whilst thinking about how we would need to change the core of AmigaOS to allow for MP, I thought of a talking point we can use to (hopefully) progress our discussion into something more productive. Am I right in thinking that your main argument behind 'no MP' with the OS3.1 API is because you can't think of a way of adding resource tracking without breaking compatibility? If I am correct, then lets look at how API calls with MP and non-MP operating systems compare. Lets take the allocation of memory API call for example. In AmigaOS we have AllocMem: http://utilitybase.com/ref/?keyword=AllocMem&funcgroup=AmigaOS&action=Search "memoryBlock = AllocMem(byteSize, attributes)" Now let's look at malloc, the equivalent memory allocation function in FreeBSD, an OS with MP: http://www.freebsd.org/cgi/man.cgi?query=malloc&sektion=9 "malloc(unsigned long size, struct malloc_type *type, int flags);" Okay, so let's compare these API calls. First we can see they both have attributes that allow you to set the size of memory space required. They also both have flags/attributes you can set to determine the behaviour of that memory space. With AllocMem (AmigaOS), we have the following flags: MEMF_CHIP (request ChipMem), MEMF_FAST (request FastMem), MEMF_LOCAL (memory survives CPU reset), MEMF_24BITDMA (used for setting memory for Zorro devices), MEMF_KICK (allows memory to be accessed by Exec early in boot process), MEMF_CLEAR (sets memory to all 'zeros'), MEMF_REVERSE (allocate from top of memory pool), MEMF_NO_EXPUNGE (prevents memory from being expunged on failed memory allocation) Now let's look at the flags we can set using malloc (FreeBSD): M_ZERO (sets memory to all 'zeros'), M_NOWAIT (returns value if memory cannot be set immediately), M_WAITOK (indicates okay to wait for memory to be set), M_USE_RESERVE (indicates memory can be set in memory reserved for OS use) Take a good look at AllocMem and malloc. If I didn't tell you that one function was used on a non-MP OS and the other was on a MP OS, would you have been able to tell just by looking at the API call structure? No. Similarly, the API call itself doesn't care if it's running on a MP OS or non-MP OS. There is no 'anti-MP' flag for AllocMem. Resource tracking is a separate issue from API calls, it is what the kernel handles. Thoughts?
__________________
"OS5 is so fast that only Chuck Norris can use it." AeroMan |
||||||||
|
|
|
|
|
#52 | ||||||||||
|
Master Sock Abuser
|
Quote:
Quote:
The problem is not that you can't add MP to AmigaOS. The problem is that when you add it, the system doesn't work like AmigaOS any more. In an MP OS, you pass data between programs and system functions. This is how they communicate. This is clearly defined behavior, as the OS and the programs "know" that they all live in separate address spaces... which are to all intents and purposes separate computers. In AmigaOS, programs pass pointers, NOT DATA, to each other... these pointers reference memory anywhere in the flat address space. As soon as each task gets it's own address space, the pointers which are passed between programs are meaningless!!! Thus all amiga software stops working! There is no way to fix this since AmigaOS only has one message passing system and the OS puts no controls on what is passed.
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
||||||||||
|
|
|
|
|
#53 | ||||||||
|
Master Sock Abuser
|
As an example,
Two task in AmigaOS... A and B Task A will allocate some memory and fill it with some Data, and then send a pointer to Task B. Task B receives that pointer and uses it to access the Data put there by Task A. This is a very quick process and requires only the memory allocated by Task A. In an MP OS there are several strategies used to pass data, I will only present a simple one here. Task A will allocate some memory and fill it with Data. It then must actually send that Data to task B, this means physically copying the Data from Task A's address space to Task B's Address space byte by byte... there are actually other strategies that one might employ (since this is rather slow) but it shows clearly the problem which we have to overcome! Task B must have it's own copy of the same Data in it's own address space in order to work on it. Amiga OS can happily use the slower more complex strategies for passing data, which are MP compatible... but these methods were never required and thus not used either by the OS or any applications... so we are stuck with a non MP compatible OS... since there is no way to know what the OS and task are passing to each other!
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
||||||||
|
|
|
|
|
#54 | ||||||||
|
Master Sock Abuser
|
In your AllocMem() Vs malloc() example...
The difference is this; AllocMem() returns an address that points to the same bit of memory to any program that were to receive that pointer. malloc() returns an address that is meaningful only to the task that called the function... any other task that receives that pointer has just received a meaningless pointer which points to nowhere that it can address!
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
||||||||
|
|
|
|
|
#55 | ||||||||
|
Merely Curious
![]()
Join Date: Jun 2008
Posts: 7
|
Hi guys,
sorry I didn`t read the whole thread...but here some notes from me. I suppose MP in this context means Multiprocessing, right? It`s true that most comercial and free operating systems out there use a separate address space for each process. This is a design decision** and not mandatory nor necessary for a MP capable OS. It`s possible to have MP working on a single address space and to use the MMU to extend this space beyond the physical memory by using the page swaping techique and to handle memory protection. Shared resources must still be protected through mutexes or semaphores from concurrent CPU accesses. In a single (flat) address space OS (SASOS) message passing is done by passing pointers to the data in memory, just like AmigaOS does, there is no need to move or copy data around. Note that even in non-SASOS data is generally not copied around, it`s mapped with the help of the MMU, so both processes may see the same data in the same place or in case a process already allocated that virtual memory region for other stuff, in different memory places. ** in the early days of computing when there was 16 bit address spaces only, address translations didn`t make much sense because one could not get over the 16 bit address space with it. Earlier MMUs just swapped memory regions with the bank switching method, thus having many code blocks using the same adresses but only one at a time. In the 32 bit era this technique became obsolete and segmenting and paging took over. However, using for each process different address spaces mapped to the same region simplified program loading as programs could be linked statically and did not need to be relocated in memory. In the 64 bit era there is realy no need to have many address spaces any more. Newer research OSes (e.g. singularity from Microsoft) are in fact SASOS. Best regards, Leo24 |
||||||||
|
|
|
|
|
#56 | |||||||||||
|
Master Sock Abuser
|
Quote:
Lets not even go near Multiprocessing yet as that is a whole other issue, which AmigaOS isn't well suited to... Quote:
Quote:
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
|||||||||||
|
|
|
|
|
#57 | |||||||||
|
Defender of the Faith
![]()
Join Date: Oct 2002
Posts: 1,874
|
@HenryCase
Quote:
Similarly you can not know who is really going to use memory allocated by AllocMem() or malloc() (in the end malloc() calls AllocMem()). On Amiga you can share all memory allocated by AllocMem()/malloc(), you can even share your code and structures allocated from the stack. There is no absolutely privacy on Amiga. Everything you do is exposed to other applications and both applications and kernel exploit this. Especially Kickstart 2.0 added many aspects to API which make adding MP even more difficult than it was for Kickstart 1.3. I should also remind you that OpenWindow() is only one of those few hundred functions which should change to introduce memory protection. Even message passing system in Amiga is flawed in this sense. To put it short Amiga API is completely broken and can not get fixed. If you want MP, that is ![]()
__________________
Only MorphOS makes it possible \o_ |
|||||||||
|
|
|
|
|
#59 | ||||||||||
|
Master Sock Abuser
|
Quote:
__________________
My iPhone Game: Puny Humans - http://itunes.apple.com/gb/app/puny-...362230281?mt=8 |
||||||||||
|
|
|
|
|
#60 | |||||||||
|
Cult Member
![]()
Join Date: Oct 2007
Posts: 800
|
@bloodline
I'm glad we're getting somewhere now, you were right I was unaware of the pointer usage in AmigaOS. Quote:
http://www.codeproject.com/KB/cpp/pointers.aspx So in C you set the pointer variable with a command like this: int* pNumberOne; (for a pointer of integer type) Now going to compare this with Pascal. Using this guide... http://www.learn-programming.za.net/programming_pascal_learn13.html So if you wanted to declare the same pointer in Pascal you would use these commands: var pNumberOne: ^integer; My question is this. When it comes to compiling the C and Pascal programs will they have the same machine code value for the pointer we declared?
__________________
"OS5 is so fast that only Chuck Norris can use it." AeroMan |
|||||||||
|
|
|
![]() |
| Bookmarks |
| Tags |
| aros , move , forward |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Of FPGAs and the way forward | SamuraiCrow | General chat about Amiga topics | 33 | 08-13-2008 09:01 PM |
| Looking Forward to 1993 | scuzzb494 | General chat about Amiga topics | 4 | 04-07-2008 11:51 PM |
| Linux: The way forward? | stefcep2 | Alternative Operating Systems | 2 | 02-02-2008 03:08 AM |
| Look forward to any new Amy news | Reactioned | General chat about Amiga topics | 12 | 08-21-2006 05:15 PM |
| Fast Forward to Jail | FluffyMcDeath | CH / Entertainment | 14 | 11-26-2004 05:56 PM |