README 7.8 KB

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