README 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. Dev/Mod/*
  23. all except ElfLinker16
  24. Dev/Rsrc/*
  25. Docu/BB-License.odc
  26. Docu/BB-Licensing-Policy.odc
  27. Docu/BB-Open-Source-License.odc
  28. Obx/*
  29. Std/*
  30. System/Mod/
  31. all except Console
  32. System/Rsrc/*
  33. Text/*
  34. Xhtml
  35. OpenBUGS:
  36. Dev/Mod/ElfLinker16.odc
  37. Dev/Docu/ElfLinker.odc
  38. Docu/OpenBUGS-License.odc
  39. http://forum.oberoncore.ru/viewtopic.php?f=34&t=1159&sid=3e82517160caa46c64331178c1b61e95:
  40. {_LinuxOpenBSD_}/System/Mod/Kernel_so_init.odc
  41. http://oberoncore.ru/projects/bb16ru-kras/:
  42. Dev/Rsrc/ru/Strings.odc
  43. Std/Rsrc/ru/Strings.odc
  44. System/Rsrc/ru/Strings.odc
  45. modified:
  46. _OpenBSD_/System/Mod/Kernel.odc:
  47. 1.6-rc6 System/Mod/Kernel.odc, OpenBUGS Lin/Mod/linKernel.odc:
  48. OpenBSD specific:
  49. Memory management rewritten (based on mmap)
  50. Kernel.TrapHandler
  51. OpenBSD sigcontext-specific
  52. Kernel.Time
  53. CLOCKS_PER_SEC related
  54. Kernel.InitModule
  55. mprotect call added
  56. Kernel.InstallSignals:
  57. do not install signal handler for SIGTHR (when executable linked with -pthread)
  58. IsReadable
  59. Kernel.cmdLine support:
  60. Kernel.INIT (SetCmdLine2)
  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. _OpenBSD_/Host/Mod/Files.odc:
  69. OpenBUGS Lin/Mod/linHostFiles.odc:
  70. OpenBSD-specific:
  71. size_t
  72. __xstat -> stat
  73. Kernel.cmdLine support:
  74. str := "" -> str := Kernel.cmdLine$
  75. _Linux_/Host/Mod/Files.odc:
  76. OpenBUGS Lin/Mod/linHostFiles.odc:
  77. Kernel.cmdLine support:
  78. str := "" -> str := Kernel.cmdLine$
  79. _OpenBSD_/Lin/Mod/Libc.txt:
  80. OpenBUGS Lin/Mod/Libc.odc:
  81. OpenBSD-specific
  82. _Linux_/Lin/Mod/Libc.odc:
  83. OpenBUGS Lin/Mod/Libc.odc:
  84. PROT_*, MAP_*, O_*, _SC_PAGESIZE, SIGSTKSZ CONSTs added
  85. open, close, read, write, mmap, munmap, mprotect, getenv, sysconf, sigaltstack functions added
  86. _Linux_/Lin/Mod/Dl.odc:
  87. OpenBUGS Lin/Mod/Dl.odc
  88. _Linux_/Host/Mod/Dates.odc: from http://oberoncore.ru/
  89. _OpenBSD_/Host/Mod/Dates.odc:
  90. _Linux_/Host/Mod/Dates.odc: OpenBSD-specific
  91. Dev0/Mod:
  92. CP*
  93. BlackBox 1.6-rc6 Dev CP* modified to not depend on Dates, Texts etc.
  94. Compiler.odc:
  95. modified original BlackBox Dev/Mod/Compiler.odc
  96. Linker.odc:
  97. modified original BlackBox Dev/Mod/Linker.odc
  98. ElfLinker16.odc:
  99. modified OpenBUGS Dev/Mod/ElfLinker16.odc
  100. _LinuxOpenBSD_/Host/Mod/TextConv.odc:
  101. BlackBox 1.6-rc6 Host/Mod/TextConv.odc:
  102. Windows-specific converters removed
  103. new:
  104. Console:
  105. System/Mod/Console.odc: Console interface
  106. _Linux_/Host/Mod/Console.odc: Console implementation for Linux
  107. _OpenBSD_/Host/Mod/Console.odc:
  108. _Linux_/Host/Mod/Console.odc: stdin -> SYSTEM.ADR(__sF[0]) (OpenBSD-specific)
  109. _Windows_/Host/Mod/Console.odc:
  110. Console implementation for Windows
  111. Cons/Mod
  112. Interp.odc: console interpreter
  113. Compiler.odc: console interface to Dev compiler
  114. Log.odc: Log.Hook console implementation
  115. Enc: encodings conversion subsystem
  116. typical usage -- from low level modules (from Hosts), as libiconv
  117. _LinuxOpenBSD_/Host/Mod/Lang.odc: Dialog.LanguageHook implementation and LANG environment variable support
  118. {_OpenBSD_,_Linux_}/libBB.so: compiled and linked shared library to run BlackBox
  119. {_OpenBSD_,_Linux_}/libBB0.so: compiled and linked shared library to run simple development interpreter
  120. _Windows_/dev0.exe: compiled and linked simple development interpreter
  121. Dev0/Views.odc: minimal Views implementation required to compile StdInterpreter
  122. __Interp/Host/Mod: Fonts.odc, Dialog.odc, Windows.odc: simple Hosts implementation
  123. _LinuxOpenBSD_/System/Mod/Init.odc: Init for console interpreter
  124. Notes:
  125. Dev0:
  126. I will not remove Dev0 because I can not link .so library based on ConsInterp and Dev
  127. Kernel.baseStack issue (preliminary description):
  128. baseStack is upper border:
  129. * of garbage collector stack scan range (see Kernel.MarkLocals)
  130. * of TrapViewer stack show range (see Kernel.TrapHandler)
  131. it is initialized in Kernel.INIT and initially points close to upper
  132. border of library stack (because Kernel.INIT called from library
  133. constructor, which executes close to upper border of library stack)
  134. it can be changed in Kernel.Start to skip unnecessary stack addresses
  135. if libBB.so exports procedure for calling from main program,
  136. then it will be executed on main program stack, not on library
  137. stack, at stack addresses higher than baseStack.
  138. Thus, MarkLocals and TrapViewer will work incorrectly.
  139. in this case, to solve problem, baseStack should be adjusted and
  140. should point to stack on which this exported procedure executes
  141. if necessary, this can be done using auxiliary module Kernel_so_init
  142. A. V. Shiryaev, 2012