What are my Options?

20 December, 2006

What are my options on a Linux Server?

This question came up reciently on Squeak-dev. I found this answer on wiki. I figured I’d post it here since it provides a complete answer for all platforms.

VM Command Line Options

The distinction between command line args meaningful to the VM or the .changes file can be found by defining the startup command as

 SqueakVM [vmOptions] imageName [imageOptions]

In other words, the first argument NOT meaningful to the VM is interpreted as the first image option. If the first image option is not the name of a valid Squeak image, then the VM may silently insert a hidden name of an image (at least on Mac and Win32 it does) allowing starting any *.sqo file by double-clicking or dragging on the VM executable. – VM Command Line Options


Windows VM Options

Following are some of the command line options for the Squeak Windows VM (abstracted from some of Andreas’s postings to the Squeak mailing list). Note that the space between an option and its argument (or between options) is required:

-headless
Tells Squeak to run without a main window. However, for allowing at least some access to Squeak, an icon is added to the system tray. If you double-click this icon, the Squeak window will show up again.
-log: "logName"
Use the named file as log file for VM messages.
-memory: megaBytes
For limiting or expanding the memory allocated for the VM at startup (the standard amount allocated by the Win32 VM is 16MB)
-service: "serviceName"
Install Squeak as Windows NT service. You will be asked for a couple of things such as if to start the service on system startup or if to run the service right now. You can modify these settings in the service control panel.
-browserWindow: parentHWND
You can get Squeak into any Win32 Window you want, with the security measures turned on: the only files you can see and manipulate are those in and beyound the image directory — everything else you can’t see, touch, or destroy. (This is also true when you start the Win32 VM as a browser plugin.)

NOTE: When using the -service: option, you must give the entire command line as if you want to run the image immediately. The installation process will add a few registry settings to determine the command line during system start up.
Example:

Squeak -memory: 4 -log: "C:VM.log" -service: "Squeak Sample Service" C:SwikiServer.image

NOTE 2: In some versions of Win32 VM you have to specify image file path in *.INI file to run Squeak as service correctly.
Example:

ImageFile="Squeak.image"

The “-service:” switch is fully supported on Win95 but has a little non-standard behavior. Squeak will show up in the system tray (just as when running -headless) because there is no such thing as a service control panel within Win95. If you want to remove a service from a Win95 system you’ll have to remove the entry in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

See also: Win32 Squeak Port


Acorn RiscOS VM options

The Acorn VM understands these options:-

  1. -help – don’t start the VM, just display some hopefully useful help info
  2. -version – display version info, the VM number etc.
  3. -memory: – set the amount of memory to use for object memory. M is Megabytes. Use as in -memory:15M
  4. -swapMeta – swap the left and right Ctrl key meanings for the convenience of some folks finger length
  5. -windowlabel: – set the label for the Squeak window instead of using the default of the image’s pathname. For example -windowlabel:Freds Dinky Application
  6. -taskname: – set the name that will appear in the Task Display

The last two enable one to build an application that will appear to be your application rather than Squeak.


Mac OS X VM (Usage from 3.6g-2 VM) See also: Squeak Man Pages – OS X


Usage: squeak [<option>...] [<imageName> [<argument>...]]

       squeak [<option>...] – [<argument>...]

X11 lt;option>s:

  -browserWindow <wid>  run in window <wid>

  -browserPipes <r> <w> run as Browser plugin using descriptors <r> <w>

  -cmdmod <n>           map Mod<n> to the Command key

  -display <dpy>        display on <dpy> (default: $DISPLAY)

  -fullscreen           occupy the entire screen

  -headless             run in headless (no window) mode

  -iconic               start up iconified

  -lazy                 go to sleep when main window unmapped

  -mapdelbs             map Delete key onto Backspace

  -nointl               disable international keyboard support

  -notitle              disable the Squeak window title bar

  -optmod <n>           map Mod<n> to the Option key

  -swapbtn              swap yellow (middle) and blue (right) buttons

  -xasync               don't serialize display updates

  -xshm                 use X shared memory extension

Common <option>s:

  -encoding <enc>       set the internal character encoding (default: MacRoman)

  -help                 print this help message, then exit

  -memory <size>[mk]    use fixed heap size (added to image size)

  -mmap <size>[mk]      limit dynamic heap size (default: 1024m)

  -noevents             disable event-driven input support

  -notimer              disable interval timer for low-res clock 

  -pathenc <enc>        set encoding for pathnames (default: UTF-8)

  -plugins <path>       specify alternative plugin location (see manpage)

  -textenc <enc>        set encoding for external text (default: UTF-8)

  -version              print version information, then exit

  -vm-<sys>-<dev>       use the <dev> driver for <sys> (see below)

Deprecated:

  -display <dpy>        equivalent to '-vm-display-X11 -display <dpy>'

  -headless            equivalent to '-vm-display-X11 -headless'

  -nodisplay            equivalent to '-vm-display-null'

  -nosound              equivalent to '-vm-sound-null'

  -quartz               equivalent to '-vm-display-Quartz'

Notes:

  <imageName> defaults to `squeak.image'.

  Using `unix:0' for <dpy> may improve local display performance.

  -xshm only works when Squeak is running on the X server host.

  If `-memory' is not specified then the heap will grow dynamically.

  <argument>s are ignored, but are processed by the Squeak image.

  The first <argument> normally names a Squeak `script' to execute.

  Precede <arguments> by `–' to use default image.

Available drivers:

  vm-sound-null

  vm-sound-MacOSX

  vm-display-null

  vm-display-X11

Macintosh Carbon VM

Starting at 3.5.1b4 the macintosh VM takes the following attributes in the applications info.plist.
SqueakMaxHeapSize – (bytes) maximum heap size, normally 512MB
SqueakFloatingWindowGetsFocus – (yes/no) Window should get keyboard focus
SqueakWindowAttribute – <8200001e> attributes for window, see apple’s documentation
SqueakWindowType – 6 (normal document window) (8 is floating window) see apple’s documentation
SqueakWindowHasTitle – (yes/no) Squeak window gets image name in title bar?

See http://www.smalltalkconsulting.com/html/squeakinfoplist.html for more information.

Starting at 3.8.7b5 the carbon mac VM will take a limit set of cmd line arguments.

Usage: ./Squeak VM Opt […] [ […]]
./Squeak VM Opt […] – […]

Common s:
-help print this help message, then exit
-memory [mk] use fixed heap size (added to image size)
-pathenc set encoding for pathnames (default: macintosh)

At 3.8.14b2 we added
-headless run as background process
-headfull placeholder for running with head
-browserPipes handles passing pipes when running VM as subprocess of browser

Notes:
defaults to `Squeak.image’.
If `-memory’ is not specified then the heap will grow dynamically.
s are ignored, but are processed by the Squeak image.
The first normally names a Squeak `script’ to execute.
Precede by `–’ to use default image.

Image Options

See: Writing scripts for image startup options.


Unix VM (Usage from 3.6-3 VM)


Usage: squeak [<option>...] [<imageName> [<argument>...]]

       squeak [<option>...] – [<argument>...]

OSS <option>s:

  -nomixer              disable mixer (volume) adjustment

X11 <option>s:

  -browserWindow <wid>  run in window <wid>

  -browserPipes <r> <w> run as Browser plugin using descriptors <r> <w>

  -cmdmod <n>           map Mod<n> to the Command key

  -display <dpy>        display on <dpy> (default: $DISPLAY)

  -fullscreen           occupy the entire screen

  -headless             run in headless (no window) mode

  -iconic               start up iconified

  -lazy                 go to sleep when main window unmapped

  -mapdelbs             map Delete key onto Backspace

  -nointl               disable international keyboard support

  -notitle              disable the Squeak window title bar

  -optmod <n>           map Mod<n> to the Option key

  -swapbtn              swap yellow (middle) and blue (right) buttons

  -xasync               don't serialize display updates

  -xshm                 use X shared memory extension

Common <option>s:

  -encoding <enc>       set the internal character encoding (default: MacRoman)

  -help                 print this help message, then exit

  -memory <size>[mk]    use fixed heap size (added to image size)

  -mmap <size>[mk]      limit dynamic heap size (default: 1024m)

  -noevents             disable event-driven input support

  -notimer              disable interval timer for low-res clock 

  -pathenc <enc>        set encoding for pathnames (default: UTF-8)

  -plugins <path>       specify alternative plugin location (see manpage)

  -textenc <enc>        set encoding for external text (default: UTF-8)

  -version              print version information, then exit

  -vm-<sys>-<dev>       use the <dev> driver for <sys> (see below)

Deprecated:

  -display <dpy>        equivalent to '-vm-display-X11 -display <dpy>'

  -headless             quivalent to '-vm-display-X11 -headless'

  -nodisplay            quivalent to '-vm-display-null'

  -nomixer              disable modification of mixer settings

  -nosound              quivalent to '-vm-sound-null'

  -quartz               quivalent to '-vm-display-Quartz'

Notes:

  <imageName> defaults to `squeak.image'.

  Using `unix:0' for <dpy> may improve local display performance.

  -xshm only works when Squeak is running on the X server host.

  If `-memory' is not specified then the heap will grow dynamically.

  <argument>s are ignored, but are processed by the Squeak image.

  The first <argument> normally names a Squeak `script' to execute.

  Precede <arguments> by `–' to use default image.

Available drivers:

  vm-sound-null

  vm-sound-OSS

  vm-display-null

  vm-display-X11

(Ian Piumarta said that:) “-swapbtn” only makes sense to (and is only parsed/recognised by) the X display driver. Until that driver is loaded, the option will not be recognised by the core VM itself. The solution is to provide an option that forces the X driver to be loaded before using the -swapbtn option, for example:


    squeak -display $DISPLAY -swapbtn my.image

    squeak -vm-display-X11 -swapbtn my.image

(On Squeak-Dev Ian Piumarta explained:)
There are two command-line options (with equivalent environment variables) to control how memory is allocated on Unix:

  • If no options are given then memory is allocated dynamically with the limit set at 75% of the available virtual memory.
  • If -memory N{mk} is given then memory is allocated statically; the argument to the option defines a hard upper limit.
  • If -mmap N{mk} is given then memory is allocated dynamically, with an explicit upper limit to the amount of memory that will be allocated (but the “75% of available virtual memory” limit still applies).

Leave a comment