<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to F$Chain</title><link>https://sourceforge.net/p/nitros9/wiki/F%2524Chain/</link><description>Recent changes to F$Chain</description><atom:link href="https://sourceforge.net/p/nitros9/wiki/F$Chain/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 27 Jun 2014 23:20:31 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/nitros9/wiki/F$Chain/feed" rel="self" type="application/rss+xml"/><item><title>F$Chain modified by Lothan</title><link>https://sourceforge.net/p/nitros9/wiki/F%2524Chain/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;Chain&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Loads and executes a new primary module without creating a new process&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;OS9 F$Chain 103F 05&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Entry Conditions&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A &lt;br /&gt;
&lt;em&gt;language/type code&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;B &lt;br /&gt;
&lt;em&gt;size of the area&lt;/em&gt; (in pages); must be at&amp;nbsp;??? &lt;/p&gt;
&lt;p&gt;X &lt;br /&gt;
&lt;em&gt;address of the module name or filename&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Y &lt;br /&gt;
&lt;em&gt;parameter area size&lt;/em&gt; (in pages); defaults to zero if not specified &lt;/p&gt;
&lt;p&gt;U &lt;br /&gt;
&lt;em&gt;starting address of the parameter area&lt;/em&gt;; must be at least one page &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Error Output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;CC &lt;br /&gt;
carry set on error &lt;/p&gt;
&lt;p&gt;B &lt;br /&gt;
&lt;em&gt;error code&lt;/em&gt; (if any) &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Additional Information&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chain loads and executes a new primary module, but does not create a new process. A Chain system call is similar to a Fork followed by an Exit, but it has less processing overhead. Chain resets the calling process program and data memory areas and begins executing a new primary module. It does not affect open paths. This is a user mode system call. &lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Warning&lt;/strong&gt;: Make sure that the hardware stack pointer (Register SP) is located in the direct page before Chain executes. Otherwise the system might crash or return a suicide attempt error. This precaution also prevents a suicide in the event that the new module requires a smaller data area than that in use. Allow approximately 200 bytes of stack space for execution of the Chain system call. &lt;/li&gt;
&lt;li&gt;Chain performs the following steps: &lt;ol&gt;
&lt;li&gt;It causes NitOS-9 to unlink the process’s old primary module. &lt;/li&gt;
&lt;li&gt;NitOS-9 parses the name string of the new process’s primary module (the program that is to be executed first). Then, it causes NitrOS-9 to search the system module directory to see if a module with the same name, type, and language is already in memory. &lt;/li&gt;
&lt;li&gt;If the module is in memory, it links to it. If the module is not in memory, it uses the name string as the pathlist of a file to load into memory. Then, it links to the first module in this file. (Several modules can be loaded from a single file.) &lt;/li&gt;
&lt;li&gt;It reconfigures the data memory area to the size specified in the new primary module’s header. &lt;/li&gt;
&lt;li&gt;It intercepts and erases any pending signals. &lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following diagram shows how Chain sets up the data memory area and registers for the new module. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="o"&gt;+----------------+&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;D &lt;br /&gt;
&lt;em&gt;parameter area size&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;PC &lt;br /&gt;
&lt;em&gt;module entry point absolute address&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;CC &lt;br /&gt;
F=0, I=0; others are undefined &lt;/p&gt;
&lt;p&gt;Registers Y and U (the top-of-memory and bottom-of-memory pointers, respectively) always have values at page boundaries. If the parent process does not specify a size for the parameter area, the size (Register D) defaults to zero. The data area must be at least one page. &lt;/p&gt;
&lt;p&gt;(For more information, see the Fork system call.) &lt;/p&gt;
&lt;p&gt;&lt;em&gt;krnp2&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lothan</dc:creator><pubDate>Fri, 27 Jun 2014 23:20:31 -0000</pubDate><guid>https://sourceforge.netfb9460aa9670c6d783a9ba74decf8e262531650b</guid></item></channel></rss>