Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!uunet!mcsun!hp4nl!dutrun!vlrugvg From: vlrugvg@dutrun.UUCP (Ge van Geldorp) Newsgroups: comp.unix.aix Subject: PS/2 device driver docs Summary: Appendix C stinks Keywords: AIX 1.1, device driver Message-ID: <1517@dutrun.UUCP> Date: 31 May 90 20:13:40 GMT Reply-To: ge@dutlru2.tudelft.nl (Ge van Geldorp) Organization: Delft University of Technology, The Netherlands Lines: 39 I'm trying to write a device driver for AIX PS/2 1.1 and find the IBM documentation (Appendix C of the Technical Reference) less than clear. Sometimes the documentation even seems to lie: - It says to compile the driver with the command `cc -c -DKERNEL -Di386 driver.c'. You better add a `-I/usr/include/sys' to this. - The discussion of `ddopen' says the `oflag' argument of the open(2) system call is passed as the `flag' argument to `ddopen'. Most of the bits get passed unmodified, however, the O_RDONLY flag has the value 0 when passed to open(2), but `ddopen' receives a value of 1. O_WRONLY and O_RDWR also exhibit this behaviour. - subyte() is documented to return 0 if the address at which the byte is to be stored is valid, -1 otherwise. It seems that subyte() actually returns the byte which it stored (i.e. the `c' parameter). I looked around /etc/master to find an unused major number. My system had major values in the range 0-49, so I picked 50 as the major number of my driver. This resulted in lots of `no such device or address' messages. In dispair, I tried 19 as my major number (19 was not used in the /etc/master file). Presto, end of problem. Does this mean there is a hard-coded maximum major value of 49 somewhere? If so, is this documented anywhere? Suppose (well, don't suppose, I actually do this) I tell an adapter to do something, then go to sleep, to be waken up from an interrupt routine. Is there a race condition here? I.e. if the adapter immediately generates an interrupt before the user-context routine goes to sleep, will the wakeup() specifying a channel for which there is no correspon- ding sleep() yet be discarded or will the information be saved? Could someone please provide an example of the use of the physio() routine? The 2-line explanation in the documentation is not sufficient for me to determine how to call this routine. Thanks. Ge van Geldorp ge@dutlru2.tudelft.nl ...!uunet!hp4nl!dutlru2.tudelft.nl!ge