<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><pre class=""><span style="white-space: pre-wrap;" class="">Thomas,</span></pre><pre class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre class=""><span style="white-space: pre-wrap;" class="">see the answers inline below.</span></pre><pre class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre class=""><span style="white-space: pre-wrap;" class=""> > thomas.kral at email.cz thomas.kral at email.cz Wed Mar 22 15:40:42 CET 2017</span></pre><pre class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><div class=""> > In the chapter 14.2 it hints that linker is almost identical to `Modules.</div></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""> > Mod' loader, except it links statically into a file, rather than into memory.</pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="white-space: pre-wrap; background-color: rgb(255, 255, 255);" class=""><br class=""></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">The linker referred to in the book "Project Oberon" is called ORL.Mod. It corresponds to module Linker.Mod in the repository </span><a href="https://github.com/andreaspirklbauer/Oberon-building-tools" style="white-space: pre-wrap;" class="">https://github.com/andreaspirklbauer/Oberon-building-tools</a><span style="white-space: pre-wrap;" class="">. I don’t have access to the source code of ORL.Mod, but from the description in the book, it looks like ORL.Link is doing pretty much what Linker.Link does.</span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">If you have a quick glance at the source code of Linker.Mod, you will see that it *is* in fact the Oberon 2013 module loader (i.e. Modules.Load renamed to Linker.Link), line for line - with the *one* important difference that it writes the “loaded” modules into a separate memory area first (instead of modifying the “official” module area itself) and then, at the very end of the linking process, simply writes that area byte for byte to the specified output file. That’s all there is too it — the regular Oberon 2013 module loader, where however the output is written to a file.</span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">
<br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""> >Addresses are relocated with origin 0H, from a fixed start of Oberon partition?
<br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">During the regular Oberon boot process, the regular Oberon boot file (containing the pre-linked binary of the 4 modules of the Oberon inner core, i.e. modules Kernel, FileDir, Files and Kernel) is loaded from the so-called “boot area” of the local disk. In Oberon 2013, the boot area is located in sectors 2-63 of the disk. Looking at the source code of Builder.Load, you can indeed see that it literally overwrites exactly those sectors with the inner core, byte for byte. Then, during the system boot process, the boot loader (BootLoad.Mod) merely reads those sectors from disk and transfers their content byte for byte into main memory, starting at location 0. The number of bytes to be read is extracted from location 16 of the boot file itself (see source code of BootLoad.LoadFromDisk which is less than half a dozen lines of code).</span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">Note that the *format* of the Oberon boot file, as transferred into main memory by the boot loader from the boot area of the disk, is *defined* to *exactly* mirror the standard Oberon storage layout, starting at location 0 (</span>See chapter 8.1, page 103, of the book Project Oberon, 2013 Edition, for a detailed description of Oberon’s storage layout)<span style="white-space: pre-wrap;" class="">.</span><span style="white-space: pre-wrap;" class=""> The boot file</span><span style="white-space: pre-wrap;" class=""> is *created* this way by Linker.Mod (see Linker.Link, towards the end). </span><span style="white-space: pre-wrap;" class="">In particular, location 0 in</span><span style="white-space: pre-wrap;" class=""> </span><span style="white-space: pre-wrap;" class="">the boot file (and later in main memory once it</span><span style="white-space: pre-wrap;" class=""> </span><span style="white-space: pre-wrap;" class="">has been loaded) contains a branch instruction to the initialization sequence</span><span style="white-space: pre-wrap;" class=""> </span><span style="white-space: pre-wrap;" class="">of the top module of the boot file (i.e. module Modules). </span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">Thus, the boot loader (BootLoad.Mod) can simply transfer</span><span style="white-space: pre-wrap;" class=""> </span><span style="white-space: pre-wrap;" class="">the boot file byte for byte from the boot area (sectors 2-63) to main memory location 0 during the regular Oberon boot process, and then branch to location 0 –</span><span style="white-space: pre-wrap;" class=""> </span><span style="white-space: pre-wrap;" class="">which is *precisely* what</span><span style="white-space: pre-wrap;" class=""> </span><span style="white-space: pre-wrap;" class="">it does. And this is why BootLoad.Mod is so simple: just a few lines of code.</span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">
> I also found found some boot linking modules in native oberon souce files.
> ./src/x86/Unix/BootLinker.Mod
> ./src/NO/BootLinker.Mod
</span><pre class=""><span style="white-space: pre-wrap;" class=""> > Was I close?</span></pre><div class=""><br class=""></div></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">Those are quite similar indeed. </span><span style="white-space: pre-wrap;" class="">These files come from older implementations. </span><span style="white-space: pre-wrap;" class="">I am not using those.</span></pre><div class=""><br class=""></div><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">The file Linker.Mod that you will find in the repository <a href="https://github.com/andreaspirklbauer/Oberon-building-tools" class="">https://github.com/andreaspirklbauer/Oberon-building-tools</a> has the nice property that it behaves *exactly* like the regular Oberon *2013* module loader (Modules.Load) - because, well, it *is* in fact the module loader, with the one small modification outlined above. So, by keeping the above repository in sync with the official version of the Oberon 2013 module loader, it is *guaranteed* to work with the latest version(s) of Oberon 2013. </span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">
> What would be also interesting to decompose `prom.mem' to understand how this file could be produced.
> It seems to have 361 lines each ascii encoded long word. Ends with C7000000, lines 362-490 are zeros. </span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><pre class=""><span style="white-space: pre-wrap;" class=""> > </span><span style="white-space: pre-wrap;" class="">Are these RISC machine instructions?</span></pre><div class=""><br class=""></div></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">The file prom.mem file looks like it is, in essence, the boot loader (think: "BootLoad.rsc re-packaged"). If that is the case, it is supposed to be produced by the command:</span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""> Builder.WriteFile BootLoad.rsc 512 prom.mem
</span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><span style="white-space: pre-wrap;" class="">However, I just haven’t gotten around to implement it - first, because I don’t have the specific hardware to test it . . . and second, because I don’t need it. I already *have* a working prom.mem which I don’t intend, nor have any reason, to change. As outlined in the README file of the above repository, there usually is no need to change the boot loader itself.
<br class=""></span></pre><pre style="background-color: rgb(255, 255, 255);" class=""><pre class=""><span style="white-space: pre-wrap;" class="">But - in case you intend to implement it - all this command does needs to do is take the binary file for the boot loader (BootLoad.rsc - as generated by the regular Oberon compiler, see the README file for the details), copy it byte for byte to the file “prom.mem", and add a few additional bits of information around it, so that it is compatible with the specific hardware used (e.g. Xilinx FPGA board). For that, one probably needs to read some Xilinx documentation I suppose.</span></pre><div class=""><span style="white-space: pre-wrap;" class=""><br class=""></span></div><span style="white-space: pre-wrap;" class="">
PS: Note that Builder.WriteFile corresponds to ORX.WriteFile, but I don’t have the source code of module ORX.Mod either. But the creator of the file prom.mem certainly does. That would be the file you’d need to get.
> Many thanks
> Tomas
---------- Původní zpráva ----------
Od: Andreas Pirklbauer <</span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" style="white-space: pre-wrap;" class="">andreas_pirklbauer at yahoo.com</a><span style="white-space: pre-wrap;" class="">>
Komu: ETH Oberon and related systems <</span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" style="white-space: pre-wrap;" class="">oberon at lists.inf.ethz.ch</a><span style="white-space: pre-wrap;" class="">>
Datum: 22. 3. 2017 11:36:35
Předmět: [Oberon] FPGA Oberon - Modules.rsc
"
The book Project Oberon does not describe the way the inner core itself is built (it only mentions that a “boot linker”is needed for that) or loaded onto the boot area of the local disk, nor are the tools to accomplish this published.
<br>
A minimal set of the Oberon building tools can be found at:
<br>
<span style='white-space:pre-wrap'><a href='</span><a href="https://github.com/andreaspirklbauer/Oberon-building-tools" style="white-space: pre-wrap;" class="">https://github.com/andreaspirklbauer/Oberon-building-tools</a><span style="white-space: pre-wrap;" class="">'></span><a href="https://github.com/andreaspirklbauer/Oberon-building-tools%3C/a" style="white-space: pre-wrap;" class="">https://github.com/andreaspirklbauer/Oberon-building-tools</a</a><span style="white-space: pre-wrap;" class="">></span>
<span style='white-space:pre-wrap'><br></span>
<span style='white-space:pre-wrap'>Usage:</span>
<span style='white-space:pre-wrap'><br></span>
<span style='white-space:pre-wrap'> ORP.Compile Kernel.Mod FileDir.Mod Files.Mod Modules.Mod ~</span>
<span style='white-space:pre-wrap'><br></span>
<span style='white-space:pre-wrap'> Linker.Link Modules # prepare inner core (pre-linked binary)</span>
<span style='white-space:pre-wrap'><br></span>
<span style='white-space:pre-wrap'> Builder.Build Modules # load inner core into boot area of disk</span>
<br>
<br>
---------------------------------------------------------
thomas.kral at email.cz thomas.kral at email.cz
Tue Mar 21 09:13:34 CET 2017
Hi Joerg,
I was rereading the chapter 14 again, I realise the boot over RS232 is
triggered by a switch, but I still do miss the point, how do I build the
inner core, and Oberon0. In the text there is a reference to boot linker.
Many thanks
Tomas
---------- Původní zpráva ----------
Od: Jörg <<a href='</span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" style="white-space: pre-wrap;" class="">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><span style="white-space: pre-wrap;" class="">'>joerg.straube at <a href="http://iaeth.ch" class="">iaeth.ch</a></a>>
Komu: ETH Oberon and related systems <<a href='</span><a href="https://lists.inf.ethz.ch/mailman/listinfo/oberon" style="white-space: pre-wrap;" class="">https://lists.inf.ethz.ch/mailman/listinfo/oberon</a><span style="white-space: pre-wrap;" class="">'>oberon at <a href="http://lists.inf.ethz.ch" class="">lists.inf.ethz.ch</a></a>>
Datum: 21. 3. 2017 8:06:54
Předmět: Re: [Oberon] FPGA Oberon - Modules.rsc
"
The inner core is at a fixed location on the disk.
The boot process is described in chapter 14.1:
<a href='</span><a href="https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf" style="white-space: pre-wrap;" class="">https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf</a><span style="white-space: pre-wrap;" class="">'></span><a href="https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf%3C/a" style="white-space: pre-wrap;" class="">https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf</a</a><span style="white-space: pre-wrap;" class="">>
(<a href='</span><a href="https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf" style="white-space: pre-wrap;" class="">https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf</a><span style="white-space: pre-wrap;" class="">'></span><a href="https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf%3C/a" style="white-space: pre-wrap;" class="">https://www.inf.ethz.ch/personal/wirth/ProjectOberon/PO.Applications.pdf</a</a><span style="white-space: pre-wrap;" class="">>)
</span></pre></body></html>