README 7.4 KB

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