...
Real Mode, Large Model with Hardware Floating-Point Support
This chapter section describes how µC/OS-II has been ported to the Intel 80x86 series of processors that provides a Floating-Point Unit (FPU). Some of the processors that can make use of this port are the Intel 80486™, Pentiums™ (all models), Xeon™, AMD Athlon™, K6™-series, ElanSC520™ and more. The port assumes the Borland C/C++ compiler V4.51 and was setup to generate code for the large memory model. The processor is assumed to be running in real mode. The code for this port is very similar to the one presented in Chapter 14 and in some cases, I will only be presenting the differences.
...
Figure 15.1 shows the programming model of an 80x86 processor running in real mode. The integer registers are identical to those presented in Chapter 14. In fact, they are saved and restored using the same technique. The only difference between this port and the one presented in Chapter 14 is that we also need to save and restore the FPU registers which is done by using the context switch hook functions.Figure 15.1 80x86 real-mode register model.
Development Tools
As with Chapter 14, I used the Borland C/C++ V4.51 compiler along with the Borland Turbo Assembler for porting and testing. This compiler generates reentrant code and provides in-line assembly language instructions that can be inserted in C code. The compiler can be directed to generate code specifically to make use of the FPU. I tested the code on a 300 MHz Pentium-II-based computer running the Microsoft Windows 2000 operating system. In fact, I configured the compiler to generate a DOS executable which was run in a DOS window.
...
Table 15.1, Compiler options used to compile port and examples.
Option (i.e., setting) | Description |
---|---|
-1 | Generate 80186 code |
-B | Compile and call assembler |
-c | Compiler to .OBJ |
-d | Merge duplicate strings |
-f287 | Use FPU hardware instructions |
-G | Select code for speed |
-I | Path to compiler include files is C:\BC45\INCLUDE |
-k- | Standard stack frame |
-L | Path to compiler libraries is C:\BC45\LIB |
-ml | Large memory model |
-N- | Do not check for stack overflow |
-n..\obj | Path where to place object files is ..\OBJ |
-O | Optimize jumps |
-Ob | Dead code elimination |
-Oe | Global register allocation |
-Og | Optimize globally |
-Oi | Expand common intrinsic functions inline |
-Ol | Loop optimization |
-Om | Invariant code motion |
-Op | Copy propagation |
-Ov | Induction variable |
-v | Source debugging ON |
-vi | Turn inline expansion ON |
-wpro | Error reporting: call to functions with no prototype |
-Z | Suppress redundant loads |
Table 15.2 shows the Borland Turbo Assembler V4.0 options (i.e., flags) supplied on the command line. These settings were used to assemble OS_CPU_A.ASM
.
Table 15.2, Assembler options used to assemble .ASM files.
Option (i.e., setting) | Description |
---|---|
/MX | Case sensitive on globals |
/ZI | Full debug info |
/O | Generate overlay code |
Directories and Files
The installation program provided on the companion CD installs the port for the Intel 80x86 (real mode, large model with FPU support) on your hard disk. The port is found under the:
...