5/19 I'm writing a device driver for Solaris to access our PCI board.
I want to allow unlimited xxx_open() calls to the board in
read-only mode, but only one xxx_open() call in read-write
mode. I tried doing this with a flag to indicate that the board
is open in read-write only, but what I can't seem to figure
out is how to match a xxx_open() to the corresponding
xxx_close(). I though about using pid's to track the xxx_open()
and xxx_close() calls but I don't seem to be able to access
pid's in the xxx_open(). I must be missing something. Any ideas?
\_ WINDOWS. WINDOWS IS THE STANDARD OS.
\_ Really, does any OS out of M$ have support for
CPCI, hotswap, H110, RT processing, etc that are
required to do any real work. BTW, I'm working
on a VoIP switch which will be able to handle 6000
simultaneous calls. You think that any M$ OS can
keep up with that kind of call processing or
the associated memory access and setup for the
\_ you get passed a proc structure as argument to xxx_open(), don't you?
processing board? Don't delude yourself, your
M$ box is basically a KEWL MP3/DVD player and
Game console.
\_ Yes, MS has support for all those things.
you?
if not, there is a global variable, typically of type struct proc
which contains the pid.
\_ Real Time Windows, how do you do
that? I though that the NT kernel
is not interruptable and that the
time slice is not adjustable. Last
I checked CPCI hotswap was not
reliable, kept rebooting the stupid
kernel, or locking it up.
\_ We used M$ LoseNT as call agents @ cisco.
Guess how we get reliability, two boxes
that perodically reboot each other (once
ever few hours). I told them we should have
just deployed it on the cache engine with
IOS, or an RTOS or UNIX, but they wanted
to do LoseNT so bad. I can't begin to
express what a load of shit it is.
express what a load of sh*t it is.
\_ Oh GHOOOOOOD! NOOO! PLEEEEEASE TELL ME IT'S NOT TRUE!!!!!
\_ Ok, won't tell you it's true.
\_ Wow. never thought I'd see a solaris driver question on solaris.
Anyways, I think it might have something to do with using a
"clone" type device. Try looking at that alternative.
["send in the clones" jokes may now commence]
\_ If I understand this correctly, I should create one device
that is read-write and limit that to one rw access and
have another device that is read-only and have unlimited
access on that one. Sounds good. I have a library that
abstracts device usage, so I can do this under the covers.
BTW, I'm using mmap in my user programs to access the
device, rather than ioctls, so if there is some way to
just limit access in the xxx_*map routines that would
work too.
\_ Use a semaphore for rw open() requests. Use the thread/pid handle
1. thats not what he wants
2. there was something on c.u.solaris about 6 months ago saying
"dont do that", for some other vaguely similar proposition.
\_ Why not? I really want to prevent multiple writers on the
device, but debugging is really hard if I can't have a
couple of monitoring programs.
\_ yes, "debugging kernel drivers is really hard".
Decide whether you want to make it easy on yourself, or
if you want to write a proper driver.
No, I dont know myself. Go try to find the article,
if you care that much.
\_ you get passed a proc structure as argument to xxx_open(), don't
you? if not, there is a global variable, typically of type struct
proc which contains the pid. |