Monday, January 21, 2019

LoadModule syntax

Console loop only consumes the first argument of a lod, and there is a general argument passing semantic.  Load Module assumes ant additional arguments to Init the loaded device are attached as in:

LoadModule ./flush xchars flusher;

The console loop consumes the xchars argument to locate the loadable. It then replaces the filename with Init, and increments argc to call Init.  Init number of args are variable length, up to a semi-colon or null. All Init function should have published defaults for the general case they get no init parameters.

IO manager is likely to have init parameters, in the form of fd names for mouse and keyboard. Xchars makes a default rectangle for a window. Flush has defaults.
.

A few other things not posted.

Loadables can be from an arbitrary set of directories, again with the variable args feature.
I gave console loop a PutStr command to dump a variable lists into the flush. Everyone is havng their own PutStr, it is a commonly useful name to overload.
We can look up loadable entry points, look up any symbol in console loop use the key value common form. But that is another overloaded name, symbol table can be its own snippet and offer it, s0 does xchars, to make binding possible.

Technically, to operate on the Bus a snippet need only know to return 0 when command not found. So the no header rule is very much in force, but commons certainly grease the wheels.
ExecFile still works fine,and I can initialize multiple modules. Warning messages from gcc and linker ere almost gone. All the issues with name space delayed two days, but I needed to get it to match up so can can freely set up bindings between snippets.

No comments: