[Oberon] Oberon 3 on Windows 7, PELinker, Windows executable
Dieter
d.gloetzel at web.de
Mon Mar 16 13:52:12 CET 2015
Hi Chris,
thanks a lot. Your example works on my Oberon 3-plugin Version [Win32
2.5 (7.2.2009)]. So basically my problem seems to be solved.
However on the newer version [Win32 2.5 (18.12.2010)] your example does
not run, because /PELinker /and /BootLinker/ are not available in this
distribution.
I wonder whether the PELinker/BootLinker are no longer free as
non-commercial license, or did somebody overlook something, when he
created the latest Version?
My application is practically ready on the Oberon side.
What do you think? Will I need more Kernel32 routines in order to do my
job, namely reading and writing a file?
Also I write a lot of control information onto the System.Log with the
Out-Module.
Will this work during the EXE, or do I have to replace the
Out-statements by something else, e.g. writing into a third file?
Although I always got along without using the Oberon Debugger, I would
like to have some more information on how to use it.
For the missing PELinker and BootLinker I tried something which did not
work.
When I copy the PELinker.obj from the older Version and try to run it,
then I get a trap, as follows.
===============================================================================
TRAP PELinker.ErrorException in thread Oberon.Loop
PELinker.Error PC = 236
str1 = "stub.exe"
str2 = " Files.Old failed"
PELinker.Assert PC = 369
cond = FALSE
str1 = "stub.exe"
str2 = " Files.Old failed"
PELinker.WriteImageHeader PC = 1530
F = 00000000H (Files.File)
R = 00416E98H Files.Rider
ch = 00000000X
char = 0
dosHead = 020DD958H PELinker.ImageDosHeader
imgHead = 020DDA98H PELinker.ImageFileHeader
sR = 00416E98H Files.Rider
sections = 3
PELinker.DoLink PC = 21677
F = 020F28E0H Files.File
R = 00416E98H Files.Rider
T = 020DF3C0H Texts.TextDesc
base = 0
context = 0042DBB8H Exceptions.Context
done = FALSE
mod = 00000000H (BootLinker.ModuleDesc)
name = 00000000H (PELinker.NameList)
offs = 0
sections = 3
PELinker.Link PC = 23391
S = 00447178H Texts.Scanner
T = 020DF3C0H Texts.TextDesc
done = FALSE
Oberon.Call PC = 5931
Mod = 01F7B7C0H Kernel.ModuleDesc
P = PELinker.Link PC = 22948
cur = 01EE27C0H Windows.Window (Displays.Display)
f = 01F7DF80H Desktops.DocViewerDesc (Objects.ObjDesc)
i = 9
j = 13
name = "Link"
new = FALSE
par = 01F5B680H Oberon.ParRec
res = 1
=============================================
et cetera
=============================================
Which Oberon version have you been using, Chris?
This brings me also to the following questions, which could maybe better
be answered by ETHZ.
Being a seasoned FORTRAN programmer, the books of Wirth and Reiser
were a revelation to me, when I got them 20 years ago. I can do things
in Oberon, which I could not have dreamed off in my FORTRAN times.
System 3 is such a wonderful, effective and efficient development
environment with powerful libraries, with comprehensive documentation,
nicely embedded in the
Windows system and ideal for learning to program. And I would really be
missing something in my life without Oberon. The Oberon branch of AOS
did not convince me so far.
What is the future of Oberon 3 for Windows? Will Oberon 3 be running
on Windows 10?
Or should I move to Native Oberon on Linux, which seems to be actively
worked upon recently?
Regards, Dieter
Am 16.03.2015 um 00:28 schrieb Chris Burrows:
>> From: Dieter [mailto:d.gloetzel at web.de]
>> Sent: Monday, 16 March 2015 4:30 AM
>> To:oberon at lists.inf.ethz.ch
>> Subject: Re: [Oberon] Oberon 3 on Windows 7, PELinker, Windows
>> executable
>>
>> Hi Chris,
>>
>> thanks for your recommendations. I tried, what you told me. But I did
>> not succeed. It seems I am lacking some crucial information.
>>
>> o.k. with the HelloCon-example:
>>
> Great!
>
>> Compile->Link->Register->Run and "Hello from Oberon!" appears on the
>> DOS-Console. This example is somewhat limited.
>> It does not tell me how to deal with an executable Oberon Procedure
>> in a Module or maybe several of these in one Module.
>>
> If you have one executable Oberon Procedure in the Module then just put a
> call to that procedure in the initialisation section of the Module after all
> of the existing initialisation code.
>
> If you have more than one executable Oberon procedure in the Module then you
> could add a third parameter to your command line. You can then read that
> parameter and interpret it in your program to decide which executable
> procedure to call.
>
>> Then I tried to extend this in a way that the EXE would read a
>> parameter from the command line.
>> Since I do not know the intricacies of the Kernel32-Library,
> OK - here is a start for you. Kernel32 has a procedure call GetCommandLine
> that returns the content of the command line that your program was called
> with. I have extended the HelloCon example to get the command line and
> display it. Hence, if you call it with the command:
>
> Hello abc xyz 123
>
> It will display:
>
> Hello from Oberon!
> Hello abc xyz 123
>
> The source code is:
>
> MODULE HelloCon;
>
> IMPORT Kernel32;
>
> VAR
> cl: Kernel32.LPSTR;
> commandLine: ARRAY 255 OF CHAR;
> BEGIN
> Kernel32.Str("Hello from Oberon!"); Kernel32.Ln();
> cl := Kernel32.GetCommandLine();
> Kernel32.CopyString(cl, commandLine);
> Kernel32.Str(commandLine); Kernel32.Ln();
> END HelloCon.
>
> The work that you will now have to do is parse that command line to extract
> the three parameters "abc", "def", "123" as strings and then interpret them
> according to your requirements.
>
>> I tried the following:
>> The only idea I had was to try to use the parameter mechanism of
>> Oberon
>> and hope that this would be magically transferred to the
>> executable.
> Unfortunately not. Once you get out of the Oberon environment and into a
> Windows command line (i.e. MS-DOS) environment then you have to give up all
> of the GUI capabilities of the Oberon environment. If your program is
> dependent on any GUI, graphics or mouse capabilities then you need to have a
> rethink about what you are trying to do.
>
>> A batch solution like << myprogram.exe "path to input file" "path to
>> output file">> would be sufficient for my present task.
> Good. That will make your life a whole lot easier.
>
>> But could one also produce screen oriented interactive Windows
>> programs from Oberon code?
> Yes. If you use a development system that was primarily designed to produce
> screen oriented interactive MS Windows programs e.g. Blackbox, Gardens Point
> Component Pascal, POW! etc.
>
> Regards,
> Chris
>
> Chris Burrows
> CFB Software
> http://www.cfbsoftware.com/gpcp
>
>
>
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/oberon/attachments/20150316/84aa65dc/attachment.html
More information about the Oberon
mailing list