rcw@upas.UUCP (05/08/87)
This line == can of raid. Greetings. I have a problem with the shmcreate facility of Microport Unix 2.2 when attempting to use shared memory to access the Hercules bit mapped graphics memory. The documentation says to put the following line in /etc/rc: /etc/shmcreate 0xb0000 b0000 32768 /* create a segment whose key is b0000, mapped to physical address b0000, with length 32768 bytes. */ In the user program, the following code should give me access to the shared memory through char * pointer shmaddr: extern char *shmat(); shmid = shmget (0xb8000,32768,0); /* shmid is an int, large model */ shmaddr = shmat (shmid, (char *) 0); /* shmaddr is a large model pntr */ However, in all cases, shmget returns -1 and errno gets set to ENOENT. What am I doing wrong? I am remembering to compile using the large model. Any help would be appreciated. Send to me, and I will post summary to the net. This is my first post ever, if there are mistakes, polite flames only. Robert White, Graphics Information Inc. UUCP: seismo!nbires!hao!scicom!qetzal!rcw ************* * what are * * these box * * logos * * anyway? * ************* he
root@hobbes.UUCP (John Plocher) (05/10/87)
This is a topic which has broad interest (there are lots of Microport users out there) so I am posting this instead of mailing. I'm glad to see that I'm not the only one having problems with this! +---- Robert White writes the following in article <93@upas.UUCP> ---- | | Greetings. I have a problem with the shmcreate facility of | Microport Unix 2.2 when attempting to use shared memory to access | the Hercules bit mapped graphics memory. | | extern char *shmat(); | shmid = shmget (0xb8000,32768,0); /* shmid is an int, large model */ Problem 1: shmid = shmget ((key_t)0xb8000,32768,0); ^^^^^^^ the key parameter is not an int, but a long | shmaddr = shmat (shmid, (char *) 0); /* shmaddr is a large model pntr */ Problem 2: shmaddr = shmat (shmid, (char *) 0, 0); ^^^ Bug in MicroPort manual, need a flag here to tell shmat to give read/write permission to this memory. | | However, in all cases, shmget returns -1 and errno gets set to | ENOENT. What am I doing wrong? | | Robert White, Graphics Information Inc. +---- Problem 3: The Microport SV/AT release 2.2 (and before) version of shmcreate is BROKEN. It doesn't attach the segment created to the proper physical memory location. I got bit by this last week... No work-around, call tech support and bug them about getting a fix to this program. -- John Plocher UUCP: <backbone>!uwvax!uwmacc!hobbes!plocher ============== Internet: plocher%hobbes.UUCP@uwvax.WISC.EDU FidoNet: 121/0 BITNET: uwvax!uwmacc!hobbes!plocher@psuvax1
josh@hi.UUCP (Josh Siegel) (05/10/87)
In article <93@upas.UUCP> rcw@upas.UUCP (Robert White) writes: > >This line == can of raid. > > Greetings. I have a problem with the shmcreate facility of >Microport Unix 2.2 when attempting to use shared memory to access >the Hercules bit mapped graphics memory. The documentation says to >put the following line in /etc/rc: > > /etc/shmcreate 0xb0000 b0000 32768 /* create a segment whose key is > b0000, mapped to physical address > b0000, with length 32768 bytes. */ > > > In the user program, the following code should give me access >to the shared memory through char * pointer shmaddr: > > extern char *shmat(); > > shmid = shmget (0xb8000,32768,0); /* shmid is an int, large model */ > > shmaddr = shmat (shmid, (char *) 0); /* shmaddr is a large model pntr */ > > All together now... If ya going to include examples... make sure the examples are bug free! Your making a key of b0000 and asking for a key of b8000. Is this a typo? --Josh Siegel -- Josh Siegel (siegel@hc.dspo.gov) It's a 9mm hand gun... useful for killing people... If you're into that sorta thing...
sysop@upas.UUCP (05/11/87)
This line == can of raid. Greetings. I have a problem with the shmcreate facility of Microport Unix 2.2 when attempting to use shared memory to access the Hercules bit mapped graphics memory. The documentation says to put the following line in /etc/rc: /etc/shmcreate 0xb0000 b0000 32768 /* create a segment whose key is b0000, mapped to physical address b0000, with length 32768 bytes. */ In the user program, the following code should give me access to the shared memory through char * pointer shmaddr: extern char *shmat(); shmid = shmget (0xb8000,32768,0); /* shmid is an int, large model */ shmaddr = shmat (shmid, (char *) 0); /* shmaddr is a large model pntr */ However, in all cases, shmget returns -1 and errno gets set to ENOENT. What am I doing wrong? I am remembering to compile using the large model. Any help would be appreciated. Send to me, and I will post summary to the net. This is my first post ever, if there are mistakes, polite flames only. Robert White, Graphics Information Inc. UUCP: seismo!nbires!hao!scicom!qetzal!rcw ************* * what are * * these box * * logos * * anyway? * *************