Intel 80386 Dependent Features
******************************

The i386 version of rtmk supports the 32-bit Intel architecture.  Sometime in the future support for the 64-bit architecture will be added.

Application Binary Interface Related
====================================

The SVR4/i386 ABI (pages 3-31, 3-32) says that when the entry point runs, most registers' values are unspecified, except for:

%edx
     Contains a function pointer to be registered with atexit. This is how the dynamic linker arranges to have DT_FINI functions called for shared libraries that have been loaded before this code runs.

%esp
     The stack contains the arguments and environment:

          0(%esp)                 argc
          4(%esp)                 argv[0]
          ...
          (4*argc)(%esp)          NULL
          (4*(argc+1))(%esp)      envp[0]
          ...
                                  NULL

Machine-dependent thread states
===============================

Intel 80386 depdendent thread state flavors:

THREAD_STATE_FLAVOR_I386_CPU
     The executing context (i.e., hardware registers) of the thread. The thread_state_i386_cpu structure holds execution state. *COUNTP should be THREAD_STATE_FLAVOR_I386_CPU_COUNT. To set or read this state, the thread must be suspended.

THREAD_STATE_FLAVOR_I386_LDT
     On the Intel 80386 architecture each thread have a LDT entry available for custom use.  The thread_state_i386_ldt structure holds LDT state.  The segment number is 0x17.

Booting the kernel
==================

The rtmk kernel uses the GNU GRUB bootloader to load the microkernel and the operating system kernel.  Example of GRUB configuration file:

     title rtmk + operating system kernel
       root (hd0,1)
       kernel /boot/rtmk
       module /boot/os-kernel --single-user --root=hd0a

You can find GNU GRUB at http://www.gnu.org/software/grub/grub.html.