2
0

README 7.5 KB

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