My first idea was to create an event and have the alarm function set
the value of the event with _os_ev_set(). Any other process wanting to
query the value can do so with _os_ev_read(). Unfortunately _os_ev_set
() is one of the functions that cannot be called from a system state
alarm function.
My next idea was to create a shared data module to hold the value. But
it seems like a lot of overhead just to store what is effectively a 1-
byte value!
Then I thought about the system globals area. There are some system
globals with intriguing names such as:
u_int 16 d_rev1[15]; /* reserved first 32 bytes of globals */
u_int32 d_rev2[7]; /* reserved space */
u_int32 d_endresv[11]; /* Reserved fields at end of structure */
I can't find any other reference to these either in the MWOS header
files, on Google, or in this group. Do you think it might be safe to
use some of this space?
(Sadly I don't have the full source-code package of OS-9000 so I can't
add new globals to struct sysglobs.)
Otherwise, what other low-overhead ways are there for a system alarm
function to make data available to other processes in the system?
Good morning
What version of OS9K are you using. I find nothing in the documents
that say you cannot use _os_ev_set from a system state alarm.
THere is an area of sysglob refered to as OEM GLOBS this is available for
OEM use or user useage.
Are you triggering a single process or multiple process when the alarm is
triggered ? If a single process why not use a signal or semaphore.
Allan
The documentation specifically mentions that you can't use F_EVENT
from a system-state alarm routine. This is in Chapter 3: Interprocess
Communication. If I do call _os_ev_set() from inside the system state
alarm function then the whole machine just locks up (and if I don't,
it doesn't).
Anyway, I've got a proof-of-concept working where the alarm function
writes its output to sys_globs->d_rev2[0..3], and it appears to work
flawlessly. I couldn't find anything in the system globals referred to
as OEM GLOBS, but I wonder if perhaps this is something in a more
recent version.
I should say that the alarm function doesn't trigger any other
process. It just does some simple calculations and stores the result.
Thanks for the suggestions.
Ian