README 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. News
  2. ====
  3. 2004/08/01 armin:
  4. - lot of fixes, compiler can compile itself on a netware server
  5. 2003/02/16 armin:
  6. - added nwconio, nwthreads, nwsnut
  7. 2003/02/15 armin:
  8. - changes for new threadvars
  9. 2002/02/27 armin:
  10. - changes for current fpc 1.1
  11. 2001/04/16 armin:
  12. - implemented CRT and SYSUTILS
  13. - nwimp/convertimp to convert .imp files to unix
  14. 2001/05/26 armin:
  15. - successfuly compiled binutils for win32 under linux. Patched nlmconv
  16. for win32 available. This makes it possible to use FPC to create NLM's
  17. unter win32.
  18. General
  19. =======
  20. Currently generating NetWare-NLM's only work under Linux and win32. (may be under bsd also)
  21. For Win32 you need a win32 compiled binutils with netware target enabled. Because nlmconv
  22. only works with elf objects, elf support in binutils is also needed.
  23. Binutils with netware-support needed
  24. ====================================
  25. You need a version of binutils compiled with netware-support. (nlmconv has to be present)
  26. Unfortunately in the Linux distibutions this component of the binutils is not included
  27. so you have to compile it. So download the latest stable binutils package from your
  28. favourite GNU mirror, decompress it ('tar xfz binutils-x.yy.z.tar.gz' on unices
  29. with GNU tar), change to the binutils-x.yy.z directory and configure:
  30. ./configure --prefix=/usr --enable-shared --enable-targets=i386-netware,i386-linux
  31. I used the prefix /usr because thats the default location on redhat (thats what I'm using)
  32. and use
  33. make
  34. make install
  35. to build and install binutils. To check that netware is supported by the version of binutils
  36. installed, use ld --version. The emulation 'i386nw' must be present. Also check that nlmconv
  37. is present and can be started without specifying the complete path of nlmconv.
  38. You can find more information and a binary version of binutils with netware-support for
  39. linux on:
  40. http://home.sch.bme.hu/~keresztg/novell/howto/NLM-Linux-HOWTO.html.
  41. Binutils-2.11 for win32 and RedHat 7.2 with netware support and a patched nlmconv
  42. that supports "copyright" are available from:
  43. http://home.arcor.de/armin.diehl/fpcnw
  44. The copyright-patch is included in newer versions of binutils (2.13)
  45. Building the freepascal runtime-library for netware
  46. ===================================================
  47. Install the current fpc sources from ftp.freepascal.org and change to the directory
  48. rtl/netware under the freepascal sourcetree. Verify the path of your units in
  49. Makefile. The default is /usr/lib/fpc/1.9.5/units/netware/rtl.
  50. Compile and install the rtl with
  51. make install
  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.9.5/units/netware/rtl
  58. -Fl/usr/lib/fpc/1.9.5/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. $SCREENNAME DEFAULT : output to logger screen
  90. $SCREENNAME NONE : no output at all
  91. $SCREENNAME MyScreen: Name the screen "MyScreen"
  92. $THREADNAME : Sets the thread name (dont use names that are to long
  93. for netware, that will prevent your nlm from loading)
  94. - Exports
  95. -------
  96. Exports will be handled like in win32:
  97. procedure bla; CDECL; EXPORT;
  98. begin
  99. end;
  100. exports bla name 'bla';
  101. Be aware that without Name 'bla' this will be exported in upper-case.
  102. - Netware import (.imp) files
  103. ---------------------------
  104. Import files are needed by nlmconv as with other netware linkers. FreePascal is
  105. searching import files via the specified library path (-Fl). If you plan to use
  106. import files from novell be aware that they have to be converted from CR/LF to
  107. LF only. The script 'convertimp' in rtl/netware/nwimp will do that.
  108. If a module name is specified in an import, the module is automaticly
  109. declared as autoload by FreePascal.
  110. I.e. the following declaration needs nlmlib.imp and sets nlmlib.nlm as autoload:
  111. FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL 'nlmlib.nlm' NAME 'rmdir';
  112. while the following declaration only imports the symbol without autoloading:
  113. FUNCTION rmdir (path : PCHAR) : LONGINT; CDECL; EXTERNAL;
  114. If nlmlib.nlm is not loaded while loading your nlm, you will get an error about
  115. unknown symbols.
  116. - Debugging
  117. ---------
  118. Debugging is possible with gdb on Netware 4.11, 5, 6 and 6.5.
  119. See http://home.arcor.de/armin.diehl/fpcnw/gdbnw.html for details
  120. - Netware SDK
  121. -----------
  122. Delphi declarations for the multiplattform api is available at
  123. http://developer.novell.com. You can download the sdk after registering
  124. as a developer.
  125. The files are designed for win32 so they will not work off the box.
  126. I think changing the dll-name to the corrosponding nlm-name will work.
  127. i.e. in calwin32.imp the following declaration:
  128. function NWAbortServicingQueueJob2; StdCall; external 'calwin32.dll' index 231;
  129. has to be changed to
  130. function NWAbortServicingQueueJob2; CDecl; external 'calwin32.nlm';
  131. - FreePascal RTL
  132. --------------
  133. Currently the following units are available for netware:
  134. - SYSTEM
  135. - CRT
  136. - DOS
  137. - SYSUTILS
  138. - STRINGS
  139. - KEYBOARD
  140. - VIDEO
  141. - MATH
  142. - TYPINFO
  143. - OBJECTS
  144. - GETOPTS
  145. - HEAPTRC
  146. - VARUTILS
  147. - CPU
  148. - MMX
  149. - WinSock2
  150. - SYSTHRDS
  151. - nwconio
  152. - nwthreads
  153. - nwsnut
  154. [email protected]