README 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. Oberon Microsystems BlackBox Component Builder (http://www.oberon.ch/)
  2. Port for OpenBSD/i386, GNU/Linux/i386, FreeBSD/i386
  3. Some significant parts taken from OpenBUGS (http://www.openbugs.info/)
  4. Tested on:
  5. OpenBSD 5.4
  6. Fedora Core 17
  7. Ubuntu 12.04 LTS, 12.10, 13.10, 14.04
  8. FreeBSD 9.0
  9. Status: stable, but TODO list is not empty
  10. How to build:
  11. if you have 64-bit version of Ubuntu, do this:
  12. sudo apt-get install libc6-dev-i386
  13. cd BlackBox
  14. ./clean
  15. ./switch-target `uname -s` [ GUI ]
  16. compile loader executable:
  17. cd BlackBox/Lin/Rsrc/loader
  18. make clean
  19. make
  20. mv loader ../../../_`uname -s`_/Lin/Rsrc/loader/
  21. compile self:
  22. cd BlackBox
  23. ./build
  24. ./pack-dev0
  25. Files:
  26. original:
  27. BlackBox:
  28. Comm/Mod/Streams.odc
  29. Comm/Docu/*
  30. Dev/Mod/*
  31. all except ElfLinker16
  32. Dev/Docu/*
  33. all except ElfLinker
  34. Dev/Rsrc/*
  35. Dev/Spec/*
  36. Docu/BB-License.odc
  37. Obx/*
  38. Std/*
  39. System/Mod/
  40. all except Console
  41. System/Rsrc/*
  42. Text/*
  43. Xhtml
  44. _Windows_/{Comm,BlackBox.exe,BlackBox.exe.manifest}
  45. _Windows_GUI/*
  46. __GUI/{Comm,Dev,Form,Host/Rsrc/*.odc,Obx,Std,System,Empty.odc,Tour.odc}
  47. OpenBUGS:
  48. Dev/Mod/ElfLinker16.odc
  49. Dev/Docu/ElfLinker.odc
  50. Docu/OpenBUGS-License.odc
  51. http://forum.oberoncore.ru/viewtopic.php?f=34&t=1159&sid=3e82517160caa46c64331178c1b61e95:
  52. _FreeBSDLinuxOpenBSD_/System/Mod/Kernel_so_init.odc
  53. http://oberoncore.ru/projects/bb16ru-kras/:
  54. Dev/Rsrc/ru/Strings.odc
  55. Std/Rsrc/ru/Strings.odc
  56. System/Rsrc/ru/Strings.odc
  57. __GUI/Host/Rsrc/ru/Strings.odc
  58. http://gitlab.molpit.com/oberon/blackbox-freenix/:
  59. _{LinuxOpenBSD,Linux,OpenBSD}_GUI
  60. modified:
  61. _OpenBSD_/System/Mod/Kernel.odc:
  62. BlackBox 1.6 System/Mod/Kernel.odc, OpenBUGS Lin/Mod/linKernel.odc:
  63. OpenBSD specific:
  64. Memory management rewritten (based on mmap)
  65. Kernel.TrapHandler
  66. OpenBSD sigcontext-specific
  67. Kernel.Time
  68. Kernel.InitModule
  69. mprotect call added
  70. Kernel.InstallSignals:
  71. do not install signal handler for SIGTHR (when executable linked with -pthread)
  72. IsReadable
  73. GetRefVar memory access protection
  74. _Linux_/System/Mod/Kernel.odc:
  75. _OpenBSD_/System/Mod/Kernel.odc modified for Linux:
  76. Time*
  77. TrapHandler
  78. mmap: use "/dev/zero" device instead of -1
  79. mprotect addresses must be page-aligned
  80. do not show warning message if signal install failed
  81. _FreeBSD_/System/Mod/Kernel.odc:
  82. _OpenBSD_/System/Mod/Kernel.odc modified for FreeBSD:
  83. Time*
  84. TrapHandler
  85. SetupModListAccess: initial module list must be writeable (read only by default in FreeBSD)
  86. _Linux_/Host/Mod/Files.odc:
  87. OpenBUGS Lin/Mod/linHostFiles.odc:
  88. synchronized with BlackBox 1.6
  89. server configuration via BB_PRIMARY_DIR and BB_SECONDARY_DIR environment variables (not command line)
  90. filenames encoding translation implemented
  91. _OpenBSD_/Host/Mod/Files.odc:
  92. _Linux_/Host/Mod/Files.odc:
  93. OpenBSD-specific:
  94. size_t
  95. __xstat -> stat
  96. LEN(clock_t) = 8
  97. _FreeBSD_/Host/Mod/Files.odc:
  98. _Linux_/Host/Mod/Files.odc:
  99. FreeBSD-specific:
  100. size_t
  101. __xstat -> stat
  102. mode_t
  103. _Linux_/Lin/Mod/Libc.odc:
  104. OpenBUGS Lin/Mod/Libc.odc:
  105. PROT_*, MAP_*, O_*, _SC_PAGESIZE, SIGSTKSZ CONSTs added
  106. open, close, read, write, mmap, munmap, mprotect, getenv, sysconf, sigaltstack functions added
  107. _Linux_/Lin/Mod/Dl.odc:
  108. OpenBUGS Lin/Mod/Dl.odc
  109. _Linux_/Host/Mod/Dates.odc: from http://oberoncore.ru/
  110. _FreeBSDOpenBSD_/Host/Mod/Dates.odc:
  111. _Linux_/Host/Mod/Dates.odc: OpenBSD and FreeBSD specific
  112. _FreeBSDLinuxOpenBSD_/Host/Mod/TextConv.odc:
  113. BlackBox 1.6 Host/Mod/TextConv.odc:
  114. Windows-specific converters removed
  115. _FreeBSDLinuxOpenBSD_/Host/Mod/PackedFiles.odc:
  116. BlackBox 1.6 Host/Mod/PackedFiles.odc:
  117. use BB_PACKED_NAME environment variable instead of appName
  118. GetNextSubLoc, GetLoc: filenames-specific
  119. _FreeBSDLinuxOpenBSD_Interp/Host/Mod/DevPackedFiles.odc:
  120. _FreeBSDLinuxOpenBSD_/Host/Mod/PackedFiles.odc:
  121. with priority to packed files
  122. _FreeBSDLinuxOpenBSD_/System/Mod/Config.odc:
  123. BlackBox 1.6 System/Mod/Config.odc:
  124. Windows-specific removed
  125. _FreeBSDLinuxOpenBSD_GUI/Host/Mod/Registry.odc:
  126. BlackBox 1.6 Host/Mod/Registry.odc
  127. _Windows_Interp/Host/Mod/{Dates.odc,Lang.odc}:
  128. part of BlackBox 1.6 Host/Mod/Dialog.odc
  129. _Windows_Interp/Host/Mod/DevPackedFiles.odc:
  130. BlackBox 1.6 Host/Mod/PackedFiles.odc:
  131. with priority to packed files
  132. new:
  133. Console:
  134. System/Mod/Console.odc: Console interface
  135. _FreeBSDLinux_/Host/Mod/Console.odc: Console implementation for Linux and FreeBSD
  136. _OpenBSD_/Host/Mod/Console.odc:
  137. _Linux_/Host/Mod/Console.odc: stdin -> SYSTEM.ADR(__sF[0]) (OpenBSD-specific)
  138. _Windows_/Host/Mod/Console.odc:
  139. Console implementation for Windows
  140. Cons/Mod
  141. Interp.odc: console interpreter
  142. Compiler.odc: console interface to Dev compiler
  143. Log.odc: Log.Hook console implementation
  144. {_OpenBSD_,_FreeBSD_}/Lin/Mod/Libc.odc: OpenBSD and FreeBSD specific libc interface
  145. {_OpenBSD_,_FreeBSD_}/Lin/Mod/Dl.odc: OpenBSD and FreeBSD specific interface to dl
  146. {_Linux_,_OpenBSD_,_FreeBSD_}/Lin/Mod/Iconv.odc: interface to iconv
  147. {_Linux_,_OpenBSD_}/Lin/Mod/Ioctl.odc: interface to ioctl
  148. {_Linux_,_OpenBSD_}/Lin/Mod/Termios.odc: interface to termios
  149. {_Linux_,_OpenBSD_}/Lin/Mod/Net.odc: interface to network functionality
  150. _FreeBSDLinuxOpenBSD_/Host/Mod/Lang.odc: Dialog.LanguageHook implementation and LANG environment variable support
  151. _LinuxOpenBSD_/Comm/Mod/V24.odc: CommV24 implementation for Linux and OpenBSD
  152. _OpenBSD_/Comm/Mod/TCP.odc: CommTCP implementation for OpenBSD
  153. _Linux_/Comm/Mod/TCP.odc: CommTCP implementation for Linux
  154. _Linux_/Lin/Mod/Rt.odc: interface to librt
  155. {_OpenBSD_,_Linux_}/libBB.so: compiled and linked shared library to run BlackBox
  156. {_OpenBSD_,_Linux_}/libBB0.so: compiled, linked and packed shared library to run console interpreter
  157. _Windows_/dev0.exe: compiled and linked simple development interpreter
  158. Dev0/Views.odc: minimal Views implementation required to compile StdInterpreter
  159. __Interp/Host/Mod: Fonts.odc, Dialog.odc, Windows.odc: simple Host implementation
  160. __Interp/System/Mod/Init.odc: Init for console interpreter
  161. Notes:
  162. Kernel.baseStack issue:
  163. baseStack is upper border:
  164. * of garbage collector stack scan range (see Kernel.MarkLocals)
  165. * of TrapViewer stack show range (see Kernel.TrapHandler)
  166. it is initialized in Kernel.INIT and initially points close to upper
  167. border of library stack (because Kernel.INIT called from library
  168. constructor, which executes close to upper border of library stack)
  169. it can be changed in Kernel.Start to skip unnecessary stack addresses
  170. if libBB.so exports procedure for calling from main program,
  171. then it will be executed on main program stack, not on library
  172. stack, at stack addresses higher than baseStack.
  173. Thus, MarkLocals and TrapViewer will work incorrectly.
  174. in this case, to solve problem, baseStack should be adjusted and
  175. should point to stack on which this exported procedure executes
  176. if necessary, this can be done using auxiliary module Kernel_so_init,
  177. or by using Kernel.Start
  178. Command line support removed because there is no easy way to access argc argv from outside main()
  179. Environment variables supported instead:
  180. BB_PRIMARY_DIR
  181. BB_SECONDARY_DIR (was: /USE command line option)
  182. BB_PACKED_NAME
  183. Alexander V. Shiryaev, 2014