4 ms·
That neat message passing design is also what made memory protection impossible, even on later versions of the OS. Sending a message from one task to another wa
by icedchai 5y ago
That neat message passing design is also what made memory protection impossible, even on later versions of the OS. Sending a message from one task to another was really just sending a pointer, giving the receiver permission to use some of the sending task's memory temporarily. That's why it was so fast. Nothing was actually being sent. Still, it was cool stuff.
- agent327 5y agoPointers and (library) code were shared all over the place, not just in the message passing system. Still, on a modern CPU you could certainly do an implementation that either copies small messages, or just passes an entire page for a longer message. You'd need some kind of special AllocMsg function that takes the size of the message you want to send, let the OS decide if it should be sent by remapping a page or by copying.
- chris_j 5y agoUsing an OS with memory protection between processes doesn't make it impossible to use shared memory regions to pass messages between processes efficiently. Around twenty years ago, I worked on a project that built support for various telephony protocols on AIX. Amongst other things, we used System V IPC and shared memory to send signalling information and voice data between processes. We were able to achieve fairly low latencies using this approach; I don't remember the precise numbers but this was the sort of system where a few 10s of ms of latency would give the user a noticeably worse experience. Admittedly, this was on much more powerful hardware than the original Amiga (by this time, we had PowerPC CPUs running at hundreds of MHz) but I don't see why it couldn't have worked on older hardware.
- icedchai 5y agoYes, sorry, I should've clarified that newer AmigaOS versions couldn't add memory protection without breaking compatibility with old apps, due to weaknesses in the APIs.
- chris_j 5y agoGot it, sounds like I misunderstood the point you were making there. Makes sense (and tbh that's a problem that afflicts most of the personal computer operating systems from that era).
- pjmlp 5y agoNot really, QNX and Android do it quite easily with memory protection.
- icedchai 5y agoI should have clarified. It couldn't be done with out breaking compatibility with existing apps. If I recall, Amiga Exec's "PutMsg" didn't even take a message length, just a pointer (message) and a port name.
- pjmlp 5y agoAmiga broke compatibility with existing apps across hardware releases anyway, so?
- icedchai 5y agoExec PutMsg / GetMsg is rather foundational. If they changed it, everything would break. With Amiga OS, if you wrote your apps to API spec, compatibility was rarely broken. I remember those big "Rom Kernel Reference Manual" books! I think I still have one collecting dust, at my parents house. But yeah, if you did weird things like mucking with hardware registers directly or used undocumented fields of a struct, then yeah, you could have a problem.
- pjmlp 5y agoChanging graphics and sound chips was more fundamental than OS APIs.
- icedchai 5y agoIndeed, that did happen with some games, especially with the newer CPUs. I remember my A3000 didn't run a bunch of stuff that worked on the 500. I wasn't sure if that was due to the ECS chips or the 68030.
- agent327 5y ago