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   
Text File  |  1996-04-21  |  5KB  |  109 lines

  1.  
  2.                            "Preparing for Ultra C"
  3.  
  4.                      A step-by-step guide for setting up
  5.                  your system to run Ultra C compiled programs
  6.  
  7.  
  8. Introduction
  9. ============
  10. For a long time, OS-9 users were used to getting files from BBS's and
  11. FTP sites containing executables, bursting the archive, and running
  12. the executable programs.  Because many of these executables were compiled
  13. with Microware's long-used C 3.2 compiler, it was expected that modules
  14. such as math and cio had to be loaded into memory.  While this is still
  15. the case, new requirements are demanded by Ultra C compiled programs.
  16.  
  17. Ultra C is Microware's current ANSI compilant C/C++ compiler.  As Ultra C
  18. becomes more widely used, programs which have been compiled with it are
  19. appearing everywhere.  These programs rely on a different set of modules
  20. to be in memory than programs which were born of the old C 3.2 compiler.
  21. If proper steps have not been taken to run Ultra C compiled programs on a
  22. system, strange errors can occur.
  23.  
  24. The modules referenced here can be found in the UCCMODS directory of
  25. the archive.
  26.  
  27.  
  28. Floating Point Support
  29. ======================
  30. Unlike the old C 3.2 compiler which depended on a trap module called
  31. 'math' for floating point processing, Ultra C places floating point
  32. instructions directly into the programs that it compiles.  While this
  33. has its advantages for systems equipped with a hardware floating point
  34. unit (or FPU), it can cause havoc for those who don't have a hardware
  35. FPU and haven't made the necessary system preparations.
  36.  
  37. If your OS-9 system DOES HAVE a hardware FPU, then skip this section;
  38. OTHERWISE, you will need to install the supplied software emulation
  39. module (fpu) if you have not already done so.  If you have already
  40. installed the software fpu module at an earlier time, you will want
  41. to check if the included fpu has a higher edition number and replace
  42. your current fpu module with it.
  43.  
  44. The software fpu module is called when a floating point instruction is
  45. fetched by the CPU, and will emulate the math instruction in software.
  46. If a system without a hardware or software fpu were to execute a program
  47. with floating point instructions, you would see the OS-9 error #000:111
  48. appear, and the process would immediately die.
  49.  
  50.  
  51. To install the software fpu module, you need to do two things:
  52.  
  53.     1. Modify your init module to reference the fpu module
  54.     2. Place the fpu module in your bootfile
  55.  
  56. The fpu module MUST be in your bootfile.  It cannot merely be loaded once
  57. the system is up and running.  Additionally, your system's init module
  58. must reference the fpu module by name.  The init module has space for an
  59. 'extension list' which lists modules in the bootfile that may called
  60. during the OS-9 boot process.  The fpu module must be listed as one of
  61. these modules.
  62.  
  63. The simplest way to modify the init module is to use a binary file editor
  64. (dEd works nicely) to edit the init module file.  Locate the string 'os9p2',
  65. and you've found the extension list.  If you don't use os9p2, then great!
  66. Just overwrite it with the string: fpu  and be sure to NULL terminate it.
  67.  
  68. If you have os9p2, then you'll need to make sure you have enough room in
  69. the init module's system extension list to add the fpu module name.  If
  70. not, then you will need to remake your init module or find some way to
  71. extend it.
  72.  
  73.  
  74. Ultra C and CSL
  75. ===============
  76. CSL is to Ultra C-compiled programs what CIO is to C 3.2 compiled
  77. programs.  That is, CSL (C Shared Library) is a trap module which some
  78. programs (depending on how they were compiled) may need to run.  The
  79. simplest method is to place CSL in the bootfile, but you can also place
  80. it in the execution directory, where it will be found and loaded by the
  81. first program that needs it.
  82.  
  83. Don't throw away your CIO trap module though.  Old programs that were
  84. compiled with C 3.2 may still need to use it, so keep both CIO and CSL
  85. in memory.
  86.  
  87. Two versions of CSL are included.  csl.68k is for 68000 based systems,
  88. and csl.020 is for 68020 systems, including the CPU32.  Install the
  89. module which pertains to your system.
  90.  
  91.  
  92. RBF Device Descriptors
  93. ======================
  94. Another change that is necessary is setting the append bit in all of your
  95. RBF device descriptors.  At offset $37 in an OS-9 RBF device descriptor is
  96. the 'mode' byte.  You need to make sure that bit 4 is set in that byte.
  97. Typically, the value is $a7, so it should be changed to $b7.  If this
  98. bit is not set, then programs compiled with Ultra C that open files in
  99. append mode will receive E_BMODE errors.
  100.  
  101.  
  102.  
  103. Once these changes have been made, your system is now ready to run
  104. Ultra C compiled programs.  If you have any questions, please contact
  105. me at boisy@os9er.waukee.ia.us, or BOISY on Delphi.
  106.  
  107.  
  108. Boisy G. Pitre
  109.