Jump to content











Photo
- - - - -

K8668 - Rebuilding Windows 3.11


  • Please log in to reply
9 replies to this topic

#1 wendy

wendy

    Frequent Member

  • Lady
  • 266 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 20 July 2006 - 07:51 AM

I decided to rebuild a copy of Windows 3.11 with all of the latest mod cons etc. In essence, while we are trying to keep with the original windows, most of the thing is getting a modern makeover. The Windows 3.11 resource kit (reskit31.exe) gives extensive details on this, so we're really following what MS has documented. Still, doing this gives a ready-made custom Windows with patches installed.

This is not the first time this experiment has been conducted. A custom build of windows has been used as the main OS since about 1994 to 1998 (when win31 dominated the desktop). So this is not merely some theoretical exercise, but a day-to-day OS.

The base versions of Windows are abbreviated thus:
  • W300 : Windows 3.00
  • W310: Windows 3.10
  • W330: Windows 3.10 for Workgroups
  • W311: Windows 3.11
  • W331: Windows 3.11 for workgroups
When one speaks of 310 and 311. one usually means W310 and W331. There really was a wfw 310 and an win 311, but neither of these were mainstream. wfw 310 (w330) is also cheerfully dubbed "Windows for Warehouses", because it was slower than Windows 3.10 or either of the 3.11 stock.

The further idea is to see if we can support something like standard mode in Windows 3.11.

For as much as possible, the process is not merely to produce a 3.31 distro, but to see if much of the original can be reproduced, including compression, etc. Eventually, we will get around to recompiling help files, to add in extra information. One subject to be added is help on the Progman DDE interface.

Initial tests with W310, W311 and W331 suggest that W331 requires the least modifications, and this version is fairly accessable to many users. You should be able to access MS-DOS 6.22 and Windows 3.10 as well, because we will borrow from both of these. None the same, these are more cosmetic changes, rather than real things.

#2 wendy

wendy

    Frequent Member

  • Lady
  • 266 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 20 July 2006 - 08:22 AM

Compression

The first element is to deal with the fact that both PC-DOS / MS-DOS and Windows 3.11 are compressed in the distribution. Looking in an DOS 5.x or Win3.x0 distro file, one sees the signature letters SZDD. The Dos 6 / Win 3.x1 files have here KWAJ. Windows NT and 98 are in MSCF format.

One can make SZDD files using a MS utility hight "compress.exe". This is fairly easy to come by, it basically escaped the Windows 3.1 SDK. The "compress.exe" that comes with the Windows NT resource kit makes MSCF files. One has to go way back to find a compress.exe for the KWAJ format.

To understand what has happened, KWAJ is an older format than SZDD, but is generally better compression. MSCF is generally as good as KWAJ, but appeared later. One might easily suppose that SZDD is native microsoft format, but did not give the same compression ratios as an earlier KWAJ. But because Windows 3.11 and DOS 6 are considerably larger than their DOS 5 / Windows 3.10, the older format was reused to save disk storage. EXPAND 2 (in DOS 6.x), and 2.1 (in Windows 3.11), are there largely to handle both SZDD and KWAJ formats transparently.

One notes also that there is an OS/2 utility DECOMP.EXE, (included in the WLO libraries), which is quite capable of expanding the Windows 3.11 / DOS 6 files. even though the file is quite old. On the other hand, the expand from dos 5.0 or Windows 3.x0 (3.00/3.10/3.30) is incapable of expanding KWAJ format.

The compress.exe for KWAJ is quite rare. I found it in conjuction with the Foxpro distribution Kit. Still, because of fears of it being overwritten, i renamed it to ENCOMP (to match DECOMP). Here is encomp's help screen,

Microsoft (R) Compression Utility - Version 1.02

Copyright (c) Microsoft Corp 1989 - 1991.  All rights reserved.



Usage: compress [-aAlg -bceflq$ -sSize -tText -zSize] srcArg [destArg]

   -a -- Choices for compression algorithm are:  [default = 3]

	  2 - the Steven Zeck algorithm.

	  3 - Jeff Johnson's algorithm (LZSS + Huffman).

   -be will include each file basename/extension in the header.

   -f will force overwriting and recompression of files.

   -l will include each file length in the header.

   -q will compute compressed file lengths (no output) (ignores -sz flags).

   -s will split output into Size x 512 byte pieces naming each piece

	  with a sequentially higher numerical base name.

   -t will include following Text in the header.

	  Text that includes spaces should be double-quoted.

   -z will split off and compress just one piece, and leave the

	  remainder uncompressed in a second file.

   -$ will turn OFF dollar sign renaming.  Specific destArg will override.



   srcArg can be a filename, a wildcard pattern, or a directory.  The

   latter will cause a tree walk operation.  destArg can be a directory,

   a specific filebase, or omitted in which case digits are appended.

You might imagine these to be in a batch condition, where one writes eg "pack winfile.ex e". The default of this version is to rename winfile.exe to winfile.ex$. The $ was changed to _ to match the ISO 9660 file restrictions, mainly.
  • DOS6xx: encomp -a3 -l -f %1%2 %1_
  • Win3x1: encomp -a3 -b -e -l -f %1%2 %1_
Note that both the DOS and Windows files store length (-l), but only the Windows version stores the filename. This is why the expand.exe from Windows 3.11 supports the -r option (which does not work under DOS files, because the information is not stored in the files.

This is the compress from Windows SDK:

Microsoft (R) File Compression Utility  Version 2.00

Copyright (C) Microsoft Corp. 1990-1992.  All rights reserved.



Compresses one or more files.



COMPRESS [-r] Source Destination

COMPRESS -r Source [Destination]



  -r		  Automatically rename compressed files.

  Source	  Source file specification. Source may be multiple file

			  specifications. Wildcards may be used.

  Destination Destination file / path specification. Destination may be a

			  directory. If Source is multiple files and -r is not specified,

			  Destination must be a directory. Wildcards may not be used.

This produces the SZDD files found in MS/PC DOS 5.00 and Windows 3.00 / 3.10 / 3.11. In general, it is not as tight as the encomp format, and the letter is stored only if the -r option is used. In practice, the last letter is stored, not the full name as under KWAJ format.

Still, the purpose of this is that one should look for version 1 if one wants to make SZDD files, not version 2.

A more recent version comes with the Windows NT reskit files, makes only MSCF format, the format used with Windows NT, 2K, XP, (as individual files), and Win9x (as cabinet-files).

OS/2 uses pack and pack2, but this is not a worry at this stage.

Target

Because we want to use the -r option of expand.exe, we need to repack DOS files to meet this. DOS 6 setup does not understand SZDD files, because it is a one-shot install. Windows 3.x1 has to understand the older format because the LZEXPAND dll is used elsewhere after install, eg with SZDD files.

We also plan to update some of the dos files, and this is therefore needed.

#3 wendy

wendy

    Frequent Member

  • Lady
  • 266 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 20 July 2006 - 08:38 AM

PC-DOS 6.31

OK, this is a fairly rare DOS, i'd amit, but i have used PC-DOS as my OS from vers 5.00 onwards through 6,10, 6.30, 7.00 and 2000. BTW, Edlin 2000 does _not_ run under DOS 2000! OK, onwards we go.

PC-DOS 6.3 had a number of fixes released, including ibmdos.com, ibmbio.com, command.com, and a few others. We plan to slipstream these all to the new DOS. Also, there are a number of standard drivers that we plan to integrate, largely from DOS 2000.

Here is a list of drivers from the different DOS's, based on release date. The file collection was up to date at the time the file was built, but new entries have been made since.

Emm   Ram  Smart

						   Himem   386  Drive  Drv  Mouse  Mscdex

   Win286  2.11  U 270588  1.0		   2.04  1.05

   MS-DOS  4.01  U 070489  2.04   4.00   2.12  2.10

   MS-Win  3.00  U 311090  2.60   4.10   3.04  3.06  7.04

   IBMDOS  5.00  U 090591  2.77   4.20   3.06  3.13  7.04

   MS-DOS  5.00  U 111191  2.78   4.33   3.06  3.13

   IBMDOS  5.02  B 010992  2.78   4.33   3.06  3.13  8.20

   MS-Win  3.10  U 100392  3.07   4.44   3.06  4.00  8.20

   MS-Win  3.11  U 311293  3.07   4.44   3.06  4.00

   MS-DOS  6.00  U 100393  3.07   4.45   3.06  4.10  8.20   2.22

   IBMDOS  6.00  U 290693  3.09   4.45   3.06  4.10  8.20

   PC-DOS  6.10  U 161193  3.09   4.45   3.06  4.10  8.20

   MS-Fix  6.0a  F 010693					  4.20

   PC-DOS  6.30  U 311293  3.09   4.48   3.06  5.00  9.01   2.23

   MS-DOS  6.20  U 270993  3.10   4.48   3.07  5.00  8.20   2.23

   MS-WfW  3.11  U 011193  3.10   4.48   3.07  5.00		 2.23

   MS-DOS  6.21  B 130294  3.10   4.48   3.07  5.00		 2.23

   MS-DOS  6.22  U 310594  3.10   4.49   3.07  5.01  8.20   2.23

   PC-DOS  7.00  U 171194  3.15   4.50   3.10  5.10  8.20   2.25

   Win-95  3.95  U 110795  3.95   4.95   3.06  5.00 (8.30)  2.25


We plan to keep the version 9 of the mouse driver. The default install creates a hideous mouse.ini, but deleting this fixes all problems. The rest are updated according to the table.

We also plan to update a number of other files, such as qconfig.exe (pc-dos version of msd.exe), and expand.exe (windows 3.11, supporting -r options), and probably a patched version of pcdos 7.00 dosshell.

#4 TheHive

TheHive

    Platinum Member

  • .script developer
  • 4138 posts

Posted 20 July 2006 - 02:17 PM

Well I cant keep up with all of it but it sounds good.

There is a shell replacement called Calmira that can either make Windows 3.11 look like Win98 or Win XP.
http://www.calmira.de/

#5 wendy

wendy

    Frequent Member

  • Lady
  • 266 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 06 August 2006 - 07:14 AM

Some pictures.

This is Windows K8668 just after being installed. The picture shows Windows Help (winhelp.exe), loaded and then the "Help/about" dialog displayed.

On the left is the control panel. There are a number of extra control panel applets, for ATM font manager, Clock, Wallpaper, Pif Editor, Reg-Edit and WinSetup. These are modified versions of the NEVERnever control panel applets.

Clock launches clock.exe. The OS/2 clock icon lives in the control panel.

Wallpaper directly links to the program paper.exe, which is a "file-open" dialog that changes the wallpaper.

PifEdit and RegEdit are the standard pifedit and regedit programs. They live in the control panel

WinSetup is the Windows Setup program. It has been started, you see it to the bottom right of the screen.

The colour-scheme is "WinOS/2 original" from the package "Workplace Shell for Windows"

r

Attached Thumbnails

  • win311b.gif


#6 Nuno Brito

Nuno Brito

    Platinum Member

  • Team Reboot
  • 10452 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 06 August 2006 - 11:48 AM

Your Win3.1 desktop looks good! :P


Are you planning to make some tutorials on how/where to apply these mods? :P

#7 wendy

wendy

    Frequent Member

  • Lady
  • 266 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 07 August 2006 - 08:59 AM

I am planning to write how to integrate individual packages into the result. It's not hard.

Just have to document it...

W

#8 Yorn

Yorn

    Frequent Member

  • Advanced user
  • 178 posts
  • Location:United States

Posted 07 August 2006 - 02:24 PM

I remember using PC-DOS for a while on the old Compaq. But that came with Win95 and 8 meg RAM, so it was impossible for me to completely axe MS-DOS, if I remember right.

#9 wendy

wendy

    Frequent Member

  • Lady
  • 266 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 12 August 2006 - 07:34 AM

The rexx script for doing the mods to setup.inf, etc is now done. It took just three bugs to get it working nicely.

The script is produced by a rexx-script weave.rex. The process allows you to write elegant fully documented code, and test the result at the end. Don Knuth invented this particular process "literate programming". I implemented it to write text files etc (you can write raw binary files and floppy disks with it!).

extproc weave.rex

regina.exe weave.rexx zmk3.cmd

goto :erexx

!topic About



!src

!! Directory of output	  !!set ytarget #\k-dos\build\mswfw##

!exe rexxmain #winsetup.rex##Parse winsetup.inf##

!exe batfile #test1.bat##

!end



This command is intended to process winsetup.inf based on the location of

files as set forth in the directories above.  Basically. winsetup.inf is

a prototype for all setup.inf files, and the output has the cumulative

build of individual insertions.



If the file exists in the output directory, then the line is printed to

the default printer object.  Only optional files are thus added.



!topic - settings



!src settings

!! Name of source tape	 !!set yinput #winsetup.inf##

!! Command to search for   !!set ykey #@@#

!! Output to:			  !!set youtdir #r:##

!lbl rexxsets

!! key to find	   !!exe rexxvar #key##ykey##

!! non-active file   !!exe rexxvar #null##*~*##

!! true variable	 !!exe rexxvar #true##*t*##

!! false variable	!!exe rexxvar #false##*f*##

!! input file		!!exe rexxvar #infile##yinput##

!! target dir		!!exe rexxvar #target##ytarget#\##

!! underscore		!!exe rexxvar #uscore##_##

!! outdir			!!exe rexxvar #outdir##youtdir##

!put ##

!lbl rexxvar

!put #zvar1#='#zvar2#';#

!end



To set a DOS directory into something like UNIX or whatever, use this

command.



   !set ytarget \build\mswfw/

   !say #zq.*\*ytarget*/*	 ->  /build/mswfw/



!topic cmdline



!src cmdline

parse arg a1 a2&#59; if stream(a1'\xmsmmgr.exe', 'c', 'query exists') = ''

  then nop; else; do; target = a1; outdir = a2; end

!lbl batfile

!new #zvar1#

@echo off

!put #regina.exe winsetup.rex #ytarget#\ #youtdir#\##

!exe copyfile #setup.in##f##

!exe compress #control.sr##c##

!exe compress #system.sr#c##

!exe compress #win.sr##c##

!lbl copyfile

!put #rem copy /y #youtdir#\#zarg1#zarg2# #ytarget#\#zarg1#zarg2##

!lbl compress

!put #encomp -b -e -f -l #youtdir#\#zarg1#zarg2# #ytarget#\#zvar1#_##

!end







!topic eachline



This is the gist of the program.  We initialise the assorted printers

and then fire up the loop.  When the loop is done, we turn off any open

printers, and then exit.



!src eachline

if pos(key, incard) > 0

  then call procline

  else call printline

!lbl printline

!put #printline:&#59; select; #

!put   #when defprint = '*' then nop; #

!put   #when paused = true then nop&#59; ##

!put   #otherwise call lineout defprint, incard; end; #

!put #return##

!end



The idea here is that we can print a line if a file exists or does not

exist, eg



	exists('calendar.ex_') gives 'true'

	thisline = exists('calendar.ex_'); call printtrue





!topic procline



Here we process the lines that have the string '@@' in them.  The actual

action is one of many things, including opening and closing printers.



   @@*	 select printer

   @@*/	select printer null

   @@c	 printtrue(file)

   @@/	 printfalse(file)



!src procline

!put #procline:&#59; #

!put #parse var incard incard (key) cmdcard; #

!put #parse var cmdcard 1 cmdx 2 testme; ##

!put #if pos( cmdx, '*/') = 0 then testme = cmdcard; #

!put #parse var testme testme .; ##

select;

 when cmdx = '*' then call setprint

 when cmdx = '/' then call isfile testme, false

 otherwise call  isfile testme, true&#59; end

return

!inc setprint

!end



With setprint, we now allow pausing of the file, too, eg



   @@\  pause

   @@/  restart









!topic isfile testme, true/false.



!src isfile

!put #isfile:; #

!put   #parse arg testfile, allow&#59;#

!put   #call testforme; ##

!put   #if exists = allow; #

!put	  #then call printline; #

!put #return##

!inc testforme

!end







!topic testforme



See if any of the files exist.  Files are comma separated, eg



  @@winfile.exe,winfile.hlp



!src testforme

!put #testforme:&#59;#

!put   #exists = false; #

!put   #testme = testfile; ##

!put #do while testme <> &#34;&#34;; #

!put   #parse var testme test1 &#39;,&#39; testme; ##

!inc findfile

!put # if exists = true then leave; #

!put   #end&#59;#

!put #return##

!lbl findfile -----------------------------------

test2 = reverse&#40;test1&#41;; parse var test2 1 . 2 test2;

test2 = reverse&#40;test2&#41; || uscore&#59; select;

  when stream&#40; target || test2, &#39;c&#39;, &#39;query exists&#39;&#41; <> &#39;&#39; then exists = true

  when stream&#40; target || test1, &#39;c&#39;, &#39;query exists&#39;&#41; <> &#39;&#39; then exists = true

  otherwise; nop; end

!end







!topic selprint



The idea here is that one of three printers are available, either



!src setprint

!put #setprint&#58;&#59; #

!put #select; #

!put  #when testme = &#39;/&#39; then paused = false; #

!put  #when testme = &#39;\&#39; then paused = true&#59; #

!put #otherwise; ##

!put	#call stream defprint, &#39;c&#39;, &#39;close&#39;; #

!put	#defprint = outdir&#39;\&#39;testme; paused = defprint; ##

!put	#call stream defprint, &#39;c&#39;, &#39;open write replace&#39;&#59; #

!put #end; #

!put #return##

!end



	/   resumes a printer

	\   pauses a printer

	otherwise, start a new printer





!topic rexxmain



This is the main rexx script.  We only give the highlights here, and

direct the user to read the individual routines listed in the script.



!src rexxmain

!inc settings&#59;  General Weave variables.

!new #zvar1#

!put #/* REXX #zcomment# */##/*~ #zvar2# */##

!inc rexxsets&#59;  General REXX variables

!inc cmdline&#59;   Command line processing

call stream infile, &#39;c&#39;, &#39;open read&#39;

defprint = null; thisline = null;

do while lines&#40;infile&#41;

 incard = linein&#40;infile&#41;

!inc eachline

 end

call stream defprint, &#39;c&#39;, &#39;close&#39;

call stream infile, &#39;c&#39;, &#39;close&#39;

exit

!rem ------------- routines -------------------------

!inc printline&#59; print the current line to defprint

!inc procline &#59; process lines with @@.

!inc isfile   &#59; part of checking for file

!end





!topic eof

!eof

&#58;erexx

The rexx-script this makes is:

/* REXX Woven from zmk3.cmd by Wendy Krieger on 20060811 at 20&#58;25&#58;49 */

/*~ Parse winsetup.inf */

key=&#39;@@&#39;;null=&#39;*~*&#39;;true=&#39;*t*&#39;;false=&#39;*f*&#39;;infile=&#39;winsetup.inf&#39;;

target=&#39;\k-dos\build\mswfw\&#39;;uscore=&#39;_&#39;;outdir=&#39;r&#58;&#39;;

parse arg a1 a2&#59;  if stream&#40;a1&#39;\xmsmmgr.exe&#39;, &#39;c&#39;, &#39;query exists&#39;&#41; = &#34;&#34;

  then nop; else; do; target = a1; outdir = a2; end

call stream infile, &#39;c&#39;, &#39;open read&#39;

defprint = null; thisline = null;

do while lines&#40;infile&#41;

 incard = linein&#40;infile&#41;

if pos&#40;key, incard&#41; > 0

  then call procline

  else call printline

 end

call stream defprint, &#39;c&#39;, &#39;close&#39;

call stream infile, &#39;c&#39;, &#39;close&#39;

exit

printline&#58;&#59; select; when defprint = &#39;*&#39; then nop; when paused = true then nop&#59;

otherwise call lineout defprint, incard; end; return

procline&#58;&#59; parse var incard incard &#40;key&#41; cmdcard; parse var cmdcard 1 cmdx 2 testme;

if pos&#40; cmdx, &#39;*/&#39;&#41; = 0 then testme = cmdcard; parse var testme testme .;

select;

 when cmdx = &#39;*&#39; then call setprint

 when cmdx = &#39;/&#39; then call isfile testme, false

 otherwise call  isfile testme, true&#59; end

return

setprint&#58;&#59; select; when testme = &#39;/&#39; then paused = false; when testme = &#39;\&#39; then paused = true&#59; 

otherwise; call stream defprint, &#39;c&#39;, &#39;close&#39;; defprint = outdir&#39;\&#39;testme; paused = defprint;

call stream defprint, &#39;c&#39;, &#39;open write replace&#39;&#59; end; return

isfile&#58;; parse arg testfile, allow&#59;call testforme;

if exists = allow; then call printline; return

testforme&#58;&#59;exists = false; testme = testfile;

do while testme <> &#34;&#34;; parse var testme test1 &#39;,&#39; testme;

test2 = reverse&#40;test1&#41;; parse var test2 1 . 2 test2;

test2 = reverse&#40;test2&#41; || uscore&#59; select;

  when stream&#40; target || test2, &#39;c&#39;, &#39;query exists&#39;&#41; <> &#39;&#39; then exists = true

  when stream&#40; target || test1, &#39;c&#39;, &#39;query exists&#39;&#41; <> &#39;&#39; then exists = true

  otherwise; nop; end

 if exists = true then leave; end&#59;return


#10 wendy

wendy

    Frequent Member

  • Lady
  • 266 posts
  • Location:one mile from the QR main line
  • Interests:Operating systems, Weights and Measures, Geometry
  •  
    Australia

Posted 02 December 2013 - 08:26 AM

I have decided to rebuild the installs to match the new style of running Windows 3.1x.  It is most successful, and installs and runs faster. 

 

The new style consists of moving as much as possible to a different directory, which can be moved later in the PATH environment.  These files are simply copied.  Likewise, the bitmaps are stored off-path, and we use Nevernever's PAPER utility to set these.

 

If the setup can see these in the path, it will still create icons for them, even though they never have been copied across.  None the less, the style is to use something like DDESCRPT to pass progman.dde calls to the shell, to delete and create the groups.

 

There's still a number of installable items, (expand, moricons.dll, and the screen-savers), but most of the stuff ends up elsewhere.

 

We're looking at creating an other group to handle things like tcmd, winrexx, scriptease, and a mob of other utilities.


  • Nuno Brito likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users