118
K
DAK
KwikNet System Construction
KwikNet
Restart and Exit Procedures
You must include KwikNet Restart Procedure kn_osready first (or near first) in your list
of Restart Procedures in your AMX System Configuration Module.
KwikNet includes a startup procedure kn_enter and a shutdown procedure kn_exit. You
can include the KwikNet startup procedure kn_enter in your list of Restart Procedures in
your AMX System Configuration Module. It is this procedure which starts the KwikNet
Task to initialize the KwikNet TCP/IP Stack. Alternatively, one of your own Restart
Procedures can call
kn_enter(). The position of this procedure in the list of Restart
Procedures is not critical since no
KwikNet services can be used by tasks until the KwikNet
Task has executed. Another approach is to have a task call kn_enter() to start KwikNet.
Be certain that no other task tries to use KwikNet services until KwikNet is operational.
If your AMX application allows an orderly shutdown and exit from AMX, you can add
the KwikNet shutdown procedure kn_exit to your list of Exit Procedures in your AMX
System Configuration Module. Alternatively, one of your own Exit Procedures can call
kn_exit(). Insert this procedure into the list at the point in the exit sequence at which
the KwikNet TCP/IP Stack is no longer required. You must ensure that all tasks have
stopped using KwikNet services before you allow KwikNet to shut down. For KwikNet to
shut down, you must use the KwikNet Configuration Builder to edit your Network
Parameter File and enable KwikNet shutdown on the General property page.
AMX 86 PC Supervisor
AMX 86 includes a component called the PC Supervisor which permits AMX 86 to be
used with DOS on PC platforms. Special care must be taken when using the PC
Supervisor with AMX 86 and KwikNet.
The PC Supervisor's Clock Tick Task and Keyboard Task must be of higher priority than
the KwikNet Task to ensure that they operate without interference from network activity.
All tasks which use KwikNet services must be of lower priority than the KwikNet Task.
The PC Supervisor Task must be of lower priority than all application tasks which use
KwikNet so that it does not interfere with their use of the network.
These task prioritization rules work provided that tasks which use KwikNet services never
go compute bound. For example, if a task continuously polls
KwikNet to test for the
completion of some network operation, then any higher priority task which attempts to
use DOS services will appear to hang because the low priority PC Supervisor Task is
unable to execute to service the DOS request. In such cases, you will have no choice but
to raise the priority of the PC Supervisor Task and accept the fact that DOS operations
can temporarily block tasks of lower priority.
If you examine the KwikNet Sample Program provided with AMX 86, you will observe
that the PC Supervisor Task has actually been placed at a priority above the
KwikNet Task.
This violation of the priority rules was done intentionally for the following reason. The
Sample Program can operate without any physical network interfaces. Consequently, the
application tasks can execute in a compute bound fashion because they never have to wait
for real devices to respond. This scenario prevents the PC Supervisor Task from
servicing any request by the Sample Program's Print Task to present messages on the PC
display screen. By raising the priority of the PC Supervisor Task above that of the
KwikNet Task, all messages appear on the PC display screen as soon as they are generated,
making it easier for you to observe the actual sequence of operations.
Comments to this Manuals