source: trunk/doc/Readme.txt@ 4606

Last change on this file since 4606 was 4179, checked in by bird, 25 years ago

Updated the Win32k documentation.

File size: 25.0 KB
Line 
1
2 O D I N Public Alpha 5 - 1999/11/16
3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4
5WANTED: We are still looking for talented developers that want to
6 contribute! Please take a look at the last section!
7
8NOTE: LICENSE.TXT describes the Project Odin Software License.
9
10
11Project Odin Information
12========================
13
141.0 Introduction
15----------------
16
17This readme is intended for end users that have downloaded the
18latest public alpha release and want to give it a try. For more
19information, be sure to regularly check http://www.netlabs.org/odin.
20
211.1 Purpose
22-----------
23
24Odin is a free Open Source project with the goal to eventually
25provide a fully working Win32 (Win 95/98/NT/2000) runtime environment,
26making it possible to run your favorite Windows programs under OS/2,
27as if they were native OS/2 programs. The second goal of Odin is to
28provide the full Win32 application programming interface (API) so
29that it is possible to build OS/2 programs using Windows source
30code. This is also refered to as Odin32 whereas Odin is the name
31of the Win32 binary emulator.
32
331.2 Current Status
34------------------
35
36Odin is still in the early alpha state so that it is very far from
37being widely usable. Most programs will not work or show many
38problems. Even though it is not usable for most programs, we have
39decided to do a public release in order to show how much progress
40the project has been made. A second goal is to attract more developers
41in order to speedup development. Our job includes rewriting most
42parts of Windows 95/NT without having the original source code so
43the more developers we have the more progess will be seen. The
44last public release (Alpha 0.004) has been in 1997 and the project
45has changed much since then. Everything is free and Open Source now
46and the base architecture has been improved quite a lot. We are now
47in a position where we can expect the first bigger applications to
48run well and to make much more visible progress.
49
501.3 Changes and additions in alpha 5
51------------------------------------
52- Removed Open32 dependacy in User32 code: windows, dialogs, buttons and
53 other controls creation and manipulation is now implemented fully in Odin32.
54 Applications have Win32 look: Win32 specific controls are also supported
55 (Open32 is still a requirement as other Odin32 functions use it!)
56- New and improved PE2LX converter
57- New Portable Executable Loader (PE) that overcomes some differences
58 between OS/2 and Win32 memory models (this does not include 512MB
59 per-process memory limitation in OS/2, you still need the Aurora-level
60 kernel for that)
61- New WIN32K32k.SYS driver that automates loading of Win32 binaries (no
62 conversion or invocation through PE.EXE loader is needed), now
63 compatible with WSeB (Aurora) and no longer dependant of code under
64 GNU license
65- Wine ports of common controls (comctl32), shell extensions (shell32) and
66 OLE
67- Full implementation of memory mapped files
68- Joystick support (winmm)
69- Direct Input (DirectX keyboard & mouse) added (Wine Port)
70- Rewrite of DirectDraw. More complete implementation.
71- Couple of (not core Win32 API, but often used) new DLLs (winasp32, lz32,
72 avifil32...), so users don't have to have Windows license at all to run
73 Windows programs
74- Many new API functions implemented or ported from Wine, allows
75 developers to port Win32 apps directly to OS/2 with little to no rewriting
76- Many bugfixes and enhancements
77- Many new programs that load and/or work with Odin
78- Full source code available
79
80
81
822.0 Installing Odin (UPDATED)
83-----------------------------
84
85Odin daily builds are now also distributed as WarpIn archives.
86WarpIn is a generic OS/2 installation application that can be
87downloaded from warpin.netlabs.org.
88
89To install Odin run warpin.exe with the name of the daily build archive
90as parameter.
91Follow the instructions to complete the installation.
92The Odin installation consists of:
93 - creating an Odin directory and copying the included files to
94 x:\odin and x:\odin\system32
95 - creating empty directories in x:\odin (to create a similar directory
96 structure as found in Windows)
97 - creating a basic registry for executing win32 applications in OS/2
98 - adds x:\odin\system32 to the path and libpath settings in your config.sys
99
100NOTE: You MUST install Odin at least once using WarpIn (unless you know
101 what you're doing). Afterwards you can use the daily build zipfiles
102 to upgrade to a newer version.
103
104To run DirectDraw games or Quake 2 in Voodoo mode, you must install Holger
105Veit's XFree86/2 support driver (XF86SUP.SYS).
106Visit http://ais.gmd.de/~veit/os2/xf86sup.html to download it.
107
1082.0.1 Log files
109---------------
110The alpha 5 binaries and daily build zipfiles can generate logfiles to show
111what a win32 application is doing. This can be very useful to determine
112why certain applications don't run correctly.
113
114The major disadvantage of loggging is the overhead. Therefor it has been
115disabled by default in the alpha 5 release and daily builds.
116To enable logging set the environment variable WIN32LOG_ENABLED:
117 SET WIN32LOG_ENABLED=1
118
119To disable logging again, you must clear this variable:
120 SET WIN32LOG_ENABLED=
121
1222.1 Using Odin to run your Windows applications
123-----------------------------------------------
124
125Odin still has several ways to execute Win32 programs.
126
127
1282.2 The Ring3 Win32 Loader (PE.EXE)
129----------------------------------
130
131This is the new and also recommended method for loading programs.
132Unlike with the previous alphas, it is not required to convert or
133anyhow change the original files. Installing a device driver is
134also not necessary. Be sure to put the Odin binary directory into
135both the PATH and LIBPATH (alternatively you can use a batch file
136with SET PATH=C:\Odin;%PATH% and SET BEGINLIBPATH=C:\Odin;)
137and then call pe.exe winprog.exe param1 param2 ... If you wanted
138to start the Windows calculator, you would type
139
140pe calc
141
142The PE (Portable Executable, the Win32 executable format) loader
143will now try to load the application into memory and execute it.
144This will either work or fail with a loader message. If you get
145such a loader message, it is very likely that a required DLL is
146missing. To correct that problem, take a look at pe_0.log (or
147pe_1.log for the second program running at this time and so on).
148At the bottom of the file you will see the DLLs and the functions
149that the loader imports. It will tell you if it couldn't find a
150DLL and you can correct the problem and try it again.
151
152
1532.2.1 PE loader issues
154----------------------
155
156As the PE loader will create the process and load the program,
157a process utility such as pstat will always show PE.EXE as the
158executable file.
159It is also possible that a certain Win32 application becomes
160a zombie (that is when it does certain things the OS/2 kernel
161cannot recover such as die when waiting on a semaphore). Then
162it will not be possible to kill the application - only a system
163restart will help.
164Certain programs do use fixed memory addresses where they need
165to be loaded (i.e. they won't use fixups). You can notice this
166at the top of the loader log file (pe_0.log). If the fixed address
167is above the 512MB barrier present in Warp 4 and Warp 3, the
168program can not be run under these system. On Aurora (Warp Server
169for e-business) this limitation has been removed. Programs known
170to fall under this category are Microsoft Office (also the
171Office viewers) and other mainly Microsoft programs.
172
173
1742.3 Win32k.sys - native OS/2 PE-loader
175--------------------------------------
176
177The win32k.sys driver makes PE (Win32) executables equal to native OS/2
178executables by implementing a Ring 0 on-the-fly loader / converter.
179
180You may wonder how you may run a Win32 program using a device driver. You
181don't have to worry about that, simply treat the Win32 program just as an
182another OS/2 program. OS/2 can't tell the difference!
183No conversion of dlls or running programs thru Pe.EXE.
184
185For example, if you fancy playing windows solitaire.
186 1) Make sure the necessary DLLs (MSVCRT.DLL and CARDS.DLL) are in you
187 PATH, current dir, SOL.EXE dir, Odin32 System32 dir, Odin32 System dir,
188 Odin32 dir, or LIBPATHs; and that you have SOL.EXE somewhere.
189
190 2) Then start SOL.EXE by simply typing SOL.EXE (with path if necessary).
191 It's also possible to start SOL.EXE from the desktop if you like.
192 Simply find the SOL.EXE icon (or create it) and double click on it!
193
194
1952.3.1 WARNING
196-------------
197
198The Win32k.sys is quite alpha software and any bugs which haven't been found
199yet may crash and/or corrupt you entire system! Make sure you have backed up
200important stuff first!
201
202We are not responsible for ANYTHING AT ALL! See Odin32 disclaimer...
203
204Before you install Win32k.sys make sure that you have a backdoor to your system
205which works. For example try to boot your system using the Alt+F1 during bootup
206and choose Commandline boot (F2). Make sure you have an textmode editor which
207works; for example TEDIT.EXE.
208
209
2102.3.2 Requirements
211------------------
212
213Win32k should at least work on OS/2 Warp 3 and above, but I don't get too
214surprised if it worked on 2.11 too. DBCS are not supported yet AFAIK.
215
216It no longer requires a kernel file for retail kernels (if you don't know what
217kernel you have, you have a retail kernel). Win32k does now contain a
218"database" for the most recent retail kernels. Currently this is:
219 Warp 4 fp#1 -> fp#14
220 Aurora GA, FP1, preFP2
221 Warp 3 fp#32-> fp#42
222
223If the running kernel is not found in the "database" or is a debug kernel
224wink32.sys will look for symbolfiles as it allways did.
225If you use the -s:<symfile> argument the given symbol file will be
226investigated before the database is searched.
227
228NOTE! It hasn't been fully verified that all the different national fixpaks
229have the same symbols as the us-english ones. Feedback on this issue is
230appreciated.
231
232NOTE! A piece of advice for those playing with debug-kernels: Make sure that
233c:\OS2KRNL.SYM is matching the running kernel.
234
2352.3.2.1 Warp 3
236--------------
237
238Win32k is not tested with Warp 3. It is _supposed_ to work with Warp 3
239provided you are running fixpack 32 or later.
240(Fixpack 32 + y2kclock.exe is required for Y2K readyness anyway so...)
241
2422.3.2.1 OS/2 2.11
243-----------------
244
245For the curiose user, Win32k.sys will probably work with OS/2 2.11 too.
246I've not test this. But I have run successful Ring-3 tests against the
247lates 2.11 fixpack kernels.
248
249
2502.3.3 Installation
251------------------
252
253To use Win32k.sys you have to add the following line into your config.sys:
254 device=<d:\path\system32>win32k.sys
255
256Where <d:\path\system32> is the path to the win32k.sys, i.e. usually the odin32
257system32 directory.
258
259After doing this, you'll have to reboot your machine to load the driver. During
260the boot process you will on a successful installation see some lines of
261technical info and finally a line saying:
262Win32k - Odin32 support driver.
263 Build: 14046 - v20.45
264 Found symbolfile: Win32k Symbol Database
265Win32k.sys succesfully initiated!
266
267If you don't see the last line something is wrong, and some error info will be
268shown. In the case of error the 'rc=<value>' is important to remember.
269
270
2712.3.4 Win32k parameters
272-----------------------
273
274The Capitalized letters are the one which is tested for when identifying the
275argument.
276
277There are some useful parameters for Win32k:
278-Quited Quiet driver initiation.
279 Default: disabled (ie. -V)
280
281-Verbose Verbose driver initiation.
282 Default: enabled
283
284-S:<filename> Full path to the current OS/2 kernel symbol file.
285 When this is specified the given
286 Default: symbol "database" and default locations are searched.
287
288
289Loader parameters:
290-SCript:<Y|N> Enable / disable UNIX script support.
291 Default: Enabled.
292
293-REXX:<Y|N> Enable / disable pure REXX script support.
294 Default: Enabled.
295
296-Java:<Y|N> Enable / disable JAVA loading.
297
298-PE:<MIXED|PE2LX|PE|NOT>
299 Enabled / disable and set mode of the PE loading.
300 MIXED: Mix of Pe2Lx and Pe.exe. It uses Pe2Lx when
301 possible and backs out to pe.exe if the executables
302 aren't supported by the converter.
303 PE2LX: Pe2Lx loader only.
304 PE: Pe.exe only. The program is started using Pe.exe,
305 and the process name will be pe.exe.
306 NOT: Disable PE loading.
307
308
309Logging parameters:
310-L<:E|:D> Enables/Disables logging.
311 Default: disabled.
312
313-Com:<1|2|3|4>
314or
315-C<1|2|3|4> Which com-port to log to.
316 Default: -C2
317
318-Warning:<1|2|3|4>
319or
320-W<1|2|3|4> Warning/info level for PE loader. (This is warnings and info
321 which is published thru the com-port as logging information.)
322 Default: -W0
323
324
325Heap parameters:
326-HEAPMax: Maximum swappable heap size in bytes.
327 Default: 512KB
328
329-Heapinit: Initial heapsize in bytes.
330 Default: 16MB
331
332-RESHEAPMax: Maximum resident heap size in bytes.
333 Default: 256KB
334
335-Resheapinit: Initial resident in bytes.
336 Default: 16MB
337
338
339Obsolete:
340-K:<filename> Ignored. Win32k scans the kernel image in memory!
341
342
3432.3.5 PE Loading
344----------------
345
346Win32k.sys are able to do PE loading in two different ways.
347
3482.3.5.1 PE2LX
349-------------
350The first one is called PE2LX and hence uses the original Win32k.sys method
351which is similar to Pe2Lx. This only requires that KERNEL32.DLL (ie. Odin32
352System32 directory) is present somewhere in the PATH or LIBPATHs. The DLL
353search order of PE2LX is now conforming with the Win32 order:
354 1. The directory of the executable (.EXE).
355 2. The current directory.
356 3. The Odin32 System32 directory. (Kernel32.dll directory)
357 4. The Odin32 System directory. (sibling of system32)
358 5. The Odin32 directory. (parent of system32)
359 6. The PATH environment variable. (TODO: quotes are not currently supported)
360 7. The BEGINLIBPATH.
361 8. The LIBPATH.
362 9. The ENDLIBPATH.
363(Note that the OS/2 DLLs in the _Odin32_ process are also found using this
364search order. This shouldn't matter much as nearly all of the OS/2 DLL are
365allready loaded. But if this proves a problem it could be changed.)
366
3672.3.5.2 PE
368----------
369The second one is called PE and invokes the Pe.EXE to execute the PE (Win32)
370programs. This of course requies that PE.EXE is found in the PATH.
371
3722.3.5.3 Modes
373--------------
374Win32k.sys have three (or four) different ways of combining these two methods,
375called modes:
376 PE2LX only
377 PE only
378 PE2LX with fallback on PE.
379 (fourth: NOT load any PE executables at all)
380
381The last one is the default one and is probably the best one currently.
382
383
3842.3.6 UNIX Shell Script Loader
385------------------------------
386
387The UNIX Shell Script Loader makes OS/2 able to run UNIX shell scripts as
388native executables, just as UNIX does. A unix shell script is a text file
389which has a starting line which specifies the interpreter for the script.
390
391For example a perl script:
392#!/bin/perl5 -Sx
393
394Or the most common one:
395#! /bin/sh
396
397Since Most OS/2 systems don't have a /bin directory or a /usr/bin directory
398the executable specified are looked for in these ways:
399 1. The exact filename specified.
400 2. The filename specified with .EXE extention.
401 3. Search the PATH for the filename (with out path of course).
402 4. Search the PATH for the filename with .EXE extention (and with out path of course).
403
404So, you could now execute UNIX shell script in OS/2 without even modify the
405path of the interpreter!
406
407The UNIX Shell Script Loader is enabled by default.
408
409
4102.3.6 Pure REXX Loader
411----------------------
412
413The Pure REXX Loader is a win32k.sys feature which enables REXX script with
414the extentions .RX and .REX to run as native OS/2 executables. These REXX
415scripts are executed using kRX.EXE which is found in the Odin32 System32
416directory.
417
418When we say "Pure REXX" scripts, that means no use of command line should
419occure in the script.
420
421The Pure REXX Loader is enabled by default.
422
423
4242.3.7 Java Loader/Invoker
425-------------------------
426
427Just for fun, I've added some code which detects JAVA class binaries and
428executes the class using JAVA.EXE. I first thougth this should be easy, but
429it turned out to have several problems.
430So please note the following:
431 - The classname is case sensitive, you have to write the exact class
432 name (with .class extention or what ever extention the file have)
433 when trying to execute a class. This could cause some throuble making
434 WPS program objects for the classes....
435 - To support executing of .class-files which are not in the current
436 directory win32k.sys send the directory of the .class-file in to
437 java.exe as a '-classpath' option. This option I soon found out had the
438 sideeffect of making JAVA.exe ignore the other CLASSPATH and not use
439 it's default class path. So now the contents of the CLASSPATH env. var.
440 or a generated default classpath is also sent in with the '-classpath'
441 option.
442 - The CLASSPATH environment variable should not be longer than 639 chars.
443
444When you have successfully installed Win32k.sys try type this at the
445commandline:
446c:\java11\demo\hello\hello.class
447
448This is then printed at my screen:
449Hello, Warped world!
450
451The JAVA Loader/Invoker is enabled by default.
452
453
4542.3.8 Rings - Ring 0 / Ring 3
455-----------------------------
456
457FYI. Ring 0 is the most priveleged level of execution in OS/2. The OS/2 kernel
458and device drivers execute at this level, while user applications execute in
459Ring 3, the least priveleged executing level.
460
461
4622.3.9 Win32k Control Center
463---------------------------
464
465In your Odin32 System32 directory there is a program called Win32kCC.exe,
466this is the Win32k Control Center (Win32kCC). Win32kCC is as the name says
467a program controlling Win32k.sys.
468
469Win32kCC allows you to enable, disable and change behaviour of different
470parts in Win32k.sys.
471
472For example: You could disable PE loading, or change it from MIXED mode (see
4732.3.4, -PE) to PE2LX mode. Or change it from PE2LX mode to PE mode to see
474if PE.EXE does a better job loading an executable.
475
476Note that the changes would not effect allready loaded executables.
477
478
479Win32kCC also displays status info on the running Win32k.sys and OS/2 kernel:
480 -Win32k.sys version number
481 -Win32k build time/date
482 -Path of the symbol file which was used (or Win32k Symbol Database).
483 -OS/2 kernel build number fixpack (guess)
484 -OS/2 kernel type as win32k has detected it
485 -Number of Pe2Lx currently loaded modules
486 -Win32k resident and swappable heap stats.
487
488PS. Beside the "PE Loader" area there is an "Elf Loader" area this is for a
489future Elf2Lx loader.
490
491
492
4932.4 The Ring3 conversion utility (PE2LX.EXE)
494--------------------------------------------
495
496PE2LX.EXE was the first method of running Win32 programs under
497OS/2. It is still provided and also functional but it has been
498deprecated. Using it is only sensible for debugging certain
499problems as it requires all DLLs and EXEs to be converted into
500another file format thus changing the original Win32 files.
501(It's only future use will be to convert Win32 executable with
502debuginfo to LX with HLL (IPMD/ICSDEBUG) debuginfo for
503sourcelevel debugging of Win32 executables under Odin32. This
504is not yet implemented but are being worked on.)
505
506
507
5083.0 Applications known to be working
509------------------------------------
510
511- Windows 95/NT Help Viewer (winhlp32.exe)
512- Windows 95/NT Registry Editor
513- Windows NT Solitaire (not the one from Windows 95)
514- Windows NT Freecell (not the one from Windows 95)
515- Windows 95/NT Calculator
516- Windows NT Pinball
517- Windows NT Minesweeper
518- Quake II
519- Red Alert
520- Professional Minesweeper
521- Windiff (part of Win32 SDK)
522
523Note that many other applications load and/or partly work.
524
525
5264.0 Reporting Problems and Successes
527------------------------------------
528
529In this early stage it is not required that you report every
530bug to the developers as we still have huge lists of to do items.
531However, an application compatibility database has been created
532at Netlabs where you can share your experiences with Odin.
533The application compatibility database can be found at
534
535http://www.netlabs.org/odin/appdatabase
536
537
538Project Odin Source Code Notes
539==============================
540
5411.0 Introduction
542----------------
543
544This readme is intended for making people more familiar with ODIN and to
545describe various aspects of the project such as accessing latest sources via
546cvs, building the binaries, running win32 applications, how to identify and
547report problems and bugs, as well as how to participate in this very
548promising project.
549
550
5511.1 Prerequisites:
552------------------
553
554Required compilers/tools:
555 - IBM VisualAge 3.0 (CTx8 fixpack applied)
556 (version 3.6 might also work, but version 4 is not
557 recommended)
558 - OS/2 Warp 4 Toolkit (project apparently doesn't compile with
559 VAC's OS/2 headers)
560 Might also work with EMX headers. (haven't tried this!)
561 - ALP 4.0 (IBM Assembly Language Processor)
562 Download the tools zipfile from http://service.boulder.ibm.com/ddk/
563 (you need to register, but it's free)
564 - Unix-like rm.exe (nmake clean)
565
566Changes from last source code release:
567 - Uses Wine headers and a stripped down version of os2win.h (Open32
568 header)
569 - All Open32 apis have the 'O32_' prefix.
570 - All Open32 declarations are appended with '_O32' (mostly due to
571 calling convention differences)
572 - nmake DEBUG=1 builds the debug version
573 nmake builds the release version
574 - Several dlls (i.e. USER32, KERNEL32, ADVAPI32) contain extra .def
575 files that are used to create libraries that contain the api names
576 as required by the linker when you use them. (_apiname@nrparameterbytes)
577
578Wine header notes:
579 - Several header files have been changed to make them usable for VAC
580 - Several header files contain bugfixes (mostly parameter type changes)
581 - Several header files include additional declarations
582 - At this time we don't intend to have our changes included in the
583 Wine codebase as header files are not likely to change often.
584
585Coding conventions:
586 - Do NOT directly call the Open32 apis unless you're writing
587 a wrapper for it.
588 - Do NOT include os2.h directly. Use os2wrap.h instead.
589 os2wrap.h contains all the OS/2 apis with a wrapper around it to save
590 and restore the selector in FS. (some OS/2 apis set it back to the
591 default value (150b))
592 - Use the correct Win32 api when there are two version (ascii & unicode)
593 Calling the standard one (SendMessage) causes a error during
594 compilation.
595 Use SendMessageA instead.
596 - Source code style will be decided on in the near future.
597
598
5992.0 Accessing ODIN source code via CVS
600--------------------------------------
601
602Please check out http://www.netlabs.org/ and http://www.netlabs.org/odin.
603
604
6053.0 Building the binaries
606-------------------------
607
608Basically, if your system setup meets above stated requirements, everything you
609need to do for a binary build is:
610
611 nmake DEBUG=1
612
613or alternatively
614
615 nmake release (not working right now!)
616
617As the current state of the project is still known to be alpha level, one should
618expect some functions not to work properly. Therefore, we recommend the use of
619the debug-version which creates long logfiles for problem determination purpose
620and to allow active debugging with debuggers such as IPMD, ICAT, KDB, etc.
621
622Please note if you do not want to suffer from the performance loss of writing
623logfiles, you can disable logging even with the debug binaries of ODIN by
624setting:
625
626 SET NOWIN32LOG=YES
627
628To enable logging again, clear this environment variable by typing:
629
630 SET NOWIN32LOG=
631
632Logging is enabled by default in the debug build, but disabled by default
633in the nodebuginfo build and not present in the release build.
634
6353.1 Build problems
636------------------
637
638ODIN is moving at a fast pace. Sometimes side effects of source dependencies may
639require you to do a full rebuild of the binaries instead of an incremental build.
640
641However, rarely it also happens the sources contained in the CVS repository do
642not build completely due to erroneous source code. Usually, this is fixed within
643two days at maximum.
644In such event, one can normally stick with the previous version of the particular
645module to further test win32 applications on ODIN.
646
647Please report such build problems through the appropriate channel.
648
649
6503.2 Downloading daily built binaries
651------------------------------------
652
653http://www.os2.org/ has setup an ftp server that hosts the automatically
654built binaries on daily basis. For people that do not have a suitable
655development setup for ODIN, we provide the latest binary code that way.
656
657
6584.0 Project participation
659-------------------------
660
661As ODIN became an open source project, everybody is kindly invited to
662contribute his/her share to the progress of the project. May it be
663active coding, fixing bugs or just providing detailed information about
664examined problems.
665
666We suggest you subscribe to win32os2-wai and the corresponsing mailing lists
667on http://www.egroups.com.
668In case you are interested in participating, every member of the project will
669be happy to give you direction to the right places and to give a personal
670introduction to further development of the particular modules.
671
Note: See TracBrowser for help on using the repository browser.