home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
MM1
/
TELECOM
/
linkup12_maint.lzh
/
ucc.doc
< prev
Wrap
Text File
|
1996-04-21
|
5KB
|
109 lines
"Preparing for Ultra C"
A step-by-step guide for setting up
your system to run Ultra C compiled programs
Introduction
============
For a long time, OS-9 users were used to getting files from BBS's and
FTP sites containing executables, bursting the archive, and running
the executable programs. Because many of these executables were compiled
with Microware's long-used C 3.2 compiler, it was expected that modules
such as math and cio had to be loaded into memory. While this is still
the case, new requirements are demanded by Ultra C compiled programs.
Ultra C is Microware's current ANSI compilant C/C++ compiler. As Ultra C
becomes more widely used, programs which have been compiled with it are
appearing everywhere. These programs rely on a different set of modules
to be in memory than programs which were born of the old C 3.2 compiler.
If proper steps have not been taken to run Ultra C compiled programs on a
system, strange errors can occur.
The modules referenced here can be found in the UCCMODS directory of
the archive.
Floating Point Support
======================
Unlike the old C 3.2 compiler which depended on a trap module called
'math' for floating point processing, Ultra C places floating point
instructions directly into the programs that it compiles. While this
has its advantages for systems equipped with a hardware floating point
unit (or FPU), it can cause havoc for those who don't have a hardware
FPU and haven't made the necessary system preparations.
If your OS-9 system DOES HAVE a hardware FPU, then skip this section;
OTHERWISE, you will need to install the supplied software emulation
module (fpu) if you have not already done so. If you have already
installed the software fpu module at an earlier time, you will want
to check if the included fpu has a higher edition number and replace
your current fpu module with it.
The software fpu module is called when a floating point instruction is
fetched by the CPU, and will emulate the math instruction in software.
If a system without a hardware or software fpu were to execute a program
with floating point instructions, you would see the OS-9 error #000:111
appear, and the process would immediately die.
To install the software fpu module, you need to do two things:
1. Modify your init module to reference the fpu module
2. Place the fpu module in your bootfile
The fpu module MUST be in your bootfile. It cannot merely be loaded once
the system is up and running. Additionally, your system's init module
must reference the fpu module by name. The init module has space for an
'extension list' which lists modules in the bootfile that may called
during the OS-9 boot process. The fpu module must be listed as one of
these modules.
The simplest way to modify the init module is to use a binary file editor
(dEd works nicely) to edit the init module file. Locate the string 'os9p2',
and you've found the extension list. If you don't use os9p2, then great!
Just overwrite it with the string: fpu and be sure to NULL terminate it.
If you have os9p2, then you'll need to make sure you have enough room in
the init module's system extension list to add the fpu module name. If
not, then you will need to remake your init module or find some way to
extend it.
Ultra C and CSL
===============
CSL is to Ultra C-compiled programs what CIO is to C 3.2 compiled
programs. That is, CSL (C Shared Library) is a trap module which some
programs (depending on how they were compiled) may need to run. The
simplest method is to place CSL in the bootfile, but you can also place
it in the execution directory, where it will be found and loaded by the
first program that needs it.
Don't throw away your CIO trap module though. Old programs that were
compiled with C 3.2 may still need to use it, so keep both CIO and CSL
in memory.
Two versions of CSL are included. csl.68k is for 68000 based systems,
and csl.020 is for 68020 systems, including the CPU32. Install the
module which pertains to your system.
RBF Device Descriptors
======================
Another change that is necessary is setting the append bit in all of your
RBF device descriptors. At offset $37 in an OS-9 RBF device descriptor is
the 'mode' byte. You need to make sure that bit 4 is set in that byte.
Typically, the value is $a7, so it should be changed to $b7. If this
bit is not set, then programs compiled with Ultra C that open files in
append mode will receive E_BMODE errors.
Once these changes have been made, your system is now ready to run
Ultra C compiled programs. If you have any questions, please contact
me at boisy@os9er.waukee.ia.us, or BOISY on Delphi.
Boisy G. Pitre