Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!news.cs.indiana.edu!att!att!mcdchg!michael From: michael@mcdchg.chg.mcd.mot.com (Michael Bodine) Newsgroups: comp.sys.m68k Subject: Re: How to access local I/O devices from a user process in SysV/68? Message-ID: <51703@mcdchg.chg.mcd.mot.com> Date: 6 Dec 90 17:54:52 GMT References: <1990Dec3.040634.1428@cs.UAlberta.CA> <637@mcdclv.UUCP> Reply-To: michael@chg.mcd.mot.com (Michael Bodine) Organization: Motorola Computer Group, Schaumburg, IL Lines: 23 Steve Alexander (stevea@mcdclv.UUCP) writes: > In article <1990Dec3.040634.1428@cs.UAlberta.CA> rasit@cs.UAlberta.CA (M. Rasit Eskicioglu) writes: > >I want to write code that would access to Local I/O Devices directly. For > >example, I want to read LANCE registers. As they are not mapped into the > >user's space in SysV/68V3R6, I always get memory protection error (signal 11). > Look at shmget(2), shmctl(2), and shmop(2) in the Programmers > Reference manual (note the IPC_PHYS parameter). Physical shared > memory MUST be allocated on 4KB memory page boundaries under sysV/68. > Also see the chapter on Interprocess Communication Techniques (IPC) in > the Programmers Guide manual for examples. As noted elsewhere, it's not considered kosher for user tasks to access hardware. In general, you would have to prevent unix from using the devices in question by taking them out of the sysgen, then use the shm interface to map them into your user task. Therefore, you wouldn't be able to run the networking or Xwindow extensions to the operating system when trying to run this way. Usually, if you're going to access i/o, you do it from a device driver, which is part of the kernel, and memory protection is not a problem. For devices which are off-board, such as a third-party I/O controller, since unix won't know about the device, you can use shm without any special considerations other than setting the physical mapping bit as Steve notes. -- [ Michael Bodine, michael@chg.mcd.mot.com, Dial: (708) 576-7840, FAX: x8875 ] [ Motorola TSD; Loc IL38; 1100 Woodfield; Suite 334; Schaumburg, Il 60173 ]