README 6.5 KB

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