Re: Executable modules, console I/O

Stewart Smith (ssmith@central.murdoch.edu.au)
Tue, 24 Mar 1998 10:22:53

408125@ingta.unizar.es wrote:
>I=B4m a spanish student of EUPLA university. We work with Component=20
>Pascal, and I have a question.=20
>Can I do EXECUTABLE a module? How?

You can generate windows EXEs and DLLs using the BlackBox Linker. There's a
brief explanation of how to do this under "Linking Blackbox Applications"
in the "Platform Specific Issues" documentation. Depending on your
configuration, you may have to provide an implementation of The Config and
Startup modules (see System/Docu/Config). These control what happens when
BlackBox initialises itself.

Clemens Szyperski <szypersk@fit.qut.edu.au> wrote:
> Regarding the linker: it is part of every BlackBox version and can be
used to
> produce DLLs: have a look at Dev/Docu/P-S-I.odc .

Yes, the linker is included with every BlackBox version. Unfortunately, the
linker documentation was omitted from the 1.3 final release (there is a
circular reference in the documentation). When I contacted Oberon
Microsystems Inc, they were happy to mail me the relevant file
(dev/docu/Linker.odc). Perhaps someone from OMI could e-mail it to the
list, in case there are others who are confused by this...

By default, the linker generates Windows GUI-mode executables. With a bit
of fiddling, it is also possible to build executables that will run in a
Windows Console, allowing a unix-style interface with piping, redirection,
etc. Essentially, all you have to do to achieve this is to fix up the Mode
byte in the executable's PE header (I wrote a little program to do this,
which I will post if anyone is interested). The framework provides no
support for text-mode I/O, so you have to do some work with WinApi to get
things happening. It would be nice to see some standard modules to support
text-mode I/O. It would be even nicer if these were compatible with a Unix
Oberon compiler, such as OOC.

Interestingly, many of the high-level features of BlackBox do not
necessarily require a GUI-mode executable. For example, TextModels are an
abstraction for texts, which can include embedded views. Views depend on
Ports, which in turn depend on the Host windowing system, so you probably
wouldn't expect to be able to use TextModels outside a GUI environment.
However, by judiciously linking the required modules you can, in fact,
build Console applications that read and write TextModels (or other Stores
for that matter). If you link the whole of BlackBox these executables tend
to be large (>1Mb); there useful are subsets of BlackBox that include
TextModels and TextFormatters and produce executables below 300K. Part of
the problem is that it is not clear which subsets of BlackBox are stable
and self-consistent. Hopefully this will be clarified in future releases.=20

Hope that this helps.

Regards,
Stewart=20