README 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. 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-dev0; ./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/System/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. do not install signal handler for SIGTHR (when executable linked with -pthread)
  46. IsReadable
  47. Kernel.cmdLine support:
  48. Kernel.INIT (SetCmdLine2)
  49. Linux/System/Mod/Kernel.odc:
  50. OpenBSD/System/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/Host/Mod/Files.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/Host/Mod/Files.odc:
  64. OpenBUGS Lin/Mod/linHostFiles.odc:
  65. Kernel.cmdLine support:
  66. str := "" -> str := Kernel.cmdLine$
  67. OpenBSD/Host/Mod/Console.odc:
  68. OpenBUGS Lin/Mod/Console.odc:
  69. stdin -> SYSTEM.ADR(__sF[0])
  70. Linux/Host/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. Linux/Host/Mod/Dates.odc: from http://oberoncore.ru/
  82. OpenBSD/Host/Mod/Dates.odc:
  83. Linux/Host/Mod/Dates.odc: OpenBSD-specific
  84. Dev0/Mod
  85. CP*
  86. BlackBox 1.6-rc6 Dev CP* modified to not depend on Dates, Texts etc.
  87. Compiler.odc:
  88. modified original BlackBox Dev/Mod/Compiler.odc
  89. ElfLinker16.odc:
  90. modified OpenBUGS Dev/Mod/ElfLinker16.odc
  91. HostTextConv.odc:
  92. BlackBox 1.6-rc6 Host/Mod/TextConv.odc:
  93. Windows-specific converters removed
  94. new:
  95. Cons/Mod
  96. Interp.odc: console interpreter
  97. Compiler.odc: console interface to Dev compiler
  98. Log.odc: Log.Hook console implementation
  99. {OpenBSD,Linux}/libBB.so: compiled and linked shared library to run BlackBox
  100. {OpenBSD,Linux}/libBB0.so: compiled and linked shared library to run simple development interpreter
  101. Views.odc: minimal Views implementation required to compile StdInterpreter
  102. HostFonts.odc, HostDialog.odc, HostWindows.odc: simple Hosts implementation
  103. Notes:
  104. Dev0:
  105. I will not remove Dev0 because I can not link .so library based on ConsInterp and Dev
  106. Kernel.baseStack issue (preliminary description):
  107. baseStack is upper border:
  108. * of garbage collector stack scan range (see Kernel.MarkLocals)
  109. * of TrapViewer stack show range (see Kernel.TrapHandler)
  110. it is initialized in Kernel.INIT and initially points close to upper
  111. border of library stack (because Kernel.INIT called from library
  112. constructor, which executes close to upper border of library stack)
  113. it can be changed in Kernel.Start to skip unnecessary stack addresses
  114. if libBB.so exports procedure for calling from main program,
  115. then it will be executed on main program stack, not on library
  116. stack, at stack addresses higher than baseStack.
  117. Thus, MarkLocals and TrapViewer will work incorrectly.
  118. in this case, to solve problem, baseStack should be adjusted and
  119. should point to stack on which this exported procedure executes
  120. if necessary, this can be done using auxiliary module Kernel_so_init
  121. A. V. Shiryaev, 2012