@Piru
Piru wrote:
@Hans_
Libraries are generally written such that the application holds the data itself.
Unfortunately this is not the case. Most libraries maintain library side data structures which are shared between different callers. These require total rewrite in MP environment.
Such as the library open count? No-one but the system needs access to those.
Exec Message passing
Well, obviously. But what kind of a change are you thinking of? I'd expect the message passing by reference to continue, but with a requirement that the entire contents of a message must be in shared mem (or temporarily shared mem, if possible), and the message receiver isn't allowed to cache pointers (i.e., after a reply message, it no longer has access).
I was merely pointing out the problems, not suggesting any ways to fix them (yes, this is much easier, I know :-)). Since the actual message can contain arbitrary data (say pointers to even more data elsewhere in memory!), it's impossible to re-use this concept in an MP environment. This is one of the largest problems since it means ALL message passing code must be rewritten everywhere. And this problem is extremely widespread since messages are in the core of pretty much every other OS component and application.
I already said that the pointers to arbitrary memory would no longer be acceptable. I even discuss pointers in the bit that you quoted. Now why would the timer messages have to be changed? I think that the driver messages with pointers to data buffers could remain mostly intact too; the buffers would just have to reside within shared memory, or within the message allocation itself. That's going to annoy some app developers, but I don't see that as a reason to completely dump the message passing scheme.
Exactly what is the difficulty with expanding ints to int64s? We're breaking compatibility anyway, so keeping structure alignment isn't necessary.
Assuming AmigaOS, all of the existing code is hardcoded to 32bit ints (pointer sizes mostly). AROS situation is better here, but AFAIK not everything is fixed yet.
typedef void* APTR;
Doing a search and replace for LONG would be a good start (just not through all source-files in one shot). This would be more of a tedious task than a hard one.
To get things started, you'd need the new exec kernel and a set of device drivers running before the sandbox could be put in place.
Device drivers alone won't do it I'm afraid. Or are you suggesting the sandbox would somehow use the drivers directly? That'd lead to double work since you'd then need to somehow access them from both the sandbox and the new OS itself. Also, not many device drivers handle two simultanous accessors well (for example imagine two OSes fighting over the access to HDD, display framebuffer and input devices). This plan smells of disaster.
Anything in the sandbox would have to go through an abstraction layer, so you'd likely have to write a scsi.device, trackdisk.device, etc. that would go through the abstraction layer (yes, more work I know).
The sand-box would be more for running the existing GUI system and other higher-level stuff. Basically anything that's not exec, DOS or a device.
Having said that, some drivers could initially be allowed to access hardware "directly" (still going through some kind of layer) from the sand-box until a replacement exists for the new OS. The idea is that, initially, the new OS would only be running one app, the sand-box. So, having something like the USB stack running in the sand-box and providing it with exclusive access to the USB card wouldn't be a big deal as the new OS wouldn't have its own USB stack yet. As soon as the new OS gets its own stack, the sand-box would require a wrapper.
Hans