home *** CD-ROM | disk | FTP | other *** search
/ C/C++ User's Journal & Wi…eveloper's Journal Tools / C-C__Users_Journal_and_Windows_Developers_Journal_Tools_1997.iso / smxdemo / root.exe / TEST.DAT < prev   
Encoding:
Text File  |  1993-05-26  |  10.9 KB  |  238 lines

  1. **************************************************************************
  2. * This is a test file for DOSdemo.  This is the file the demo reads from *
  3. * the hard disk.                                                         *
  4. **************************************************************************  
  5.  
  6.  
  7.  
  8.  
  9.                                  smx Unique Features
  10.  
  11.  
  12.           The proposition that "all kernels are basically alike" is not
  13.           true.  smx has several unique features which make it especially
  14.           well-suited for embedded systems.
  15.  
  16.  
  17.           Optimized for the 80x86 Family
  18.  
  19.           Unlike many kernels, smx was not developed for an 8-bit
  20.           processor, then extended upward to the 80x86.  Nor was smx
  21.           designed with the idea of easily porting it to many different
  22.           processors.  Instead, smx was designed to exploit the strengths
  23.           of the 80x86 architecture, to make them available to the
  24.           application programmer, and to try to simplify their complexity. 
  25.           This is evident in some of the unique features which follow.
  26.  
  27.  
  28.           Two-Level Foreground
  29.  
  30.           Nearly all kernels, except smx, disable interrupts during
  31.           "critical sections" of their code.  For example, if one kernel
  32.           call is altering a queue, another kernel call due to an interrupt
  33.           cannot be allowed to access that queue.  This is usually
  34.           prevented by disabling interrupts.  But, disabling interrupts
  35.           adds interrupt latency to every interrupt in the system --
  36.           whether the interrupt makes kernel calls or not.  Hence, the
  37.           kernel imposes a restraint upon interrupt responsiveness which
  38.           can paint the application programmer into a corner!
  39.  
  40.           smx solves this problem by creating a 2-level foreground
  41.           structure which guarantees that smx calls will never collide. 
  42.           Hence it is not necessary to disable interrupts during smx calls
  43.           nor even while the smx scheduler is running (except for a few
  44.           negligible periods).  The approach works as follows:  Interrupts
  45.           are serviced by short, fast interrupt service routines (isr's). 
  46.           When necessary, (e.g. at the end of a message) isr's invoke link
  47.           service routines (lsr's).  Link service routines are like
  48.           foreground tasks.  They are dispatched in FIFO order after any
  49.           interrupted smx call completes.  lsr's run with interrupts
  50.           enabled and can perform background operations, including making
  51.           smx calls.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.                                           1
  60.  
  61.  
  62.           Layered Ready Queue
  63.  
  64.           Most kernels use a single, doubly-linked list as a ready queue. 
  65.           To enqueue a task it is necessary to search from the beginning of
  66.           the ready queue to, potentially, its end until the right place is
  67.           found (based upon priority and time of arrival).  This can take a
  68.           long time if there are many tasks in the ready queue.  In a real-
  69.           time system it is possible that all, or most, tasks become ready
  70.           at once.  Hence worst-case performance can be poor.  Even worse,
  71.           this occurs at times of peak loads and could cause glitches.
  72.  
  73.           smx uses a different structure for its ready queue.  Each
  74.           priority level has its own queue control block (qcb).  These
  75.           qcb's are physically adjacent and in priority order.  The smx
  76.           scheduler uses priority to index to the proper qcb and simply
  77.           places the task at the end of the level (directly pointed to by
  78.           the back link in the qcb).  This fast, two-step process takes the
  79.           same time regardless of how many tasks are ready.
  80.  
  81.  
  82.           Stack Pool
  83.  
  84.           The principal overhead of a task is the stack space it requires. 
  85.           Each task's stack must be large enough to support all local
  86.           variables for the maximum nesting of functions in the task.  And
  87.           it must simultaneously provide space to save registers for the
  88.           maximum nesting of interrupt service routines.  Usually this
  89.           requires at least 200 bytes and possibly much more.  In a typical
  90.           situation, the memory overhead of a task can be reduced 90%, or
  91.           more, simply by releasing its stack!
  92.  
  93.           smx is the only kernel which permits doing exactly this.  When
  94.           tasks must wait for more work, they can release their stacks back
  95.           to a common stack pool.  When a task is restarted due to a
  96.           message, signal, timeout, etc. it is given a new stack from the
  97.           same pool.  smx does this without speed penalty!
  98.  
  99.           Stack sharing opens a new vista for embedded software design --
  100.           namely using large numbers of "small" tasks.  The advantages of
  101.           doing so are:  easier designs, capitalization upon the proven
  102.           code of the kernel, and greater benefit from error monitoring and
  103.           debug features of the kernel.
  104.  
  105.  
  106.           Near & Far Stacks
  107.  
  108.           Normally the stack pool is part of DGROUP -- i.e. it is "near." 
  109.           (This is often necessary because some library functions require
  110.           that ss==ds.)  However, should space in DGROUP become too
  111.           limited, the stack pool can be moved out to its own "far"
  112.           segment.  Then there is 64K available for near variables in
  113.           DGROUP and the stack pool can also occupy up to 64K in its own
  114.           segment.  (Of course, functions requiring ss==ds must not be used
  115.           or must be modified.)
  116.  
  117.  
  118.                                           2
  119.  
  120.  
  121.           smx also permits "bound" stacks.  These are stacks which are
  122.           never given up.  (Unless the task is deleted.)  Bound stacks may
  123.           be near or far and can be of a unique size for each task.  Near
  124.           stacks come from the smx near heap which is in DGROUP.  Near
  125.           stack sizes are, of course limited to available space in DGROUP. 
  126.           Far stacks come from the smx far heap and can be up to 64K in
  127.           size.  Far stacks are useful for tasks which require extremely
  128.           large stacks (e.g. graphics servers).
  129.  
  130.  
  131.           Message Priority and Pass-Thru Exchanges
  132.  
  133.           Though not needed in all applications, message priority is a
  134.           powerful tool.  A pass-thru exchange passes the message's
  135.           priority thru to the receiving task.  This allows a server task
  136.           to adopt the same priority as a client task.  Server tasks are
  137.           useful for managing non-reentrant resources such as disk drives
  138.           and graphics displays.  Being able to dynamically adjust their
  139.           priorities permits them to operate as extensions of client tasks.
  140.  
  141.  
  142.           Multilevel Exchanges
  143.  
  144.           Multilevel exchanges permit high priority messages to bypass low
  145.           priority messages.  This is useful, for example, in data
  146.           communications to pass protocol control messages (e.g. ACK/NAK)
  147.           around data messages.  Another example is passing catastrophic
  148.           error messages around warning messages to the error manager task.
  149.  
  150.  
  151.           Extensive Error Monitoring
  152.  
  153.           smx monitors over 40 error types.  Included are:  range checking
  154.           of all smx call parameters, checking resource availability before
  155.           creating objects, checking for stack overflow and underflow,
  156.           range checking ss:sp, checking for broken queues, checking for
  157.           invalid operations, etc.  Most misuses of smx are caught and
  158.           reported immediately.  Such thorough error checking also catches
  159.           a wide range of other errors and malfunctions.
  160.  
  161.  
  162.           Two Types of Error Management
  163.  
  164.           smx offers both central and point-of-call error management. 
  165.           Central error management is implemented with user-alterable error
  166.           service routines (esr's).  The esr's supplied with smx typically
  167.           display an error message and log the error into the error buffer. 
  168.           Then, non-catastrophic esr's return while catastrophic esr's exit
  169.           or restart.  Point-of-call error management is supported by
  170.           returning 0 instead of a value if an error or timeout has
  171.           occurred.  The global variable, xerrno, identifies which error
  172.           occurred.  xerrno == 0 if a timeout occurred.  The user may then
  173.           apply his own remedy.
  174.  
  175.  
  176.  
  177.                                           3
  178.  
  179.  
  180.           Test Mode vs Non Test Mode
  181.  
  182.           smx allows you to choose between the safety and convenience of
  183.           full error monitoring vs the increased speed and reduced size of
  184.           no monitoring.  In addition, non-test mode libraries are
  185.           optimized.
  186.  
  187.  
  188.           Task Level Debugger
  189.  
  190.           smxProbe is one of the most powerful debuggers available for any
  191.           kernel, regardless of cost.  Not only does it work standalone,
  192.           but also it can add task-aware features to standard code
  193.           debuggers, such as breakpointing in a specified task.  smxProbe
  194.           operates either on the development system or on the target via a
  195.           serial port connected to an ASCII terminal or PC.
  196.  
  197.           smxProbe provides trace buffers for tasks (up to 8192 entries),
  198.           for errors (up to 6550 entries) and for smx calls (up to 4096
  199.           entries).  It provides symbolic display of all smx control blocks
  200.           and queues.  Sophisticated trigger points can be set.  The
  201.           application can be frozen below a specified priority level.  To
  202.           top this off, any smx call can be executed from the smxProbe
  203.           command line!
  204.  
  205.  
  206.           Hook
  207.  
  208.           smx allows hooking exit/entry routine pairs into any task.  These
  209.           are automatically called when the task is suspended or resumed,
  210.           respectively.  Hooking permits additional task context switching
  211.           to be performed such as:
  212.  
  213.                (1) saving & restoring coprocessor registers
  214.                (2) switching memory banks, pages, or overlays
  215.                (3) saving & restoring static variables to achieve
  216.                    reentrancy by task
  217.                (4) moving data into and out of near memory
  218.  
  219.  
  220.           Segmentation Support
  221.  
  222.           Segmentation is the most disliked feature of the 80x86
  223.           architecture.  However, if one is using an 80x86 processor, then
  224.           one must deal with it.  smx helps in the following ways:
  225.  
  226.                (1) smx supports all memory models.
  227.                (2) smx globals are assigned to near memory (i.e. DGROUP) to
  228.                    maximize its performance for all memory models.
  229.                (3) smx saves all segment registers as part of the task
  230.                    context.
  231.                (4) smx allows a separate default data segment per module
  232.                    (SDS option).
  233.  
  234.  
  235.  
  236.                                           4                          9/3/92
  237.  
  238.