Computer Solutions Ltd
Whats New | Advanced Search
Downloads | Exchange Rates

Celebrating over 28 years
supplying all your Embedded Development Tool needs


smx86™
Support for the x86 Processor Family


smx86™ is designed for the Intel x86 processor family (and compatibles, such as the NEC V series). Features common to all implementations of smx are described on the smxFeatures page. smx86 offers full support for real modeand 32-bit protected mode.



80x86 Specialisation

Unlike many kernels, smx86 was not developed for an 8-bit processor, then extended upward to the x86. Nor was smx86 developed to be easily ported to many different processors. Instead, smx86 was originally designed to exploit the strengths of the x86 architecture and to simplify its complexity for the user.

Fully Segmented, Protected Mode Support

16-bit protected mode provides maximum isolation between code modules, data blocks, and stacks, and it allows using memory above 1 megabyte. 32-bit segmented protected mode support is currently under development. (32-bit flat mode support is available now.)

Easy Upgrade Path from Real Mode to Protected Mode

smx86 is ideal for real mode projects that may need to move to protected mode in the future for more memory or other reasons. This is because all versions of smx86 have identical structure, and the smx call API is the same. Assuming you began development with our protosystem platform, as we recommend, upgrading would simply mean moving the application modules to the protected mode protosystem, which has the same structure as the real mode protosystem. If moving to 32bit flat mode, some code changes are required, due to differences in 16-bit and 32-bit C, but these do not relate to smx.

For 32-bit flat mode, it is necessary to switch to one of the 32-bit compilers, which work much like their 16-bit counterparts, but with some important differences.

The Microsoft 32-bit tools require Windows 95/98 or Windows NT for development, since the tools will not run from DOS or 16-bit Windows. Borland tools run in all operating environments, which saves having to switch to a new operating system. There are also fundamental differences in coding for 32-bit flat mode, such as lack of segmentation and far pointers, the lack of the 'interrupt' keyword for Borland and Microsoft, and the change in the definition of the INT type to 32 bits.

The important thing is that although the development tools and the coding environment may change somewhat, smx changes as little as possible across the different versions.

smxSaves Memory

smx is one of the few kernels that support all memory models in real mode. "This gave us a 20KB reduction in size over Nucleus" . According to Carl McCauley of Checkmate Electronics smx is the kernel for you if you are trying to shoehorn your application into limited memory.


Which Version Do I Choose?

The following sections highlight the features of the different versions of smx86 to help you decide which is right for your project. To our knowledge, smx offers the widest selection of x86 operating modes of any commercial kernel. It is the only kernel that supports 16-bit protected mode.

Real Mode

 

Tools: Borland 16-bit tools: C++, TASM, TLink
Microsoft 16-bit tools: Visual C++, MASM, Link
Run-time environment: standalone or DOS
Memory models: Small, Compact, Medium, Large
Processors supported: 8086 and up
Near/far data support: near and far heaps, stacks, and variables
Memory space: < 1MB for standalone, 640K for DOS (see unDOS brochure)
Max. segment size: 64K

The real mode version of smx86 is intended for designers who are using the 8086, 186, or equivalent, or who do not have large applications and do not need the protection mechanisms of the 286 and higher. It is also for those who wish to run under DOS. (See the later section 'DOS Support'.) smx is provided in library form - a test mode and a non-test mode library per memory model.

16-bit Protected Mode

 

Tools: Borland 16-bit tools: C++, TASM, TLink
Microsoft 16-bit tools: Visual C++, MASM, Link
Run-time environment: pmEasy16 and unDOS (if necessary)
Memory models: Small, Compact, Medium, Large
Processors supported: 80386 and up
Near/far data support: near and far heaps, stacks, and variables
Memory space: 4GB
Max. segment size: 64K

Advantages over real mode

  • Greatly expanded memory space
  • Segment protection and other processor checks (e.g. general protection fault, and stack fault)

Advantages over 32-bit flat protected mode

  • Segment protection
  • Easier upgrade path from existing real mode code to protected mode
  • Changes to code are minimal
  • Can continue to use the same compiler and tools as for real mode
  • Smaller code and data sizes

Disadvantages

  • 64K limit on segments and data structures
  • 16-bit integer operations
  • Loading segment registers slower than real mode

The 16-bit protected mode version of smx86 is intended for users who have exceeded the 1 megabyte limit of real mode (or the 640K limit of DOS), or who want the segment protection offered by the 286 and higher processors, but wish to continue using familiar tools. This version provides an easy step into protected mode. There should be little change required to the application code, since it is still 16-bit C/C++. (It is necessary to get rid of any segment arithmetic, though!)

Test mode and non-test mode smx libraries are provided for each memory model. The libraries are compiled with the processor 2 switch of the compilers.

Functionally, there is no difference between the services provided by this version and those provided by the real-mode version of smx, except for the far heap. Each block of the far heap (including far stacks) is in a separate segment which has its own selector and segment descriptor. The segment descriptor specifies the base address and size of the segment. Each block is fully protected from all other blocks. Any access outside a block will generate a general protection fault (GPF).

The user can write his own GPF handler, or use that provided by pmEasy. Either way, this feature better isolates tasks from each other. This is a very useful debugging feature, because it is immediately apparent when one task overwrites another task's stack or heap block.

Performance of 16-bit protected mode is somewhat lower than real mode, since hidden registers are loaded every time segment registers are changed.

pmEasy16 is the preferred protected mode environment under which to run a 16-bit protected mode smx application. If the application makes DOS calls (e.g. INT 21h), unDOS (a separate product) may be used to emulates those calls rather than using a DOS extender. DOS extenders hurt performance and add excessive complexity. pmEasy is much simpler than a DOS extender and is designed for real time embedded systems.

pmEasy switches the processor from real mode to protected mode and loads the protected mode application. It also provides services to perform protected mode operations such as memory allocation, hooking interrupts, creating descriptors, etc. These are used by some smx calls.

32-bit Protected Mode (Flat)

 

Tools: Borland 32-bit tools: C++, TASM, TLink
Microsoft 32-bit tools: Visual C++, MASM, Link
Run-time environment: pmEasy32
Memory models: Flat
Processors supported: 80386 and up
Near/far data support: near heaps, stacks, and variables, only
Memory space: 4GB
Max. segment size: 4GB (1 code and 1 data segment)

Advantages over 16-bit smx86

  • 32-bit offsets, removing the 64KB limits on segments, arrays, etc.
  • Flat memory model (no far pointers), so more familiar to programmers with 68000 family background

Advantages over 32-bit segmented smx86

  • Borland and Microsoft compilers supported

Disadvantages

  • No segment protection (which means reduced ability to detect stack, heap, and other block overflows)

The 32-bit flat model version of smx86 provides 32-bit protected mode support, without segmentation. Assembly language portions of smx86 have been rewritten to take advantage of 32-bit instructions. C language portions have been compiled with the Microsoft Visual C++ and Borland C++ 32-bit compilers.

The services provided by this version are the same as real mode smx86 except for the omission of the far heap, far stacks, and all other far objects. Test mode and non-test mode smx libraries are provided.

Because of the large addressing range (4 GB) of 32-bit offsets, most users prefer flat mode addressing. This is the only mode supported by the Microsoft and Borland compilers. In this mode, segment registers are loaded only once. This is a conceptually simple model, since everything is near. Programmers familiar with other 32-bit processors that use use flat memory addressing, such as the 68000 family, will find this version a welcome entry to the x86 world.

pmEasy32 is the preferred protected mode environment under which to run a 32-bit protected mode smx application, since it is simpler than a DOS extender and it is designed for real time embedded systems.

32-bit Protected Mode (Segmented)

 

Tools: Watcom C/C++ and WASM
CSi-Link (linker/locator, Concurrent Sciences)
Run-time environment: pmEasy32
Memory models: Small, Compact, Medium, and Large
Processors supported: 80386 and up
Near/far data support: near and far heaps, stacks, and variables
Memory space: 4GB
Max. segment size: 4GB (as many as desired)

The 32-bit segmented version of smx86 provides 32-bit addressing, 32-bit arithmetic, and segment protection! This is clearly the best choice if 32-bit support and segment protection are needed for your system design. Also, the Watcom compiler is praised for its efficient code generation and usability.

The down-side to segmented-32 is that the choices of other add-on packages may be limited, since many may support only flat mode. Also, the memory requirement of the application will be a bit larger than 32-bit flat mode, and performance is somewhat lower due to loading of hidden registers when changing segments.

The services provided by this version are the same as for 16-bit smx86. Test mode and non-test mode smx libraries are provided for each memory model.


Features of smx Specific to x86

All Memory Models Are Supported

For segmented versions, Small, Compact, Medium, and Large memory models are supported. This offers optimum speed and memory usage for small applications while preserving extensibility for large applications. smx also supports mixed models for optimum performance. For example, smx control blocks are near in all models for fast access. Large model is supported for applications which overflow near memory.

Stack Flexibility

Stack-pool stacks are supported by all versions of smx. These are fixed-size stacks that are given to tasks and then returned to the pool when tasks stop, so other tasks can use them.

smx86 not only supports stack-pool stacks, but also it permits allocating heap stacks. Stacks may be allocated from the near heap for tasks requiring smaller-than-average stacks or near stacks. Large stacks up to the maximum segment size may be allocated from the far heap. (Note that the far heap is not available in 32-bit flat mode.)

For 32-bit flat mode, there is only one heap and all memory is effectively near. There is no limit on stack size.

Coprocessor State Saving

smx86 makes it easy for tasks using the x87 coprocessor to save and restore the coprocessor registers when they are suspended and resumed. Also the coprocessor's state is saved only for tasks that use it. This way, tasks not using the coprocessor are not burdened with this extra overhead.

Platforms

All versions of smx86 comes with the protosystem platform. The real mode version of smx86 additionally provides DOSdemo that helps users integrate smx with DOS . These are both platforms to build on and sample smx applications. The intent is to choose the one best suited to your needs and build your application upon it.

Source code is provided for each of the platforms. Also included are make and batch files which handle compiling and linking. The platforms show how to handle start-up, how to interface C to assembly, and how to configure smx. They also contain examples of how to use various smx services.

DOS Support

Although smx86 was designed primarily as a ROM-able, standalone, real-time operating system, the real mode version also works with DOS. It even protects against DOS re-entrancy and supports TSR's. Some customers have used smx86 both with and without DOS in the same system.

A DOS emulator, unDOS, is also available which allows an application to make DOS calls, without DOS being present. unDOS is helpful for real mode projects because it makes more memory available to the application than does DOS. unDOS also permits protected mode applications that make DOS calls to avoid using a DOS extender.

Optimised Scheduler

Unlike kernels that were designed for portability, the smx86 scheduler is written in highly-optimised 80x86 assembly language for speed.

smx Real mode Inc smxProbe & smxWindows £3650
32 bit flat protected mode inc. DPMI, smxProbe & smxWindows. £4850


For more Information:

Real-time executives overview
smx summary page
smx features
smx for other CPUs
smx options

Home Shop Products Supported Chips Information Zone Contact Site Map
 
Computer Solutions Ltd
1a New Haw Road, Addlestone, Surrey KT15 2BZ, England
 
Telephone: +44 (0) 1932 829460      Fax: +44 (0) 1932 840603
Email: sales@computer-solutions.co.uk      Web: www.computer-solutions.co.uk
 
Copyright © 2008 Computer Solutions Ltd