README 6.0 KB

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