[comp.os.minix] readclock.c and portio.c

bill@chinet.chi.il.us (Bill Mitchell) (03/07/90)

Today I tried to get readclock.c working on my shiny new
Zenith Turbosport 386 luggable, and I ran into some minix
stuff which stumped me.

readclock.c calls port_in().  port_in() is in lib/other/portio.c,
and reads from /dev/port.  I don't have a /dev/port.  fs/table.c
doesn't mention /dev/port.  Am I missing something obvious here?

dcd@tc.fluke.COM (David Dyck) (03/08/90)

In article <1990Mar7.004337.9883@chinet.chi.il.us> bill@chinet.chi.il.us (Bill Mitchell) writes:
>readclock.c calls port_in().  port_in() is in lib/other/portio.c,
>and reads from /dev/port.  I don't have a /dev/port.  fs/table.c
>doesn't mention /dev/port.  Am I missing something obvious here?

It's not 'obvious', but fs/table.c just defines the major device
numbers and their associated task number.
Note /dev/mem (task MEM) has major device 1.

so, take a look under "#define MEM ..." in <minix/com.h>
and see.

#define MEM               -4    /* /dev/ram, /dev/(k)mem and /dev/null class */
#       define RAM_DEV     0    /* minor device for /dev/ram */
#       define MEM_DEV     1    /* minor device for /dev/mem */
#       define KMEM_DEV    2    /* minor devige for /dev/kmem */
#       define NULL_DEV    3    /* minor device for /dev/null */
#if (CHIP == INTEL)
#       define PORT_DEV    4    /* minor device for /dev/port */
#endif

See, PORT_DEV has minor device 4.

I learned about /dev/port a while back when installing Bruce Evans'
procted mode patches into the 1.3 kernel, but it's good to 'trace-through'
the mapping of major/minor devices.

            David Dyck
    Domain: dcd@tc.fluke.COM