Path: utzoo!attcan!uunet!super!udel!rochester!rutgers!bellcore!tness7!tness1!sugar!peter From: peter@sugar.uu.net (Peter da Silva) Newsgroups: comp.sys.amiga.tech Subject: Having your cake (Re: Address Space on the Amiga (was Re: Need info on exceptions)) Message-ID: <2582@sugar.uu.net> Date: 1 Sep 88 01:47:18 GMT References: <8808311759.AA19249@cory.Berkeley.EDU> Organization: Sugar Land Unix - Houston, TX Lines: 30 This started out as a response to a message about message passing, and I think it's worth kicking around for a while: Here's my solution. (a) MMAP the same for kernel and user processes. (b) Drivers, etc... run at TRANSFER privilege (== kernel or supervisor) (c) MEMF_PRIVATE is write-protected. MEMF_PUBLIC isn't. (d) There is a system call to raise you to TRANSFER privilege. First thing to note... drivers already do a copy in the Amiga because (1) the system calls don't require block alignment, and (2) the driver uses the blitter to generate and decode MFM, so data outside MEMF_CHIP has to be copied anyway. If you want another program to get at your data, you make it MEMF_PUBLIC. Otherwise, it's MEMF_PRIVATE. Drivers can get to MEMF_PRIVATE, but only because there are programs out there that pass statically allocated data to drivers. New programs won't do this, we hope. There's no extra danger for (d)... after all, programs can already inhibit context switching and even interrupts. Make Disable() and Enable() do this automatically, so: You can have some global flag in preferences that determines whether copper lists etc. are secure or not. If Disable() and Enable() move you into and out of TRANSFER priority, then this should not be necessary for most programs. -- Peter da Silva `-_-' peter@sugar.uu.net Have you hugged U your wolf today?