README 6.3 KB

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