3 dosminix, mkfile \- Running MINIX 3 under DOS
5 .RB "C:\eMINIX> " "boot disk0.mnx" "\0\0\0\0\0(Typical example)"
7 .RB "C:\eMINIX> " "mkfile \fIsize disk"
13 This text describes running MINIX 3
15 under DOS. The DOS version
16 of the Boot Monitor, described in
18 grabs as much memory as DOS is willing to give, loads MINIX 3 into that memory
19 from the active partition of a "file as disk", and jumps to the MINIX 3 kernel
20 to let MINIX 3 take control. As far as DOS is concerned MINIX 3 is just a part
27 is the "file as disk". It is a file of many megabytes that is used by MINIX 3
28 as a disk of four partitions. These partitions will normally be
34 for the whole "disk". The Boot Monitor will set the
36 boot variable to the name of the disk (its first argument), the root file
37 system will be the active partition, usually
39 It is better to use the special name
41 to indicate this device, usually in the setting
42 .BR rootdev = bootdev .
44 Once MINIX 3 is running it will operate the same as if started from a regular
45 disk partition until it is shut down. On shutdown from protected mode it
46 will return to the Boot Monitor prompt, and with the
48 command you leave the Boot Monitor and return to DOS. Shutting down from
49 real mode will reboot the machine, just like when run from a disk partition.
50 (This more or less crashes DOS, but DOS is used to such abuse.)
52 MINIX 3 can't run in protected mode (286 or 386 mode) if DOS is using a memory
55 You can either temporarily comment out EMM386 from
59 on startup to bypass CONFIG.SYS. This is only possible with the later DOS
62 Press F8 at startup to make the boot menu visible. Choose
63 "\fBCommand prompt\fP", or "\fBSafe mode command prompt\fP" to run DOS.
64 Use the "safe mode" if EMM386 is started in CONFIG.SYS.
66 Typing F8 at the right moment isn't easy, so you may want to change the way
67 Windows boots by editing the
69 file found in the root directory of your Windows system. This is alas not
71 Open a window on your main drive, click on "\fBView\fP" and choose
72 "\fBOptions\fP." In the Options window choose "\fBView\fP" and enable
73 "\fBShow all files\fP". The MSDOS.SYS file should now be visible, among
74 several other hidden files. Right-click on the MSDOS.SYS icon, choose
75 "\fBProperties\fP" and disable "\fBRead-only\fP". Bring MSDOS.SYS into a
76 simple text editor such as Notepad. In the
78 segment add the following lines (or change existing lines into):
87 The first setting makes the Windows boot menu always visible, and the second
88 line changes the delay before booting to 5 seconds. Take care not to change
89 anything else, or things will go horribly wrong. Save MSDOS.SYS and exit.
90 Don't forget to make MSDOS.SYS read-only again, and also hide all the hidden
91 files again, unless you like it this way.
92 .SS "DOS compatibility box"
93 The 16-bit version of standard MINIX 3 can be run in real mode in a DOS box.
94 This is somewhat surprising, because it means Windows 95 simulates devices
95 like the keyboard, timer, and interrupt controller well enough to fool MINIX 3
96 into thinking that all is well. Alas it doesn't work as well under Windows
97 NT. Keypresses get lost if you type to fast, and using the floppy
98 occasionally locks MINIX 3 up. This is a bit disappointing, because it is the
99 only way to run MINIX 3 under NT. Under Windows 95 one is better off
100 putting the system in DOS at boot and then to run MINIX 3 in protected mode.
102 One thing that is better under NT is that the Boot Monitor is able to get a
103 so-called "Upper Memory Block", thereby raising useful memory to about 750K.
104 Windows 95 however hogs leftover UMB memory in a process named
106 whatever that may be. To get
107 some of this memory you can put
111 The monitor will grab a 64K UMB if it can get it, and keep that memory safe
112 for use by MINIX 3 when it is later started from Windows.
114 The easiest way to start MINIX 3 is to give all MINIX 3 disk files the suffix
116 Doubleclick on the disk you want to run to make the "\fBOpen With\fP" window
117 appear. Click on "\fBOther\fP" and browse to the
119 program. Set the name of the .mnx files to "\fBMINIX 3 "disk" file\fP" in the
120 description box if you want everything right. In the future you can
121 just click on a MINIX 3 disk file to run it, you don't have to start a DOS
122 box first. (To make it perfect use "View", "Options", "File Types", choose
123 "MINIX 3 "disk" file", "Edit", "Change Icon", "Browse", select MINIX.ICO.)
125 When MINIX 3 shuts down it will try to reboot what it thinks is a PC. Windows
126 seems to assume that the DOS session has exited. Right-click on the
127 BOOT.COM program, "Properties", "Program", and enable "Close on exit" to make
128 the DOS box disappear automatically when MINIX 3 thinks it reboots. You may
129 also want to lock the font to
131 or any other font that isn't ugly.
133 MINIX 3 disk files are opened in a write-exclusive mode. A second MINIX 3
134 session can only open it read-only, which may lead to a "can't open
137 MINIX 3 disk files can be created or resized with the
139 utility. Its two arguments are the size and name of the disk file. The
140 size is a number optionally followed by the letter
145 to specify kilobytes, megabytes, or even gigabytes. So the call
148 .B "mkfile 50m disk5.mnx"
151 will create a 50 megabyte file named
153 If the file already exist then it is shrunk or grown to 50 megabytes. No
154 data is lost if the file is grown. If the file is shrunk then only the data
155 that is cut off is lost. These features allow one to inrease the size of a
156 MINIX 3 /usr partition with the following recipe:
161 copy disk0.mnx disk0.new Copy the disk to disk0.new
162 mkfile 100M disk0.new Enlarge to 100 megabytes
163 boot disk0.mnx Boot the old "disk"
164 [ESC] Get the attention of the monitor
165 dosd5=disk0.new /dev/dosd5 becomes disk0.new
172 part Choose dosd5, move to the Size field of dosd7
173 partition, hit 'm' to fill it out to the end of the "disk". Write and quit.
176 mkfs /dev/dosd7 Recreate the file system, but larger
177 mount /dev/dosd7 /mnt
178 cpdir -v /usr /mnt Copy /usr to the new disk's /usr to be
179 shutdown Back to the monitor
181 ren disk0.mnx disk0.old
182 ren disk0.new disk0.mnx Replace old by new
183 boot disk0.mnx Run the larger system
187 Now MINIX 3 runs from a larger "disk". Don't worry if it claims to have
188 crashed, there wasn't a "shutdown" entry in /usr/adm/wtmp at the time it was
191 The above recipe is for a ordinary standard MINIX 3 installation with /usr on
192 the second and last partition.
193 .\" Minix-vmd usually has /usr on the third and
194 .\" last partition (dosd3 / dosd8), its
196 .\" command requires a
198 .\" option to specify the file system type as "V2 flex", and it knows if
199 .\" it has crashed or not.
201 In the recipe above you saw how simple it is to create a new system, just
202 copy a disk file. It is equally simple to make a backup, you just copy the
203 disk file. To make a test system: copy the disk file. To make another test
204 system: copy the disk file. Let friends have their own MINIX 3: copy the disk
205 file again. (Exciting, eh?)
207 You may want to save a MINIX 3 disk file in a ZIP file to save space. It may
208 look as a good idea to first run
212 to remove all the binary junk, but alas that has no effect at all.
213 The disk file is compressed under DOS, and there it is unknown which blocks
214 are in use and which are free. With the following trick you can make those
215 deleted blocks compress really well:
221 while cat junk >>junk; do :; done
227 After these commands all free blocks contain newlines. Long runs of the
228 same byte happen to compress by a factor 1000, so the unused disk blocks
229 will almost disappear in the ZIP file.
230 .\" Under Minix-vmd you can use
233 .\" cp /dev/zero junk
236 .\" instead of the echo/while pair of lines above. Standard MINIX 3 doesn't have
239 The dos disk driver, described in
241 has two identities. By default you get the "\fBfile\fP" driver, that uses
242 DOS file I/O calls to access a large DOS file as a disk. The other
243 alternative is the "\fBFAT\fP" driver. The FAT driver sits on top of an
244 ordinary MINIX 3 disk driver, and interprets a partition as a FAT (File Access
245 Table) file system to find a file to use as a MINIX 3 disk. The result
246 has the same effect as the file driver, except that no costly calls to DOS
247 are made. To enable this feature you have to use the following Boot
248 environment settings:
253 dosd0 = hd1:\eminix\edisk0.mnx
259 setting tells MINIX 3 to use the FAT driver, and the
261 setting tells the MINIX 3 device and DOS file name to use. Disk I/O should
262 be sped up nicely by this change, although typical use of MINIX 3 doesn't
263 require fast disk I/O, so the difference won't be too noticable.
265 Support for FAT-32 (big file system support added in the later Windows 95
266 releases) has not been tested very well. The FAT-12 and FAT-16 code has
267 been used a lot, and seems safe. Note the risks inherent in these
268 drivers: The file driver uses simple DOS file I/O calls, leaving it to
269 DOS to know its own file system. The FAT driver interprets FAT file system
270 structures by itself. MINIX 3 booted from a real hard disk partition can
271 only use DOS disk files through the FAT driver.
277 Use at your own risk.
279 Hasn't been tried under Windows 98 yet.
281 Pray the deity of your choice will forgive you for running a UNIX-like
282 system as an ordinary DOS program. The author of this code is already
283 doomed. When his time comes the daemons wi*(&%*$%*&
285 Memory fault \- core dumped
287 Kees J. Bot (kjb@cs.vu.nl)