Command-line switches
There are a lot of options in lxLite. I simply like options :-) So, you
can configure almost anything in lxLite. Moreover, to protect the user from
need of writing the same options lxLite support multiple configurations which
are kept in a single file. lxLite comes with some example configurations
(`factory defaults`) which are listed below:
- default (loaded by default)
- It is a `work` configuration. All parameters are set to optimal level of
compression without too much effort applied. File backup is disabled
except for files that have extra data after LX structure. Note that this
configuration is ALWAYS loaded before any other options are in effect, so
even /C{#} option is executed AFTER default configuration is loaded.
- unpack (loaded for /X option)
- This configuration is loaded when you request to unpack the file (/X). By
default it is empty; you can add here everything you want to happen when
files are unpacked.
- ver2x
- Optimal for pre-Warp versions of OS/2. Versions before Warp (3.0) does not
know of the Lempel-Ziv (/EXEPACK:2) method. DON`T PACK EXECUTABLES WITH
LEMPEL-ZIV`s ALGORITHM if there is a chance to run your program on OS/2
v2.xx (except 2.99).
- max
- Tightest compression level. VERY SLOW! It is rarely needed to use this
configuration.
- newStub
- This is a particular configuration used to replace one DOS stub in LX
executable by another without altering anything else. You have to specify
a filename for new stub - this configuration only tells lxLite not to
depack old objects and not to pack unpacked objects.
- minStub
- This is a configuration which is linked to newStub and replaces stubs in
given files by minimal possible stub of `say-error-and-exit` type. You
cannot make it smaller (at least I doubt it), only if you shorten the error
message.
- vdmStub
- This configuration tells lxLite to replace in specified files stub by a
`run-from-VDM`-style one. This is also as short as possible :-) Please
read the /T{#} option description for further details.
- info
- Use this configuration to get the most important information about
executables (see option /V) without altering them.
- exehdr
- Shows complete information about the executable header. Module file is not
altered in any way.
- exemap
- Shows anything about the executable structure. This can generate sometimes
very long data sheets, so use it only if really needed.
- map
- Shows the memory map of the executable: memory objects and pages which
makes the object.
- exp
- Shows everything that is exported from the module (exported names and
exported entriy points)
- imp
- Shows module import tables
- pdd
- This configuration can be used for physical device drivers (especially in
NE format).
- dll
- This configuration is useful for dynamic-link libraries.
To use a specific configuration use the /C:# switch where # is
configuration`s identifier. Settings are loaded from file lxLite.CFG in the
same directory where lxLite.EXE resides. You shouldn`t care about paths -
lxLite will always find it. For example, to use `max` configuration run
lxLite /c:Max. For a detailed description of .CFG file format see section
right below the following.
Here is a detailed explanation of what each switch does. Note that any
switch which accepts '+' or '-' sign after it (to enable/disable the action
which switch symbolizes) can be used without anything after it - this is
accepted as '+'. For example, /V+ is equivalent to /V.
- /A[{P|S|N{P|S}}{:#}]
- Set alignment method for first and rest of objects. First object can be
aligned on [P]age shift, [S]ector or [N]o boundary. Note that the last
option (No boundary) cannot be achieved by using LINK386, but it works
well, and the LX format allows it. All objects except first MUST be
aligned on at least PageShift boundary. PageShift is a value that is
specified in LX header. You can redefine it too by specifying a
semicolon and a decimal value after it: for example the /APP:512 switch
will place all pages in executable on 512 bytes boundary. Note that the
# value must be a power of two (i.e. 1,2,4,8,16,32,...).
- /B(D|X|+|-){:%}
- Enable (+) or disable (-) copying original file into *.BAK; optionaly
lxLite can do it only when [D]ebug and/or e[X]tra data are detected.
Also you can specify an directory % for backed up files (relative to
root). The entire directory tree will be re-created inside the backup
directory. For example, the /BX:c:\lxlite.bak switch will instruct
lxLite to back up files only when e[X]tra data is present in module and
to place them into the directory structure under the c:\lxlite.bak
directory.
- /C{S}{+|-}
- Enable (+) or disable (-) colored output. You can specify {S} to force
lxLite to use StdOut instead of VioXXX functions.
- /C[:%]
- Use configuration with ID = %;
The two predefined configuration names are "default" and "unpack". First
is always loaded as lxLite starts and second is used when /X+ option is
specified (this is NOT equivalent to /c:Unpack).
- /E{#}
- Set [E]xclude filemask. All files that fits given filemask(s) will be
bypassed by lxLite. All filemasks must be separated by ':' (because it
cannot be a part of filemask). For example /D*.zip:*.arj:*.rar switch
will instruct lxLite to avoid all .zip, .arj and .rar files. Default
lxlite configuration (/C:default) includes the /C:exclude configuration
which instructs lxLite to avoid all executables which are known to have
problems when packed. Note that the /D switches are additive, so /D*.zip
/D*.arj /D*.rar is equivalent to the example above. To clear exclusion
list use specify /D.
- /F{+|-}
- Force repacking. Use /F+ to bypass `already processed` message, i.e.
when lxLite thinks that file was already processed and it really wasn`t.
This usually doesn`t happen, but can happen when you try to replace a
stub by another of the same size in a already packed file.
- /I{+|-}
- Force (+) lxLite to run at idle priority. This mean that lxLite will do
its work only when no other activity in system occurs (waiting for an
keyboard/mouse event etc). This is the best in my opinion choice because
you can run lxLite in background and it will not degrade almost at all
system performance. However if you`ll run an `badly-behaved` VDM session
which grabs all CPU time lxLite will completely stop. When run with /I-
option lxLite does not changes its priority (i.e. you can run lxLite /I-
via priority.exe program which starts programs with given priority).
- /J[A|E|L|P|V](E|L|P|V|N|X|+|-)
- Change module type: Leave [A]s-is, [E]xecutable module, [L]ibrary module,
[P]hysical or [V]irtual driver. Especially useful when converting NE
drivers. Optionaly you can restrict this to work only on [E]xecutables,
[L]ibraries, [P]hysical or [V]irtual drivers, [N]E or L[X] executables
and any combination of them. [N]E and [L]X conditions are considered with
an AND operator; all others with OR, i.e. /JPELN will mean: "Change
module type into [P]hysical device driver for all [E]xecutables OR
[L]ibraries which also are (AND) [N]E modules"
- /L(A|S|U|+|-){:%}
- Instructs lxLite to maintain an log file. If no file name is specified,
lxLite.log is used in the home directory of lxLite. Beside the filename,
the start and final file size is written into log along with the problems
(if any) that were encountered when processing (for example: 'Executable
has been used by another process and replaced'). You can also optionaly
choose to log either [S]uccessful or [U]nsuccessful cases or [A]ll (which
means more than just /SU+: lxLite will also log 'already processed'
files).
- /M[R[N|1|2|3]|L[N|1]|F[N|1|2]]
- Set packing method & parameters. Second character (after M) defines the
method to set-up: `R` stands for run-length (/EXEPACK:1), 'L' for
Lempel-Ziv (/EXEPACK:2) and 'F' for Fixup packing method. The third
character is the level of compression using that method; if N is
specified the method is disabled. Three levels of packing are provided
for run-length compression. The level 1 is the fastest. It searches
only for 1-character strings. For example, the 'AAAAAAAA' string will be
detected and packed as 8, 1, 'A' while 'ABABABAB' string will be stored
as unpacked text. Level 2 detects repeated strings of up to 16
characters length, so the example above will be encoded as 4,2,'AB'.
This is the default setting for most 'factory` configurations. And last,
3rd level searchs for ALL strings of any length (up to page size/2 =
2048). This compreses VERY slow and seldom gives real results, so use it
only when you really need it. The Lempel-Ziv algorithm can be either
disabled (/MLN) or enabled (/ML1). When enabled it searchs for all
matches using a relatively fast hash-table, so there is no need in
gradations by compression speed. The fixup packing method can be set to
[N]one, level 1 end level 2; fixups packed using Level 1 are recognized
by any OS/2 version above 2.x; however level 2 compressed fixups will
work only in OS/2 Warp 3.0 with (fixpack #17 (I believe)) and above (Warp
4.0 too). Note that when /MF1 or /MF2 is in use, the /U{+|-} option is
ignored - module is always unpacked first.
- /N(B|L|A|+|-)
- [N]E executables: convert into LX (+) or reject (-) modules that are
[B]ound, not [L]FN-aware or [A]ll. For more information about [B] and
[L] option see the 'Features' section above. For example, the /NA-
option will instruct lxLite not to convert NE files into LX, the /NA+
will instruct to convert always; the /NA-LB+ will instruct lxLite to
convert ONLY non-[L]FN-aware and [B]ound executables, the /NA+LB- will
instruct lxLite to convert [A]ll except non-[L]FN-aware and [B]ound
executables.
- /O(X|D|S|A|+|-){:%}
- [O]utput e[X]tra/[D]ebug/[S]tub data into an external file; filename is
determined by applying mask % onto original filename. Data is written
[A]lways in the A+ state and only when removed in the A- state. For
example, the /OD:*.$d$ switch will have effect on the TEST.EXE
executable which contains debug info only when you choose to discard it
and will place it into the file TEST.$d$.
- /P{+|-}
- Enable (+) or disable (-) pause before each file. The program shows the
name of file which will be processed and offers a choice to continue or
to abort.
- /Q{+|-}
- Query all configuration options. Basically it simply types a colored
version of lxLite.cfg file through a MORE-style filter :-) All other
options on the command line (if any) are ignored.
- /R{+|-}
- Enable (+) or disable (-) [R]ecursive file search through subdirectories.
- /S{+|-}
- Show (+) or don`t show (-) configuration in effect. This is useful for
examining which settings are stored into .CFG file, especially for linked
configurations (see below). For example lxLite /Cdefault /S will show
the default settings.
- /T{:%}
- Use specified file as new DOS stub. DOS stub is (usualy) a tiny DOS .EXE
file linked to OS/2`s module which is typicaly used to type an error
message in the case if the executable is not run from DOS command line.
Usually this looks like:
This is an OS/2 executable module
Along with lxLite are enclosed two stubs: stub_min.bin and stub_vdm.bin.
First is the standard `type-error-and-exit` type, but it is slightly
smaller than usual stubs used by various linkers. The second is an stub
which starts a new OS/2 session and runs program from it again. If OS/2
is not detected it types the same error message and exits. The default
for stub_vdm.bin is to let OS/2 decide the type of your executable
itself. Alternatively, you can specify the type of session to be started
by stub_vdm.bin. For this you need any hex editor - find the pattern
`SesType->' in stub and replace the byte that comes after arrow (->) by
needed session type. OS/2 recognizes next session types:
- 00 - OS/2 session manager determines type (default)
- 01 - OS/2 full-screen session
- 02 - OS/2 windowed session
- 03 - PM application
- 04 - VDM full-screen session
- 07 - VDM windowed session
You can use stubs to do some neat tricks. Say you have two executables:
ZIP for OS/2 and ZIP for DOS (I mean GNU ZIP, not PKZIP). They offer the
same interface, does the same thing and share the same name. To avoid
conflicts (and avoid placing them in different directories) you can link
them both together into one EXE file which can be ran either from DOS or
OS/2 mode. This can be achieved by following command line:
lxLite /t:dos\zip.exe os2\zip.exe
If stub size is bigger than certain threshold size (default - 1024 bytes)
it will not be replaced. This is done since stubs of bigger size usualy
does something useful (for example, this can be already an 'dual-mode'
executable). It is useful for batch conversions and not too useful when
you do tricks like described above: so you can wish to change this
threshold value to zero. This can be achieved using the /Z switch (see
below for details).
- /U{+|-}
- Enable (+) or disable (-) unpacking file before packing. lxLite know how
to unpack any of two packing methods described, so default option state
is enabled. Disable it only when compression time savings are more
important than disk space savings. This option is ignored (and file is
anyway unpacked) when /MF2 packing is enabled.
- /V[{0123OCRNMPEF}{+|-}]
- [V]erbose (show a lot of file information).
This is a switch for curious ones :-) It has different levels of
verbosity, you can choose which kind of information to include in overall
output. For example: /V0-12+3-O+. Here is an detailed description of
what each key shows:
- 0
Show basical information about executable:
- module type
- required CPU
- module version
- page size (on Intel platform always 4096 :-)
- page shift
- object count
- resource count
- imported entries count
- debug info size
- start object and EIP
- stack object and ESP
- module name
- module description
- 1
- OS required to run the executable (always OS/2 :-)
- Number of pages present in file
- Fixup table overall size
- Fixup table overall CRC
- Resident portion of header size
- Resident portion of header CRC
- Automatical data object (valid only for 16-bit executables)
- Number of preloaded pages
- Additional stack size (has no effect in LX files)
- Heap size (extra auto-data-object size; has no effect in LX files)
- 2
- Uncompressed Page data offset (relative to LX header)
- Compressed data offset (relative to LX header)
- Page fixup table offset (relative to LX header)
- Fixup table offset (relative to LX header)
- Imported modules table offset (relative to LX header)
- Debug Info data offset (absolute)
- 3
- Object Table offset (relative to LX header)
- Resource Table offset (relative to LX header)
- Object Page Map Table offset (relative to LX header)
- Module Directives Table offset (relative to LX header)
- Non-resident name table offset (relative to LX header)
- Non-resident name table size
- Imported procedures table offset (relative to LX header)
- Entry points table offset (relative to LX header)
- O
Show object info (i.e. information about objects contained in file).
Output looks as follows:
## - Base --- Size --R-W-E-Res-Dis-Shr-Pre-Inv-Swp-Rsd-Loc-A16-32B-Cnf-IOP-
1 00010000 00001000 Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y
- ##
- Object`s ordinal number
- Base
- Object`s base address, i.e. linear address at which it can be placed
without applying self-addressing fixups
- Size
- Size of the object
Further follows object`s flags which describe different attributes of object:
- R - Object is readable
- W - Object is writable
- E - Object is executable
- Res - Object is resource
- Dis - Object is discardable
- Shr - Object is shared among instances (DLLs only)
- Pre - Object must be preloaded (this doesn`t work as far as I know)
- Inv - Object is invalid
- Swp - Object is swappable
- Rsd - Object is resident (for ring 0 drivers only, AFAIK)
- Loc - Object can be long-term locked (drivers only)
- A16 - Alias16, object has an alias in 16:16 format
- 32B - Object is 32-bit
- Cnf - Object is code-conforming (16-bit drivers only, never seen it)
- IOP - I/O priviledge. Object is authorised to access I/O ports.
- C
Object [C]ontents: show pages which makes object. This key enforces /VO.
Output looks something like:
++- Index --+ FileOffs + Size + Attribute +
+ 00000001 + 00012340 + 0123 + LZ-packed +
- Index
- Page number in executable (absolute, not relative)
- FileOffs
- Offset of page data in file (absolute)
- Size
- Size of page data in file
- Attribute
- Page attribute:
- Valid
- An valid unpacked page
- RL-packed
- Compressed using Run-Length encoding (EXEPACK)
- Invalid
- Page is invalid
- Zeroed
- Page must be zeroed
- Range
- ???, no info, never seen one
- LZ-packed
- Compressed using Lempel-Ziv encoding (EXEPACK2)
- R
[R]esident Names Table: This is an table which usually contains all
exported by name procedures. First entry always contains module name.
Display format:
+ Indx + Name ----------------------------------------------
| 0000 | TCPIPDLL
| 0001 | _dn_skipname
| 0002 | _res_query
| 0003 | _writev
[.....................]
+ 006F + _gethostent
- Indx
- This is the index into the Module Entry Table which describes
the actual address of routine
- Name
- The name of routine as it is imported into other programs.
- N
[N]on-Resident Name Table: This is an table which contains miscelaneous
entry points which are not exported. First entry contains module
description (if defined). Display format is the same as above.
- M
Imported [M]odule Names Table: This table contains names of all
external dynamic-link libraries which uses current module.
Display format:
+ Indx + Offs + Name ---------------------------------------
| 0001 | 0000 | SO32DLL
| 0002 | 0008 | TCP32DLL
| 0003 | 0011 | so32dll
| 0004 | 0019 | tcp32dll
| 0005 | 0022 | DOSCALLS
| 0006 | 002B | NLS
| 0007 | 002F | MSG
+ 0008 + 0033 + setloc1
- Indx
- Index into the module names table; This is often used in fixup records
although lxLite resolve such references automatically and shows directly entry name.
- Offs
- Offset in the table = sum of lengths of all previous names. This
is not used for Module Names Table but is used for Procedure Names
Table which is displayed in similar format.
- Name
- The name of entry.
- P
Imported [P]rocedure Names Table: This table contains names of all
external procedures which are imported by name. Display format is
similar to Module Names Table.
- E
Module Entry Table: This is an table which defines some entry points
into the current module; not neccessarily all entry points are defined
here: only those which are exported MUST be defined here. Here is an
sample display:
+ Indx + Entry Type + Entry Attributes ---------------------
| 0005 | 0:32 | 1:00000000, Exported, Shared Data
| 000B | 0:32 | 1:00008C90, Exported, Shared Data
| 000C | 0:32 | 1:00008FB4, Exported, Shared Data
| 002B | 16:16 | 4:02EC, Exported, Shared Data
| 002E | 0:32 | 1:00009468, Exported, Shared Data
+ 0056 + 0:32 + 1:00001448, Exported, Shared Data
- Indx
- Index into the entry table. Entry table is always sequential, and
all 'holes' between indices are filled with 'unused' entry points
(for example, entry point index 10 cannot follow index 5: there
must be entries 6,7,8,9 between them marked as 'unused'). lxLite
doesn`t show 'unused' entries since this is unuseful; however they
are there, just for your information.
- Entry Type
- Type of entry point. Entry points can be located in different
segments (16-bit, 32-bit, it can be an Call Gate etc), so OS/2
needs a flag which will describe how to handle each entry point.
There are also "forwarders" - fake entry points into the module
which are in fact redirected into another module. For example,
PMWIN.DLL, PMGPI.DLL and many other DLLs are simply a bunch of
forwarders which all points to PMMERGE.DLL.
- Entry Attributes
- These depends of the entry type. For example, 0:32 entries has
Object:Offset32 attribute, 16:16 entries have Object:Offset16
attribute, forwarders have attributes which describe to which
module and which procedure to redirect this entry etc.
- F
[F]ixup table. This is useful, I think, only for me and, may be,
for those who write compilers :-) Display format:
+ Object index: 1 Page index: 1 Absolute page: 1
| 32-bit relative offset of import SETLOC1.4
| 045C 0494 04B8
| 32-bit relative offset of import SETLOC1.5
| 035F 0CBA
[.....................]
+ Object index: 1 Page index: 2 Absolute page: 2
| 32-bit relative offset of import SETLOC1.4
| 02B6 0328 0354 090E
[.....................]
+ Object index: 1 Page index: 42 Absolute page: 42
| 32-bit relative offset of import DOSCALLS.256(DosSetFilePtr)
| 066F 0C5D 0CD5
| 32-bit relative offset of import DOSCALLS.272(DosSetFileSize)
| 0CB2
| 32-bit relative offset of import DOSCALLS.273(DosOpen)
| 0B9D
[.....................]
Imports by ordinals are handled in a special way: lxLite has a resource
table which contains information which allows lxLite to transform
MODULE:ORDINAL form into an MODULE:NAME pair. By default lxLite
contains a list of ordinals for all base OS/2 DLL`s, but if you want to
add your own or if you need something special, you can add your module
entries to lxLite.rc file in the API subdirectory and then to re-attach
resources to lxLite (using Resource Compiler).
- /W(W|S|+|-)
- [W]rite (+) or [S]imulate writing of resulting file. In the /WW- state
lxLite will do nothing (useful for /V option); in the /WS+ state lxLite
will even display compression ratio, but won`t alter the module file on
disk. Useful for /V{...} switch, but also can be useful for debugging
your options.
- /X{+|-}
- e[X]pand (+) or pack (-) given files.
Use this switch to decompress files. lxLite can decompress files which
has been compressed by itself as well as by other programs which uses
standard methods (i.e. Resource Compiler, LINK386, REPACK). It is NOT
identical to /c:Unpack option.
- /Y[U|X|B|C|D]{?}
- auto-repl[Y] '?' on one of questions:
- file in [U]se /Answer: [R]eplace, [S]kip, [A]bort/
- [D]ebug info in file /Answer: [D]iscard, [L]eave, [S]kip, [A]bort/
- e[X]tra data in file /[D]iscard, [L]eave, [S]kip, [A]bort/
- [B]ackup file exists /[O]verwrite, [N]o backup, [S]kip, [A]bort/
- [C]onfirmation on /P+ /[P]rocess, [S]kip, [A]bort/
If reply (?) is missing, lxLite will ask you interactively each time. When
lxLite asks you a question, you can press Alt+letter which will set the
default answer for all following similar questions.
- /Z{:#}
- This option will set the `threshold` for lxLite to help him determine
when stub is a `dummy` one and when it is a functional program. There
are a number of programs (for example, \os2\xdfloppy.exe) which runs both
under DOS and OS/2 - in such programs DOS executable is implemented into
OS/2`s LX as a DOS stub. By default lxLite considers all stubs bigger
than 1024 bytes as functional programs, and therefore for such
executables the /T{:#} option has no effect. If you want stub to be
always replaced, use the /Z option. If you want to disable the /T
option, use /Z-1.
- /?,/H
- Show a brief help. This is useful when you forget a particular switch
from all that list :-)
Title page |
Introduction |
Features |
Configuration file |
Error messages |
Bugs and limitations |
Thanks... |
Utility Pack |
Author info