Path: utzoo!mnetor!uunet!ncc!alberta!ubc-cs!fornax!chapman From: chapman@fornax.UUCP (John Chapman) Newsgroups: comp.unix.microport Subject: Re: shared memory?? Message-ID: <466@fornax.UUCP> Date: 22 Mar 88 09:10:12 GMT References: <259@bby-bc.UUCP> <183@sdeggo.UUCP> Organization: School of Computing Science, SFU, Burnaby, B.C. Canada Lines: 41 Summary: got a patch In article <183@sdeggo.UUCP>, dave@sdeggo.UUCP (David L. Smith) writes: > In article <259@bby-bc.UUCP>, john@bby-bc.UUCP (john) writes: > > I'm trying to use shared memory to access a frame buffer and it > > doesn't seem to work. I am running 2.2L. I put the appropriate . . . > > "A"'s to the herc. mono adapter. The program runs in a couple of seconds > > but nothing changes on the screens. The only thing I have noticed is > > that in system5.nm shmat() is listed as an int rather than a char * > > Well, your program is correct, I compiled and ran it on 'eggo without any > problems (well, it gives a core dump at the end, but that's not your problem > just yet). Hmmmm, I don't have around anymore but I don't remember it core dumping.... > There's two things to check for: On older version of 2.2, the shmcreate > program did not attach the segments properly. You can check to see if This was my problem - Harold Walters (walters@ce.okstate.edu) sent me some routines he had for accessing the ega in which he mentioned a patch I tracked down the patch to /etc/shmcreate, applied it, and now everything works like a charm. For large chunks of memory (being moved to/from the targa frame buffer) it was actually slower than using /dev/mem. I looked at the code produced by cc for for (; n>0 ; n-- ) *dst++ = *src++; and it was pretty bad even using cc -O. I replaced the code by a mov n,%cx rep smov and now everthing is much faster. In the 2.2 man page it says /etc/shmcreate is only a temporary solution for graphics and it can be expected to go away - don't get rid of it Microport!! If you have something better for graphics that is great - but leave shmcreate around, it's extremely useful for doing oddball things in a reasonably efficient way. john .....!ubc-vision!fornax!bby-bc!john