Castles in the air - they are so easy to take refuge in. And easy to build, too.
-- Henrik Ibsen
RCOS is a large, complex program the source code for which resides in multiple source (.cpp) and header (.hpp) files. Recompiling RCOS is a large job and one you will have to complete as part of the CQU subject Operating Systems.
The RCOS source code was designed to be portable across compilers and computing platforms. RCOS is known to compile on the following compilers/platforms
This chapter currently demonstrates how you can recompile RCOS. With particular emphasis on using the Borland C++ compiler platform.
The first step in compiling RCOS is to define the platform and compiler you are using. To specify your platform and compiler you can place one of the #define macros listed in Table 5.1 into the file RCOS.HPP. This macro makes sure that the correct code for your platform is compiled.
Macro Platform
BC40 Borland version 4.0
BC31 Borland version 3.1
BC20 Borland version 2.0 (for version 2.0
you must have both BC31 and BC20
defined)
MSC700 Microsoft version 7
SYM60 Symantec version 6
UNIX UNIX with X11 (tested on Linux)
Table 5.1.
Platform #define macros.
For example,
If you are compiling RCOS using Borland C version 2.0 you must have the lines
#define BC20 #define BC31somewhere in RCOS.HPP.
If you are compiling RCOS under UNIX you must have a line
#define UNIX
somewhere in RCOS.HPP.
Once this macro has been set you can follow the procedure specific to the compiler you are using to compile a new version of RCOS.
RCOS will not compile with Turbo C++ version 1.0.
RCOS consists of over 40 separate source files, all of which have to be compiled and then linked together to form the one RCOS executable. Using a Borland compiler the simplest mechanism to perform this task is to use a project file.
Project files are the method Borland compilers use to automatically compile programs that contain multiple source files. A project file contains a list of all the source files that must be compiled and linked to produce an executable and various settings about the compiler environment.
To compile RCOS using a Borland compiler you need a project file.
Different versions of the Borland compilers use different formats for their project files. There may be included in the distribution of RCOS a number of project files for Borland C++ compilers (which ones depends on how much time I have over the next couple of weeks). At the very least there will be one for version 2.0 (which can be read by version 3.1).
To use a project file chose the Open Project item that is in the Project menu. This will allow you to load the project file you need.
The project file not only stores a list of all the source files. It also stores pointers to the directories in which the compiler will look for library and include files. These directories will be specific to your system.
At the moment these project files contain pointers to the include and library directories on my machine. You must change these so they point to the correct directories for you machine. Generally the library and include directories will be the lib and include directories under the directory in which your C++ compiler is installed.
You change these directories using one of the selections under the Options menu. Refer to your compiler's manual for more information.
Simple steps for creating a project file are as follows. (Refer to your compiler manuals for more information).
Create a new project file
Choose Open Project from the Project menu.
Change to the source directory in the main RCOS directory.
Give your project file a name (rcos.prj is a suggestion)
Add all the source files
Choose Add from the Project menu. You should then add all the .CPP files from the RCOS source directory to the project file. do not include debugknl.cpp, this file is only used in special cases as a replacement for kernel.cpp
Change the memory model
Usually under the Compiler selection under the Options menu there is a place to specify which memory model to use. This must be changed to HUGE.
Make sure the graphics library is to be linked
RCOS must have the Borland Graphics library linked with it. This means a setting under the Linker option of the Options menu must be set.
Make sure the library and include directories are set properly
Usually under the Directories selection from the Options menu
RCOS uses MS-DOS graphics to generate its displays. To use MS-DOS graphics with programs compiled using a Borland compiler you must have the correct BGI file in the current directory. Since RCOS only runs on VGA graphics screens you must have the file EGAVGA.BGI in your current directory when you execute RCOS.
Students studying CQU's subject Operating Systems will have to recompile RCOS as part of their studies. RCOS can be compiled using a number of different compilers on the MS-DOS and UNIX platforms.
RCOS comes with a number of project files that can be used to compile RCOS with almost any of the supported Borland C++ compiler.