1 | .TH DOSMINIX 8
|
---|
2 | .SH NAME
|
---|
3 | dosminix, mkfile \- Running MINIX 3 under DOS
|
---|
4 | .SH SYNOPSIS
|
---|
5 | .RB "C:\eMINIX> " "boot disk0.mnx" "\0\0\0\0\0(Typical example)"
|
---|
6 | .br
|
---|
7 | .RB "C:\eMINIX> " "mkfile \fIsize disk"
|
---|
8 | .SH DESCRIPTION
|
---|
9 | .de SP
|
---|
10 | .if t .sp 0.4
|
---|
11 | .if n .sp
|
---|
12 | ..
|
---|
13 | This text describes running MINIX 3
|
---|
14 | .\" or Minix-vmd
|
---|
15 | under DOS. The DOS version
|
---|
16 | of the Boot Monitor, described in
|
---|
17 | .BR monitor (8),
|
---|
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
|
---|
21 | of the
|
---|
22 | .B boot.com
|
---|
23 | program.
|
---|
24 | .PP
|
---|
25 | In the example above
|
---|
26 | .B disk0.mnx
|
---|
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
|
---|
29 | .B /dev/dosd1
|
---|
30 | through
|
---|
31 | .BR /dev/dosd4 ,
|
---|
32 | with
|
---|
33 | .BR /dev/dosd0
|
---|
34 | for the whole "disk". The Boot Monitor will set the
|
---|
35 | .B dosd0
|
---|
36 | boot variable to the name of the disk (its first argument), the root file
|
---|
37 | system will be the active partition, usually
|
---|
38 | .BR dosd1 .
|
---|
39 | It is better to use the special name
|
---|
40 | .B bootdev
|
---|
41 | to indicate this device, usually in the setting
|
---|
42 | .BR rootdev = bootdev .
|
---|
43 | .PP
|
---|
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
|
---|
47 | .B exit
|
---|
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.)
|
---|
51 | .SS EMM386
|
---|
52 | MINIX 3 can't run in protected mode (286 or 386 mode) if DOS is using a memory
|
---|
53 | manager like
|
---|
54 | .BR EMM386 .
|
---|
55 | You can either temporarily comment out EMM386 from
|
---|
56 | .BR CONFIG.SYS ,
|
---|
57 | or you can press
|
---|
58 | .B F8
|
---|
59 | on startup to bypass CONFIG.SYS. This is only possible with the later DOS
|
---|
60 | versions.
|
---|
61 | .SS "Windows 95"
|
---|
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.
|
---|
65 | .PP
|
---|
66 | Typing F8 at the right moment isn't easy, so you may want to change the way
|
---|
67 | Windows boots by editing the
|
---|
68 | .B MSDOS.SYS
|
---|
69 | file found in the root directory of your Windows system. This is alas not
|
---|
70 | trivial.
|
---|
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
|
---|
77 | .B "[Options]"
|
---|
78 | segment add the following lines (or change existing lines into):
|
---|
79 | .PP
|
---|
80 | .RS
|
---|
81 | .nf
|
---|
82 | BootMenu=2
|
---|
83 | BootMenuDelay=5
|
---|
84 | .fi
|
---|
85 | .RE
|
---|
86 | .PP
|
---|
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.
|
---|
101 | .PP
|
---|
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
|
---|
105 | .BR vmm32 ,
|
---|
106 | whatever that may be. To get
|
---|
107 | some of this memory you can put
|
---|
108 | .B "BOOT /U"
|
---|
109 | at the start of
|
---|
110 | .BR autoexec.bat .
|
---|
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.
|
---|
113 | .PP
|
---|
114 | The easiest way to start MINIX 3 is to give all MINIX 3 disk files the suffix
|
---|
115 | .BR MNX .
|
---|
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
|
---|
118 | .B BOOT.COM
|
---|
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.)
|
---|
124 | .PP
|
---|
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
|
---|
130 | .BR 7x12 ,
|
---|
131 | or any other font that isn't ugly.
|
---|
132 | .PP
|
---|
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
|
---|
135 | root device" error.
|
---|
136 | .SS "Mkfile"
|
---|
137 | MINIX 3 disk files can be created or resized with the
|
---|
138 | .B mkfile
|
---|
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
|
---|
141 | .BR k ,
|
---|
142 | .BR m
|
---|
143 | or
|
---|
144 | .BR g
|
---|
145 | to specify kilobytes, megabytes, or even gigabytes. So the call
|
---|
146 | .PP
|
---|
147 | .RS
|
---|
148 | .B "mkfile 50m disk5.mnx"
|
---|
149 | .RE
|
---|
150 | .PP
|
---|
151 | will create a 50 megabyte file named
|
---|
152 | .BR disk5.mnx .
|
---|
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:
|
---|
157 | .PP
|
---|
158 | .RS
|
---|
159 | .ta +24n+2m
|
---|
160 | .nf
|
---|
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
|
---|
166 | boot
|
---|
167 | \&...
|
---|
168 | login: root
|
---|
169 | .fi
|
---|
170 | .in +(24n+2m)
|
---|
171 | .ti -(24n+2m)
|
---|
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.
|
---|
174 | .in -(24n+2m)
|
---|
175 | .nf
|
---|
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
|
---|
180 | exit Back to DOS
|
---|
181 | ren disk0.mnx disk0.old
|
---|
182 | ren disk0.new disk0.mnx Replace old by new
|
---|
183 | boot disk0.mnx Run the larger system
|
---|
184 | .fi
|
---|
185 | .RE
|
---|
186 | .PP
|
---|
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
|
---|
189 | copied.
|
---|
190 | .PP
|
---|
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
|
---|
195 | .\" .B mkfs
|
---|
196 | .\" command requires a
|
---|
197 | .\" .B "-t\ 2f"
|
---|
198 | .\" option to specify the file system type as "V2 flex", and it knows if
|
---|
199 | .\" it has crashed or not.
|
---|
200 | .SS Backups
|
---|
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?)
|
---|
206 | .PP
|
---|
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
|
---|
209 | .B "make clean"
|
---|
210 | in
|
---|
211 | .B /usr/src
|
---|
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:
|
---|
216 | .PP
|
---|
217 | .RS
|
---|
218 | .nf
|
---|
219 | cd /usr/tmp
|
---|
220 | echo >junk
|
---|
221 | while cat junk >>junk; do :; done
|
---|
222 | sync
|
---|
223 | rm junk
|
---|
224 | .fi
|
---|
225 | .RE
|
---|
226 | .PP
|
---|
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
|
---|
231 | .\" .PP
|
---|
232 | .\" .RS
|
---|
233 | .\" cp /dev/zero junk
|
---|
234 | .\" .RE
|
---|
235 | .\" .PP
|
---|
236 | .\" instead of the echo/while pair of lines above. Standard MINIX 3 doesn't have
|
---|
237 | .\" /dev/zero.
|
---|
238 | .SS "FAT driver"
|
---|
239 | The dos disk driver, described in
|
---|
240 | .BR dosd (4),
|
---|
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:
|
---|
249 | .PP
|
---|
250 | .RS
|
---|
251 | .nf
|
---|
252 | dosd = fat
|
---|
253 | dosd0 = hd1:\eminix\edisk0.mnx
|
---|
254 | .fi
|
---|
255 | .RE
|
---|
256 | .PP
|
---|
257 | The
|
---|
258 | .B dosd
|
---|
259 | setting tells MINIX 3 to use the FAT driver, and the
|
---|
260 | .B dosd0
|
---|
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.
|
---|
264 | .PP
|
---|
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.
|
---|
272 | .SH "SEE ALSO"
|
---|
273 | .BR dosd (4),
|
---|
274 | .BR monitor (8),
|
---|
275 | .BR usage (8).
|
---|
276 | .SH NOTES
|
---|
277 | Use at your own risk.
|
---|
278 | .SH BUGS
|
---|
279 | Hasn't been tried under Windows 98 yet.
|
---|
280 | .PP
|
---|
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*(&%*$%*&
|
---|
284 | .br
|
---|
285 | Memory fault \- core dumped
|
---|
286 | .SH AUTHOR
|
---|
287 | Kees J. Bot (kjb@cs.vu.nl)
|
---|