On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTTarget-32 Programming Manual
Introduction
Running Win32 Programs without Win32
The i386 Microprocessor
RTLoc: Locating a Program
Running a Program on the Target
Cross Debugging
Using an IDE
Using Microsoft Visual Studio
Using Borland Delphi
Setting up a Project (Delphi 5/6/7)
Setting up a Project (Delphi 2007)
Debugging with Borland Delphi
The RTTarget-32 API
Demo Programs
Advanced Topics
Compiling and Linking with On Time RTOS-32
Redistributable Components of RTTarget-32
RTLoc Error Messages
RTTarget-32 Reference Manual
RTKernel-32
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Setting up a Project (Delphi 5/6/7)
On Time RTOS-32 programs are essentially Win32 console mode programs which are run through the locator RTLoc. Thus, setting up an On Time RTOS-32 project in Delphi is best done by creating a project group with a Win32 console mode project and a batch project for the locator. This section describes step-by-step how to set up such a project group. Additional in-depth information about the Delphi compiler and general compile guidelines are available in section Compiling and Linking with On Time RTOS-32.
An On Time RTOS-32 project group should have the following properties:
- Create a project group with two projects: A Win32 console .exe project and a batch file project to run Rtloc. The simplest way to do this is to use this template1:
#---------------------------------------------------------------------------
VERSION = BWS.01
#---------------------------------------------------------------------------
!ifndef ROOT
ROOT = $(MAKEDIR)\..
!endif
#---------------------------------------------------------------------------
MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$**
DCC = $(ROOT)\bin\dcc32.exe $**
BRCC = $(ROOT)\bin\brcc32.exe $**
#---------------------------------------------------------------------------
PROJECTS = Hello.rtb Hello.exe
#---------------------------------------------------------------------------
default: $(PROJECTS)
#---------------------------------------------------------------------------
Hello.rtb: Target.bat
$(MAKE) Hello.exe
call $**
Hello.exe: Hello.dpr
$(DCC)
Replace all occurrences of "Hello" with the name of the project and then save the file as Project.bpg.
- Create a batch file project file named Target.bat with the following content1:
REM Command Interpreter: $(COMSPEC)
make
if errorlevel 1 pause
- Create a make file named Makefile with the following content (replace "Hello" with your project's name):
#
# Makefile to build the RTTarget-32 demo "Hello"
#
!ifndef RTTARGET
RTTARGET_Not_Defined:
@echo .
@echo You must define environment variable RTTARGET to compile this example.
@echo Run batch file VARSDEL.BAT in RTTarget-32's installation directory first
!endif
Hello: Hello.rtb
Hello.exe: Hello.dpr
DCC32 -v -GD -CC -M -U"$(RTTARGET)\Libdel" Hello.dpr
Hello.rtb: Hello.exe Monitor.rtb Hello.rfg Demopc.cfg
Rtloc Hello Demopc.cfg Hello.rfg
Monitor.rtb: Monitor.cfg Demopc.cfg
Rtloc -DBOOT Monitor Demopc.cfg Monitor.cfg
BootDisk Monitor A:
This make file needs configuration files Hello.rfg, Demopc.cfg, and Monitor.cfg. To get started, it's easiest to copy these files from one of the Delphi demos shipped with On Time RTOS-32. For projects requiring a custom System DLL, that DLL should also be built by this make file. Please see the demo programs for examples.
- Create a Win32 console project named Project.dpr:
PROGRAM Hello;
{$APPTYPE CONSOLE}
USES
Rttarget,
Windows;
BEGIN
WriteLn('Hello Delphi under RTTarget-32')
END.
- In the project options, directories, add Unit Search Path $(RTTARGET)\Libdel. In the environment options, enable autosaving editor files.
- To start the Delphi IDE, invoke Delphi using RTTarget-32 utility Dbgshell:
Dbgshell Hello.bpg
Dbgshell will define environment variable RTTARGET, add $(RTTARGET)\Bin to the system Path, and configure the Delphi IDE integrated debugger to act as an RTTarget-32 cross debugger.
Using Borland Delphi
Setting up a Project (Delphi 2007)
|