README 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. News
  2. ====
  3. 2001/04/16 armin:
  4. - implemented CRT and SYSUTILS
  5. - nwimp/convertimp to convert .imp files to unix
  6. 2001/05/26 armin:
  7. - successfuly compiled binutils for win32 under linux. Patched nlmconv
  8. for win32 available. This makes it possible to use FPC to create NLM's
  9. unter win32.
  10. General
  11. =======
  12. Currently generating NetWare-NLM's only work under Linux. (may be under bsd also)
  13. This is because nlmconv from binutils does not work with i.e. win32 coff object files.
  14. It works fine with ELF-Objects.
  15. Binutils with netware-support needed
  16. ====================================
  17. You need a version of binutils compiled with netware-support. (nlmconv has to be present)
  18. Unfortunately in the Linux distibutions this component of the binutils is not included
  19. so you have to compile it. So download the latest stable binutils package from your
  20. favourite GNU mirror, decompress it ('tar xfz binutils-x.yy.z.tar.gz' on unices
  21. with GNU tar), change to the binutils-x.yy.z directory and configure:
  22. ./configure --prefix=/usr --enable-shared --enable-targets=i386-netware,i386-linux
  23. I used the prefix /usr because thats the default location on redhat (thats what I'm using)
  24. and use
  25. make
  26. make install
  27. to build and install binutils. To check that netware is supported by the version of binutils
  28. installed, use ld --version. The emulation 'i386nw' must be present. Also check that nlmconv
  29. is present and can be started without specifying the complete path of nlmconv.
  30. You can find more information and a binary version of binutils with netware-support for
  31. linux on:
  32. http://home.sch.bme.hu/~keresztg/novell/howto/NLM-Linux-HOWTO.html.
  33. Binutils-2.11 for win32 with netware support and a patched nlmconv
  34. that supports "copyright" are available from:
  35. http://home.t-online.de/home/armin-diehl/fpcnw
  36. or
  37. http://members.tripod.de/adiehl/fpcnw
  38. Building the freepascal runtime-library for netware
  39. ===================================================
  40. Install the current fpc sources from ftp.freepascal.org and change to the directory
  41. rtl/netware under the freepascal sourcetree. Verify the path of your units in
  42. Makefile. The default is /usr/lib/fpc/1.1/units/netware/rtl.
  43. Compile and install the rtl with
  44. make install
  45. on win32 you can use the script compile.cmd. You need to adjust the
  46. destination directory in the script.
  47. Settings and needed files to compile for netware
  48. ================================================
  49. Edit your /etc/ppc386.cfg and add the rtl source path for netware. This are my settings,
  50. you may paste it to your ppc386.cfg:
  51. #IFDEF Netware
  52. -Fu/usr/lib/fpc/1.1/units/netware/rtl
  53. -Fl/usr/lib/fpc/1.1/units/netware/rtl
  54. #ENDIF
  55. This adds the search path for the rtl-units as well as for the needed import-files.
  56. You can use the import files from the rtl/netware directory, they are automaticly
  57. installed. If you want to use import files from novell, be aware that you have to
  58. convert the files to unix format (i.e. with dos2unix).
  59. Building the first nlm
  60. ======================
  61. Ok, now you have installed all needed files, try the following program and compile it
  62. with
  63. ppc386 -Tnetware hello.pas
  64. PROGRAM Hello;
  65. {$Description The FreePascal HelloWorld for Netware}
  66. {$Version 1.0.0}
  67. {$Copyright Copyright (c) 2001 The FreePascal Development Team}
  68. {$Screenname The Pascal Hello World for Netware}
  69. BEGIN
  70. WriteLn ('This is open source ! FreePascal for netware');
  71. END.
  72. Hints on using freepascal for nlm's
  73. ===================================
  74. - Compiler Switches for Netware
  75. -----------------------------
  76. The following compiler-swiches are supported for NetWare:
  77. $DESCRIPTION : NLM-Description, will be displayed at load-time
  78. $M : For Stack-Size. Heap-Size will be ignored
  79. $VERSION x.x.x : Sets Major, Minor and Revision, Revision 0 is nothing, 1=a, 2=b ...
  80. $COPYRIGHT : Sets Copyright, needs a patched nlmconv, patch is
  81. available at the location for binutils-win32 shown
  82. above.
  83. $SCREENNAME : Sets the screen-name (i.e. shown in ctrl-esc screen)
  84. $THREADNAME : Sets the thread name (dont use names that are to long
  85. for netware, that will prevent your nlm from loading)
  86. - Exports
  87. -------
  88. Exports will be handled like in win32:
  89. procedure bla; CDECL; EXPORT;
  90. begin
  91. end;
  92. exports bla name 'bla';
  93. Be aware that without Name 'bla' this will be exported in upper-case.
  94. - Netware import (.imp) files
  95. ---------------------------
  96. Import files are needed by nlmconv as with other netware linkers. FreePascal is
  97. searching import files via the specified library path (-Fl). If you plan to use
  98. import files from novell be aware that they have to be converted from CR/LF to
  99. LF only. The script 'convertimp' in rtl/netware/nwimp will do that.
  100. If a module name is specified in an import, the module is automaticly
  101. declared as autoload by FreePascal.
  102. I.e. the following declaration needs nlmlib.imp and sets nlmlib.nlm as autoload:
  103. FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL 'nlmlib.nlm' NAME 'rmdir';
  104. while the following declaration only imports the symbol without autoloading:
  105. FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL;
  106. If nlmlib.nlm is not loaded while loading yout nlm, you will get an error abount
  107. unknown symbols.
  108. - Debugging
  109. ---------
  110. Thats currently a problem. There is no source level debugger available. The only way
  111. to debug is using the netware internal debugger or nwdbg. nwdbg is a debugger on
  112. assembler level written by Jan Beulich. Symbols are supported. You can get nwdbg for
  113. netware 4.11,5.0 or 5.1 at developer.novell.com.
  114. I read about plans to adapt gdb to current netware versions. As soon as i have news
  115. about gdb i will change this document.
  116. - Netware SDK
  117. -----------
  118. Delphi declarations for the multiplattform api is available at
  119. http://developer.novell.com. You can download the sdk after registering
  120. as a developer.
  121. The files are designed for win32 so they will not work off the box.
  122. I think changing the dll-name to the corrosponding nlm-name will work.
  123. i.e. in calwin32.imp the following declaration:
  124. function NWAbortServicingQueueJob2; StdCall; external 'calwin32.dll' index 231;
  125. has to be changed to
  126. function NWAbortServicingQueueJob2; CDecl; external 'calwin32.nlm';
  127. - FreePascal RTL
  128. --------------
  129. Currently the following units are available for netware:
  130. - SYSTEM
  131. - CRT
  132. - DOS
  133. - SYSUTILS
  134. - STRINGS
  135. - KEYBOARD
  136. - VIDEO
  137. - MATH
  138. - TYPINFO
  139. - OBJECTS
  140. - GETOPTS
  141. - HEAPTRC
  142. - VARUTILS
  143. - CPU
  144. - MMX