Home |
RTKernel-32 Programming Manual RTKernel-32 Configuration |
RTKernel-32 ConfigurationSome of the kernel's configuration parameters are stored in the global structure RTK32Config with the following layout: typedef struct { int StructureSize; DWORD DriverFlags; DWORD UserDriverFlags; DWORD Flags; DWORD DefaultTaskStackSize; DWORD DefaultIntStackSize; unsigned MainPriority; unsigned DefaultPriority; DWORD HookedIRQs; DWORD TaskStackOverhead; RTKDuration TimeSlice; DWORD IdleTaskStackSize; } RTK32Config; A default version of this structure is included in the RTKernel-32 library. If you want to define your own configuration, include this structure in your program or modify selected values before RTKernelInit is called. Example:RTK32Config RTKConfig = { sizeof(RTK32Config), // StructureSize #if MP DF_IDLE_HALT | // DriverFlags (MP kernel) #endif 0, // DriverFlags 0, // UserDriverFlags #if MP RF_PREEMPTIVE | // MP kernel defaults to preemptive #endif #if DEBUG RF_TCPUTIME | RF_STACKCHECKS | RF_TRACE | #endif RF_AUTOINIT | RF_NAMED_WIN32CS,// Flags 16*1024, // DefaultTaskStackSize #if MP 1024, // DefaultIntStackSize #else 512, // DefaultIntStackSize #endif 5, // MainPriority 0, // DefaultPriority 0, // HookedInterrupts (none) 256, // TaskStackOverhead 0, // TimeSlice (0 == off) 256 // IdleTaskStackSize } ; The example given above corresponds to RTKernel-32's defaults. For the multiprocessor kernel, preprocessor symbol MP is defined, DEBUG is defined for the Debug Version. Unlike the single processor kernel, the multiprocessor kernel has DriverFlags DF_IDLE_HALT and Flags RF_PREEMPTIVE set and uses a default interrupt stack size of 1024 bytes. You can modify parts of RTKConfig at run time. However, care must be taken not to change them after RTKernel-32 has read and used them. Most values should only be changed before RTKernelInit is called. The various fields of RTK32Config are described below.
|