README 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. Oberon Microsystems BlackBox Component Builder (http://www.oberon.ch/)
  2. Port for OpenBSD/i386, 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. compile loader executable (BlackBox itself and simple interpreter):
  7. `uname -s`/libBB0.so must be present (can be built from Windows)
  8. cd BlackBox/`uname -s`/Lin/Rsrc/loader; make
  9. compile self:
  10. cd BlackBox; ./switch-os `uname -s`; ./clean; ./build-lindev; ./build
  11. Files:
  12. original:
  13. BlackBox:
  14. Dev/Mod/*
  15. all except ElfLinker16
  16. Dev/Rsrc/*
  17. Docu/BB-License.odc
  18. Docu/BB-Licensing-Policy.odc
  19. Docu/BB-Open-Source-License.odc
  20. Obx/*
  21. Std/*
  22. System/Mod/
  23. all except Console
  24. System/Rsrc/*
  25. Text/*
  26. OpenBUGS:
  27. Dev/Mod/ElfLinker16.odc
  28. Dev/Docu/ElfLinker.odc
  29. System/Mod/Console.odc
  30. Docu/OpenBUGS-License.odc
  31. http://forum.oberoncore.ru/viewtopic.php?f=34&t=1159&sid=3e82517160caa46c64331178c1b61e95:
  32. {Linux,OpenBSD}/Lin/Mod/Kernel_so_init.odc
  33. modified:
  34. OpenBSD/Lin/Mod/Kernel.odc:
  35. 1.6-rc6 System/Mod/Kernel.odc, OpenBUGS Lin/Mod/linKernel.odc:
  36. OpenBSD specific:
  37. Memory management rewritten (based on mmap)
  38. Kernel.TrapHandler
  39. OpenBSD sigcontext-specific
  40. Kernel.Time
  41. CLOCKS_PER_SEC related
  42. Kernel.InitModule
  43. mprotect call added
  44. Kernel.InstallSignals:
  45. use alternate stack on which signals are to be processed (to catch stack overflow)
  46. do not install signal handler for SIGTHR (when executable linked with -pthread)
  47. Kernel.cmdLine support:
  48. Kernel.INIT (SetCmdLine2)
  49. Linux/Lin/Mod/Kernel.odc:
  50. OpenBSD/Lin/Mod/Kernel.odc modified for Linux:
  51. Time*
  52. TrapHandler
  53. mmap: use "/dev/zero" device instead of -1
  54. mprotect addresses must be page-aligned
  55. do not show warning message if signal install failed
  56. OpenBSD/Lin/Mod/HostFiles.odc:
  57. OpenBUGS Lin/Mod/linHostFiles.odc:
  58. OpenBSD-specific:
  59. size_t
  60. __xstat -> stat
  61. Kernel.cmdLine support:
  62. str := "" -> str := Kernel.cmdLine$
  63. Linux/Lin/Mod/HostFiles.odc:
  64. OpenBUGS Lin/Mod/linHostFiles.odc:
  65. Kernel.cmdLine support:
  66. str := "" -> str := Kernel.cmdLine$
  67. OpenBSD/Lin/Mod/Console.odc:
  68. OpenBUGS Lin/Mod/Console.odc:
  69. stdin -> SYSTEM.ADR(__sF[0])
  70. Linux/Lin/Mod/Console.odc:
  71. OpenBUGS Lin/Mod/Console.odc
  72. OpenBSD/Lin/Mod/Libc.txt:
  73. OpenBUGS Lin/Mod/Libc.odc:
  74. OpenBSD-specific
  75. Linux/Lin/Mod/Libc.odc:
  76. OpenBUGS Lin/Mod/Libc.odc:
  77. PROT_*, MAP_*, O_*, _SC_PAGESIZE, SIGSTKSZ CONSTs added
  78. open, close, read, write, mmap, munmap, mprotect, getenv, sysconf, sigaltstack functions added
  79. Linux/Lin/Mod/Dl.odc:
  80. OpenBUGS Lin/Mod/Dl.odc
  81. OpenBSD/Lin/Mod/Dates.odc:
  82. HostDates, from http://oberoncore.ru/:
  83. OpenBSD-specific
  84. Linux/Lin/Mod/Dates.odc:
  85. HostDates, from http://oberoncore.ru/
  86. Lindev/Mod
  87. CP*
  88. BlackBox 1.6-rc6 Dev CP* modified to not depend on Dates, Texts etc.
  89. Compiler.odc:
  90. modified original BlackBox Dev/Mod/Compiler.odc
  91. ElfLinker16.odc:
  92. modified OpenBUGS Dev/Mod/ElfLinker16.odc
  93. new:
  94. Cons/Mod
  95. Interp.odc: console interpreter
  96. Compiler.odc: console interface to Dev compiler
  97. {OpenBSD,Linux}/libBB.so: compiled and linked shared library to run BlackBox
  98. {OpenBSD,Linux}/libBB0.so: compiled and linked shared library to run simple development interpreter
  99. Views.odc: minimal Views implementation required to compile StdInterpreter
  100. HostFonts.odc, HostDialog.odc, HostWindows.odc: simple Hosts implementation
  101. Notes:
  102. Lindev:
  103. I will not remove Lindev because I can not link .so library based on ConsInterp and Dev
  104. Kernel.baseStack issue (preliminary description):
  105. baseStack is upper border:
  106. * of garbage collector stack scan range (see Kernel.MarkLocals)
  107. * of TrapViewer stack show range (see Kernel.TrapHandler)
  108. it is initialized in Kernel.INIT and initially points close to upper
  109. border of library stack (because Kernel.INIT called from library
  110. constructor, which executes close to upper border of library stack)
  111. it can be changed in Kernel.Start to skip unnecessary stack addresses
  112. if libBB.so exports procedure for calling from main program,
  113. then it will be executed on main program stack, not on library
  114. stack, at stack addresses higher than baseStack.
  115. Thus, MarkLocals and TrapViewer will work incorrectly.
  116. in this case, to solve problem, baseStack should be adjusted and
  117. should point to stack on which this exported procedure executes
  118. if necessary, this can be done using auxiliary module Kernel_so_init
  119. A. V. Shiryaev, 2012