source: trunk/minix/man/man8/dosminix.8@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 10.2 KB
RevLine 
[9]1.TH DOSMINIX 8
2.SH NAME
3dosminix, 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..
13This text describes running MINIX 3
14.\" or Minix-vmd
15under DOS. The DOS version
16of the Boot Monitor, described in
17.BR monitor (8),
18grabs as much memory as DOS is willing to give, loads MINIX 3 into that memory
19from the active partition of a "file as disk", and jumps to the MINIX 3 kernel
20to let MINIX 3 take control. As far as DOS is concerned MINIX 3 is just a part
21of the
22.B boot.com
23program.
24.PP
25In the example above
26.B disk0.mnx
27is the "file as disk". It is a file of many megabytes that is used by MINIX 3
28as a disk of four partitions. These partitions will normally be
29.B /dev/dosd1
30through
31.BR /dev/dosd4 ,
32with
33.BR /dev/dosd0
34for the whole "disk". The Boot Monitor will set the
35.B dosd0
36boot variable to the name of the disk (its first argument), the root file
37system will be the active partition, usually
38.BR dosd1 .
39It is better to use the special name
40.B bootdev
41to indicate this device, usually in the setting
42.BR rootdev = bootdev .
43.PP
44Once MINIX 3 is running it will operate the same as if started from a regular
45disk partition until it is shut down. On shutdown from protected mode it
46will return to the Boot Monitor prompt, and with the
47.B exit
48command you leave the Boot Monitor and return to DOS. Shutting down from
49real 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
52MINIX 3 can't run in protected mode (286 or 386 mode) if DOS is using a memory
53manager like
54.BR EMM386 .
55You can either temporarily comment out EMM386 from
56.BR CONFIG.SYS ,
57or you can press
58.B F8
59on startup to bypass CONFIG.SYS. This is only possible with the later DOS
60versions.
61.SS "Windows 95"
62Press F8 at startup to make the boot menu visible. Choose
63"\fBCommand prompt\fP", or "\fBSafe mode command prompt\fP" to run DOS.
64Use the "safe mode" if EMM386 is started in CONFIG.SYS.
65.PP
66Typing F8 at the right moment isn't easy, so you may want to change the way
67Windows boots by editing the
68.B MSDOS.SYS
69file found in the root directory of your Windows system. This is alas not
70trivial.
71Open 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
74several other hidden files. Right-click on the MSDOS.SYS icon, choose
75"\fBProperties\fP" and disable "\fBRead-only\fP". Bring MSDOS.SYS into a
76simple text editor such as Notepad. In the
77.B "[Options]"
78segment add the following lines (or change existing lines into):
79.PP
80.RS
81.nf
82BootMenu=2
83BootMenuDelay=5
84.fi
85.RE
86.PP
87The first setting makes the Windows boot menu always visible, and the second
88line changes the delay before booting to 5 seconds. Take care not to change
89anything else, or things will go horribly wrong. Save MSDOS.SYS and exit.
90Don't forget to make MSDOS.SYS read-only again, and also hide all the hidden
91files again, unless you like it this way.
92.SS "DOS compatibility box"
93The 16-bit version of standard MINIX 3 can be run in real mode in a DOS box.
94This is somewhat surprising, because it means Windows 95 simulates devices
95like the keyboard, timer, and interrupt controller well enough to fool MINIX 3
96into thinking that all is well. Alas it doesn't work as well under Windows
97NT. Keypresses get lost if you type to fast, and using the floppy
98occasionally locks MINIX 3 up. This is a bit disappointing, because it is the
99only way to run MINIX 3 under NT. Under Windows 95 one is better off
100putting the system in DOS at boot and then to run MINIX 3 in protected mode.
101.PP
102One thing that is better under NT is that the Boot Monitor is able to get a
103so-called "Upper Memory Block", thereby raising useful memory to about 750K.
104Windows 95 however hogs leftover UMB memory in a process named
105.BR vmm32 ,
106whatever that may be. To get
107some of this memory you can put
108.B "BOOT /U"
109at the start of
110.BR autoexec.bat .
111The monitor will grab a 64K UMB if it can get it, and keep that memory safe
112for use by MINIX 3 when it is later started from Windows.
113.PP
114The easiest way to start MINIX 3 is to give all MINIX 3 disk files the suffix
115.BR MNX .
116Doubleclick on the disk you want to run to make the "\fBOpen With\fP" window
117appear. Click on "\fBOther\fP" and browse to the
118.B BOOT.COM
119program. Set the name of the .mnx files to "\fBMINIX 3 "disk" file\fP" in the
120description box if you want everything right. In the future you can
121just click on a MINIX 3 disk file to run it, you don't have to start a DOS
122box 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
125When MINIX 3 shuts down it will try to reboot what it thinks is a PC. Windows
126seems to assume that the DOS session has exited. Right-click on the
127BOOT.COM program, "Properties", "Program", and enable "Close on exit" to make
128the DOS box disappear automatically when MINIX 3 thinks it reboots. You may
129also want to lock the font to
130.BR 7x12 ,
131or any other font that isn't ugly.
132.PP
133MINIX 3 disk files are opened in a write-exclusive mode. A second MINIX 3
134session can only open it read-only, which may lead to a "can't open
135root device" error.
136.SS "Mkfile"
137MINIX 3 disk files can be created or resized with the
138.B mkfile
139utility. Its two arguments are the size and name of the disk file. The
140size is a number optionally followed by the letter
141.BR k ,
142.BR m
143or
144.BR g
145to specify kilobytes, megabytes, or even gigabytes. So the call
146.PP
147.RS
148.B "mkfile 50m disk5.mnx"
149.RE
150.PP
151will create a 50 megabyte file named
152.BR disk5.mnx .
153If the file already exist then it is shrunk or grown to 50 megabytes. No
154data is lost if the file is grown. If the file is shrunk then only the data
155that is cut off is lost. These features allow one to inrease the size of a
156MINIX 3 /usr partition with the following recipe:
157.PP
158.RS
159.ta +24n+2m
160.nf
161copy disk0.mnx disk0.new Copy the disk to disk0.new
162mkfile 100M disk0.new Enlarge to 100 megabytes
163boot disk0.mnx Boot the old "disk"
164[ESC] Get the attention of the monitor
165dosd5=disk0.new /dev/dosd5 becomes disk0.new
166boot
167\&...
168login: root
169.fi
170.in +(24n+2m)
171.ti -(24n+2m)
172part Choose dosd5, move to the Size field of dosd7
173partition, hit 'm' to fill it out to the end of the "disk". Write and quit.
174.in -(24n+2m)
175.nf
176mkfs /dev/dosd7 Recreate the file system, but larger
177mount /dev/dosd7 /mnt
178cpdir -v /usr /mnt Copy /usr to the new disk's /usr to be
179shutdown Back to the monitor
180exit Back to DOS
181ren disk0.mnx disk0.old
182ren disk0.new disk0.mnx Replace old by new
183boot disk0.mnx Run the larger system
184.fi
185.RE
186.PP
187Now MINIX 3 runs from a larger "disk". Don't worry if it claims to have
188crashed, there wasn't a "shutdown" entry in /usr/adm/wtmp at the time it was
189copied.
190.PP
191The above recipe is for a ordinary standard MINIX 3 installation with /usr on
192the 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
201In the recipe above you saw how simple it is to create a new system, just
202copy a disk file. It is equally simple to make a backup, you just copy the
203disk file. To make a test system: copy the disk file. To make another test
204system: copy the disk file. Let friends have their own MINIX 3: copy the disk
205file again. (Exciting, eh?)
206.PP
207You may want to save a MINIX 3 disk file in a ZIP file to save space. It may
208look as a good idea to first run
209.B "make clean"
210in
211.B /usr/src
212to remove all the binary junk, but alas that has no effect at all.
213The disk file is compressed under DOS, and there it is unknown which blocks
214are in use and which are free. With the following trick you can make those
215deleted blocks compress really well:
216.PP
217.RS
218.nf
219cd /usr/tmp
220echo >junk
221while cat junk >>junk; do :; done
222sync
223rm junk
224.fi
225.RE
226.PP
227After these commands all free blocks contain newlines. Long runs of the
228same byte happen to compress by a factor 1000, so the unused disk blocks
229will 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"
239The dos disk driver, described in
240.BR dosd (4),
241has two identities. By default you get the "\fBfile\fP" driver, that uses
242DOS file I/O calls to access a large DOS file as a disk. The other
243alternative is the "\fBFAT\fP" driver. The FAT driver sits on top of an
244ordinary MINIX 3 disk driver, and interprets a partition as a FAT (File Access
245Table) file system to find a file to use as a MINIX 3 disk. The result
246has the same effect as the file driver, except that no costly calls to DOS
247are made. To enable this feature you have to use the following Boot
248environment settings:
249.PP
250.RS
251.nf
252dosd = fat
253dosd0 = hd1:\eminix\edisk0.mnx
254.fi
255.RE
256.PP
257The
258.B dosd
259setting tells MINIX 3 to use the FAT driver, and the
260.B dosd0
261setting tells the MINIX 3 device and DOS file name to use. Disk I/O should
262be sped up nicely by this change, although typical use of MINIX 3 doesn't
263require fast disk I/O, so the difference won't be too noticable.
264.PP
265Support for FAT-32 (big file system support added in the later Windows 95
266releases) has not been tested very well. The FAT-12 and FAT-16 code has
267been used a lot, and seems safe. Note the risks inherent in these
268drivers: The file driver uses simple DOS file I/O calls, leaving it to
269DOS to know its own file system. The FAT driver interprets FAT file system
270structures by itself. MINIX 3 booted from a real hard disk partition can
271only 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
277Use at your own risk.
278.SH BUGS
279Hasn't been tried under Windows 98 yet.
280.PP
281Pray the deity of your choice will forgive you for running a UNIX-like
282system as an ordinary DOS program. The author of this code is already
283doomed. When his time comes the daemons wi*(&%*$%*&
284.br
285Memory fault \- core dumped
286.SH AUTHOR
287Kees J. Bot (kjb@cs.vu.nl)
Note: See TracBrowser for help on using the repository browser.