Changeset 4180 for trunk/src


Ignore:
Timestamp:
Sep 4, 2000, 4:03:35 AM (25 years ago)
Author:
bird
Message:

Updated the documentation to reflect the new Win32k.sys version.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/win32k.txt

    r2898 r4180  
    1 2.3.0 Win32k.sys - native OS/2 PE-"loader"
    2 ----------------------------------------
     12.3 Win32k.sys - native OS/2 PE-loader
     2--------------------------------------
    33
    44The win32k.sys driver makes PE (Win32) executables equal to native OS/2
    5 executables by implementing a Ring 0 on-the-fly converter. The converter is
    6 Pe2Lx.exe. So, everything that works with Pe2Lx will probably work with
    7 win32k.sys. And vice versa, when Pe2lx can't handle it, win32k.sys won't either.
     5executables by implementing a Ring 0 on-the-fly loader / converter.
    86
    97You may wonder how you may run a Win32 program using a device driver. You
     
    1311
    1412For example, if you fancy playing windows solitaire.
    15     1) Make sure the necessary DLLs are in you (BEGIN/END)LIBPATH,
    16        and that SOL.EXE is in the current directory or the directory you
    17        specify.
     13    1) Make sure the necessary DLLs (MSVCRT.DLL and CARDS.DLL) are in you
     14       PATH, current dir, SOL.EXE dir, Odin32 System32 dir, Odin32 System dir,
     15       Odin32 dir, or LIBPATHs; and that you have SOL.EXE somewhere.
    1816
    1917    2) Then start SOL.EXE by simply typing SOL.EXE (with path if necessary).
     
    3129We are not responsible for ANYTHING AT ALL! See Odin32 disclaimer...
    3230
    33 Before you install win32k.sys make sure that you have a backdoor to your system
     31Before you install Win32k.sys make sure that you have a backdoor to your system
    3432which works. For example try to boot your system using the Alt+F1 during bootup
    3533and choose Commandline boot (F2). Make sure you have an textmode editor which
     
    4038------------------
    4139
    42 Win32k should work on any Warp 4 or Warp Server for e-business installations
    43 which Odin32 works on. It no longer requires a kernel file for non-debug
    44 kernels. Win32k does now contain a "database" for the most recent retail
    45 kernels. Currently this is:
    46     Warp 4 fp#5 -> fp#12
    47     Aurora GA
     40Win32k should at least work on OS/2 Warp 3 and above, but I don't get too
     41surprised if it worked on 2.11 too. DBCS are not supported yet AFAIK.
     42
     43It no longer requires a kernel file for retail kernels (if you don't know what
     44kernel you have, you have a retail kernel). Win32k does now contain a
     45"database" for the most recent retail kernels. Currently this is:
     46    Warp 4 fp#1 -> fp#14
     47    Aurora GA, FP1, preFP2
    4848    Warp 3 fp#32-> fp#42
    4949
    5050If the running kernel is not found in the "database" or is a debug kernel
    51 wink32.sys will look for symbolfiles as it allways has.
     51wink32.sys will look for symbolfiles as it allways did.
    5252If you use the -s:<symfile> argument the given symbol file will be
    5353investigated before the database is searched.
     
    5757appreciated.
    5858
    59 For those playing with debug-kernels, make sure that OS2KRNL.SYM is matching
    60 the running kernel.
    61 
     59NOTE! A piece of advice for those playing with debug-kernels: Make sure that
     60c:\OS2KRNL.SYM is matching the running kernel.
    6261
    63622.3.2.1 Warp 3
     
    6867(Fixpack 32 + y2kclock.exe is required for Y2K readyness anyway so...)
    6968
     692.3.2.1 OS/2 2.11
     70-----------------
     71
     72For the curiose user, Win32k.sys will probably work with OS/2 2.11 too.
     73I've not test this. But I have run successful Ring-3 tests against the
     74lates 2.11 fixpack kernels.
     75
    7076
    71772.3.3 Installation
     
    7379
    7480To use Win32k.sys you have to add the following line into your config.sys:
    75     device=<d:\path\>win32k.sys
    76 
    77 Where <d:\path\> is the path to the win32k.sys, i.e. the odin32 executables
    78 directory.
     81    device=<d:\path\system32>win32k.sys
     82
     83Where <d:\path\system32> is the path to the win32k.sys, i.e. usually the odin32
     84system32 directory.
    7985
    8086After doing this, you'll have to reboot your machine to load the driver. During
    8187the boot process you will on a successful installation see some lines of
    8288technical info and finally a line saying:
    83     'Win32k.sys succesfully initiated!'
    84 
    85 If you don't see the line above something is wrong.
     89Win32k - Odin32 support driver.
     90    Build:            14046 - v20.45
     91    Found symbolfile: Win32k Symbol Database
     92Win32k.sys succesfully initiated!
     93
     94If you don't see the last line something is wrong, and some error info will be
     95shown. In the case of error the 'rc=<value>' is important to remember.
    8696
    8797
     
    103113                Default: symbol "database" and default locations are searched.
    104114
     115
     116Loader parameters:
     117-SCript:<Y|N>   Enable / disable UNIX script support.
     118                Default: Enabled.
     119
     120-REXX:<Y|N>     Enable / disable pure REXX script support.
     121                Default: Enabled.
     122
     123-Java:<Y|N>     Enable / disable JAVA loading.
     124
     125-PE:<MIXED|PE2LX|PE|NOT>
     126                Enabled / disable and set mode of the PE loading.
     127                    MIXED:  Mix of Pe2Lx and Pe.exe. It uses Pe2Lx when
     128                            possible and backs out to pe.exe if the executables
     129                            aren't supported by the converter.
     130                    PE2LX:  Pe2Lx loader only.
     131                    PE:     Pe.exe only. The program is started using Pe.exe,
     132                            and the process name will be pe.exe.
     133                    NOT:    Disable PE loading.
     134
     135
    105136Logging parameters:
    106137-L<:E|:D>       Enables/Disables logging.
    107138                Default: disabled.
    108139
    109 -C<1|2>         Which com-port to log to.
     140-Com:<1|2|3|4>
     141or
     142-C<1|2|3|4>     Which com-port to log to.
    110143                Default: -C2
    111144
     145-Warning:<1|2|3|4>
     146or
    112147-W<1|2|3|4>     Warning/info level for PE loader. (This is warnings and info
    113148                which is published thru the com-port as logging information.)
    114149                Default: -W0
    115150
     151
    116152Heap parameters:
    117153-HEAPMax:       Maximum swappable heap size in bytes.
     
    127163                Default: 16MB
    128164
    129 -SCript<:Y|:N>  Enable / disable UNIX script support.
    130                 Default: Enabled.
    131165
    132166Obsolete:
     
    134168
    135169
    136 2.3.5 Rings - Ring 0 / Ring 3
     1702.3.5 PE Loading
     171----------------
     172
     173Win32k.sys are able to do PE loading in two different ways.
     174
     1752.3.5.1 PE2LX
     176-------------
     177The first one is called PE2LX and hence uses the original Win32k.sys method
     178which is similar to Pe2Lx. This only requires that KERNEL32.DLL (ie. Odin32
     179System32 directory) is present somewhere in the PATH or LIBPATHs. The DLL
     180search order of PE2LX is now conforming with the Win32 order:
     181    1. The directory of the executable (.EXE).
     182    2. The current directory.
     183    3. The Odin32 System32 directory. (Kernel32.dll directory)
     184    4. The Odin32 System directory. (sibling of system32)
     185    5. The Odin32 directory. (parent of system32)
     186    6. The PATH environment variable. (TODO: quotes are not currently supported)
     187    7. The BEGINLIBPATH.
     188    8. The LIBPATH.
     189    9. The ENDLIBPATH.
     190(Note that the OS/2 DLLs in the _Odin32_ process are also found using this
     191search order. This shouldn't matter much as nearly all of the OS/2 DLL are
     192allready loaded. But if this proves a problem it could be changed.)
     193
     1942.3.5.2 PE
     195----------
     196The second one is called PE and invokes the Pe.EXE to execute the PE (Win32)
     197programs. This of course requies that PE.EXE is found in the PATH.
     198
     1992.3.5.3 Modes
     200--------------
     201Win32k.sys have three (or four) different ways of combining these two methods,
     202called modes:
     203    PE2LX only
     204    PE only
     205    PE2LX with fallback on PE.
     206    (fourth: NOT load any PE executables at all)
     207
     208The last one is the default one and is probably the best one currently.
     209
     210
     2112.3.6 UNIX Shell Script Loader
     212------------------------------
     213
     214The UNIX Shell Script Loader makes OS/2 able to run UNIX shell scripts as
     215native executables, just as UNIX does. A unix shell script is a text file
     216which has a starting line which specifies the interpreter for the script.
     217
     218For example a perl script:
     219#!/bin/perl5 -Sx
     220
     221Or the most common one:
     222#! /bin/sh
     223
     224Since Most OS/2 systems don't have a /bin directory or a /usr/bin directory
     225the executable specified are looked for in these ways:
     226    1. The exact filename specified.
     227    2. The filename specified with .EXE extention.
     228    3. Search the PATH for the filename (with out path of course).
     229    4. Search the PATH for the filename with .EXE extention (and with out path of course).
     230
     231So, you could now execute UNIX shell script in OS/2 without even modify the
     232path of the interpreter!
     233
     234The UNIX Shell Script Loader is enabled by default.
     235
     236
     2372.3.6 Pure REXX Loader
     238----------------------
     239
     240The Pure REXX Loader is a win32k.sys feature which enables REXX script with
     241the extentions .RX and .REX to run as native OS/2 executables. These REXX
     242scripts are executed using kRX.EXE which is found in the Odin32 System32
     243directory.
     244
     245When we say "Pure REXX" scripts, that means no use of command line should
     246occure in the script.
     247
     248The Pure REXX Loader is enabled by default.
     249
     250
     2512.3.7 Java Loader/Invoker
     252-------------------------
     253
     254Just for fun, I've added some code which detects JAVA class binaries and
     255executes the class using JAVA.EXE. I first thougth this should be easy, but
     256it turned out to have several problems.
     257So please note the following:
     258    - The classname is case sensitive, you have to write the exact class
     259      name (with .class extention or what ever extention the file have)
     260      when trying to execute a class. This could cause some throuble making
     261      WPS program objects for the classes....
     262    - To support executing of .class-files which are not in the current
     263      directory win32k.sys send the directory of the .class-file in to
     264      java.exe as a '-classpath' option. This option I soon found out had the
     265      sideeffect of making JAVA.exe ignore the other CLASSPATH and not use
     266      it's default class path. So now the contents of the CLASSPATH env. var.
     267      or a generated default classpath is also sent in with the '-classpath'
     268      option.
     269    - The CLASSPATH environment variable should not be longer than 639 chars.
     270
     271When you have successfully installed Win32k.sys try type this at the
     272commandline:
     273c:\java11\demo\hello\hello.class
     274
     275This is then printed at my screen:
     276Hello, Warped world!
     277
     278The JAVA Loader/Invoker is enabled by default.
     279
     280
     2812.3.8 Rings - Ring 0 / Ring 3
    137282-----------------------------
    138283
     
    141286Ring 3, the least priveleged executing level.
    142287
     288
     2892.3.9 Win32k Control Center
     290---------------------------
     291
     292In your Odin32 System32 directory there is a program called Win32kCC.exe,
     293this is the Win32k Control Center (Win32kCC). Win32kCC is as the name says
     294a program controlling Win32k.sys.
     295
     296Win32kCC allows you to enable, disable and change behaviour of different
     297parts in Win32k.sys.
     298
     299For example: You could disable PE loading, or change it from MIXED mode (see
     3002.3.4, -PE) to PE2LX mode. Or change it from PE2LX mode to PE mode to see
     301if PE.EXE does a better job loading an executable.
     302
     303Note that the changes would not effect allready loaded executables.
     304
     305
     306Win32kCC also displays status info on the running Win32k.sys and OS/2 kernel:
     307    -Win32k.sys version number
     308    -Win32k build time/date
     309    -Path of the symbol file which was used (or Win32k Symbol Database).
     310    -OS/2 kernel build number fixpack (guess)
     311    -OS/2 kernel type as win32k has detected it
     312    -Number of Pe2Lx currently loaded modules
     313    -Win32k resident and swappable heap stats.
     314
     315PS. Beside the "PE Loader" area there is an "Elf Loader" area this is for a
     316future Elf2Lx loader.
     317
     318
     319
     3202.4 The Ring3 conversion utility (PE2LX.EXE)
     321--------------------------------------------
     322
     323PE2LX.EXE was the first method of running Win32 programs under
     324OS/2. It is still provided and also functional but it has been
     325deprecated. Using it is only sensible for debugging certain
     326problems as it requires all DLLs and EXEs to be converted into
     327another file format thus changing the original Win32 files.
     328(It's only future use will be to convert Win32 executable with
     329debuginfo to LX with HLL (IPMD/ICSDEBUG) debuginfo for
     330sourcelevel debugging of Win32 executables under Odin32. This
     331is not yet implemented but are being worked on.)
Note: See TracChangeset for help on using the changeset viewer.