User`s guide

10
K
A
DAK
KwikNet Overview
Multitasking Operation
In a multitasking system which uses an RTOS, operation of the TCP/IP stack is
controlled by a single task called the KwikNet Task. This task begins execution after your
application calls procedure
kn_enter() to start KwikNet. The KwikNet Task executes at a
priority above that of all other tasks which use
KwikNet services.
The KwikNet Task receives timer ticks from the RTOS through the KwikNet OS interface.
These ticks, KwikNet's fundamental timing source, occur at the frequency which you
specify when you configure your
KwikNet Library.
KwikNet uses its Ethernet, SLIP or PPP network driver to interact with a particular
network's device driver. The KwikNet Task and the device driver cooperate to ensure that
network packet transmission and reception occur in a timely fashion. Interrupts
generated by the device's hardware interface are serviced by an RTOS compatible
interrupt service routine (ISR) which calls the device driver's interrupt handler.
Your application tasks interact with KwikNet using the UDP or IP programming interface
or the TCP or UDP socket services.
At times, KwikNet may be forced to suspend your application task pending completion of
a requested service. How this is done depends on the magic of the KwikNet OS interface.
In a multitasking environment, only the task requesting service is suspended. Other tasks
are free to execute and use KwikNet services. KwikNet and its OS interface resolve the
problems, if any, which may occur when multiple tasks make conflicting demands on the
use of the stack.
If you use any of the optional KwikNet components such as the FTP Server or Web Server,
you will observe that these servers are also implemented as tasks running under the
auspices of the RTOS. These tasks will be of lower priority than the KwikNet Task but
will usually be of higher priority than your application tasks which use KwikNet services.
Finally, note that most applications will probably include one or more tasks of higher
priority than the KwikNet Task. These tasks, although critical for the success of your
application, must not starve the KwikNet Task's demands for execution time.
Note
All application tasks which use KwikNet services MUST
execute at a priority below that of the KwikNet Task.