UcosII 80x86 32Bit Flat mode Port for Borland C++ 5.2
Introduction.
Bcc52ucos.zip contains the port of ucos_II to 80x86 in 32bit flat mode developed with the Borland C++
5.2 compiler. This port is based on Jean L. Gareau’s original Visual C++ 6.0 port.
There are however some important differences:
� Several errors have been corrected. These include not adjusting the priorities correctly in OSCtxSw
which make the system run erratically.
� PC services implemented in pc.c have been ported. CMOS clock is read for time/date functions.
� Ports for the three examples in the books are included. Very minor changes are required in the code.
These are explained in detail later.
� Borland’s C++ 5.2 (or latter) is used to build the application. This has some very important
consequences as segment definitions have to be modified and OSIntCtxSw has to be modified
according to the extra information saved in the stack by bcc32 in function calls. Several minor
modifications have been included to cope with assembler specific syntax differences.
� On Time Systems RTTarget32 is used to initialize the target.
� Tick rate can be altered by changing OS_TICKS_PER_SECOND. Of course you must call
PC_SetTickRate in the application.
Port Contents.
The port contents the standard ucos_II port files:
� Cpu specific C files: OS_cpu_c.c
� Cpu specific asm files: OS_cpu_a.asm
� Cpu specific configuration: OS_cpu.h
� Generic OS config file (no change from default).
� Ported pc services: pc386.c
� Ported pc services include: pc386.h
� Example ports: ex1p.c, ex2p.c and ex3p.c
� RTTarget config files: hello.cfg, bt8x8.cfg
� Makefile to build the examples.
� RTB\ directory contains RTTarget loadable images for the examples.
Building and Running Applications.
To build a ucos_II 386flat application you need to have RTTarget32 in your system. This product is
distributed by On Time Informatik GMBH (www.on-time.com). Although On Time has their own RTOS
it is a separate product from RTTarget 32. RTTarget 32 can be used to run any Win32 console
application in a PC without MSwindows.
If you do not have RTTarget use can still try my port by downloading RTOS-32 evaluation version from
www.on-time.com. This evaluation version includes several other products but only RTTarget is needed
for our porpoise. The evaluation version only permits booting the target from floppy disk and
downloading the application (including ucos of course) by a serial cable. The “real” version lets you load
your application in many different ways including floppy, hard disk, bios extension eprom and reset
vector eprom.
Once you have installed RTTarget you can proceed building the application. First unzip the port and
include the standard ucos_II files (from the book) in the same directory.
As an example we will build example ex1p. To build the exe file just type in a MSDOS window in the
port extraction directory make ex1p. This will run the compiler (bcc32 ex1p.c ucos_II.c os_cpu_a.asm
os_cpu_c.c pc386.c) and the locator (rtloc ex1p xxx.cfg). The rttarget configuration file used is different
in the demo and the standard version, as the demo version is restricted to a specific hardware
configuration (standard PC).
If you are using the standard rttarget you can modify Makefile to use BT8x8.cfg configuration file and
produce a bootable floppy with your application by typing bootdisk ex1p a: and boot it in the target.
In any case you can create a bootable floppy with the rttarget monitor, boot the target with it and
download the application by typing rtrun ex1p. You can also cross debug the application in the target by
using rtd.
评论0