[Vm-dev] External Modules--two questions/observations

David T. Lewis lewis at mail.msen.com
Sun Nov 10 01:01:20 UTC 2013

On Sat, Nov 09, 2013 at 04:03:42PM -0800, gettimothy wrote:
> I am systematically working through Eliot's Cog Blog :: Building a Cog Development Image checklist on both my 64 bit Linux box with 32 bit compat libs and a slow/old pure 32 bit linux box.
> I noticed that both Alien and VMMaker added and "activated" new plugins.
>       'IA32ABI VMMaker.oscog-eem.99 (i)'   << post alien
>       'SoundPlugin VMMaker-oscog.54 (i)'    <<post alien
>       'UUIDPlugin VMMaker-oscog.47 (e)'     <<post alien
>       'CroquetPlugin VMMaker-oscog.40 (i)'   <<post VMMaker
>       'FloatMathPlugin VMMaker-oscog.40 (i)' <<post VMMaker 
>      'JPEGReadWriter2Plugin VMMaker-oscog.40 (i)'   <<post VMMaker
> While 
>       SqueakSSL-Plugin-ar.3
>       VMConstruction-Plugins-OSProcessPlugin.oscog-eem.44
>       Freetype-Plugin-IgorStasenko.64
>       VMConstruction-Plugins-AioPlugin-eem.15
> Did not show any new plugins in either SmalltalkImage current listLoadedModules or listBuiltinModules.
> When I ran into this on my 64 bit box with the 32 bit compat libs, I thought it might be a library problem, however, now that I have done this on the pure 32 bit system, I dont know.
> Looking at SmalltalkImage, I did not see any method to LOAD a module. Is there one?

The normal way to load an external plugin is to call one of its primitives
and let the loader locate and load the plugin.

In your example, you have the UnixOSProcessPlugin built as an external plugin,
but you can see that it has not yet been loaded. One of the primitives in
that plugin is #primitiveGetPid, so if you were to write a method to call
that primitive, the plugin module would be loaded.

To illustrate, try adding the following method to some class.

  MyClass class>>myMethodThatUsesOSPP
      <primitive: 'primitiveGetPid' module: 'UnixOSProcessPlugin'>
      self primitiveFailed

Now evaluate "MyClass myMethodThatUsesOSPP". Check listLoadedModules and
you should see that the plugin is now loaded.


More information about the Vm-dev mailing list