add directory Minix

This commit is contained in:
gohigh
2024-02-19 00:21:39 -05:00
parent 56596ada90
commit 5a46ddb732
2923 changed files with 1764412 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,48 @@
Welcome to Bochs, an 80386 emulator!
Bochs is a portable x86 emulator, which runs Minix-386 and
MS-DOS/Windows. You can compile and run Bochs on almost
any Unix & X Windows environment.
Since software emulation is very performance sensitive, it is
recommended that you run Bochs on at least a 100Mhz machine,
with a minimum of 32MBytes of physical memory. Additionally,
you'll need a couple Megabytes of disk space to uncompress and
compile the Bochs distribution, plus 10 to 30 Megabytes for
the creation of hard disk image files, depending upon the option
you choose.
Installation begins with the BOCHS.TAZ file. It is a compressed
tar format file, of the entire Bochs source distribution. You
need to compile Bochs for your platform before using it. To
extract the source code, change directory into a parent directory
in which Bochs will be untarred:
unix:/> cd /usr/local/src
-or
unix:/> cd /users/JohnDoe/src
Uncompress and untar Bochs:
unix:/usr/local/src> zcat BOCHS.TAZ | tar xvf -
You should now have a sub-directory 'bochs-YYMMDD'. Change directory
into it, and read the files 'INSTALL.MINIX386' & 'INSTALL' for further
detailed installation notes. For uses of Bochs, outside of running
the version of Minix on this CD, please consult the file 'LICENSE'.
The file 'INSTALL.DOS_WIN31' may also be of interest.
Thanks for your interest in using Bochs! Current versions of Bochs
as well as other relevant information may be obtained at the following
Web and ftp sites. Feel free to give me feedback on portability and
other relevant issues. I'd like to continually enhance Bochs, and
add to its general portability.
http://world.std.com/~bochs
ftp://ftp.std.com/pub/bochs
Kevin Lawton
Bochs Software Company
bochs@world.std.com

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,37 @@
This package consists of a 16-bit Pascal compiler, a 32-bit Pascal-to-C
translator, a debugger, and a C and C++ interpreter. It was written
by Henrik Quintel. Comments and questions should be directed to him at
quintel@fh-worms.de. His URL is http://www.fh-worms.de/quintel/
The file READMES.TAZ, which you should now have on a floppy, is a compressed
tar archive containing the following README files:
README.TXT - This file
READMES.TAZ - Compressed tar file containing the following five files:
README.PAS-16 - What you should know about the pascal
compiler/interpreter/debugger for the OS-16-Bit version
(PASCAL16.TAR)
README.PAS-32 - What you should know about the pascal
compiler/interpreter/debugger for the OS-32-Bit version
(PASCAL32.TAR)
USING.QDB - What you should know about using the debugger.
README.CC++EXE - What you should know about the C and C++ interpreter.
(CCPPEXEC.TAR)
README.FUTURE - What you should know about my work
README.TQ - What you should know about TQ (in German only)
To install part of this software, insert the floppy containing README.TAZ,
in drive 0 (the a: drive) and type:
vol -r /dev/fd0 | uncompress | tar xvfp -
Then read the appropriate file.
For more information, please contact Henrik Quintel <quintel@Fh-Worms.DE>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,26 @@
INFORMATION on mdb version 2.6.0 (Sept 9/96).
MDB is the MINIX debugger which allows you to place breakpoints and
control the execution of a program. It has a lot of the features that
you would expect in a program debugger; for example, stack traces and
single step execution.
The current version works with MINIX for PC and was developed and tested
under MINIX 1.7.x (32 bit version). It should work with 16 bit MINIX.
How to Install
1) Place MDB.TAZ on a floppy with FDVOL
2) Boot Minix, login as bin and type: setup /usr/local/src
3) Move to /usr/local/src/mdb and review additional information in the
README file.
4) Edit Makefile for Compiler and extra options as required.
5) make
6) make install
7) make install_man
Comments to:
Philip Murton.
philip.murton@utoronto.ca
\

View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

View File

@@ -0,0 +1,197 @@
Table of Errors:
Most of these will prevent the hard disk from working correctly under DOS, so
it's not likely that you ever get these errors.
Invalid root sector signature
The last two bytes of the root sector should be 55 AA (hex).
This is a serious error and usually prevents the hard disk from being
accessible under DOS. You can use 'fdisk /mbr' after booting from a
floppy disk to write a correct root sector.
Calculation error
Oops, this is a bug in FIPS. The changed root sector is defective. Please
send a bug report to schaefer@rbg.informatik.th-darmstadt.de
Overlapping partitions
The partition table contains overlapping partitions. This is a serious
problem and should not happen.
Invalid jump instruction in boot sector
The first three bytes of the boot sector must be a 3-byte jump (E9 xx xx)
or a 2-byte jump (EB xx 90). Perhaps the partition is not yet formatted.
FIPS can only split DOS-formatted partitions.
Invalid boot sector
The last two bytes of the boot sector must be 55 AA (hex)
Can't handle number of bytes per sector
The number of bytes per sector must be 512
Number of sectors per cluster must be a power of 2
Only 1, 2, 4, 8, 16, 32, 64 or 128 are allowed
Partition must have 2 FATs
Every DOS partition has 2 copies of the FAT
Number of root directory entries must not be zero
Sounds reasonable, doesn't it?
Number of hidden sectors incorrect
The number of hidden sectors in the boot sector must match the number
of the start sector in the partition table
12-bit FAT not supported
FIPS can't split partitions with a 12-bit FAT
Number of sectors (short) must be zero
For partitions with more than 65536 sectors (BIGDOS) the number of sectors
(short) must be zero
Number of sectors (short) does not match partition info
The number of sectors in the partition table must match the number of
sectors in the boot sector
Number of sectors (long) does not match partition info
The number of sectors in the partition table must match the number of
sectors in the boot sector
Invalid drive number
Only the numbers 128 - 255 are valid drive numbers
Error reading FAT 1
Read error - bad sector
Error reading FAT 2
Read error - bad sector
FAT copies differ
The two copies of the FAT differ - use 'chkdsk /f' to correct this
New partition not empty
The New Partition is not empty. Apparently this is a bug in FIPS, since
the empty space of the partition has been determined before. Please
send a bug report to schaefer@rbg.informatik.th-darmstadt.de
Too many drives found
FIPS can handle up to 9 drives - that should be enough for most PCs :-)
No compatible hard disk found
Hey, where is your drive? Perhaps your hard disk is not int 13h compatible.
No valid partition found
All partitions in the partition table are empty
No free partition
All four partitions are in use
Error reading drive geometry
Interrupt 13h 08h returned an error code
Drive initialization failure
Interrupt 13h 00h returned an error code
Error reading root sector
Read error - bad sector, wrong drive number or incompatible harddrive
Can't split extended partitions
FIPS can not yet split extended DOS partitions
Unknown file system
Only DOS partitions can be split (system indicator byte must be 4 or 6)
Error reading boot sector
Read error - bad sector
Partition too small - can't split
If the partition has only slightly more than 4085 clusters, it can't be
split any further without rewriting the FAT to 12 bit.
Last cylinder is not free
Since the new partition is created at the end of the old one and
contains at least one cylinder, the partition can not be split if
not at least the very last cylinder is completely free.
Probably there is a hidden file like 'image.idx' or 'mirorsav.fil'
in the last cylinder - see the doc.
Error writing root sector
Write error - perhaps the disk is write protected?
Error writing boot sector
Write error :-( - this will hopefully never happen ...
Too many save files on disk
There can only be ten save files on one floppy disk (rootboot.000 to
rootboot.009). Delete some or use another floppy disk.
Can't open file
FIPS tried to write the file rootboot.00? to drive A: but an error occured
Try using another floppy disk
Error writing file
FIPS tried to write the file rootboot.00? to drive A: but an error occured
Try using another floppy disk
Error closing file
FIPS tried to write the file rootboot.00? to drive A: but an error occured
Try using another floppy disk
Warnings:
These will not cause FIPS to exit, since they are not really errors. If you
have the possibility to correct the problem, do it; if not, this will not
affect DOS, so you should be safe.
More than one active partition
More than one partition is marked 'active' in the partition table.
There are some boot programs that do not complain about more than one
active partition - they will just use the first one. If you have such
a program in your root sector and the PC boots normally, you may ignore
this message. Otherwise use fdisk to correct the error.
Invalid active flag
The 'active' flag of a partition should be either 80h or 0.
By modifying the active flag and the boot program it is theoretically
possible to boot from the second harddrive. If you happen to have such
a configuration, ignore this message. Otherwise you can delete the flag
now.
Partition table inconsistency
FIPS has detected that the 'physical' start or end sector (head/cylinder/
sector) do not match with the 'logical' start/end sector. This is not
an error since the 'physical' values are redundant and not used anyway.
There are many configurations where the values differ. This message is
meant only to inform you that FIPS has adapted the 'physical' values
according to the current drive geometry. So don't be alarmed by an unex-
pected cylinder range.
Invalid partition entry
The partition entry contains data, but the system indicator is 0 (empty).
Attention: FIPS will possibly overwrite this entry. Make sure this is no
valid Partition (temporarily disabled etc.)
No active partition
No partition in the partition table is marked active. Normally you will
not be able to boot from this disk. Use fdisk to correct that.
Partition does not end on cylinder boundary
All partitions should end on a cylinder boundary
Partition does not begin on cylinder boundary
Normally, all partitions except the first one should begin on head 0,
sector 1 of a cylinder. This is not required by DOS, however.
Free space between partitions
There is free space on the harddisk that is not covered by a partition
Number of reserved sectors should be 1
The boot sector uses only 1 sector, so the number of reserved sector
is usually 1. If you can access your drive, do not attempt to change this.
Number of root directory entries must be multiple of 16
One sector of the root directory contains 16 entries. An invalid number
of root directory entries is accepted by DOS but causes problems.
Wrong media descriptor byte in boot sector
The media descriptor byte should be F8h for a harddisk, but other values
like FCh are accepted by DOS (perhaps used for removable media ?).
FAT too large
Since the number of sectors per FAT is a 2 byte number, it is theoretically
possible to have up to 65535 sectors per FAT. A number of FAT sectors
greater than 256 is accepted by DOS, but not useful, since the largest
possible FAT has 2 bytes * 64K entries = 128K = 256 * 512 bytes. If you can
access the drive, do not attempt to change this.
FAT too small
If the number of clusters in the partition is larger than there are entries
in the FAT, DOS uses only part of the partition. Something has gone *very*
wrong with this partition, but all is not lost - reduce the partition to a
size that can be properly managed.
Sectors per track incorrect
The number of sectors per track in the boot sector does not match the actual
drive geometry reported by the BIOS
Number of drive heads incorrect
The number of drive heads in the boot sector does not match the actual
drive geometry reported by the BIOS
Wrong system indicator byte
For BIGDOS Partitions the System Indicator Byte should be 6; for DOS16
Partitions it should be 4
Wrong signature
Partitions with 32-bit sector numbers (since DOS 4.0+) have an 'extended
Bios Parameter Block' in the boot sector, its signature byte is 29h. This
is however totally ignored by DOS.
Drive number in boot sector does not match actual drive number
The drive number in the boot sector does not match the drive number by which
the drive is accessed
Wrong media descriptor byte in FAT
The first byte of each FAT is the Media Descriptor - it should be F8h
for a hard disk, but other values like FCh are accepted by DOS (perhaps
used for removable media ?).
Wrong FAT entries 1 & 2
A 16-bit FAT should start with F8 FF FF FF
Can't open debug file
The debug file is created in the current directory - make sure it is
writable

View File

@@ -0,0 +1,523 @@
Welcome to FIPS
The First nondestructive Interactive Partition Splitting program
Version 1.5
august 22, 1995
Copyright 1993-95 by Arno Schaefer
0. What you need to use FIPS
1. Introduction
2. What FIPS does
3. Safety
4. Restrictions
5. Before you start
6. Use with a multitasking OS
7. Using FIPS
8. After splitting the partition
9. Commandline Switches
10. Troubleshooting
11. Credits
In file SPECIAL.DOC:
S1. Use with Stacker/SuperStor/Doublespace etc.
S2. Use with OS/2
S3. Use with OnTrack Disk Manager and similar drivers
FIPS is a program designed to split an existing DOS partition without deleting
the data on it.
FIPS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
FIPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FIPS; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
0. What you need to use FIPS
You need a defragmentation program in order to move all data to the beginning
of the hard disk. FIPS will only split your partition if you have enough free
space at the end. DOS 6.0 and later contains DEFRAG, which is suitable for
this purpose. Other suitable programs are Norton Speedisk (actually DEFRAG
is speedisk with less functions, licensed from Norton), PCTools' Compress,
DISKOPT in Novell DOS 7, or the shareware programs ORG, DOG or SAFPAK
(available by anonymous FTP from any SimTel mirror in the diskutil directory).
I did not test these however, so don't blame me if they don't work for you.
You may also want to use a program like Norton Disk Doctor (or 'scandisk'
in DOS 6.2) to check your harddisk before and after using FIPS.
FIPS was developed under DOS 5.0. It should work fine with anything above
3.0, perhaps even with 2.0. However it will not be of much use with older
DOS versions, since the large partition sizes are only available since DOS 4.
It has been reported to work with DOS 6.0 and 6.2 and Novell DOS 7. I have
also received reports about successful use with Windows95 partitions. Note
that the long filenames are no problem for FIPS, because it works on a
lower level where directory structure is of no concern. It is probably
sensible to boot from a DOS disk before using FIPS in such a setup (see 6.)
1. Introduction
The program was inspired by the Linux Project. When installing Linux on a
PC that was used for DOS / Windows, many people want to retain a smaller
partition for their DOS software. However, since most Harddisks contain
only one large partition, you would normally be required to do a complete
backup, erase the partition and build two (or more) new partitions. Then you
would restore the backup to one of the new partitions. On today's systems
with hard disk capacities of usually 500MB or more, a complete backup becomes
practically infeasible without large media like streamer tapes once the
drive has filled up to some considerable fraction. Even though many people
backup their most valuable date (a practice which I would highly recommend
in any case), the process of reinstalling all the software packages takes
many hours or even days.
FIPS was written to remedy this problem. You can now split a partition
without losing any data, provided there is enough free space for the new
partition at the end of the old one.
2. What FIPS does
FIPS reduces the size of a partition by changing some values in the
partition table and boot sector. It does not change the formatting of
the partition, especially not the cluster size and the size of the file
allocation table (FAT). Therefore the reduced partition will have a FAT
that is in part unused, but this is not a problem for DOS.
From the free space that is won by this, FIPS creates a new _primary_ DOS
partition.
If you want to use the new partition under a different OS (e.g. Linux), use
its supplied fdisk program to make any necessary changes (refer to the OS
manuals).
If you want to use the new partition under DOS/Windows, you can use it as
it is (after formatting!), but be aware of the following:
According to the official references, DOS can only have one primary
partition. All DOS versions (at least from v5.0 on) will happily work with
multiple primary partitions, but this is an 'undocumented feature'. If
you want to follow the official rules, you can delete the new partition with
fdisk and create an extended partition in its place.
There are reasons for having multiple primary partitions, among them the
possibility to boot from different partitions by changing the active par-
tition with fdisk.
Known problems with multiple primary partitions are:
- If you accidentally delete one primary partition with fdisk, you can not
easily recreate it, since fdisk will refuse to. There may be other fdisk
programs around that work, and if all else fails you can boot from a
Linux boot disk to run Linux' fdisk, but it is always a hassle.
- There exist some software packages that work with the partition table and
which may be confused by multiple primary partitions. Among them was SFS,
the 'Secure file system' by Peter Gutmann. I think Peter has made a change
to his program to accept some unusual configuration, but there may exist
other software packages that will have problems.
3. Safety
FIPS was specifically designed to provide a maximum of safety. On startup
it checks the Partition Table, Boot Sector and FAT for any inconsistencies.
If it finds anything suspicious, it will tell you so. If there are errors,
FIPS will not proceed.
You have the possibility to write backup copies of your root and boot sector
to a floppy disk before proceeding. If something goes wrong, you may restore
these with the program 'restorrb.exe' (see section 5). I strongly recommend
making use of this feature. It will also enable you to reverse the partition
split afterwards, so it might be a good idea to save the root/boot sector
image in a safe place.
FIPS checks for free space on the partition and will let you choose the
new start cylinder accordingly.
After having calculated the new partition table and boot sector, FIPS will
check everything again, so that possible bugs in the calculation may be
detected. Only if everything is ok, FIPS will ask for permission to write
the new root and boot sector.
4. Restrictions
FIPS will only work with Hard Disk BIOSes that use interrupt 13h for low
level harddisk access. This is true for almost all PCs. I have received
a report that an older Adaptec SCSI controller had a software driver
that worked on a higher level. In this case you can only hope to get a
new driver from Adaptec. This is no problem any more for all newer
Adaptecs (I personally use one).
FIPS will only work on disks with a sector size of 512 bytes.
It seems that DOS is prepared to deal with different sector sizes, but
so far I have never seen this.
FIPS will not split partitions with 12 bit FATs (you would not want to split
partitions with less than 10 MB, would you?).
FIPS will only split DOS partitions. Partition pable and boot sector must
conform to the MSDOS 3.0+ conventions. This is marked by the system
indicator byte in the partition table, it must have the value 4 (16 bit
sector number) or 6 (32 bit sector number).
It will especially *not* split Linux partitions.
FIPS does not yet work on extended DOS partitions. Support for these has
been planned for a long time, but I can't say when it will come.
FIPS will not work if you already have four partitions, since it needs one
free partition entry.
FIPS will not reduce the original partition to a size with less than 4085
clusters, because this would imply rewriting the 16 bit FAT to a 12 bit FAT.
5. Before you start
Run CHKDSK or (under DOS 6.2) SCANDISK on the partition you want to split.
If you have Norton Disk Doctor or something similar, you may use it alter-
natively. Make sure there remain no 'dead' clusters on the disk.
Prepare a bootable floppy disk in drive A:. Under DOS this is usually done
by giving the command 'sys a:' or 'format a:/s'. Under Windows NT or OS/2
this may be different, if in doubt check your manual or boot from a boot
disk from a DOS PC.
Copy the FIPS files RESTORRB.EXE, FIPS.EXE and ERRORS.TXT to this disk.
Test booting from the prepared floppy disk. Read you manual or ask a local
guru if you can't boot from floppy disk or if you can not access your hard
disk after booting (test this by giving the command 'dir c:', you should
see your hard disk's root directory). If all else fails, try using FIPS
after booting normally from the hard disk (a bit more risky, but sometimes
the last resort).
When you start FIPS (later!), you will be given the opportunity to write
backup copies of your root and boot sector to a file on drive A: called
ROOTBOOT.00x (where x stands for a digit from 0 to 9). If anything goes wrong
while using FIPS, you can restore the original configuration by booting from
the floppy and running RESTORRB. Please note: if you use FIPS more than once
(this is normally not necessary, but it may happen), more than one ROOTBOOT
file is written to the floppy disk. RESTORRB lets you choose which configu-
ration file to restore. The file RESTORRB.000 contains your original confi-
guration. Try not to confuse the versions.
You will need this backup file (ROOTBOOT.00x) if you want to undo the
partition split later.
But before starting FIPS you _must_ now defragment your Harddisk. All of the
space that will be used for the new partition must be free. Be aware that the
Windows Swapfile will not be moved by most defragmentation programs. You must
uninstall it (in the 386enhanced part of the Windows Control Panel) and rein-
stall it after using FIPS.
If you use IMAGE or MIRROR, the last sector of the hard disk contains a
hidden system file with a pointer to your mirror files. You _must_ delete this
file before using FIPS (it will be recreated the next time you run mirror).
Do 'attrib -r -s -h image.idx' or 'attrib -r -s -h mirorsav.fil' in the root
directory, then delete the file.
If FIPS does not offer as much disk space for creation of the new partition
as you would expect it to have, this may mean that
a. You still have too much data in the remaining partition. Consider making
the new partition smaller or deleting some of the data.
b. There are hidden files in the space of the new partition that have not
been moved by the defragmentation program. You can find the hidden files
on the disk by typeing the command 'dir /a:h /s' (and 'dir /a:s /s' for
the system files). Make sure to which program they belong. If a file is
a swap file of some program (e.g. NDOS) it is possible that it can be
safely deleted (and will be recreated automatically later when the need
arises). See your manual for details.
If the file belongs to some sort of copy protection, you must uninstall
the program to which it belongs and reinstall it after repartitioning.
I can't give you more aid in this - if you really can't figure out what
to do, contact me directly.
Attention! Do _not_ try to move DOS' hidden system files (ibmbio.com &
ibmdos.com or something similar). You may end up with a hard disk that
will not boot any more. Since these files are already in the first sectors
of the partition, it is not necessary to move them. In DOS 5.0 and later,
at least one of the system files _may_ be moved, but it is nevertheless a
good idea to leave it alone.
When you have run FIPS, you must reboot, so make sure to disable any
programs in the config.sys and autoexec.bat that write to the disk, in
particular mirror or image. Consider temporarily renaming these files.
Be aware that the location of your DOS partitions in the partition table may
change after using FIPS. If you use the new partition under DOS _and_ you
have an extended partition and/or two drives, this means that the names of
the partitions may change (e.g. D: may become E:). I have taken care that C:
always remains C:, so that you will still be able to boot.
Also if you have a CD-ROM, it will in most cases change its drive letter.
If you use the /L switch to explicitly specify the drive letter in the call
to MSCDEX in the autoexec.bat file, you might have to change it accordingly.
If you don't use the /L switch, MSCDEX will automatically choose the first
free letter, so that you do not need to change anything.
Apropos drive letters: DOS uses the following order to assign them:
1. The first primary partition on each drive
2. The volumes inside the extended partitions on all drives
3. The remaining primary partitions on all drives
Example:
C: first primary partition on first HD
D: first primary partition on second HD
E: first volume in extended partition on first HD
F: second volume in extended partition on first HD
G: first volume in extended partition on second HD
H: second primary partition on second HD
I: CD ROM
I am not aware of an easy way to change this scheme. In particular you
can not assign an arbitrary drive letter to a partition. You can however
influence the ordering by changing a primary partition into an extended one.
For Linux users:
The possible change of the location of the DOS paritition in the partition
table also means that the device number of the DOS partition under Linux may
change (e.g. /dev/hda3 may become /dev/hda1). Any existing Linux partitions
will not change, so that you will have no trouble booting. You just need to
edit your /etc/fstab file if you mount your DOS partition on bootup.
6. Use with a multitasking OS
You should not use FIPS in multitasking environments like OS/2, Desqview,
Windows, Novell Task Manager or the Linux DOS Emulator. These systems might
still write to the disk after FIPS has changed the hard disk structure,
which may result in corrupting the disk. This is not necessarily so, I'd
suppose that in most cases it would work nevertheless. But since safety is my
first concern with FIPS, I would recommend booting from a DOS boot disk and
then running FIPS, that should be safe.
In version 1.0 I added some code by Dave McCaldon to detect Windows and
Desqview (thanks, Dave!). OS/2 and Novell Task Manager are not yet detected.
I had to remove the code for detecting the Linux DOS emulator because it
caused a hangup on many machines.
7. Using FIPS
If you have prepared a bootable floppy disk as described in section 5,
boot from it now.
Important! Make sure not to have a disk cache program like Smartdrive
running. It has been reported that in some cases the changes FIPS made
were only written to the disk in part, which resulted in hard disk
corruption later. I think this may be caused by the use of Smartdrive,
which in the default configuration delays the disk writes for some seconds.
If you reboot too fast, some of the changes may be lost.
You start FIPS by typing FIPS at the DOS prompt, followed by <ENTER>.
You may exit from the program at any time by pressing <CTRL-C>.
FIPS will first try to detect under which OS it is running. If it is
Windows or Desqview, it will complain and tell you to boot from a floppy
disk. You can proceed nevertheless, but this is at your own risk (see
section 8).
Then FIPS will detect your hard disks, if you have more than one, it will
ask you which one you want to work on.
In previous releases, FIPS failed to detect the correct number of hard disks
with some BIOSes (esp. in Gateway Pentium machines). I hope to have corrected
this. If FIPS fails to detect the correct number of disks, please let me
know. In the meantime you may use the '-n' switch to select the drive
by hand (see below).
FIPS then reads the root sector of the hard disk and displays the partition
table.
Example:
| | Start | | End | Start |Number of|
Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors | MB
-----+--------+----------------+------+----------------+--------+---------+----
1 | yes | 0 148 1| 83h| 15 295 63| 149184| 149184| 72
2 | no | 1 0 1| 06h| 15 139 63| 63| 141057| 68
3 | no | 0 140 1| 06h| 15 147 63| 141120| 8064| 3
4 | no | 0 0 0| 00h| 0 0 0| 0| 0| 0
If you don't know what to make of this, don't worry too much. You may just use
the number of Megabytes to identify your partitions.
The root sector is then checked for errors.
If you have more than one partition on the disk, you will be asked which one
you want to split.
The boot sector of the chosen partition is read and some information is dis-
played.
Example:
Bytes per sector: 512
Sectors per cluster: 8
Reserved sectors: 1
Number of FATs: 2
Number of rootdirectory entries: 512
Number of sectors (short): 0
Media descriptor byte: f8h
Sectors per FAT: 145
Sectors per track: 63
Drive heads: 16
Hidden sectors: 63
Number of sectors (long): 141057
Physical drive number: 80h
Signature: 29h
FIPS checks if this information is consistent with the partition table and
tries to detect other errors.
It then verifies if the two copies of the FAT are identical, if they are not,
FIPS will exit with an error message.
If everything checks out ok, FIPS now looks for free space at the end of
the partition. The new partition must have at least one cylinder, so if
the last cylinder is not free, you have no chance of splitting the
partition: FIPS will exit with an error message. Probably you forgot
to remove a mirror or image file (see above).
You must now enter on which cylinder the new partition should start.
Use the cursor keys right/left to increase or decrease the cylinder
count. The size of the remaining partition and the new partition are
displayed in the process, so you will have no trouble choosing the
right cylinder. With cursor up/down you can change the count in steps
of 10. When ready, press enter to continue.
FIPS will check again if the space for the new partition is empty -
this is an additional security measure and should never show an error,
since the free space was already determined before.
After this, FIPS will calculate the changes to the root sector, check the
changes and display the new partition table. You may now choose to reedit the
partition table (this will return you to the point where you select the par-
tition) or to continue. If you type 'c', FIPS will calculate the changed
boot sector, check it again and prompt you if you want to proceed. If you type
'y' then, FIPS will write the changes to the disk and exit.
8. After splitting the partition
Make sure that the changes have been written to the disk. If you used
a disk cache like Smartdrive (despite my explicit recommendation not
to use it :-), wait for some seconds so that the cache is flushed to disk.
Your new partition will be recognized by DOS after you rebooted. DO NOT
WRITE ANYTHING TO THE DISK BEFORE REBOOTING. After rebooting, use CHKDSK
or Norton Disk Doctor to make sure your old (now smaller) partition is ok.
There have been cases where the changes made by FIPS were not correctly
written. To make sure that this is not the case, run FIPS again with the
-t (test mode) switch after rebooting. Select the drive and partition that
you were splitting. If FIPS displays no error until the cylinder selection
dialogue, there is no problem and you can stop the program with CTRL-C.
Otherwise you should undo the changes with 'restorrb' and contact me by
email.
If you don't find any errors, you may now reboot with your normal config.sys
and autoexec.bat. Start some programs and make sure you can still read your
data.
If you want to use your new partition under DOS, you must format it. If you
have multiple partitions, make sure to format the right one, the drive names
may have changed!
If you want to use the partition under Linux, you may now change the system
indicator byte with Linux' fdisk, then use MKFS.
If you want to split the new partition again in two smaller ones, you must
first format it under DOS, otherwise FIPS will complain.
9. Commandline Switches
Here is the explanation of FIPS' commandline switches. If you prefer the DOS
style, you may use '/' instead of '-' as the switch character. The switches
may be arbitrarily combined. Type 'FIPS -help' to get a list of the switches.
Here is a more detailed explanation:
-t or -test : test mode (no writes to disk)
This doesn't need much explanation.
-d or -debug : debug mode
In this mode, a complete transcript of your session along with some additio-
nal information is written to the file FIPSINFO.DBG in the current directory.
You can send this file to me in case of trouble (see below).
-h or -help or -? : help page
A short summary of the switches
-n<num> : select drive <num>
Preselect the drive number with this switch. Valid numbers are 128 to 255.
This may also be used to override the automatic drive detection - if for any
reason the drive is not found by FIPS, you may try this switch.
10. Troubleshooting
FIPS is still somewhat experimental, although it has been used by many
people successfully and without serious problems.
When in doubt I usually decided to stay safe and display error messages
when encountering suspicious configurations. Some of the minor errors may
be overridden.
Please make sure you have read this doc carefully and also look in the file
FIPS.FAQ that covers some frequently asked questions.
If you can't resolve a problem yourself, or have a configuration not sup-
ported by FIPS, or if you suspect a bug in FIPS, make a transcript of your
session using the -d switch and send the full FIPSINFO.DBG file along with a
short comment to schaefer@rbg.informatik.th-darmstadt.de. Possibly your
problem has already been solved.
11. Credits
FIPS is based on the procedure described by Drew Eckhardt in Linux digest132.
Most of what I know about Harddisk structures comes from the excellent german
book 'Scheibenkleister II' by Claus Brod and Anton Stepper. It is for the
Atari ST, but much of it applies to PCs also.
Information on the Harddisk Interrupts was drawn from Ralf Brown's Interrupt
List. Thanks to Hamish Coleman for some useful info and to Paul Smith for
his good suggestions. Gunnar Hilmarsson suggested the procedure for stacked
drives, and Miguel Alvarez helped me improve the partition ordering. Chetan
Patil, Rand Phares and Eric Jung pointed me at bugs in the program and
documentation. Stefan Andreasen provided important informations about OS/2.
Keith Crews suggested some additions to the documentation concerning the
preparation of the boot disk and new features of DOS 6.x. Dave McCaldon
wrote the code for detecting the OS FIPS is running under. Scott Ellentuch
and Billy Patton provided info about OnTrack Disk Manager.
A very valuable piece of info on EIDE drives and address translation is the
Linux EIDE-Mini-HOWTO by Patrick LoPresti.
Thanks to all others who sent me feedback and suggestions. FIPS would not be
the same program without the innumerable emails I received.
Arno Schaefer
schaefer@rbg.informatik.th-darmstadt.de

Binary file not shown.

View File

@@ -0,0 +1,368 @@
FIPS Frequently Asked Questions
-------------------------------
Here are some questions that people asked me by email. This file may
help you with some common problems. Please read it carefully before sending
mail. If you want to know what FIPS is all about, read the file README.1ST.
There are answers to the following questions:
Q01. Since you can split partitions with FIPS, it should also be possible
to merge partitions, right?
Q02. Can I reverse the changes that FIPS made to my harddisk?
Q03. What if I did not keep the root and boot sector? Can I still undo the
partition split?
Q04. I heard that the cluster size depends on the partition size and that
space usage is better with a small cluster size. Can I use FIPS to
decrease the cluster size of my hard disk?
Q05. I want to split a large partition into three or four smaller ones.
Can I use FIPS multiple times?
Q06. FIPS creates a second primary DOS partition by default. Is this allowed?
Q07. What does the message "Info: Partition table inconsistency" mean?
Q08. FIPS displays an error message and refuses to work. What should I do?
Q09. FIPS does not recognize my SCSI disk.
Q10. FIPS finds a partition with partition type 56h.
Q11. FIPS seems to work fine, and DOS sees the new partition, but Linux
fdisk sees only one partition.
Q12. Does FIPS work with Windows 95?
------------------------------------------------------------------------------
Q01. Since you can split partitions with FIPS, it should also be possible
to merge partitions, right?
A01.a
-----
NOT IN GENERAL. I don't want to go into technical details, just so much:
Every DOS formatted partition has a file allocation table (FAT) that holds
entries for every cluster of the partition. Usually one FAT is not large
enough to hold the information for both partitions, so that partitions can
not be easily joined. It is feasible, but I'm probably not going to incor-
porate this into FIPS.
So far I have heard of two software packages that claim to expand partitions.
One is a free program called "Partition Resizer" (look for a file called
presz???.zip on you favorite BBS or FTP server), the other is a commercial
product called PartitionMagic by Powerquest. I did not try these yet.
A01.b
-----
YES, if you split the partitions with FIPS before. As you may expect,
the problem with the FAT does not exist in that case, since it was origi-
nally formatted large enough. In fact the only thing required is resto-
ring the original root and boot sector (it does not matter how the data
on the partition changed in the meantime). This can be done with the
program 'restorrb' which comes with FIPS. Please consider the following:
- You must have the original image of the root and boot sector. For this
you _must_ save them to a floppy disk when FIPS offers that.
- You must not format the first partition in the meantime (because then
a new FAT is generated which is probably too small).
- The data on the second partition (the one that was generated by FIPS)
is lost, of course. The data on the first partition is preserved.
---------
Q02. Can I reverse the changes that FIPS made to my harddisk?
A02.
----
Yes, see answer A01.b. Make sure that you keep the original root and boot
sectors that you can save to floppy disk with FIPS.
---------
Q03. What if I did not keep the root and boot sector? Can I still undo the
partition split?
A03.
----
Difficult. For the moment, your only option is to read the file TECHINFO.TXT
to learn about the hard disk structures, recalculate the old partition
and format info by hand and use a disk editor the change them. You must
roughly proceed as follows (I will call the partition that was split off
of the original partition the 'second' partition, the remaining part of
the original partition the 'first' one):
1. Make sure there is no important data left on the second partition,
since it will be deleted. Make copies of all root and boot sectors
(on floppy disk!) in case you make a mistake. Also make sure that
you have a bootable DOS floppy with the disk editor on it. Backup
your data!
2. Choose 'edit physical drive' and 'edit partition table' in the disk
editor menu (assuming that your disk editor supports this).
3. Examine the table to make sure which two partitions you want to merge.
4. Take end head, cylinder, sector from the second partition and enter the
values in the corresponding fields of the first partition.
5. Add the number of sectors of the first partition to the number of sectors
of the second and enter the new value in the number of sectors field
of the first partition.
6. Delete the entry for the second partition completely (overwrite with
zeroes).
7. Look for the boot sector of the first partition and enter the new no.
of sectors in the no. of sectors field in the boot sector.
Please make sure you know what you are doing. I can't take any responsibi-
lity if you mess up your hard disk. Read the TECHINFO.TXT file carefully.
---------
Q04. I heard that the cluster size depends on the partition size and that
space usage is better with a small cluster size. Can I use FIPS to
decrease the cluster size of my hard disk?
A04.
----
In the partition that you split off of the original partition, the cluster
size is automatically adapted to the new size when you format it. In the
original partition, you can not change the cluster size without reformat-
ting and thereby deleting all data.
If your new partition is big enough, you might copy the data to the new
partition and format the old one, but be aware of two things:
1. You will not be able to reverse the partition split afterwards (see A1.a).
2. Newer format programs check to see if the partition has already been
formatted and in this case will preserve the format (to make data re-
covery easier in case the formatting was a mistake). You might have
to trick the format program into thinking that the partition is new.
Possibly the /u switch will do this (I have no possibility to check
this, please let me know if it works), but if not, you might have to use
a disk editor and overwrite the boot sector of the partition with zeroes
to invalidate it.
Note: I received a report that even overwriting the boot sector was not
enough. I can only imagine that there was still information in the
BIOS tables about the old format - I suggest to reboot after overwriting
the boot sector to clear all tables. Sometimes the DOS tools are just
too intelligent :-(
If you experience problems here, drop me a line.
The usual cluster size of a partition is roughly as follows:
0 - 32MB 512 Bytes
32 - 64MB 1024 Bytes
64 - 128MB 2048 Bytes
128 - 256MB 4096 Bytes
256 - 512MB 8192 Bytes
512 -1024MB 16384 Bytes
---------
Q05. I want to split a large partition into three or four smaller ones.
Can I use FIPS multiple times?
A05.
----
Yes. You must format the newly created partitions between successive uses
of FIPS. Regarding the cluster size, consider the following example:
- Suppose you want to split a 1GB hard disk into four partitions of
256K each.
- The original partition is formatted with a cluster size of 16KB.
- The first split is into 256KB / 768KB. The cluster size of the first
partition remains 16KB, although 4KB would be enough. It can only be
changed by reformatting, see A04.
- The new partition of 768KB is formatted, still with a cluster size of 16KB.
- The second split is made into 256KB / 256KB / 512KB.
- The third partition is formatted with a cluster size of 8KB.
- The third split is made into 256KB / 256KB / 256KB / 256KB.
- The fourth partition is formatted with a cluster size of 4KB.
- So now you have the cluster sizes 16K - 16K - 8K - 4K.
- Since the second and third partition are still empty, it is possible
to reformat them to a cluster size of 4K. See A04. for details on
reformatting.
---------
Q06. FIPS creates a second primary DOS partition by default. Is this allowed?
A06.
----
See the section 'What FIPS does' in FIPS.DOC for a discussion of this
issue.
---------
Q07. What does the message "Info: Partition table inconsistency" mean?
A07.
----
The partition table in the master boot record (root sector) consists of
four entries with several fields each. The strange thing about this table
is that some of the fields are redundant. Look here:
| | Start | | End | Start |Number of|
Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors | MB
-----+--------+----------------+------+----------------+--------+---------+----
1 | yes | 0 148 1| 83h| 15 295 63| 149184| 149184| 72
2 | no | 1 0 1| 06h| 15 139 63| 63| 141057| 68
3 | no | 0 140 1| 06h| 15 147 63| 141120| 8064| 3
4 | no | 0 0 0| 00h| 0 0 0| 0| 0| 0
The start and end (head/cylinder/sector) values can be calculated from the
start sector and number of sectors (after inquiring the BIOS about the number
of heads and number of sectors per track), and in fact that's exactly what
DOS does. These field are completely unused by DOS (and every other OS that
I know of), so they could as well be set to all zeroes. It does however not
hurt to keep them in a consistent state.
When fdisk creates a partition table entry, it should enter the correct
values in these fields. Now how can there be an inconsistency? There are
at least two possibilities:
1. Some fdisk programs seem to write incorrect values, especially end
cylinders that are off by one or two.
2. You have an EIDE drive that uses address translation. Modern hard disks
usually have more than 1024 cylinders, but DOS does not allow for cylinder
numbers greater than 1024. This caused the hard disk controller manufacturers
to implement a trick: they decrease the number of cylinders and increase
the number of heads that DOS is told when asking for the drive geometry.
So DOS thinks it has a drive with e.g. 63 sectors, 32 heads and 1000
cylinders, whereas the correct values are 63 sectors, 16 heads, 2000
cylinders. Now if DOS asks for the first sector on cylinder 500, it
really gets the first sector on cylinder 1000. This trick is called
address translation.
Some newer EIDE drives allow the address translation to be switched
on and off in the BIOS. In some cases this is changed after the disk
is formatted. This means that the drive geometry that DOS gets when
querying the disk controller differs from the geometry that the drive
was formatted with and which is reflected in the partition table. This
is no problem for DOS, but it was a problem for FIPS until release 1.4.
In the current release, if FIPS detects this kind of problem, it will
adapt the partition table to the changed disk geometry.
The bottomline is that you need not worry about this message, it is
perfectly normal.
---------
Q08. FIPS displays an error message and refuses to work. What should I do?
A08.
----
Although this is already addressed in FIPS.DOC, I can not emphasize it
enough: If you send me email, please include the _DEBUG SCRIPT_ that you can
produce with the -d switch. If you don't, I will have to ask you for it,
and it will take longer to solve your problem.
---------
Q09. FIPS does not recognize my SCSI disk.
A09.
----
There exist older SCSI adapters (an Adaptec 1524 was reported to have that
'feature') that need a device driver that is loaded from the config.sys
before the disk can be accessed (i.e. the system must be booted from a
second hard disk or floppy). This device driver does not provide a 'BIOS
level' interface but a 'DOS level' interface to the hard disk (for the
technicians: it hooks into the DOS interrupt 21h instead of the BIOS inter-
rupt 13h). This means that the partition table can only be accessed via a
special fdisk program that knows about the adapters' internals. FIPS will
not work on these drives (and in fact even DOS' fdisk won't either).
Possibly there exists a newer driver for that adapter that will provide a
BIOS level interface - ask the manufacturer.
---------
Q10. FIPS only finds a partition with partition type 56h, no DOS partition.
A10.
----
You have OnTrack Disk Manager installed. Read the relevant section in
SPECIAL.DOC.
---------
Q11. FIPS seems to work fine, and DOS sees the new partition, but Linux
fdisk sees only one partition.
A11.
----
Somehow DOS loads a different partition table than the one in the master
boot record.
There are two possible causes:
1. You use a device driver like OnTrack Disk Manager. See the file
SPECIAL.DOC
2. You have a virus in the master boot record. This does not happen often,
but it is quite possible. Some viruses install themselves in the MBR and
copy the original MBR to some other place. When DOS tries to access the
partition table, the virus intercepts the BIOS call and returns the backup
copy, in order to hide from possible detection. Check this with a virus
scanner after booting from a clean DOS boot disk. You can remove a virus
from the MBR by using DOS fdisk with the /mbr option, but be aware that
in this case the 'backup' partition table is not restored. Thus the boot
sector will contain the new info as changed by FIPS, but the partition table
will contain the original (single partition) setup. This inconsistency
must be corrected (e.g. with a disk editor).
---------
Q12. Does FIPS work with Windows 95?
A12.
----
Yes. The file system of Windows 95 is the same as that of DOS. The only
difference are the long file names, but FIPS works on a level below the
directory level, so this is not a problem. Several people reported that
FIPS worked flawlessly on a Win 95 partition.

View File

@@ -0,0 +1,175 @@
Revision History of FIPS
------------------------
Version 1.5 - august 22, 1995
- Moved some of the special topics (use with OS/2, OnTrack, Stacker) from
FIPS.DOC to SPECIAL.DOC
- Revised the doc, added some info and tips
- Changed -d<num> switch to -n<num>
Version 1.4 - january 18, 1995 (not publicly released)
- FIPS can now correct a number of errors and inconsistencies on-the-fly
- Support for drives with configurable address translation - this should
finally eliminiate the 'inconsistent partition table' error.
Version 1.3 - january 6, 1995 (not publicly released)
- Replaced override switches by questions in the program
- Some errors of the hard disk structure can now be corrected by FIPS,
especially wrong end cylinder/head/sector numbers in the partition
table
- Revised error messages, minor corrections in the doc
- Added information about the common problem of 'invalid start/end head'
or 'inconsistent/corrupt partition table' to the file FIPS.FAQ.
- Cylinder numbers above 1024 are now shown without the 1024 modulus in
the partition table
Version 1.2 - october 20, 1994
- Added information about OnTrack Disk Manager to the doc.
- Added file FIPS.FAQ that covers frequently asked questions.
Version 1.1.1 - october 13, 1994 (not publicly released)
- Added support for hard disks with > 1024 logical cylinders.
Version 1.1 - may 26, 1994
- Bugfix: Removed the code for detecting the Linux DOS Emulator because
it caused a hangup on some machines.
Version 1.0 - may 3, 1994
- Added code to detect the OS FIPS is running under (thanks to Dave
McCaldon). This is to make sure that FIPS is not run in a multitasking
OS. Does not yet detect OS/2 and Novell Task Manager.
- First official release. There have been few bug reports in the test phase
and only one serious problem (with OS/2 dual boot). It is addressed in
detail in the doc.
Version 0.9.3 beta - march 31, 1994 (not publicly released)
- Some minor corrections for compatibility with Borland C++ 4.0
- Bugfix: "FAT too small" error with some configurations corrected
Version 0.9.2 beta - march 25, 1994 (not publicly released)
- Documentation revised, information about use with OS/2 added, features
of DOS 6.x taken into account
- -quiet and -s switches removed
- Drive detection code changed, this hopefully solves the problem with
the 'Too many drives found' error
Version 0.9.1 beta - january 21, 1994 (not publicly released)
- Select the start cylinder for the new partition with the cursor keys
- Automatically check for free space even before prompting for the
new start sector
- A nasty bug in the partition reordering procedure that caused FIPS to
fail in some cases was removed
- Slight bug in class definition corrected
Version 0.9 beta - november 7, 1993
- Save files on floppy (root and boot sector) are not overwritten -
there may be up to ten save files on a disk.
- Verbose error messages are now displayed by default, -verbose switch
has been removed.
- A minor error resulting in a 'division by zero' error with some invalid
bootsectors has been corrected
Version 0.8 beta - july 23, 1993
- A minor correction to the documentation
- No changes in the program from version 0.3. This is the first beta re-
lease. It is intended to be available to a wider audience.
Version 0.3 alpha - june 8, 1993
- FIPS is now completely translated to C++ (for easier maintenance and
programming experience)
- Explanation of the calculation of the new starting cylinder improved
- FIPS was reported to work with Stacker and SuperStor
Version 0.2.2 alpha - may 26, 1993 (not publicly released)
- partition table reordering improved - non-dos partitions remain in their
slots
- all necessary header files now included (sorry about that, my compiler
does not complain about missing prototypes)
Version 0.2.1 alpha - may 5, 1993 (not publicly released)
- bugfix: minimal cylinder number for start of new partition now calculated
correctly on drives with 16 sectors per cluster
- some improvements/simplifications to the code
Version 0.2 alpha - april 27, 1993
- added commandline switches to override certain error messages and
use FIPS non-interactively
- test mode without writing added
- debug mode added (writes a session transcript + additional info to a file)
- more informative error messages
- display of verbose error messages may be selected
- error checking is now more 'dos-like' (more unusual configurations
accepted)
- possibility to reedit the partition table without restarting the program
- added the number of megabytes to the partition table display
- now works correctly with drives that only have one free partition
- now supports more than two harddisks on a PC
- some minor fixes
Version 0.1 alpha - april 12, 1993
- Initial Release

View File

@@ -0,0 +1,115 @@
This is FIPS v1.5
FIPS is a program for non-destructive splitting of harddisk partitions.
IMPORTANT:
Please _carefully_ read the file FIPS.DOC for instructions on the use of
FIPS. FIPS is _not_ self documenting. I urge you to read at least sections
2, 5, 7 and 8. In case of problems read 4, 9 and 10 and the file FIPS.FAQ.
Muto Toshihisa has been so kind as to translate the docs into japanese.
They are available in Japan from NIFTY-Serve as FPCUPRO LIB1 #463.
Japanese users will hopefully know what this means.
One frequent problem people encounter is that their defragmentation program
leaves unmovable sectors at the end of the partition. It is addressed in
detail in FIPS.DOC. Other frequently asked questions are answered in the
file FIPS.FAQ.
If you use OS/2, a disk driver like OnTrack Disk Manager or a disk com-
pressor like Stacker, please read the relevant sections in the file
SPECIAL.DOC.
The changes from previous version are listed in the file HISTORY.TXT.
The latest version is available from my FIPS WWW page at
http://www.student.informatik.th-darmstadt.de/~schaefer/fips.html
FIPS has been out for about two years by now. It has been used by many
people on the Internet successfully. No serious bugs have been reported.
Nevertheless one can never be sure one hundred percent. FIPS reads and writes
the essential harddisk sectors, so an undiscovered bug may still corrupt your
harddisk. Use at your own risk!
If you want to make sure not to lose any data, make a complete backup before
using it (in this case you at least save yourself the time needed for re-
storing if it works).
However, every effort has been made to provide a maximum of safety. When
there is anything suspicious with the hard disk, the program will typically
exit with an error message, even if DOS doesn't complain.
If an error occurs, an error message is displayed together with a short
explanation. If you don't know what to make of it, read FIPS.DOC and
FIPS.FAQ.
If you still can't resolve the problem, make a transcript of your session
using the -d switch and send it to me at schaefer@rbg.informatik.
th-darmstadt.de. I usually try to answer within two or three days. Please
understand that the support for FIPS takes a considerable amount of time,
so that it may happen that I put back some of the harder problems and then
forget about them. In this case it may help to send another mail.
If you want to know how FIPS works, read the file TECHINFO.TXT. If you have
additions or corrections to make, please let me know.
FIPS is free under the GNU GENERAL PUBLIC LICENSE (GPL). See the file COPYING.
You may freely redistribute FIPS under the condition that you include all of
the files listed below without changes. If you modify it, you must follow
the conditions of the GPL.
I hold the copyright of FIPS. If you want to use parts of the source code in
your programs, you may do so under the conditions of the GPL. Of course I
would like to hear about it. If you want to use the code in a program that
is not covered by the GPL (shareware or commercial), I will probably agree
also, but you must ask me first.
You should have received the following files in this archive:
CALCULAT.CPP - calculation of the new root-/bootsector
CHECK.CPP - checking of the root-/bootsector
CMDL_ARG.CPP - evaluation of commandline arguments
DISK_IO.CPP - low level disk io
FAT.CPP - some operations on the FAT
GLOBAL.CPP - global procedures
HDSTRUCT.CPP - harddisk specific code
FIPSSPEC.CPP - FIPS-specific adaption of harddisk classes
INPUT.CPP - User input
LOGDR_ST.CPP - operations on logical drive
MAIN.CPP - main()
SAVE.CPP - saving root- and bootsector
HOST_OS.CPP - OS detection
DISK_IO.H - low level disk io classes
FAT.H - FAT classes
GLOBAL.H - global definitions
HDSTRUCT.H - harddisk specific classes
FIPSSPEC.H - FIPS-specific adaption of harddisk classes
INPUT.H - user input prototypes
LOGDR_ST.H - logical drive classes
TYPES.H - global type definitions
HOST_OS.H - The class host_os
PRIMPART.H - class for primary partitions
GETOPT.C - Simple UNIX getopt clone for commandline parsing
GETOPT.H - prototypes etc. for for GETOPT.C
VERSION.H - FIPS version
RTYPES.H - type definitions for RESTORRB
RESTORRB.C - a program that restores root and boot sector
RVERSION.H - RESTORRB version
FIPS.EXE - the executable of FIPS
RESTORRB.EXE - the executable of RESTORRB
COPYING - the GNU general public license
README.1ST - this file
FIPS.DOC - the documentation of FIPS
SPECIAL.DOC - special topics: OS/2, Stacker, OnTrack Disk Manager
FIPS.FAQ - some frequently asked questions with answers
TECHINFO.TXT - technical info on FIPS
ERRORS.TXT - a brief explanation of FIPS' error messages
HISTORY.TXT - the revision history
If you lack any of these files, try to get the original archive. If you can't
find it, contact me.
Arno Schaefer
schaefer@rbg.informatik.th-darmstadt.de

View File

@@ -0,0 +1,8 @@
FIPS is a program to split an MS-DOS partition in two. If your hard disk
contains only one partition, for MS-DOS/Windows, you will have to split it
to run MINIX. First run scandisk to repair any errors in the file system.
Then run defrag to compact the partition. Then you can use fips to split
the partition.
Before starting, please read README.1st, FIPS.DOC, FIPS,FAQ, and SPECIAL.DOC.

Binary file not shown.

View File

@@ -0,0 +1,239 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module restorrb.c
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <io.h>
#include <stdlib.h>
#include <dos.h>
#include <bios.h>
#include <alloc.h>
#include <conio.h>
#include <ctype.h>
#include "rtypes.h"
#include "rversion.h"
#define DISK_INT 0x13
#define RESET_DISK 0
#define WRITE_SECTOR 3
#define VERIFY_SECTOR 4
#define DISK1 0x80
/* ----------------------------------------------------------------------- */
/* Copyright notice and version number */
/* ----------------------------------------------------------------------- */
void notice (void)
{
printf ("\nFIPS version " FIPS_VERSION ", Copyright (C) 1993/94 Arno Schaefer\n");
printf ("Module RESTORRB.EXE - Please read the file README.1ST\n");
printf ("FIPS comes with ABSOLUTELY NO WARRANTY, see file COPYING for details\n");
printf ("This is free software, and you are welcome to redistribute it\n");
printf ("under certain conditions; again see file COPYING for details.\n\n");
}
/* ----------------------------------------------------------------------- */
/* Error Handling */
/* ----------------------------------------------------------------------- */
int getx (void)
{
int character = getch();
if (character == 3)
{
printf ("\n");
exit (0);
}
return (character);
}
void error (char *message)
{
fprintf (stderr,"\nError: %s!\n",message);
exit (-1);
}
/* ----------------------------------------------------------------------- */
/* BIOS calls */
/* ----------------------------------------------------------------------- */
int reset_drives (void)
{
union REGS regs;
regs.h.ah = RESET_DISK;
regs.h.dl = DISK1;
int86 (DISK_INT,&regs,&regs);
if (regs.x.cflag) return (-1);
return 0;
}
/* ----------------------------------------------------------------------- */
/* read / write sectors */
/* ----------------------------------------------------------------------- */
int verify_sector (int drive_number,dword head,dword cylinder,dword sector,byte *buffer)
{
if (biosdisk (VERIFY_SECTOR,drive_number,head,cylinder,sector,1,buffer)) return (-1);
return 0;
}
int write_sector (int drive_number,dword head,dword cylinder,dword sector,byte *buffer)
{
int i;
boolean done=false;
for (i=0;i<3;i++)
{
if (!biosdisk (WRITE_SECTOR,drive_number,head,cylinder,sector,1,buffer))
{
done=true;
break;
}
reset_drives();
}
if (!done) return (-1);
return (verify_sector (drive_number,head,cylinder,sector,buffer));
}
int write_root_sector (int drive_number,byte *buffer)
{
return (write_sector (drive_number,0,0,1,buffer));
}
/* ----------------------------------------------------------------------- */
/* User Input */
/* ----------------------------------------------------------------------- */
void ask_for_write_permission (char *filename)
{
int character = 'x';
printf ("\nReady to write old root- and bootsector from file %s to disk\n", filename);
printf ("Do you want to proceed (y/n): ");
while ((character != 'y') && (character != 'n')) character = getx();
printf ("%c\n",character);
if (character == 'n') exit (0);
}
/* ----------------------------------------------------------------------- */
/* Main */
/* ----------------------------------------------------------------------- */
void main (void)
{
byte rootsector[512];
byte bootsector[512];
int drive_number,partition_number,i;
FILE *handle;
dword head,cylinder,sector;
char *filename = "a:\\rootboot.000";
int no_of_savefiles = 0;
char first = 'x';
char list[10];
notice();
if (reset_drives ()) error ("Drive Initialization Failure");
for (i='0';i<='9';i++)
{
filename[14] = i;
if (access (filename,0) == 0)
{
if (first == 'x') first = i;
list[no_of_savefiles++] = i;
printf ("Found save file %s\n",filename);
}
}
if (no_of_savefiles == 0) error ("No savefile ROOTBOOT.00? found on disk A:");
if (no_of_savefiles > 1)
{
printf ("\nWhich file do you want to restore (");
for (i = 0; i < no_of_savefiles; i++)
{
printf ("%c/", list[i]);
}
printf ("\b)? ");
while (true)
{
int c;
if (isdigit (c = getx()))
{
boolean found = false;
for (i = 0; i < no_of_savefiles; i++)
{
if (c == list[i]) found = true;
}
if (found)
{
printf ("%c\n", c);
filename[14] = c;
break;
}
}
}
}
else
{
filename[14] = first;
}
if ((handle = fopen (filename,"rb")) == NULL)
error ("Can't open file");
for (i=0;i<512;i++)
{
int character = fgetc (handle);
if (character == EOF) error ("Error reading file from disk");
*(rootsector + i) = character;
}
for (i=0;i<512;i++)
{
int character = fgetc (handle);
if (character == EOF) error ("Error reading file from disk");
*(bootsector + i) = character;
}
if ((drive_number = fgetc (handle)) == EOF) error ("Error reading file from disk");
if ((partition_number = fgetc (handle)) == EOF) error ("Error reading file from disk");
if (fclose (handle)) error ("Error closing file");
head = (dword) rootsector[0x1be+16*partition_number+1];
cylinder = (((dword) rootsector[0x1be+16*partition_number+2] << 2) & 0x300)
| (dword) rootsector[0x1be+16*partition_number+3];
sector = (dword) rootsector[0x1be+16*partition_number+2] & 0x3f;
ask_for_write_permission(filename);
if (write_root_sector (drive_number,rootsector))
error ("Error writing rootsector");
if (write_sector (drive_number,head,cylinder,sector,bootsector))
error ("Error writing bootsector");
}

View File

@@ -0,0 +1,79 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module types.h
RCS - Header:
$Header: c:/daten/c/fips/source/RCS/types.h%v 2.0 1993/04/28 03:32:20 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
typedef unsigned char byte;
typedef unsigned int word;
typedef unsigned long dword;
typedef enum {false,true} boolean;
struct drive_geometry
{
dword heads;
dword cylinders;
dword sectors;
};
struct physical_sector
{
dword head;
dword cylinder;
dword sector;
};
struct partition_info
{
byte bootable; /* 80h or 0 */
byte start_head; /* location of first sector (bootsector) */
word start_cylinder;
byte start_sector;
byte system; /* 1 = 12-bit FAT, 4 = 16-bit FAT & 16-bit sector number */
/* 6 = 16-bit FAT & 32-bit sector number (BIGDOS) */
byte end_head; /* location of last sector */
word end_cylinder;
byte end_sector;
dword start_sector_abs; /* = start_cylinder * heads * sectors + start_head * sectors */
/* + start_sector - 1 */
dword no_of_sectors_abs; /* = end_cylinder * heads * sectors + end_head * sectors */
/* + end_sector - start_sector_abs */
};
struct bootsector_info
{
word bytes_per_sector; /* usually 512 */
byte sectors_per_cluster; /* may differ */
word reserved_sectors; /* usually 1 (bootsector) */
byte no_of_fats; /* usually 2 */
word no_of_rootdir_entries; /* usually 512 (?) */
word no_of_sectors; /* 0 on BIGDOS partitions */
byte media_descriptor; /* usually F8h */
word sectors_per_fat; /* depends on partition size */
word sectors_per_track; /* = sectors */
word drive_heads; /* = heads */
dword hidden_sectors; /* first sector of partition */
dword no_of_sectors_long; /* number of sectors on BIGDOS partitions */
byte phys_drive_no; /* 80h or 81h */
byte signature; /* usually 29h */
};

View File

@@ -0,0 +1 @@
#define FIPS_VERSION "1.5"

View File

@@ -0,0 +1,138 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module calculat.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/calculat.cpp 1.4 1995/01/19 00:00:49 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include "hdstruct.h"
#include "fipsspec.h"
/* ----------------------------------------------------------------------- */
/* Some calculations */
/* ----------------------------------------------------------------------- */
void fips_partition_table::calculate_new_root
(
dword new_start_cylinder,
partition *partition,
const drive_geometry &geometry
)
{
for (int i = 0; i < 3; i++) if (!partition_info[i].system)
// move DOS partitions to the beginning of the partition table
{
for (int j = i + 1; j < 4; j++) if
(
(partition_info[j].system == 1) ||
(partition_info[j].system == 4) ||
(partition_info[j].system == 6)
)
{
struct partition_info tmppart = partition_info[i];
partition_info[i] = partition_info[j];
partition_info[j] = tmppart;
if (partition->number == j) partition->number = i;
break;
}
}
int partition_no = partition->number;
partition->partition_info = &partition_info[partition_no];
for (i=0;i<4;i++) if (!partition_info[i].system) break;
// search for first empty slot
struct partition_info *newpart = &partition_info[i];
struct partition_info *oldpart = &partition_info[partition_no];
newpart->bootable = 0;
newpart->start_sector_abs =
new_start_cylinder *
geometry.heads *
geometry.sectors;
newpart->no_of_sectors_abs =
oldpart->start_sector_abs +
oldpart->no_of_sectors_abs -
newpart->start_sector_abs;
if
(
(newpart->no_of_sectors_abs > 0xffff) ||
(newpart->start_sector_abs > 0xffff)
)
{
newpart->system = 6;
}
else if
(
newpart->no_of_sectors_abs >= 20740
)
{
newpart->system = 4;
}
else
{
newpart->system = 1;
}
oldpart->no_of_sectors_abs =
newpart->start_sector_abs -
oldpart->start_sector_abs;
if
(
(oldpart->no_of_sectors_abs > 0xffff) ||
(oldpart->start_sector_abs > 0xffff)
)
{
oldpart->system = 6;
}
else
{
oldpart->system = 4;
}
correct_physical (geometry);
}
void fips_bpb::calculate_new_boot (const partition_info &partition_info)
{
if ((partition_info.no_of_sectors_abs > 0xffff) || (partition_info.start_sector_abs > 0xffff))
{
no_of_sectors = 0;
no_of_sectors_long = partition_info.no_of_sectors_abs;
}
else
{
no_of_sectors_long = 0;
no_of_sectors = partition_info.no_of_sectors_abs;
}
}

View File

@@ -0,0 +1,361 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module check.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/check.cpp 1.4 1995/01/19 00:20:41 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <stdlib.h>
#include "hdstruct.h"
#include "global.h"
#include "fipsspec.h"
#include "input.h"
/* ----------------------------------------------------------------------- */
/* Consistency check of root sector / partition table */
/* ----------------------------------------------------------------------- */
void fips_partition_table::correct_physical (const drive_geometry &geometry)
{
for (int i = 0; i < 4; i++)
{
if (partition_info[i].system)
{
physical_sector_no start
(
partition_info[i].start_sector_abs,
geometry
);
partition_info[i].start_cylinder = start.cylinder;
partition_info[i].start_head = start.head;
partition_info[i].start_sector = start.sector;
// recalculate 'physical' start sector
physical_sector_no end
(
partition_info[i].start_sector_abs
+ partition_info[i].no_of_sectors_abs
- 1,
geometry
);
partition_info[i].end_cylinder = end.cylinder;
partition_info[i].end_head = end.head;
partition_info[i].end_sector = end.sector;
// recalculate 'physical' end sector
}
}
}
void fips_harddrive::check (boolean final_check)
{
int i,j,k;
boolean bootable = false;
boolean do_correct = false;
byte *root_sector = harddrive::root_sector->data;
partition_info *parts = partition_table().partition_info;
int order[4] = {-1,-1,-1,-1};
printx ("\nChecking root sector ... ");
if ((root_sector[510] != 0x55) || (root_sector[511] != 0xaa))
error ("Invalid root sector signature: %02X %02X", root_sector[510], root_sector[511]);
for (i = 0; i < 4; i++)
{
if (parts[i].bootable == 0x80)
{
if (bootable)
{
warning (false, "More than one active partition");
printx ("Continue (y/n)? ");
if (ask_yes_no () == 'n') exit (-1);
}
else bootable = true;
}
else if (parts[i].bootable != 0)
{
warning (false, "Invalid active flag: partition %u: %02Xh",i+1,parts[i].bootable);
// must be 0 or 80h
printx ("Do you want to set the flag to zero (y/n)? ");
if (ask_yes_no () == 'y') parts[i].bootable = 0;
}
if (parts[i].system)
{
if ((parts[i].start_sector == 0) || (parts[i].start_sector > geometry.sectors))
{
if (final_check)
error ("Calculation error: Invalid start sector partition %u: %u", i + 1, parts[i].start_sector);
infomsg ("Partition table inconsistency");
do_correct = true;
}
if ((parts[i].end_sector == 0) || (parts[i].end_sector > geometry.sectors))
{
if (final_check)
error ("Calculation error: Invalid end sector partition %u: %u", i + 1, parts[i].end_sector);
if (!do_correct)
{
infomsg ("Partition table inconsistency");
do_correct = true;
}
}
if
(
(parts[i].start_head > (geometry.heads - 1)) ||
(parts[i].end_head > (geometry.heads - 1)) ||
(parts[i].start_sector_abs !=
(parts[i].start_cylinder * geometry.heads * geometry.sectors +
parts[i].start_head * geometry.sectors + parts[i].start_sector - 1)) ||
// physical start sector does not match logical start sector
((parts[i].start_sector_abs + parts[i].no_of_sectors_abs - 1) !=
(parts[i].end_cylinder * geometry.heads * geometry.sectors +
parts[i].end_head * geometry.sectors + parts[i].end_sector - 1))
// physical end sector does not match logical end sector
)
{
if (final_check)
error ("Calculation error: Inconsistent table entry for partition %u", i + 1);
if (!do_correct)
{
infomsg ("Partition table inconsistency");
do_correct = true;
}
}
for (j = 0; j < 4; j++) // insert partition in ordered table
{
if (order[j] == -1)
{
order[j] = i;
break;
}
else if (parts[i].start_sector_abs < parts[order[j]].start_sector_abs)
{
for (k=3;k>j;k--) order[k] = order[k-1];
order[j] = i;
break;
}
}
}
else // system = 0
{
for (j = 0; j < 16; j++)
{
if (root_sector[0x1be + 16 * i + j] != 0)
{
warning (false, "Invalid partition entry: partition %u", i+1);
printx ("Do you want to delete this entry (y/n)? ");
if (ask_yes_no () == 'y')
{
parts[i].bootable = 0;
parts[i].start_head = 0;
parts[i].start_cylinder = 0;
parts[i].start_sector = 0;
parts[i].end_head = 0;
parts[i].end_cylinder = 0;
parts[i].end_sector = 0;
parts[i].start_sector_abs = 0;
parts[i].no_of_sectors_abs = 0;
}
break;
}
}
}
}
if (do_correct)
{
pr_partition_table.correct_physical (geometry);
printx ("\nPartition table adapted to the current drive geometry:\n\n");
pr_partition_table.print();
}
if (!bootable && number == 0x80) warning (true, "No active partition");
for (i = 0; i < 4; i++)
{
if ((k = order[i]) != -1) // valid partition
{
if ((parts[k].end_sector != geometry.sectors) || (parts[k].end_head != (geometry.heads - 1)))
warning (true, "Partition does not end on cylinder boundary: partition %u", k + 1);
if (i != 0) if ((parts[k].start_sector != 1) || (parts[k].start_head != 0))
warning (true, "Partition does not begin on cylinder boundary: partition %u", k + 1);
if (i < 3) if ((j = order[i + 1]) != -1) // following valid partition
{
if ((parts[k].start_sector_abs + parts[k].no_of_sectors_abs) > parts[j].start_sector_abs)
error ("Overlapping partitions: %u and %u", k + 1, j + 1);
if ((parts[k].start_sector_abs + parts[k].no_of_sectors_abs) < parts[j].start_sector_abs)
warning (true, "Free space between partitions: %u and %u", k + 1, j + 1);
}
}
}
printx ("OK\n");
}
void fips_partition::check (void)
{
printx ("Checking boot sector ... ");
byte *boot_sector = partition::boot_sector->data;
if (boot_sector[0] == 0xeb)
{
if (boot_sector[2] != 0x90)
error ("Invalid jump instruction in boot sector: %02X %02X %02X", boot_sector[0], boot_sector[1], boot_sector[2]);
}
else if (boot_sector[0] != 0xe9)
error ("Invalid jump instruction in boot sector: %02X %02X %02X", boot_sector[0], boot_sector[1], boot_sector[2]);
if ((boot_sector[510] != 0x55) || (boot_sector[511] != 0xaa))
error ("Invalid boot sector: %02X %02X", boot_sector[510], boot_sector[511]);
if (bpb().bytes_per_sector != 512)
error ("Can't handle number of bytes per sector: %u",bpb().bytes_per_sector);
switch (bpb().sectors_per_cluster)
{
case 1:case 2:case 4:case 8:case 16:case 32:case 64:case 128: break;
default:
error ("Number of sectors per cluster must be a power of 2: actually it is %u",bpb().sectors_per_cluster);
}
if (bpb().reserved_sectors != 1)
{
warning (false, "Number of reserved sectors should be 1: actually it is %u",bpb().reserved_sectors);
if (ask_correction () == 'y') bpb().reserved_sectors = 1;
}
if (bpb().no_of_fats != 2)
error ("Partition must have 2 FATs: actually it has %u",bpb().no_of_fats);
if (bpb().no_of_rootdir_entries % 16)
{
warning (false, "Number of root directory entries must be multiple of 16: actually it is %u",bpb().no_of_rootdir_entries);
printx ("Do you want to set the number to the next multiple of 16 (y/n)? ");
if (ask_yes_no () == 'y')
bpb().no_of_rootdir_entries += (16 - bpb().no_of_rootdir_entries % 16);
}
if (bpb().no_of_rootdir_entries == 0)
error ("Number of root directory entries must not be zero");
if (bpb().media_descriptor != 0xf8)
{
warning (false, "Wrong media descriptor byte in boot sector: %02X",bpb().media_descriptor);
if (ask_correction () == 'y') bpb().media_descriptor = 0xf8;
}
if (bpb().sectors_per_fat > 256)
{
warning (false, "FAT too large: %u sectors",bpb().sectors_per_fat);
printx ("Continue (y/n)? ");
if (ask_yes_no () == 'n') exit (-1);
}
if (bpb().sectors_per_fat < (info().no_of_clusters + 1) / 256 + 1)
{
warning (false, "FAT too small: %u sectors (should be %u)",bpb().sectors_per_fat, (unsigned int) ((info().no_of_clusters + 1) / 256 + 1));
printx ("Continue (y/n)? ");
if (ask_yes_no () == 'n') exit (-1);
}
if (bpb().sectors_per_track != drive->geometry.sectors)
{
warning (false, "Sectors per track incorrect: %u instead of %u",bpb().sectors_per_track,(int) drive->geometry.sectors);
if (ask_correction () == 'y') bpb().sectors_per_track = drive->geometry.sectors;
}
if (bpb().drive_heads != drive->geometry.heads)
{
warning (false, "Number of drive heads incorrect: %u instead of %u",bpb().drive_heads,(int) drive->geometry.heads);
if (ask_correction () == 'y') bpb().drive_heads = drive->geometry.heads;
}
if (bpb().hidden_sectors != partition_info->start_sector_abs)
error ("Number of hidden sectors incorrect: %lu instead of %lu",bpb().hidden_sectors,partition_info->start_sector_abs);
if (info().no_of_clusters <= 4084)
error ("12-bit FAT not supported: number of clusters is %u",(int) info().no_of_clusters);
if (bpb().no_of_sectors)
{
if (partition_info->no_of_sectors_abs > 0xffff)
error ("Number of sectors (short) must be zero");
if (bpb().no_of_sectors != partition_info->no_of_sectors_abs)
error ("Number of sectors (short) does not match partition info:\n%u instead of %lu",bpb().no_of_sectors,partition_info->no_of_sectors_abs);
if (partition_info->system != 4)
{
warning (true, "Wrong system indicator byte: %u instead of 4",partition_info->system);
if (ask_correction () == 'y') partition_info->system = 4;
}
}
else
{
if (bpb().no_of_sectors_long != partition_info->no_of_sectors_abs)
error ("Number of sectors (long) does not match partition info:\n%lu instead of %lu",bpb().no_of_sectors_long,partition_info->no_of_sectors_abs);
if (bpb().signature != 0x29)
{
warning (false, "Wrong signature: %02Xh",bpb().signature);
if (ask_correction () == 'y') bpb().signature = 0x29;
}
if (partition_info->system != 6)
{
warning (true, "Wrong system indicator byte: %u instead of 6",partition_info->system);
if (ask_correction () == 'y') partition_info->system = 6;
}
}
printx ("OK\n");
}

View File

@@ -0,0 +1,138 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module cmdl_arg.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/cmdl_arg.cpp 1.4 1995/01/19 00:00:51 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "global.h"
#include "getopt.h"
/* ----------------------------------------------------------------------- */
/* Replacement for atoi */
/* ----------------------------------------------------------------------- */
static int atoint (char *string)
{
long int value = 0;
while (isdigit (*string))
{
value = value * 10 + (*string - '0');
if (value > 32767) return (-1);
string++;
}
if (*string != '\0') return (-1);
return (int) value;
}
/* ----------------------------------------------------------------------- */
/* Usage instructions */
/* ----------------------------------------------------------------------- */
static void usage (void)
{
printf ("\nFIPS [-t] [-d] [-h|-?] [-n<num>]:\n\n");
printf ("-t : test mode (no writes to disk)\n");
printf ("-d : debug mode\n");
printf ("-h/-? : this help page\n");
printf ("-n<num> : select drive <num> - valid values: 128 to 255\n");
}
/* ----------------------------------------------------------------------- */
/* Process commandline parameters */
/* ----------------------------------------------------------------------- */
void evaluate_argument_vector (int argc, char *argv[])
{
int c;
opterr = 0;
while ((c = getopt (argc, argv, ":htdn:")) >= 0)
{
switch (c)
{
case 't':
global.test_mode = true;
break;
case 'd':
global.debug_mode = true;
break;
case 'h':
usage ();
exit (1);
case 'n':
global.drive_number_cmdline = atoint (optarg);
if
(
global.drive_number_cmdline < 0x80
|| global.drive_number_cmdline > 0xff
)
{
fprintf
(
stderr,
"\nInvalid argument: %s\n",
optarg
);
usage ();
exit (-1);
}
break;
case ':':
fprintf
(
stderr,
"\nSwitch %c requires an argument\n",
optopt
);
usage ();
exit (-1);
case '?':
if (optopt != '?')
fprintf
(
stderr,
"\nInvalid Commandline Parameter: %s\n",
argv[optind - 1]
);
usage ();
exit (-1);
} /* switch */
} /* while */
}

View File

@@ -0,0 +1,267 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module disk_io.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/disk_io.cpp 1.4 1995/01/19 00:00:51 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include "disk_io.h"
#include <dos.h>
#include <bios.h>
#define DISK_INT 0x13
#define RESET_DISK 0
#define READ_SECTOR 2
#define WRITE_SECTOR 3
#define VERIFY_SECTOR 4
#define GET_DRIVE_PARAMS 8
#define GET_DISK_TYPE 0x15
/* ----------------------------------------------------------------------- */
/* Bios call to get the number of drives attached */
/* ----------------------------------------------------------------------- */
int get_no_of_drives (void)
{
union REGS regs;
regs.h.ah = GET_DRIVE_PARAMS;
regs.h.dl = 0x80;
int86 (DISK_INT, &regs, &regs);
if (regs.h.ah != 0) return (1); // will be checked again
return (regs.h.dl);
}
/* ----------------------------------------------------------------------- */
/* Calculates physical sector number (Head, Cylinder, Sector). */
/* Log_sector is absolute logical sector number (0 = master boot record). */
/* ----------------------------------------------------------------------- */
physical_sector_no::physical_sector_no
(
dword logical_sector,
const drive_geometry &geometry
)
{
cylinder =
logical_sector
/ (geometry.heads * geometry.sectors);
head =
(
logical_sector
- (cylinder * geometry.heads * geometry.sectors)
)
/ geometry.sectors;
sector =
logical_sector
- (cylinder * geometry.heads * geometry.sectors)
- (head * geometry.sectors)
+ 1;
}
/* ----------------------------------------------------------------------- */
/* Bios call get_drive_geometry, returns error status in var errorcode */
/* ----------------------------------------------------------------------- */
void physical_drive::get_geometry (void)
{
union REGS regs;
regs.h.ah = GET_DRIVE_PARAMS;
regs.h.dl = number;
int86 (DISK_INT, &regs, &regs);
if ((errorcode = regs.h.ah) != 0) return;
geometry.heads = (dword) regs.h.dh + 1;
geometry.sectors = (dword) regs.h.cl & 0x3f;
geometry.cylinders =
(
(dword) regs.h.ch
| (((dword) regs.h.cl << 2) & 0x300)
) + 1;
}
/* ----------------------------------------------------------------------- */
/* Bios call reset_drive, returns error status in var errorcode */
/* ----------------------------------------------------------------------- */
void physical_drive::reset (void)
{
union REGS regs;
regs.h.ah = RESET_DISK;
regs.h.dl = number;
int86 (DISK_INT, &regs, &regs);
errorcode = regs.h.ah;
}
/* ----------------------------------------------------------------------- */
/* Initialization physical_drive, requires drive number. */
/* Calls get_drive_geometry, errorcode contains return status */
/* ----------------------------------------------------------------------- */
physical_drive::physical_drive (int number)
{
physical_drive::number = number;
get_geometry ();
};
/* ----------------------------------------------------------------------- */
/* Initialization physical_drive with physical_drive object */
/* ----------------------------------------------------------------------- */
physical_drive::physical_drive (physical_drive &pd)
{
number = pd.number;
errorcode = pd.errorcode;
geometry = pd.geometry;
}
/* ----------------------------------------------------------------------- */
/* Assignment operator for physical drive */
/* ----------------------------------------------------------------------- */
void physical_drive::operator= (physical_drive &pd)
{
number = pd.number;
errorcode = pd.errorcode;
geometry = pd.geometry;
}
/* ----------------------------------------------------------------------- */
/* Read sector */
/* ----------------------------------------------------------------------- */
int physical_drive::read_sector (struct sector *sector, dword sector_number)
{
physical_sector_no p (sector_number, geometry);
boolean done = false;
for (int i=0; i<3; i++)
{
if (biosdisk
(
READ_SECTOR,
number,
p.head,
p.cylinder,
p.sector,
1,
sector->data
) == 0)
{
done=true;
break;
}
reset ();
}
if (!done) return (-1);
return 0;
}
/* ----------------------------------------------------------------------- */
/* Write sector with verify */
/* ----------------------------------------------------------------------- */
int physical_drive::write_sector (struct sector *sector, dword sector_number)
{
physical_sector_no p (sector_number,geometry);
boolean done = false;
for (int i=0; i<3; i++)
{
if (biosdisk
(
WRITE_SECTOR,
number,
p.head,
p.cylinder,
p.sector,
1,
sector->data
) == 0)
{
done=true;
break;
}
reset ();
}
if (!done) return (-1);
if (biosdisk
(
VERIFY_SECTOR,
number,
p.head,
p.cylinder,
p.sector,
1,
sector->data
) != 0) return (-1);
return 0;
}
/* ----------------------------------------------------------------------- */
/* Bios call get_disk_type - returns 0 if drive not present. */
/* Valid drive numbers: 0 - 255, result: 1 - floppy without disk change */
/* detection, 2 - floppy with disk change detection, 3 - harddisk */
/* ----------------------------------------------------------------------- */
int get_disk_type (int drive_number)
{
union REGS regs;
regs.h.ah = GET_DISK_TYPE;
regs.h.dl = drive_number;
int86 (DISK_INT, &regs, &regs);
if (regs.x.cflag) return 0;
return (regs.h.ah); // disk type
}

View File

@@ -0,0 +1,138 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module disk_io.h
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/disk_io.h 1.4 1995/01/19 00:01:25 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef DISK_IO_H
#define DISK_IO_H
#include "types.h"
/* ----------------------------------------------------------------------- */
/* Structure to hold information about the drive geometry */
/* ----------------------------------------------------------------------- */
struct drive_geometry
{
dword heads;
dword cylinders;
dword sectors;
};
/* ----------------------------------------------------------------------- */
/* Low level structure physical_drive, contains drive number and geometry, */
/* as well as low level sector read and write routines */
/* Geometry is determined on initialization, errorcode contains error */
/* number after call to get_geometry() and reset(). */
/* Initialization requires number (e.g. physical_drive drive1 (0x80);). */
/* */
/* Read and write are called max. 3 times in case of failure, return code */
/* contains 0 if successful. Sector CRC is verified after write. */
/* sector_number is absolute logical sector number (0 = master boot record)*/
/* ----------------------------------------------------------------------- */
class physical_drive
{
protected:
virtual void get_geometry (void);
public:
// constructors & operators
physical_drive (int number);
physical_drive (physical_drive &pd);
void operator= (physical_drive &pd);
// public data
int number;
int errorcode;
drive_geometry geometry;
// functions
virtual void reset (void);
int read_sector (struct sector* sector, dword sector_number);
int write_sector (struct sector* sector, dword sector_number);
};
/* ----------------------------------------------------------------------- */
/* Physical_sector_no holds and calculates physical sector number (Head, */
/* Cylinder, Sector). Number is calculated on initialization. Log_sector */
/* is absolute logical sector number (0 = master boot record). Usage: */
/* physical_sector_no mbr (0,geometry); */
/* physical_sector_no mbr (0,0,1); */
/* ----------------------------------------------------------------------- */
struct physical_sector_no
{
// public data
dword head;
dword cylinder;
dword sector;
// constructors
physical_sector_no (dword logical_sector, const drive_geometry &geometry);
physical_sector_no (dword head, dword cylinder, dword sector)
{
physical_sector_no::head = head;
physical_sector_no::cylinder = cylinder;
physical_sector_no::sector = sector;
}
};
/* ----------------------------------------------------------------------- */
/* Structure sector - contains only sector data */
/* ----------------------------------------------------------------------- */
struct sector
{
byte data[512];
};
/* ----------------------------------------------------------------------- */
/* Prototype for bios call get_disk_type - returns 0 if drive not present. */
/* Valid drive numbers: 0 - 255, result: 1 - floppy without disk change */
/* detection, 2 - floppy with disk change detection, 3 - harddisk */
/* ----------------------------------------------------------------------- */
int get_disk_type (int drive_number);
/* Bios call get_no_of_drives */
int get_no_of_drives (void);
#endif

View File

@@ -0,0 +1,161 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module fat.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/fat.cpp 1.4 1995/01/19 00:00:51 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <stdlib.h>
#include "logdr_st.h"
#include "global.h"
#include "fat.h"
#include "input.h"
fat::fat (class logical_drive *logical_drive,int number)
{
fat::logical_drive = logical_drive;
fat::number = number;
buffer = new sector;
start_sector = (number == 1) ? logical_drive->info().start_fat1 : logical_drive->info().start_fat2;
sector_in_buffer = -1;
}
dword fat16::next_cluster (dword cluster_number)
{
dword sector = cluster_number / 256;
int offset = (cluster_number % 256) * 2;
if (sector != sector_in_buffer)
{
read_sector (sector);
}
return ((dword) buffer->data[offset] | ((dword) buffer->data[offset + 1] << 8));
}
void fat::read_sector (dword sector)
{
if (logical_drive->read_sector (sector + start_sector,buffer))
if (number == 1)
error ("Error reading FAT 1");
else
error ("Error reading FAT 2");
sector_in_buffer = sector;
}
void fat16::check_against (class fat16 *fat2)
{
printx ("Checking FAT ... ");
for (int i=0;i<logical_drive->bpb().sectors_per_fat;i++)
{
read_sector (i);
fat2->read_sector (i);
for (int j=0;j<512;j++) if (buffer->data[j] != fat2->buffer->data[j])
error ("FAT copies differ: FAT 1 -> %02Xh, FAT 2 -> %02Xh in sector %u, byte %u",buffer->data[j],fat2->buffer->data[j],i,j);
if (i == 0)
{
if (buffer->data[0] != 0xf8)
{
warning (false, "Wrong media descriptor byte in FAT: %02Xh",buffer->data[0]);
printx ("Continue (y/n)? ");
if (ask_yes_no () == 'n') exit (-1);
}
if ((buffer->data[1] != 0xff) || (buffer->data[2] != 0xff) || (buffer->data[3] != 0xff))
warning (true, "Wrong FAT entries 1 & 2: %02X %02X %02X %02X",buffer->data[0],buffer->data[1],buffer->data[2],buffer->data[3]);
}
}
printx ("OK\n");
}
void fat16::check_empty (dword new_start_sector)
{
dword first_cluster = (new_start_sector - logical_drive->info().start_data) / logical_drive->bpb().sectors_per_cluster + 2;
dword last_cluster = logical_drive->info().no_of_clusters + 1;
if (last_cluster > ((dword) 256 * logical_drive->bpb().sectors_per_fat - 1)) last_cluster = (dword) 256 * logical_drive->bpb().sectors_per_fat - 1;
printx ("First Cluster: %lu\nLast Cluster: %lu\n\n",first_cluster,last_cluster);
printx ("Testing if empty ... ");
for (dword i=first_cluster;i <= last_cluster;i++)
{
dword fat_entry = next_cluster (i);
if (fat_entry != 0) if (fat_entry != 0xfff7)
{
if (fat_entry == 0xffff)
{
error ("New partition not empty: cluster %lu ( FAT entry: <EOF> )",i);
}
else
{
error ("New partition not empty: cluster %lu ( FAT entry: %lu )",i,fat_entry);
}
}
}
printx ("OK\n");
}
dword fat16::min_free_cluster (void)
{
dword first_cluster = 2;
dword last_cluster = logical_drive->info().no_of_clusters + 1;
if (last_cluster > ((dword) 256 * logical_drive->bpb().sectors_per_fat - 1)) last_cluster = (dword) 256 * logical_drive->bpb().sectors_per_fat - 1;
printx ("Searching for free space ... ");
dword i;
for (i=last_cluster;i >= first_cluster;i--)
{
dword fat_entry = next_cluster (i);
if (fat_entry != 0) if (fat_entry != 0xfff7)
{
i++;
break;
}
}
printx ("OK\n\n");
return (i);
}

View File

@@ -0,0 +1,65 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module fat.h
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/fat.h 1.4 1995/01/19 00:01:25 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef FAT_H
#define FAT_H
#include "types.h"
#include "disk_io.h"
#include "logdr_st.h"
class fat
{
protected:
logical_drive *logical_drive;
int number;
dword start_sector;
sector *buffer;
dword sector_in_buffer;
void read_sector (dword sector);
public:
virtual dword next_cluster (dword cluster_number) = 0;
fat (class logical_drive *logical_drive,int number);
~fat (void) { delete buffer; }
};
class fat16:public fat
{
public:
dword next_cluster (dword cluster_number);
void check_empty (dword new_start_cluster);
void check_against (class fat16 *fat2);
dword min_free_cluster (void);
fat16 (class logical_drive *logical_drive,int number):fat (logical_drive,number) {}
};
#endif

View File

@@ -0,0 +1,285 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module fipsspec.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/fipsspec.cpp 1.4 1995/01/19 00:00:53 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <dos.h>
#include "fipsspec.h"
#include "global.h"
#include "input.h"
#define FIRST_CHECK false
#define FINAL_CHECK true
#define DISK_INT 0x13
#define RESET_DISK 0
#define GET_DRIVE_PARAMS 8
void fips_bpb::print (void)
{
printx ("Bytes per sector: %u\n",bytes_per_sector);
printx ("Sectors per cluster: %u\n",sectors_per_cluster);
printx ("Reserved sectors: %u\n",reserved_sectors);
printx ("Number of FATs: %u\n",no_of_fats);
printx ("Number of rootdirectory entries: %u\n",no_of_rootdir_entries);
printx ("Number of sectors (short): %u\n",no_of_sectors);
printx ("Media descriptor byte: %02Xh\n",media_descriptor);
printx ("Sectors per FAT: %u\n",sectors_per_fat);
printx ("Sectors per track: %u\n",sectors_per_track);
printx ("Drive heads: %u\n",drive_heads);
printx ("Hidden sectors: %lu\n",hidden_sectors);
printx ("Number of sectors (long): %lu\n",no_of_sectors_long);
printx ("Physical drive number: %02Xh\n",phys_drive_no);
printx ("Signature: %02Xh\n\n",signature);
}
void fips_partition_table::print (void)
{
printx (" | | Start | | End | Start |Number of|\n");
printx ("Part.|bootable|Head Cyl. Sector|System|Head Cyl. Sector| Sector |Sectors | MB\n");
printx ("-----+--------+----------------+------+----------------+--------+---------+----\n");
for (int i=0;i<4;i++)
{
printx ("%u | %s |%4u %4u %4u| %02Xh|%4u %4u %4u|%8lu| %8lu|%4lu\n",i+1,
partition_info[i].bootable ? "yes" : " no",
partition_info[i].start_head,partition_info[i].start_cylinder,partition_info[i].start_sector,
partition_info[i].system,partition_info[i].end_head,partition_info[i].end_cylinder,partition_info[i].end_sector,
partition_info[i].start_sector_abs,partition_info[i].no_of_sectors_abs,partition_info[i].no_of_sectors_abs / 2048);
}
}
void fips_harddrive::get_geometry (void)
{
union REGS regs;
regs.h.ah = GET_DRIVE_PARAMS;
regs.h.dl = number;
int86 (DISK_INT,&regs,&regs);
if (global.debug_mode)
{
fprintf (global.debugfile,"\nRegisters after call to int 13h 08h (drive %02Xh):\n\n",number);
fprintf (global.debugfile," 00 sc/cl hd\n");
fprintf (global.debugfile,"al ah bl bh cl ch dl dh si di cflgs flags\n");
hexwrite ((byte *) &regs,16,global.debugfile);
}
if ((errorcode = regs.h.ah) != 0) return;
geometry.heads = (dword) regs.h.dh + 1;
geometry.sectors = (dword) regs.h.cl & 0x3f;
geometry.cylinders = ((dword) regs.h.ch | (((dword) regs.h.cl << 2) & 0x300)) + 1;
if (global.debug_mode)
{
fprintf (global.debugfile, "\nGeometry reported by BIOS:\n");
fprintf
(
global.debugfile,
"%ld cylinders, %ld heads, %ld sectors\n",
geometry.cylinders,
geometry.heads,
geometry.sectors
);
}
}
void fips_harddrive::reset (void)
{
union REGS regs;
regs.h.ah = RESET_DISK;
regs.h.dl = number;
int86 (DISK_INT,&regs,&regs);
if (global.debug_mode)
{
fprintf (global.debugfile,"\nRegisters after call to int 13h 00h (drive %02Xh):\n\n",number);
fprintf (global.debugfile,"al ah bl bh cl ch dl dh si di cflgs flags\n");
hexwrite ((byte *) &regs,16,global.debugfile);
}
errorcode = regs.h.ah;
}
void fips_logdrive_info::put_debug_info (void)
{
fprintf (global.debugfile,"Calculated Partition Characteristica:\n\n");
fprintf (global.debugfile,"Start of FAT 1: %lu\n",start_fat1);
fprintf (global.debugfile,"Start of FAT 2: %lu\n",start_fat2);
fprintf (global.debugfile,"Start of Rootdirectory: %lu\n",start_rootdir);
fprintf (global.debugfile,"Start of Data: %lu\n",start_data);
fprintf (global.debugfile,"Number of Clusters: %lu\n",no_of_clusters);
}
dword fips_partition::min_cylinder (fat16 fat, drive_geometry geometry)
{
dword new_part_min_sector =
info().start_data
+ (dword) 4085
* bpb().sectors_per_cluster;
dword new_part_min_cylinder =
(
new_part_min_sector
+ partition_info->start_sector_abs
- 1
)
/ (geometry.heads * geometry.sectors)
+ 1;
if (new_part_min_cylinder > partition_info->end_cylinder)
error ("Partition too small - can't split");
dword min_free_cluster = fat.min_free_cluster ();
dword min_free_sector =
info().start_data
+ (min_free_cluster - 2)
* (dword) bpb().sectors_per_cluster;
dword min_free_cylinder =
(
min_free_sector
+ partition_info->start_sector_abs
- 1
)
/ (geometry.heads * geometry.sectors)
+ 1;
if (min_free_cylinder > partition_info->end_cylinder)
error ("Last cylinder is not free");
if (new_part_min_cylinder < min_free_cylinder)
new_part_min_cylinder = min_free_cylinder;
return (new_part_min_cylinder);
}
boolean fips_partition::split (fips_harddrive hd)
{
if (read_boot_sector ())
error ("Error reading boot sector");
if (global.debug_mode)
{
fprintf
(
global.debugfile,
"\nBoot sector drive %02Xh, partition %u:\n\n",
hd.number,
number + 1
);
hexwrite
(
boot_sector->data,
512,
global.debugfile
);
}
get_bpb ();
printx ("\nBoot sector:\n\n");
print_bpb ();
get_info ();
if (global.debug_mode)
write_info_debugfile ();
check ();
fat16 fat1 (this,1);
fat16 fat2 (this,2);
fat1.check_against (&fat2);
dword new_part_min_cylinder =
min_cylinder (fat2, hd.geometry);
if (ask_if_save()) save_root_and_boot(&hd,this);
dword new_start_cylinder =
ask_for_new_start_cylinder
(
partition_info->start_cylinder,
new_part_min_cylinder,
partition_info->end_cylinder,
hd.geometry.heads * hd.geometry.sectors
);
fat2.check_empty
(
new_start_cylinder
* hd.geometry.heads
* hd.geometry.sectors
- partition_info->start_sector_abs
);
hd.calculate_new_root (new_start_cylinder, this);
hd.put_partition_table();
hd.get_partition_table();
printx ("\nNew partition table:\n\n");
hd.print_partition_table ();
hd.check (FINAL_CHECK);
if (ask_if_continue () == false)
{
return (false);
}
calculate_new_boot ();
put_bpb ();
get_bpb ();
printx ("\nNew boot sector:\n\n");
print_bpb ();
get_info ();
if (global.debug_mode)
write_info_debugfile ();
check();
if (!global.test_mode)
{
ask_for_write_permission ();
if (hd.write_root_sector ())
error ("Error writing root sector");
if (write_boot_sector ())
error ("Error writing boot sector");
printx ("Repartitioning complete\n");
}
return (true);
}

View File

@@ -0,0 +1,120 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module fipsspec.h
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/fipsspec.h 1.4 1995/01/19 00:01:26 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef FIPSSPEC_H
#define FIPSSPEC_H
#include "logdr_st.h"
#include "hdstruct.h"
#include "primpart.h"
#include "fat.h"
#include "disk_io.h"
class fips_bpb:public bios_parameter_block
{
public:
void print (void);
void calculate_new_boot (const partition_info &partition_info);
};
class fips_partition_table:public partition_table
{
public:
void print (void);
void calculate_new_root (dword new_start_cylinder,partition *partition,const drive_geometry &geometry);
void correct_physical (const drive_geometry &geometry);
int select (void);
};
class fips_harddrive:public harddrive
{
fips_partition_table pr_partition_table;
protected:
void get_geometry (void);
public:
void reset (void);
class partition_table &partition_table() { return pr_partition_table; }
void print_partition_table (void) { pr_partition_table.print(); }
void calculate_new_root (dword new_start_cylinder, partition *partition)
{
pr_partition_table.calculate_new_root (new_start_cylinder,partition,geometry);
}
void check (boolean final_check);
fips_harddrive (int number)
:harddrive (number)
{
get_geometry ();
// to write register info to debugfile
}
fips_harddrive (fips_harddrive &hd):harddrive (hd)
{
harddrive::operator= (hd);
// in constructor of base class virtual functions are not yet
// accessible => assign again so that partition_table() is
// copied correctly
}
void operator= (fips_harddrive &hd)
{
harddrive::operator= (hd);
}
};
class fips_logdrive_info:public logical_drive_info
{
public:
void put_debug_info (void);
};
class fips_partition:public partition
{
fips_bpb pr_bpb;
fips_logdrive_info pr_info;
public:
bios_parameter_block &bpb() { return pr_bpb; }
logical_drive_info &info() { return pr_info; }
void print_bpb (void) { pr_bpb.print(); }
void write_info_debugfile (void) { pr_info.put_debug_info(); }
void calculate_new_boot (void)
{
pr_bpb.calculate_new_boot (*partition_info);
}
void check (void);
fips_partition (class fips_harddrive *drive,int number):partition(drive,number) {}
dword min_cylinder (fat16 fat, drive_geometry geometry);
boolean split (fips_harddrive hd);
};
#endif

View File

@@ -0,0 +1,205 @@
/*
* $Header$
*
* Copyright (C) 1994 Arno Schaefer
*
* AU: Auswertung der Kommandozeile, der POSIX-Version von getopt ()
* nachempfunden.
*
* PO: ANSI C
*/
#include <stdio.h>
#include <string.h>
#include "getopt.h"
/* Globale Variablen */
char *optarg;
int optind = 1;
int opterr = 1;
int optopt;
static char *nextarg = NULL;
/* Funktion */
int getopt (int argc, char *argv[], char *optstring)
/*
* AU: Auswertung der Kommandozeile
*
* VB: argc und argv sind die Parameter, die an main () uebergeben werden.
* optstring ist ein String, der die Zeichen enthaelt, die als
* Optionen erkannt werden. Wenn ein Zeichen von einem Doppelpunkt
* gefolgt wird, hat die Option ein Argument, das direkt auf das Zeichen
* folgt oder durch Space davon getrennt ist. Gueltige Optionszeichen
* sind alle druckbaren Zeichen ausser '?', ' ' und ':'.
*
* optind ist der Index auf das naechste Element von argv[], das
* bearbeitet wird.
*
* opterr ist ein Flag, das festlegt, ob bei Fehlern Fehlermeldungen
* ausgegeben werden.
*
* optarg ist ein Zeiger auf das Argument, wenn eine Option ein
* Argument hat.
*
* optopt enthaelt bei Fehlern das Optionszeichen, das den Fehler aus-
* geloest hat.
*
* NB: Rueckgabewert ist das jeweils naechste Optionszeichen, oder -1 am
* Ende der Optionsliste.
*
* Die Optionsliste ist zu Ende, wenn argv[optind] NULL ist, oder
* argv[optind] nicht mit '-' (oder '/') beginnt, oder argv[optind]
* ein einzelnes "-" ist. In diesem Fall wird optind nicht erhoeht.
* Das Ende der Optionsliste kann mit "--" erzwungen werden, dann ist
* argv[optind] das erste Argument nach "--".
*
* FB: Ein '?' wird zurueckgegeben, wenn ein Optionszeichen nicht in
* optstring enthalten war oder ein ungueltiges Optionszeichen
* uebergeben wurde ('?' oder ':'). Ausserdem bei einem fehlenden
* Argument, wenn das erste Zeichen von optstring kein ':' ist.
*
* Ein ':' wird zurueckgegeben bei einem fehlenden Argument, wenn
* das erste Zeichen von optstring ein ':' ist.
*/
{
char *search;
optarg = NULL;
if (nextarg == NULL)
{
nextarg = argv[optind];
if (nextarg == NULL)
{
return (-1);
}
#ifdef __MSDOS__
if (*nextarg != '-' && *nextarg != '/')
#else
if (*nextarg != '-')
#endif
{
return (-1);
}
nextarg++;
} /* if */
optopt = *nextarg++;
if (optopt == 0)
{
return (-1);
}
optind++;
if (optopt == '-' && *nextarg == 0)
{
return (-1);
}
if (optopt == ':' || optopt == '?')
{
if (opterr)
{
fprintf
(
stderr,
"%s: illegal option -- %c\n",
argv[0],
optopt
);
}
return ('?');
} /* if */
search = strchr (optstring, optopt);
if (search == NULL)
{
if (opterr)
{
fprintf
(
stderr,
"%s: illegal option -- %c\n",
argv[0],
optopt
);
}
return ('?');
} /* if */
if (*nextarg == 0)
{
nextarg = NULL;
}
if (search[1] != ':')
{
if (nextarg != NULL)
{
optind--;
}
return (optopt);
}
if (nextarg != NULL)
{
optarg = nextarg;
nextarg = NULL;
return (optopt);
}
optarg = argv[optind];
if (optind == argc)
{
if (opterr)
{
fprintf
(
stderr,
"%s: option requires an argument -- %c\n",
argv[0],
optopt
);
} /* if */
if (optstring[0] == ':')
{
return (':');
}
else
{
return ('?');
}
} /* if */
else
{
optind++;
}
return (optopt);
} /* getopt () */

View File

@@ -0,0 +1,29 @@
/*
* $Header$
*
* Copyright (C) 1994 Arno Schaefer
*
* AU: Prototypen und externe Variablen fuer getopt ()
*
* PO: ANSI C
*/
#ifndef GETOPT_H
#define GETOPT_H
#ifdef __cplusplus
extern "C" {
#endif
extern char *optarg;
extern int optind;
extern int opterr;
extern int optopt;
int getopt (int argc, char *argv[], char *optstring);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,257 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module global.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/global.cpp 1.4 1995/01/19 00:00:52 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <stdarg.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include "version.h"
#include "global.h"
#define CTRL_C 3
global_vars global;
/* ----------------------------------------------------------------------- */
/* Initialization of global variables */
/* ----------------------------------------------------------------------- */
global_vars::global_vars (void)
{
test_mode = false;
verbose_mode = true;
debug_mode = false;
drive_number_cmdline = 0;
}
global_vars::~global_vars (void)
{
if (debug_mode) fclose (debugfile);
}
void exit_function (void)
{
printx ("\nBye!\n");
}
void global_vars::open_debugfile (int argc,char *argv[])
{
if ((debugfile = fopen ("fipsinfo.dbg","wt")) == NULL)
{
global.debug_mode = false;
warning (true, "Can't open debug file");
}
else
{
fprintf (debugfile,"FIPS debug file\n\n");
fprintf (debugfile,"The command was: ");
while (argc--) fprintf (debugfile,argc ? "%s " : "%s", *argv++);
fprintf (debugfile,"\n\nTranscript of session:\n");
}
}
/* ----------------------------------------------------------------------- */
/* Replacement for printf - prints to screen and debugfile */
/* ----------------------------------------------------------------------- */
void printx (char *fmt,...)
{
va_list ap;
va_start (ap,fmt);
vprintf (fmt,ap);
if (global.debug_mode) vfprintf (global.debugfile,fmt,ap);
va_end (ap);
}
/* ----------------------------------------------------------------------- */
/* Replacement for getch - exit when CTRL-C is pressed */
/* ----------------------------------------------------------------------- */
int getx (void)
{
int character = getch();
if (character == CTRL_C)
{
printx ("\n");
exit (0);
}
return (character);
}
/* ----------------------------------------------------------------------- */
/* Copyright notice and version number */
/* ----------------------------------------------------------------------- */
void notice (void)
{
printx ("\nFIPS version " FIPS_VERSION ", Copyright (C) 1993/94 Arno Schaefer\n\n");
printx ("DO NOT use FIPS in a multitasking environment like Windows, OS/2, Desqview,\n");
printx ("Novell Task manager or the Linux DOS emulator: boot from a DOS boot disk first.\n\n");
printx ("If you use OS/2 or a disk compressor, read the relevant sections in FIPS.DOC.\n\n");
printx ("FIPS comes with ABSOLUTELY NO WARRANTY, see file COPYING for details\n");
printx ("This is free software, and you are welcome to redistribute it\n");
printx ("under certain conditions; again see file COPYING for details.\n");
printx ("\nPress any Key\n");
getx();
}
/* ----------------------------------------------------------------------- */
/* Hexdump binary data into a file */
/* ----------------------------------------------------------------------- */
void hexwrite (byte *buffer,int number,FILE *file)
{
for (int i=0;i<number;i++)
{
fprintf (file,"%02X ",*(buffer+i));
if ((i+1)%16 == 0) fprintf (file,"\n");
else if ((i+1)%8 == 0) fprintf (file,"- ");
}
fprintf (file,"\n");
}
/* ----------------------------------------------------------------------- */
/* Error Handling */
/* ----------------------------------------------------------------------- */
static void print_verbose_message (char *message)
{
char line[256];
int length = 0;
FILE *error_msg_file;
fprintf (stderr,"\n");
if (global.debug_mode) fprintf (global.debugfile,"\n");
if ((error_msg_file = fopen ("errors.txt","rt")) == NULL)
{
fprintf (stderr,"File ERRORS.TXT not found - no verbose messages available\n");
if (global.debug_mode) fprintf (global.debugfile,"File ERRORS.TXT not found - no verbose messages available\n");
global.verbose_mode = false;
return;
}
while (message[length] != 0 && message[length] != ':') length++;
fgets (line,255,error_msg_file);
while (strncmp(message,line,length)) if (fgets (line,255,error_msg_file) == NULL) return;
fgets (line,255,error_msg_file);
while (!strncmp(" ",line,2))
{
fprintf (stderr,"%s",line+2);
if (global.debug_mode) fprintf (global.debugfile,"%s",line+2);
if (fgets (line,255,error_msg_file) == NULL) return;
}
fclose (error_msg_file);
}
void error (char *message,...)
{
va_list ap;
va_start (ap,message);
fprintf (stderr,"\nError: ");
vfprintf (stderr,message,ap);
fprintf (stderr,"\n");
if (global.debug_mode)
{
fprintf (global.debugfile,"\nError: ");
vfprintf (global.debugfile,message,ap);
fprintf (global.debugfile,"\n");
}
va_end (ap);
if (global.verbose_mode) print_verbose_message (message);
exit (-1);
}
void warning (boolean wait_key, char *message,...)
{
va_list ap;
va_start (ap,message);
fprintf (stderr,"\nWarning: ");
vfprintf (stderr,message,ap);
fprintf (stderr,"\n");
if (global.debug_mode)
{
fprintf (global.debugfile,"\nWarning: ");
vfprintf (global.debugfile,message,ap);
fprintf (global.debugfile,"\n");
}
va_end (ap);
if (global.verbose_mode) print_verbose_message (message);
if (wait_key)
{
fprintf (stderr,"\nPress any key\n");
if (global.debug_mode) fprintf (global.debugfile,"\nPress any key\n");
getx ();
}
}
void infomsg (char *message,...)
{
va_list ap;
va_start (ap,message);
fprintf (stderr,"\nInfo: ");
vfprintf (stderr,message,ap);
fprintf (stderr,"\n");
if (global.debug_mode)
{
fprintf (global.debugfile,"\nInfo: ");
vfprintf (global.debugfile,message,ap);
fprintf (global.debugfile,"\n");
}
va_end (ap);
if (global.verbose_mode) print_verbose_message (message);
fprintf (stderr,"\nPress any key\n");
if (global.debug_mode) fprintf (global.debugfile,"\nPress any key\n");
getx ();
}

View File

@@ -0,0 +1,70 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module disk_io.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/global.h 1.4 1995/01/19 00:01:25 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef GLOBAL_H
#define GLOBAL_H
#include <stdio.h>
#include "types.h"
#include "hdstruct.h"
#include "primpart.h"
struct global_vars
{
boolean test_mode;
boolean verbose_mode;
boolean debug_mode;
int drive_number_cmdline;
FILE *debugfile;
void open_debugfile (int argc,char *argv[]);
global_vars (void);
~global_vars (void);
};
extern global_vars global;
void printx (char *fmt,...);
int getx (void);
void error (char *message,...);
void warning (boolean wait_key, char *message,...);
void infomsg (char *message,...);
void hexwrite (byte *buffer,int number,FILE *file);
void exit_function (void);
void notice (void);
void evaluate_argument_vector (int argc,char *argv[]);
void save_root_and_boot (harddrive *drive,partition *partition);
#endif

View File

@@ -0,0 +1,154 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module hdstruct.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/hdstruct.cpp 1.4 1995/01/19 00:20:01 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include "types.h"
#include "hdstruct.h"
root_sector::root_sector (root_sector &rs)
{
drive = rs.drive;
for (int i=0; i<512; i++) data[i] = rs.data[i];
}
void root_sector::operator= (root_sector &rs)
{
drive = rs.drive;
for (int i=0; i<512; i++) data[i] = rs.data[i];
}
void harddrive::operator= (harddrive &hd)
{
physical_drive::operator= (hd);
*root_sector = *(hd.root_sector);
partition_table () = hd.partition_table ();
}
void harddrive::get_partition_table (void)
{
partition_table().get (root_sector);
for (int i = 0; i < 4; i++)
{
class partition_info* p
= &(partition_table().partition_info[i]);
if (p->system == 0) continue;
while
(
p->start_sector_abs
> (
(p->start_cylinder + 1000UL)
* geometry.heads
* geometry.sectors
+ p->start_head
* geometry.sectors
+ p->start_sector
- 1
)
)
{
p->start_cylinder += 1024; // more than 1024 cylinders
}
while
(
(p->start_sector_abs + p->no_of_sectors_abs - 1)
> (
(p->end_cylinder + 1000UL)
* geometry.heads
* geometry.sectors
+ p->end_head
* geometry.sectors
+ p->end_sector
- 1
)
)
{
p->end_cylinder += 1024; // more than 1024 cylinders
}
}
}
/* ----------------------------------------------------------------------- */
/* Extract Partition Table from root sector */
/* ----------------------------------------------------------------------- */
void partition_table::get (root_sector *root_sector)
{
for (int i=0;i<4;i++)
{
class partition_info *p = &partition_info[i];
byte *pi = &(root_sector->data[0x1be+16*i]);
p->bootable = *pi;
p->start_head = *(pi+1);
p->start_cylinder = *(pi+3) | ((*(pi+2) << 2) & 0x300);
p->start_sector = *(pi+2) & 0x3f;
p->system = *(pi+4);
p->end_head = *(pi+5);
p->end_cylinder = *(pi+7) | ((*(pi+6) << 2) & 0x300);
p->end_sector = *(pi+6) & 0x3f;
p->start_sector_abs = (dword) *(pi+8) | ((dword) *(pi+9) << 8) | ((dword) *(pi+10) << 16) | ((dword) *(pi+11) << 24);
p->no_of_sectors_abs = (dword) *(pi+12) | ((dword) *(pi+13) << 8) | ((dword) *(pi+14) << 16) | ((dword) *(pi+15) << 24);
}
}
/* ----------------------------------------------------------------------- */
/* Write Partition Table back into root sector */
/* ----------------------------------------------------------------------- */
void partition_table::put (root_sector *root_sector)
{
for (int i=0; i<4; i++)
{
class partition_info p = partition_info[i];
byte *pi = &(root_sector->data[0x1be+16*i]);
*pi = p.bootable;
*(pi+1) = p.start_head;
*(pi+2) = ((p.start_cylinder >> 2) & 0xc0) | (p.start_sector & 0x3f);
*(pi+3) = p.start_cylinder & 0xff;
*(pi+4) = p.system;
*(pi+5) = p.end_head;
*(pi+6) = ((p.end_cylinder >> 2) & 0xc0) | (p.end_sector & 0x3f);
*(pi+7) = p.end_cylinder & 0xff;
*(pi+8) = p.start_sector_abs & 0xff;
*(pi+9) = (p.start_sector_abs >> 8) & 0xff;
*(pi+10) = (p.start_sector_abs >> 16) & 0xff;
*(pi+11) = (p.start_sector_abs >> 24) & 0xff;
*(pi+12) = p.no_of_sectors_abs & 0xff;
*(pi+13) = (p.no_of_sectors_abs >> 8) & 0xff;
*(pi+14) = (p.no_of_sectors_abs >> 16) & 0xff;
*(pi+15) = (p.no_of_sectors_abs >> 24) & 0xff;
}
}

View File

@@ -0,0 +1,144 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module hdstruct.h
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/hdstruct.h 1.4 1995/01/19 00:01:26 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef HDSTRUCT_H
#define HDSTRUCT_H
#include "types.h"
#include "disk_io.h"
/* ----------------------------------------------------------------------- */
/* Class root_sector - derived from structure sector */
/* Must be initialized with a pointer to a physical_drive object */
/* Read() and Write() read/write sector 0 of physical drive */
/* ----------------------------------------------------------------------- */
class root_sector:public sector
{
physical_drive *drive;
public:
// constructors and operators
root_sector (physical_drive *drive) { root_sector::drive = drive; }
root_sector (root_sector &rs);
void operator= (root_sector &rs);
// functions
int read (void) { return drive->read_sector (this, 0); }
int write (void) { return drive->write_sector (this, 0); }
};
/* ----------------------------------------------------------------------- */
/* Partition Info Structure */
/* Each entry in the partition table contains this information */
/* ----------------------------------------------------------------------- */
struct partition_info
{
byte bootable; // 80h or 0
byte start_head; // location of first sector (boot_sector)
word start_cylinder;
byte start_sector;
byte system; // 1 = 12-bit FAT
// 4 = 16-bit FAT & 16-bit sector number
// 6 = 16-bit FAT & 32-bit sector number (BIGDOS)
byte end_head; // location of last sector
word end_cylinder;
byte end_sector;
dword start_sector_abs; // = start_cylinder * heads * sectors
// + start_head * sectors + start_sector - 1
dword no_of_sectors_abs; // = end_cylinder * heads * sectors + end_head * sectors
// + end_sector - start_sector_abs
};
/* ----------------------------------------------------------------------- */
/* Partition Table Structure */
/* The partition table consists of 4 entries for the 4 possible partitions */
/* Get() reads the partition table from the root_sector, put() writes the */
/* data back into the root_sector buffer */
/* ----------------------------------------------------------------------- */
struct partition_table
{
partition_info partition_info[4];
void get (root_sector *root_sector);
void put (root_sector *root_sector);
};
/* ----------------------------------------------------------------------- */
/* Harddrive Class, derived from physical_drive */
/* Represents one physical harddrive. Must be initialized with the drive */
/* number (0x80 for 1st HDD). Contains the root_sector and partition table. */
/* ----------------------------------------------------------------------- */
class harddrive:public physical_drive
{
partition_table pr_partition_table;
public:
// constructors, destructors, operators
harddrive (int number):physical_drive (number)
{
root_sector = new class root_sector (this);
}
harddrive (harddrive &hd):physical_drive (hd)
{
root_sector = new class root_sector (*(hd.root_sector));
partition_table () = hd.partition_table ();
}
void operator= (harddrive &hd);
~harddrive (void) { delete root_sector; }
// public data
root_sector *root_sector;
// member access functions
virtual partition_table &partition_table() { return pr_partition_table; }
// functions
int read_root_sector (void) { return (root_sector->read ()); }
int write_root_sector (void) { return (root_sector->write ()); }
void get_partition_table (void); // extract pt data from root sector
void put_partition_table (void) // put pt data into root sector
{partition_table().put (root_sector);}
};
#endif

View File

@@ -0,0 +1,114 @@
// host_os.cpp host operating system classes
// dave mccaldon (d.mccalden@staffordshire.ac.uk)
#include "host_os.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dos.h>
char *msdos_info (void)
{
return ("MS-DOS version %d.%d");
};
char *dosemu_info (void)
{
return ("Linux dosemu version %d.%d");
};
char *mswindows_info (void)
{
return ("MS-Windows version %d.%d");
};
char *desqview_info (void)
{
return ("Desq-View version %d.%d");
};
host_os::host_os (void)
{
status = NOT_OK;
if (mswindows_detect () == true) format = mswindows_info;
// else if (dosemu_detect () == true) format = dosemu_info;
else if (desqview_detect () == true) format = desqview_info;
else
{
status = OK;
msdos_version ();
format = msdos_info;
}
}
char *host_os::information( char *p )
{
if( p == NULL )
p = (char *) malloc( strlen( format() ) + 12 );
sprintf( p, format(), ver_major, ver_minor );
return p;
}
void host_os::msdos_version()
{
ver_major = _osmajor; // borlandc constants
ver_minor = _osminor;
}
boolean host_os::mswindows_detect()
{
union REGS r;
r.x.ax = 0x1600;
int86( 0x2F, &r, &r );
if( r.h.al & 0x7F )
{
ver_major = r.h.al;
ver_minor = r.h.ah;
return (true);
}
return (false);
}
boolean host_os::dosemu_detect()
{
union REGS r;
// this is slightly more difficult than just calling the dosemu
// interrupt (0xE5), we need to check if the interrupt has a
// handler, as DOS and BIOS don't establish a default handler
if( getvect( 0xE5 ) == NULL )
return (false);
r.x.ax = 0;
int86( 0xE5, &r, &r );
if( r.x.ax == 0xAA55 ) // check signature
{
ver_major = r.h.bh;
ver_minor = r.h.bl;
return (true);
}
return (false);
}
boolean host_os::desqview_detect()
{
union REGS r;
r.x.ax = 0x2B01; // AL=01 => get desqview version
r.x.cx = 0x4445; // CX = 'DE'
r.x.dx = 0x5351; // DX = 'SQ'
int86( 0x21, &r, &r );
if( r.h.al != 0xFF )
{
ver_major = r.h.bh;
ver_minor = r.h.bl;
return (true);
}
return (false);
}

View File

@@ -0,0 +1,34 @@
// host_os.h host operating system classes
// dave mccaldon (d.mccalden@staffordshire.ac.uk)
#ifndef HOST_OS_H
#define HOST_OS_H
#include "types.h"
#define NOT_OK 0 // NOT_OK for FIPS to run
#define OK 1 // OK for FIPS to run
#define UNKNOWN 2
class host_os
{
public:
host_os(); // constructor
virtual int ok () { return status; };
virtual char *information( char * );
protected:
char* (*format)();
void msdos_version ();
boolean mswindows_detect ();
boolean dosemu_detect ();
boolean desqview_detect ();
int status; // status value
int ver_major; // major version number
int ver_minor; // minor version number
};
#endif

View File

@@ -0,0 +1,232 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module input.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/input.cpp 1.4 1995/01/19 00:00:54 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <ctype.h>
#include <stdlib.h>
#include "types.h"
#include "disk_io.h"
#include "global.h"
#include "input.h"
/* ----------------------------------------------------------------------- */
/* User Input */
/* ----------------------------------------------------------------------- */
static void wait_for_key (void)
{
printx ("\nPress any Key\n");
getx();
}
int ask_for_drive_number (void)
/*
* Find Disk Drives - if more than one, ask for drive number. If no drive
* was found, issue warning, try drive 0x80 anyway
*/
{
int drives_found = 0;
int drive_table[] = {0,0,0,0,0,0,0,0,0};
int no_of_drives = get_no_of_drives ();
for (int i=0x80; i < 0x80 + no_of_drives; i++)
{
if (get_disk_type (i) == 3)
{
drive_table[drives_found++] = i;
if (drives_found == 9)
break;
}
}
if (drives_found == 0)
{
warning (false, "No compatible hard disk found");
ask_if_continue ();
return (0x80);
}
if (drives_found == 1)
return (drive_table[0]);
printx ("Which Drive (");
for (i=0; i<drives_found; i++)
printx ("%u=0x%02X/", i+1, drive_table[i]);
printx ("\b)? ");
while (true)
{
i = getx ();
if (i >= '1' && i <= '9')
if (drive_table[i - '1'] != 0) break;
}
printx ("%c\n",i);
return (drive_table[i - '1']);
}
int ask_for_partition_number (partition_info parts[])
{
int number_of_partitions = (parts[0].system != 0) + (parts[1].system != 0) +
(parts[2].system != 0) + (parts[3].system != 0);
if (number_of_partitions == 0)
error ("No valid partition found");
if (number_of_partitions == 4)
error ("No free partition");
if (number_of_partitions == 1)
{
wait_for_key();
for (int i = 0; i < 4; i++) if (parts[i].system) return i;
}
printx ("\nWhich Partition do you want to split (");
for (int i = 0; i < 4; i++) if (parts[i].system) printx ("%u/", i + 1);
printx ("\b)? ");
while (true)
{
i = getx ();
if (isdigit (i)) if (('0' < i) && (i <= '4')) if (parts[i - '1'].system) break;
}
printx ("%c\n", i);
return (i - '1');
}
dword ask_for_new_start_cylinder (int start_cylinder, int min_cylinder, int max_cylinder, int sectors_per_cylinder)
{
int akt_cylinder = min_cylinder;
printx ("\nEnter start cylinder for new partition (%u - %u):\n\n",min_cylinder,max_cylinder);
printx ("Use the cursor keys to choose the cylinder, <enter> to continue\n\n");
printx ("Old partition Cylinder New Partition\n");
while (true)
{
double oldsize = (akt_cylinder - start_cylinder) * (double) sectors_per_cylinder / 2048;
double newsize = (max_cylinder - akt_cylinder + 1) * (double) sectors_per_cylinder / 2048;
printf (" %6.1f MB %4u %6.1f MB\r", oldsize, akt_cylinder, newsize);
int input = getx ();
if (input == '\r')
{
printx (" %6.1f MB %4u %6.1f MB\n\n", oldsize, akt_cylinder, newsize);
return (akt_cylinder);
}
else if (input != 0) continue;
input = getx ();
switch (input)
{
case 75:
if (akt_cylinder > min_cylinder) akt_cylinder--;
break;
case 77:
if (akt_cylinder < max_cylinder) akt_cylinder++;
break;
case 72:
if (akt_cylinder - 10 >= min_cylinder) akt_cylinder -= 10;
break;
case 80:
if (akt_cylinder + 10 <= max_cylinder) akt_cylinder += 10;
break;
}
}
}
char ask_yes_no (void)
{
int character;
do character = getx(); while ((character != 'y') && (character != 'n'));
printx ("%c\n",character);
return (character);
}
char ask_correction (void)
{
printx ("Do you want to correct this (y/n) ");
return (ask_yes_no ());
}
void ask_for_write_permission (void)
{
printx ("\nReady to write new partition scheme to disk\n");
printx ("Do you want to proceed (y/n)? ");
if (ask_yes_no () == 'n') exit (0);
}
boolean ask_if_continue (void)
{
printx ("\nDo you want to continue or reedit the partition table (c/r)? ");
int character;
do character = getx(); while ((character != 'c') && (character != 'r'));
printx ("%c\n",character);
if (character == 'r') return (false);
return (true);
}
boolean ask_if_save (void)
{
int character;
printx ("Do you want to make a backup copy of your root and boot sector before\nproceeding (y/n)? ");
if (ask_yes_no () == 'n') return (false);
printx ("Do you have a bootable floppy disk in drive A: as described in the\ndocumentation (y/n)? ");
if (ask_yes_no () == 'n')
{
printx ("Please read the file FIPS.DOC!\n");
exit (0);
}
return (true);
}
void ask_if_proceed (void)
{
printx ("Do you want to proceed (y/n)? ");
if (ask_yes_no () == 'n') exit (0);
}

View File

@@ -0,0 +1,47 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module input.h
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/input.h 1.4 1995/01/19 00:01:27 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef INPUT_H
#define INPUT_H
#include "types.h"
#include "hdstruct.h"
int ask_for_drive_number (void);
int ask_for_partition_number (partition_info parts[]);
dword ask_for_new_start_cylinder (int start_cylinder, int min_cylinder,int max_cylinder, int sectors_per_cylinder);
void ask_for_write_permission (void);
boolean ask_if_continue (void);
boolean ask_if_save (void);
void ask_if_proceed (void);
char ask_yes_no (void);
char ask_correction (void);
#endif

View File

@@ -0,0 +1,126 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module logdr_st.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/logdr_str.cpp 1.4 1995/01/19 00:00:54 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <string.h>
#include "types.h"
#include "logdr_st.h"
/* ----------------------------------------------------------------------- */
/* Extract Bios Parameter Block from boot sector */
/* ----------------------------------------------------------------------- */
void bios_parameter_block::get (boot_sector *boot_sector)
{
byte *bp = boot_sector->data;
memcpy (jump_instruction,bp,3);
memcpy (oem_name,bp+3,8);
oem_name[8]=0;
bytes_per_sector = *(bp+0xb) | (*(bp+0xc) << 8);
sectors_per_cluster = *(bp+0xd);
reserved_sectors = *(bp+0xe) | (*(bp+0xf) << 8);
no_of_fats = *(bp+0x10);
no_of_rootdir_entries = *(bp+0x11) | (*(bp+0x12) << 8);
no_of_sectors = *(bp+0x13) | (*(bp+0x14) << 8);
media_descriptor = *(bp+0x15);
sectors_per_fat = *(bp+0x16) | (*(bp+0x17) << 8);
sectors_per_track = *(bp+0x18) | (*(bp+0x19) << 8);
drive_heads = *(bp+0x1a) | (*(bp+0x1b) << 8);
hidden_sectors = (dword) *(bp+0x1c) | ((dword) *(bp+0x1d) << 8) | ((dword) *(bp+0x1e) << 16) | ((dword) *(bp+0x1f) << 24);
no_of_sectors_long = (dword) *(bp+0x20) | ((dword) *(bp+0x21) << 8) | ((dword) *(bp+0x22) << 16) | ((dword) *(bp+0x23) << 24);
phys_drive_no = *(bp+0x24);
signature = *(bp+0x26);
serial_number = (dword) *(bp+0x27) | ((dword) *(bp+0x28) << 8) | ((dword) *(bp+0x29) << 16) | ((dword) *(bp+0x2a) << 24);
memcpy (volume_label,bp+0x2b,11);
volume_label[11] = 0;
memcpy (file_system_id,bp+0x36,8);
file_system_id[8] = 0;
}
/* ----------------------------------------------------------------------- */
/* Write Bios Parameter Block back into boot sector */
/* ----------------------------------------------------------------------- */
void bios_parameter_block::put (boot_sector *boot_sector)
{
byte *bp = boot_sector->data;
memcpy (bp,jump_instruction,3);
memcpy (bp+3,oem_name,8);
*(bp+0xb) = bytes_per_sector & 0xff;
*(bp+0xc) = (bytes_per_sector >> 8) & 0xff;
*(bp+0xd) = sectors_per_cluster;
*(bp+0xe) = reserved_sectors & 0xff;
*(bp+0xf) = (reserved_sectors >> 8) & 0xff;
*(bp+0x10) = no_of_fats;
*(bp+0x11) = no_of_rootdir_entries & 0xff;
*(bp+0x12) = (no_of_rootdir_entries >> 8) & 0xff;
*(bp+0x13) = no_of_sectors & 0xff;
*(bp+0x14) = (no_of_sectors >> 8) & 0xff;
*(bp+0x15) = media_descriptor;
*(bp+0x16) = sectors_per_fat & 0xff;
*(bp+0x17) = (sectors_per_fat >> 8) & 0xff;
*(bp+0x18) = sectors_per_track & 0xff;
*(bp+0x19) = (sectors_per_track >> 8) & 0xff;
*(bp+0x1a) = drive_heads & 0xff;
*(bp+0x1b) = (drive_heads >> 8) & 0xff;
*(bp+0x1c) = hidden_sectors & 0xff;
*(bp+0x1d) = (hidden_sectors >> 8) & 0xff;
*(bp+0x1e) = (hidden_sectors >> 16) & 0xff;
*(bp+0x1f) = (hidden_sectors >> 24) & 0xff;
*(bp+0x20) = no_of_sectors_long & 0xff;
*(bp+0x21) = (no_of_sectors_long >> 8) & 0xff;
*(bp+0x22) = (no_of_sectors_long >> 16) & 0xff;
*(bp+0x23) = (no_of_sectors_long >> 24) & 0xff;
*(bp+0x24) = phys_drive_no;
*(bp+0x26) = signature;
*(bp+0x27) = serial_number & 0xff;
*(bp+0x28) = (serial_number >> 8) & 0xff;
*(bp+0x29) = (serial_number >> 16) & 0xff;
*(bp+0x2a) = (serial_number >> 24) & 0xff;
memcpy (bp+0x2b,volume_label,11);
memcpy (bp+0x36,file_system_id,8);
}
/* ----------------------------------------------------------------------- */
/* Extract some misc. drive parameters from BPB */
/* ----------------------------------------------------------------------- */
void logical_drive_info::get (const bios_parameter_block &bpb)
{
start_fat1 = bpb.reserved_sectors;
start_fat2 = start_fat1 + bpb.sectors_per_fat;
start_rootdir = start_fat2 + bpb.sectors_per_fat;
if (bpb.no_of_rootdir_entries == 0) start_data = start_rootdir;
else start_data = start_rootdir + (bpb.no_of_rootdir_entries - 1) / 16 + 1;
if (bpb.sectors_per_cluster == 0) no_of_clusters = 0;
else no_of_clusters = ((bpb.no_of_sectors ? bpb.no_of_sectors : bpb.no_of_sectors_long) - start_data) / bpb.sectors_per_cluster;
};

View File

@@ -0,0 +1,174 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module logdr_st.h
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/logdr_st.h 1.4 1995/01/19 00:01:27 schaefer Exp $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef LOGDR_ST_H
#define LOGDR_ST_H
#include "types.h"
#include "disk_io.h"
/* ----------------------------------------------------------------------- */
/* Class boot_sector - derived from structure sector */
/* Must be initialized with pointer to logical drive object */
/* Read() and write() read/write sector 0 of logical drive */
/* ----------------------------------------------------------------------- */
class boot_sector:public sector
{
class logical_drive *logical_drive;
public:
// constructor
boot_sector (class logical_drive *logical_drive)
{ boot_sector::logical_drive = logical_drive; }
// functions
int read (void);
int write (void);
};
/* ------------------------------------------------------------------------ */
/* Bios Parameter Block structure */
/* This is not exactly the BPB as understood by DOS, because it contains */
/* the additional fields that are in the boot_sector like jump_instruction, */
/* oem_name etc. Get() extracts info from the boot_sector, put() writes the */
/* info back into the boot_sector buffer. */
/* ------------------------------------------------------------------------ */
struct bios_parameter_block
{
byte jump_instruction[3]; // EB xx 90 or E9 xx xx
char oem_name[9];
word bytes_per_sector; // usually 512
byte sectors_per_cluster; // may differ
word reserved_sectors; // usually 1 (boot_sector)
byte no_of_fats; // usually 2
word no_of_rootdir_entries; // usually 512 for HDs (?), 224 for
// HD-Floppies, 112 for DD-Floppies
word no_of_sectors; // 0 on BIGDOS partitions
byte media_descriptor; // usually F8h
word sectors_per_fat; // depends on partition size
word sectors_per_track; // depends on drive
word drive_heads; // dto.
dword hidden_sectors; // first sector of partition or 0 for FDs
dword no_of_sectors_long; // number of sectors on BIGDOS partitions
byte phys_drive_no; // usually 80h
byte signature; // usually 29h
dword serial_number; // random
char volume_label[12];
char file_system_id[9];
void get (boot_sector *boot_sector);
void put (boot_sector *boot_sector);
};
/* ----------------------------------------------------------------------- */
/* Some miscellaneous figures about the drive */
/* Get() extracts this info from the BPB */
/* ----------------------------------------------------------------------- */
struct logical_drive_info
{
dword start_fat1;
dword start_fat2;
dword start_rootdir;
dword start_data;
dword no_of_clusters;
virtual void get (const bios_parameter_block &bpb);
};
/* ----------------------------------------------------------------------- */
/* Abstract Class logical_drive. This can be any DOS drive that allows */
/* direct reading and writing of sectors, like Harddisk Partitions, Floppy */
/* disks or Ramdisks */
/* ----------------------------------------------------------------------- */
class logical_drive
{
// private data
struct bios_parameter_block pr_bpb;
struct logical_drive_info pr_info;
public:
// public data
class boot_sector *boot_sector;
// member access functions
virtual bios_parameter_block &bpb() { return pr_bpb; }
virtual logical_drive_info &info() { return pr_info; }
// functions
virtual int read_sector (dword number,sector *sector) = 0;
virtual int write_sector (dword number,sector *sector) = 0;
// pure virtual functions
int read_boot_sector (void) { return (boot_sector->read ()); }
int write_boot_sector (void) { return (boot_sector->write ()); }
void get_bpb (void) { bpb().get (boot_sector); }
void put_bpb (void) { bpb().put (boot_sector); }
void get_info (void) { info().get (bpb ()); }
};
/* ----------------------------------------------------------------------- */
/* Function to read boot_sector from logical drive */
/* It must be in the header file because it is inline */
/* ----------------------------------------------------------------------- */
inline int boot_sector::read (void)
{
return logical_drive->read_sector (0,this);
}
/* ----------------------------------------------------------------------- */
/* Function to write boot_sector to logical drive */
/* ----------------------------------------------------------------------- */
inline int boot_sector::write (void)
{
return logical_drive->write_sector (0,this);
}
#endif

View File

@@ -0,0 +1,171 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module main.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/main.cpp 1.4 1995/01/19 00:00:55 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <stdlib.h>
#include "logdr_st.h"
#include "global.h"
#include "input.h"
#include "fat.h"
#include "fipsspec.h"
#include "host_os.h"
#define FIRST_CHECK false
#define FINAL_CHECK true
extern unsigned _stklen = 20000U;
int main (int argc, char *argv[])
{
// *********************************************************
// Initialize Program
// *********************************************************
evaluate_argument_vector (argc, argv);
atexit (exit_function);
if (global.debug_mode)
global.open_debugfile (argc,argv);
notice ();
host_os os;
char infostring[256];
if (os.ok () != OK)
{
printx ("\nWARNING: FIPS has detected that it is running under %s\n"
"FIPS should not be used under a multitasking OS. If possible, boot from a DOS\n"
"disk and then run FIPS. Read FIPS.DOC for more information.\n\n",
os.information (infostring));
ask_if_proceed ();
}
// *********************************************************
// Select Drive
// *********************************************************
int drive_number;
if (global.drive_number_cmdline != 0)
drive_number = global.drive_number_cmdline;
else
drive_number = ask_for_drive_number ();
fips_harddrive harddrive (drive_number); // reads geometry
if (harddrive.errorcode)
error
(
"Error reading drive geometry: Errorcode %u",
harddrive.errorcode
);
harddrive.reset ();
if (harddrive.errorcode)
{
warning
(
false,
"Drive initialization failure: Errorcode %u",
harddrive.errorcode
);
ask_if_proceed ();
}
// *********************************************************
// Select partition
// *********************************************************
if (harddrive.read_root_sector () != 0)
error ("Error reading root sector");
if (global.debug_mode)
{
fprintf
(
global.debugfile,
"\nRoot sector drive %02Xh:\n\n",
drive_number
);
hexwrite (harddrive.root_sector->data, 512, global.debugfile);
}
while (true)
{
fips_harddrive hd = harddrive;
hd.get_partition_table();
printx ("\nPartition table:\n\n");
hd.print_partition_table ();
hd.check (FIRST_CHECK);
int partition_number =
ask_for_partition_number
(
hd.partition_table().partition_info
);
int system = hd.partition_table()
.partition_info[partition_number].system;
switch (system)
{
case 5:
error ("Can't split extended partitions");
break;
case 1: case 4: case 6:
{
fips_partition* partition =
new fips_partition (&hd, partition_number);
if (partition->split (hd) == true)
return (0);
delete partition;
}
break;
default:
error ("Unknown file system: %02Xh", system);
break;
}
}
}

View File

@@ -0,0 +1,83 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module hdstruct.h
RCS - Header:
$Id$
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
/* ----------------------------------------------------------------------- */
/* Partition Class, derived from logical_drive and raw_partition */
/* Represents one primary DOS partition. Read_sector() and write_sector() */
/* are instances of the virtual functions in the logical_drive class */
/* ----------------------------------------------------------------------- */
#ifndef PRIMPART_H
#define PRIMPART_H
#include "types.h"
#include "disk_io.h"
#include "logdr_st.h"
#include "hdstruct.h"
class partition:public logical_drive
{
public:
int number;
physical_drive *drive;
partition_info *partition_info;
int read_sector (dword number, sector *sector)
{
return (drive->read_sector
(
sector,
partition_info->start_sector_abs
+ number
));
}
int write_sector (dword number, sector *sector)
{
return (drive->write_sector
(
sector,
partition_info->start_sector_abs
+ number
));
}
partition (class harddrive *drive, int number)
{
partition::number = number;
partition::drive = drive;
partition_info =
&(drive->partition_table().partition_info[number]);
boot_sector = new class boot_sector (this);
}
~partition (void) { delete boot_sector; }
};
#endif

View File

@@ -0,0 +1,68 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module save.cpp
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/save.cpp 1.4 1995/01/19 00:01:24 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#include <stdio.h>
#include <io.h>
#include "global.h"
#include "hdstruct.h"
/* ----------------------------------------------------------------------- */
/* Save root- and boot sector to floppy disk */
/* ----------------------------------------------------------------------- */
void save_root_and_boot (harddrive *drive,partition *partition)
{
FILE *save_file;
char *filename = "a:\\rootboot.000";
while (access (filename,0) == 0)
{
if (++filename[14] > '9')
error ("Too many save files on disk");
}
if ((save_file = fopen (filename,"wb")) == NULL)
error ("Can't open file: %s",filename);
printx ("\nWriting file %s\n", filename);
if (fwrite (drive->root_sector->data,1,512,save_file) != 512)
error ("Error writing file: %s",filename);
if (fwrite (partition->boot_sector->data,1,512,save_file) != 512)
error ("Error writing file: %s",filename);
if (fputc (drive->number,save_file) != drive->number)
error ("Error writing file: %s",filename);
if (fputc (partition->number,save_file) != partition->number)
error ("Error writing file: %s",filename);
if (fclose (save_file))
error ("Error closing file: %s",filename);
}

View File

@@ -0,0 +1,40 @@
/*
FIPS - the First nondestructive Interactive Partition Splitting program
Module disk_io.h
RCS - Header:
$Header: c:/daten/fips/source/main/RCS/types.h 1.4 1995/01/19 00:01:28 schaefer Exp schaefer $
Copyright (C) 1993 Arno Schaefer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Report problems and direct all questions to:
schaefer@rbg.informatik.th-darmstadt.de
*/
#ifndef TYPES_H
#define TYPES_H
typedef unsigned char byte;
typedef unsigned int word;
typedef unsigned long dword;
typedef enum {false,true} boolean;
#endif

View File

@@ -0,0 +1 @@
#define FIPS_VERSION "1.5"

View File

@@ -0,0 +1,142 @@
FIPS 1.5 - file SPECIAL.DOC
---------------------------
S1. Use with Stacker/SuperStor/Doublespace etc.
S2. Use with OS/2
S3. Use with OnTrack Disk Manager and similar drivers
------------------------------------------------------------------------------
S1. Use with Stacker/SuperStor/Doublespace etc.
These programs are used to increase disk space by compressing files. They
all work similarly. When installed, they create a compressed volume on the
disk, into which all the files are moved. This compressed volume is a big
file that fills up almost all space on the disk. After booting with the
compression driver, the previous drive C: that contains the compressed
volume is renamed to D:, and the compressed volume itself becomes C:.
From reports I received from users of Stacker and DoubleSpace, I distilled
the following scheme. If you have difficulties, please let me know.
a. Make sure that there is enough space on the compressed partition to be
split.
b. Use the Checkdisk program that comes with the compression software.
c. Remove the Windows swapfile if you have one.
d. Decrease the size of the compressed volume with the utilities that come
with the compression software.
e. Defragment the uncompressed drive that contains the compressed volume
(in most cases drive D:)
f. use FIPS as described in FIPS.DOC
If your system will not let you defragment the uncompressed drive or if
the compressed volume can not be defragmented because it has the hidden
attribute set, FIPS might not offer as much space for the new partition
as is shown in the directory listing of the uncompressed drive. You should
add the following steps:
e1. Copy the defragmentation program (e.g. diskopt.exe, defrag.exe) of the
system to the boot disk
e2. Boot without the compression device driver. This may be tricky, since in
some systems the driver is part of the system files on the boot disk. Try
using a boot disk from an older DOS version, or consult your manuals.
e3. Remove Hidden, Readonly and System attributes from compressed volume
(use dir /a:h to find the name of the the compressed volume)
e4. Defragment the partition.
It was reported that you can use FIPS either with or without the compression
driver loaded.
S2. Use with OS/2
FIPS is known to have problems with OS/2, especially with the dual boot
feature. This is partly due to the fact that OS/2 dual boot uses two copies
of the boot sector - if only one copy is changed by FIPS, OS/2 will not
work properly.
But even when taking this into consideration, some people have reported
strange error messages by OS/2. I encourage you to give FIPS a try, but
make sure to save the root and boot sector to floppy disk with FIPS before
making any changes. FIPS might work if you
a. Remove dual boot from the partition if you use it. I don't know if and
how this is possible, please consult your manual or call IBM. If you
find out, please let me know, so that I can include this info.
b. Boot from a bootable DOS disk
c. Run FIPS (make sure to make FIPS save the root and boot sector to floppy)
d. Reboot, check if everything is ok under DOS
e. Boot from your OS/2 installation disk and reinstall dual boot if
necessary.
f. Boot to OS/2 and look if everything works as expected.
If e. does not work (OS/2 complains with 'hardware error' or something
similar), use RESTORRB to undo the changes FIPS made, reboot again and
reinstall dual boot (if necessary).
So far I did not find out what OS/2 complains about. Since I do not use
OS/2, I have to rely on user reports. If you try FIPS with OS/2,
I would like to hear about it. Any information is welcome, even if it
is just "it worked" or "it did not work". If you have an idea what might
be the problem or any technical information, please tell me about it.
S3. Use with OnTrack Disk Manager and similar drivers
Note: Everything said here also applies to similar device drivers that
perform the same functions as OnTrack. OnTrack is just the most widely
used such system.
I'll try to start at the beginning:
Older BIOSes have a limit on the 'drive geometry' built in, i.e. they
can only properly handle disk drives of up to 1024 cylinders, 16 heads
and 63 sectors. Given a sector size of 512, this results in a total
limit of 504 MB. Most hard drives are far larger nowadays, especially
in the number of cylinders. So a method for accessing these large drives
had to be devised. For compatibility reasons, the cylinder and sector
count could not be extended, but there was still room in the number of
heads value - up to 256 heads.
Modern BIOSes (i.e. BIOSes prepared for EIDE drives) do exactly this,
they trick DOS into thinking that the disk has less than 1024 cylinders,
but more than 16 heads (this is indicated by 'extended sector translation'
or 'logical block addressing' in the BIOS setup). The same is true for
SCSI disks - in this case the translation is done by the BIOS of the
SCSI controller. If you have one of these, you will probably not be using
OnTrack anyway.
OnTrack Disk Manager is a special program that does the translation in
software. It installs its own boot program in the hard disk's master
boot record, so that it is loaded before any other disk access is
done. This means that you can not access the hard disk without loading
the OnTrack device driver first.
This is also true for FIPS. If you just boot from a floppy disk, you will
not be able to access the C: drive, and FIPS will not work. As far as
I know, you _must_ boot from the hard disk, after which FIPS will work
properly.
Note to Linux users: You can NOT use this scheme to create a Linux
partition. This is because the partitioning information that FIPS modifies
is on a level above the OTDM driver, so you can only access them after
having loaded the driver. Since Linux does not use DOS drivers, it can
not access the new partition. The only thing that Linux will see is a
large non-DOS partition: the OnTrack partition (system indicator byte
54h or 56h).
Unfortunately, I currently know of no way to get rid of the OnTrack
device driver or to split off a partition for use under Linux without
completely reformatting and thus losing all data. It might be possible,
given sufficient technical information, but since I personally don't
use it, I can't investigate further into this.
If you are prepared to reformat the disk (after backing up all your data),
you can just delete the OnTrack partition with Linux fdisk and create
new partitions as you require. Note that you can create a DOS partition
at the beginning of the disk. You won't need OnTrack to use it, as
long as its last cylinder is less than 1024. Linux of course has no
problems accessing the cylinders beyond 1024, so you can use all the rest
of the disk for Linux partitions. In case of problems, read the EIDE-
Mini-HOWTO, it contains some more information on this from the Linux
point of view.

View File

@@ -0,0 +1,226 @@
Technical Info on FIPS
----------------------
FIPS was written in C++ V2.0 with the Turbo C++ 1.0 and Borland C++ 3.1
compilers.
It should compile with any newer C++ compiler (perhaps after minor changes
to the BIOS calls).
If you're a C++ wizard, don't look too closely at the code, this is my first
C++ program, so it is far from acceptable (too much public data, some ini-
tializers and assignment operators are missing etc.). Constructive critizism
is always welcome however.
How FIPS works:
FIPS uses the BIOS interrupts 13h 00h (reset disks), 13h 02h (read sector),
13h 08h (get drive parameters), 13h 03h (write sector) and 13h 04h (verify
sector).
Here is the sequence of function calls in main:
evaluate_argument_vector
read the commandline arguments and set the global variables accordingly
notice
display copyright notice and version number
ask_for_drive_number
let the user choose the drive (if more than 1)
harddrive.reset
reset harddrive
harddrive.rootsector->read
read the sector 0,0,1 of the chosen drive into an array of unsigned char
hd.partition_table().get
extract the necessary information from the root sector (see below - The
root sector)
hd.print_partition_table
print the information
hd.check
check if everything is ok (see below - The root sector)
ask_for_partition_number
let the user choose the partition
partition->bootsector->read
read the first sector of the chosen partition to another array
partition->bpb().get
extract info from the boot sector (see below - The boot sector)
partition->print_bpb
print the info
partition->info().get
calculate no. of clusters, starting sector of FATs etc.
partition->check
check boot sector (see below - The boot sector)
fat1.check_against(fat2)
check if FAT 1 is identical to FAT 2 (see below - The FAT)
save_root_and_boot
write root- and boot sector to floppy disk (optional)
ask_for_new_start_cylinder
ask the user for the first cylinder of the new partition
fat2.check_empty
check if chosen part of partition is empty (see below - The FAT)
hd.calculate_new_root
from the chosen start cylinder calculate the new partition table
Note that the partition entries will be moved to the beginning of the par-
tition table, so that the new partition will be the last one and the drive
names will not change.
hd.partition_table.put
write the new partition table into the root sector buffer
hd.partition_table.get,hd.print_partition_table,hd.check
check if new root sector is ok
partition->calculate_new_boot
put new number of sectors in boot sector info
partition->bpb()->put
write new boot sector info into boot sector buffer
partition->bpb()->get,partition->print_bpb,partition->check
check if new boot sector is ok
ask_for_write_permission
ask if user wants to proceed
harddrive.rootsector->write
write the changed root sector to the disk
partition->bootsector->write
write the changed boot sector to the disk
The root sector
---------------
The root sector is the first sector on every hard disk. It contains the
program that loads the boot sector of the bootable partition and the
partition table. The last two bytes of the root sector must be 55 aa (hex).
The partition table begins at 1be. It contains 4 * 16 Bytes for the four
possible partitions.
All numbers are zero based except the start/end-sector number (may be 1-63).
One partition entry contains the following:
1 Byte - Bootable Flag. Must be 0 (not bootable) or 80h (bootable).
At most one Partition may be bootable at a time.
(somewhere I read the bootable flag may also be 81h for the
second drive - does anybody know anything about that?)
1 Byte - Start Head. The number of the head of the first sector of the
partition.
2 Bytes - Start Sector + Cylinder. The Bits are as follows:
CCSSSSSS CCCCCCCC
where the first byte contains the sector number (1 - 63), and
the high two bits of the cylinder number. The second byte con-
tains the low eight bits of the cylinder number.
1 Byte - System Indicator. For DOS this may be:
1 - 12-bit FAT, 16-bit sector number
4 - 16-bit FAT, 16-bit sector number
5 - Extended Partition
6 - 16-bit FAT, 32-bit sector number
1 Byte - End Head. Head Number of the last sector of the partition
2 Bytes - End Sector + Cylinder. Same format as Start Sector + Cylinder
4 Bytes - First Sector. Number of the first sector of the partition. This
corresponds to the Start Head, Sector + Cylinder. High Byte
comes first.
4 Bytes - Total number of Sectors.
The function check_rootsector_validity checks the following:
- Signature Bytes (55 aa) in the last two bytes of the sector
- not more than one bootable partition
- Bootable flag is 0 or 80h
- Start/End sector of a partition is not 0
- Start/End sector & head are not greater than drive geometry allows
- Start cylinder * sectors * heads + start head * sectors + start sector - 1
= first sector (where sectors is no. of sectors per track, heads is
no. of heads of the drive)
- End cylinder * sectors * heads + end head * sector + end sector = first
sector + number of sectors
- if System Indicator is 0, all other bytes of partition entry are 0
- all partitions except the first begin on cylinder boundaries (head = 0,
sectors = 1)
- all partition end on cylinder boundaries
- partitions don't overlap
- no free space between partitions
The boot sector
---------------
The boot sector is the first sector of every partition. It contains the
program that boots the operating system and the bios parameter block.
The last two bytes must again contain 55 aa. The information in the
boot sector is the following:
00 3 bytes jump instruction ('eb xx 90' or 'e9 xx xx')
03 8 bytes OEM name and version - e.g. MSDOS5.0
0b 2 bytes bytes per sector - should be 512
0d 1 byte sectors per cluster - power of two
0e 2 bytes reserved sectors - typically 1 (boot sector)
10 1 byte number of FATs - must be 2
11 2 bytes number of rootdirectory entries - typically 512
13 2 bytes number of sectors (short) - 0, if BIGDOS partition
15 1 byte media descriptor - typically f8h
16 2 bytes sectors per FAT - varies
18 2 bytes sectors per track
1a 2 bytes number of heads
1c 2 bytes number of hidden sectors (low)
- extended BPB since DOS 4.0 -
1e 2 bytes number of hidden sectors (high)
20 4 bytes number of sectors (long)
24 1 byte physical drive number - 80h or 81h
25 1 byte reserved
26 1 byte signature - 29h
The function check_bootsector_validity checks the following:
- correct jump instruction
- signature bytes 55 aa in the last two bytes of the sector
- bytes per sector = 512
- sectors per cluster is power of two
- reserved sectors = 1
- number of FATs = 2
- number of rootdirectory entries is multiple of 16
- media descriptor = f8h
- sectors per fat <= 256
- sectors per fat big enough to hold complete FAT
- sectors per track matches BIOS info
- number of heads matches BIOS info
- hidden sectors = start sector
- signature = 29h, if BIGDOS
- physical drive number = actual drive number
- number of sectors matches partition info
- system indicator byte in root sector matches partition type
The FAT
-------
The File Allocation Table contains the information how the clusters of the
disk are linked to files. Every directory entry contains a pointer to the
first cluster of the file. The corresponding cluster entry in the FAT con-
tains a pointer to the next cluster, or an EOF marker (FFFF for 16-bit FATs,
FFF for 12-bit FATs) if the cluster is the last one of the file.
Bad clusters are marked with FFF7 or FF7. Empty clusters are marked with 0.
The first cluster on the disk is cluster number 2, it begins at the first
sector after the root directory. The FAT entries for the clusters 0 and 1
contain the media descriptor byte (usually F8h for harddisk) and two or
three FFh bytes.
There exist two copies of the FAT on a normal DOS partition, these two
copies must be identical. FAT 2 is the primary FAT.
The function check_fat_validity checks if the two FATs are identical and if
the entries 0 and 1 contain what they are supposed to.
The function check_fat_empty checks if the cluster entries that cover the
new partition contain either 0 (empty) or FFF7 (Bad cluster).
------------------------------------------------------------------------------
I hope you find this information useful. If you found anything not to be
exact or if you have additions, please let me know asap.
Arno Schaefer
schaefer@rbg.informatik.th-darmstadt.de

Binary file not shown.

View File

@@ -0,0 +1,68 @@
RaWrite 1.3
------------
Disclaimer of Warrenty
----------------------
Users of this software must accept this disclaimer of warranty: "This
software is supplied AS IS. Mark Becker disclaims all warranties, expressed
or implied, including, without limitation, the warranties of merchantability
and of fitness for any purpose. Mark Becker assumes no liability for
damages, direct or consequential, which may result from the use of this
software."
Purpose
-------
Write a disk image file to a floppy disk.
Equipment/Software Requirements
-------------------------------
* PC/XT/AT or 100% compatible with at least 256K of RAM and a floppy disk
drive.
* MS-DOS version 3.21 or greater.
* A formatted diskette.
This program uses well-documented generic low-level DOS and BIOS functions.
It should run on nearly every PC in existance. PS/2's should be able to run
RaWrite but this has not been tested.
CAVEAT
------
This program will write ANY disk file to a floppy, overwriting any previous
information that may have been present. If you wish to re-use a diskette
that has been written to by RaWrite then that diskette will probably need to
be reformatted; all MS-DOS specific information will have been erased.
Usage
-----
C> RAWRITE
And follow the prompts. All arguments are case-insensitive.
If the source and destination drives are the same, RaWrite will ask the user
to swap diskettes as required. Rawrite allocates a large buffer in RAM to
reduce the number of disk swaps.
RaWrite may be aborted at any time by typing ^C or CTRL-Break.
Errors
------
RaWrite attempts to determine if the diskette is a 1.44M, 1.2M, 720K, or 360K
diskette by reading sectors 18, 15, and 9 in that order. If the inserted
diskette is not one of the these types, then RaWrite will abort with an error
message.
Errors such as write protect, door open, bad disk, bad sector, etc. cause a
program abort with a short error message.

Binary file not shown.

View File

@@ -0,0 +1,139 @@
WRTDSK v0.90 readme file
DISCLAIMER
==========
WRTDSK is careware: anyone who uses it is obliged (by one's conscience) to
help the local Red-Cross organization. And, of course, it is distributed as
it is, with no warranty. In no event shall author, or his family and pets,
be liable for any incidental, indirect, special or consequential damages made
by use of this software. Anyway, don't get frightened. It is not much worse
than the similar utilities.
DESCRIPTION
===========
WRTDSK is an utility primarily written for copying image files on floppies.
It is intended to be used with formatted DOS floppies with capacity of 360,
720, 1200 or 1440 K. Data read from the file is written onto 'raw device'.
It is very important to use floppies without any bad sectors. You can
determine this by unconditional formatting with MS-DOS FORMAT (use /U switch)
and then running CHKDSK. If you have DOS version 6.20 or newer, you can use
SCANDISK utility to examine floppies that are allready formatted. To prevent
possibility of writing on bad sectors WRTDSK has the ability to verify the
data written.
The length of an image file has to be multiple of 512 bytes (DOS sector
size). If it is not, WRTDSK writes all the data, but last sector data is
overwritten entirely. This has an effect only if more files are specified to
be written on the same floppy.
If anything goes wrong, WRTDSK can be stopped by pressing Ctrl-Break.
USAGE and PARAMETERS
====================
Display of short help that is available with WRTDSK /? follows:
Writes DOS files to raw floppy device.
WRTDSK [drive:] {file [file...] | @filelist} [/F:size] [/V:level] [/A:attempts]
drive Floppy drive (default A:)
file DOS file name (wildcards allowed)
filelist File containing list of files to copy
size Floppy disk capacity in Kbytes (default CMOS data)
level Verify level: 0 = none, 1 = CRC, 2 = Read + CRC (default 1)
attempts Number of write attempts after failure (default 4)
drive:
------
Floppy drive letter, if specified, has to be the first parameter. If it is
not the default is drive A:.
filenames (or @filelist)
------------------------
Specifies file(s) to be written on floppy disk(s). Source files may not
reside on disk that is specified as the destination. There are two ways to
specify files: one is to count all the filenames on the command line and the
other is to enter these filenames in separate list file and specify list file
(preceded by sign '@'). Examples are:
> WRTDSK source.* bin.*
> WRTDSK b: one.dsk two.dsk three.dsk
> WRTDSK a: @dir.lst
Wildcards are allowed: first example above will copy all files beggining
with "source." and then all files beginning with "bin.". Note that if there
is a file named "source", it will not be copied. Files will be sorted in
the alphabetical order before being written to disks.
If that order of disks isn't suitable, the use of list file can greatly
simplify the copying. Supposing that one wants to copy all the files starting
with "disk", he (she) could write:
> DIR /B /O disk*.* > dir.lst
edit "dir.lst", sort files manually and than use the third example shown
above. File names in list file must not contain wildcards.
/F:size
-------
Specifies floppy capacity in Kbytes. Optional, but recommended. If you use
floppy with capacity smaller than the drive (360K floppy in 1200K drive)
the use of this parameter will suppress probing for disk formatting. If disk
formatting cannot be recognized, the user has to restart WRTDSK and then use
/F switch.
File size and disk capacity do not have to match. More small images can be
written on one or more large floppies and also spanned from one to another.
The choice to span or not is entered at the prompt. Also, large image files
can be stretched onto several floppies.
/V:level
--------
Optional parameter, specifies the verification level. The possibilites are
V:0, means no verification; V:1, verification via BIOS call that verifies data
written by its checksum; and V:2 verification by reading data just written,
comparing it with original and after that doing BIOS checksum verification.
Verification level 2 greatly reduces speed, while level 1 does it much less.
Default level is 1.
/A:attempts
-----------
Number of attempts to write data on floppy before an error is reported.
This parameter is optional, the default is 4.
CREDITS
=======
The author wishes to thank Croatian Red Cross (RedCross@hck.hr) for
understanding him being late to the job after long nights of programming,
Igor Bujanovic (igor@srce.hr) for inspiration of WRTDSK, Kees J. Bot
(kjb@cs.vu.nl) for his help and support in developing this utility and
finally everyone who uses it and helps Red-Cross.
BUG REPORTS and COMPATIBILITY LIST
==================================
Any documented bug reports sent by e-mail will be appreciated. Machine
type, including BIOS, bus, FDD controller, drive and floppy types should
be noted. Also, feedback about successful use will be welcome to create a
compatibility list. Please note the WRTDSK version too.
Hrvoje Stipetic, hs@hck.hr

281
Minix/CD-ROM-2.0/FDVOL.C Normal file
View File

@@ -0,0 +1,281 @@
/* fdvol.c - A stripped down version of the MINIX vol program. It takes
* a file and breaks into into floppy-sized chunks, writing each one raw
* to a floppy.
*
* Usage: fdvol file drive KB [slow]
*
* Examples: fdvol 1440 a: foo.taz # 1.4 MB floppy a:
* fdvol 1200 b: foo.taz # 1.2 MB floppy b:
* fdvol slow 360 a: foo.taz # old machine
* fdvol 1440 a: foo bar # concatenate
*
* The optional 'slow' parameter forces the program to write in units of 3
* sectors. Folk tradition has it that this works around some buggy BIOSes.
*
* This code borrows heavily from Mark Becker's RaWrite program.
*/
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define TEST 0
#if !TEST
#include <alloc.h>
#include <bios.h>
#include <dir.h>
#include <dos.h>
#include <io.h>
#endif
#define FALSE 0
#define TRUE (!FALSE)
#define SECTORSIZE 512
#define RESET 0
#define LAST 1
#define READ 2
#define WRITE 3
#define VERIFY 4
#define FORMAT 5
int done;
char buffer[18*SECTORSIZE]; /* do I/O in units of up to 18 sectors */
char testbuf[SECTORSIZE]; /* to do a test read of the first sector */
int handler(void)
{
/* Catch CTRL-C and CTRL-Break. */
done = 1;
return(0);
}
void msg(char (*s))
{
/* Print an error message and quit. */
fprintf(stderr, "%s\n", s);
_exit(1);
}
void Error(int status, int cyl, int head, int sector)
{
/* Identify the error code with a real error message. */
fprintf(stderr, "\nError occured while writing cyl %d, head=%d, sector=%d\n", cyl,head,sector+1);
switch (status) {
case 0x00: msg("Operation Successful"); break;
case 0x01: msg("Bad command"); break;
case 0x02: msg("Address mark not found"); break;
case 0x03: msg("Attempt to write on write-protected disk"); break;
case 0x04: msg("Sector not found"); break;
case 0x05: msg("Reset failed (hard disk)"); break;
case 0x06: msg("Disk changed since last operation"); break;
case 0x07: msg("Drive parameter activity failed"); break;
case 0x08: msg("DMA overrun"); break;
case 0x09: msg("Attempt to DMA across 64K boundary"); break;
case 0x0A: msg("Bad sector detected"); break;
case 0x0B: msg("Bad track detected"); break;
case 0x0C: msg("Unsupported track"); break;
case 0x10: msg("Bad CRC/ECC on disk read"); break;
case 0x11: msg("CRC/ECC corrected data error"); break;
case 0x20: msg("Controller has failed"); break;
case 0x40: msg("Seek operation failed"); break;
case 0x80: msg("Attachment failed to respond"); break;
case 0xAA: msg("Drive not ready (hard disk only"); break;
case 0xBB: msg("Undefined error occurred (hard disk only)"); break;
case 0xCC: msg("Write fault occurred"); break;
case 0xE0: msg("Status error"); break;
case 0xFF: msg("Sense operation failed"); break;
}
exit(1);
}
void main(int argc, char *argv[])
{
int disknr = 1, fdin, count, drive, head, cyl, status, sector;
int max_cyl, chunk, nsectors, ct;
long offset, drive_size, r, cyl_size;
char *p, c;
int slow;
int kbsize;
char **files;
int nfiles, i;
#if !TEST
/* Catch breaks. */
ctrlbrk(handler);
#endif
#if 0 /* Do we have to clear the screen? */
fprintf(stderr, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
#endif
if (argc > 1 && strcmp(argv[1], "slow") == 0) { /* Lousy BIOS? */
slow = 1;
argc--;
argv++;
} else {
slow = 0;
}
/* Check the arguments for validity. */
if (argc < 4)
msg("Usage: fdvol [slow] #kilobytes drive-letter file1 [file2 ...]");
kbsize = atoi(argv[1]);
p = argv[2];
c = *p;
if (c == 'a' || c == 'A')
drive = 0;
else if (c == 'b' || c == 'B')
drive = 1;
else
msg("fdvol: Second parameter must be drive, either a: or b:");
files = argv + 3;
nfiles = argc - 3;
switch(kbsize) {
case 360:
cyl_size = 9*2*SECTORSIZE; /* bytes/cylinder */
max_cyl = 39; /* zero-based counting */
drive_size = cyl_size * (max_cyl+1);
chunk = (!slow ? 9 * SECTORSIZE : 3 * SECTORSIZE);
nsectors = chunk/SECTORSIZE;
break;
case 720:
cyl_size = 9*2*SECTORSIZE; /* bytes/cylinder */
max_cyl = 79; /* zero-based counting */
drive_size = cyl_size * (max_cyl+1);
chunk = (!slow ? 9 * SECTORSIZE : 3 * SECTORSIZE);
nsectors = chunk/SECTORSIZE;
break;
case 1200:
cyl_size = 15*2*SECTORSIZE; /* bytes/cylinder */
max_cyl = 79; /* zero-based counting */
drive_size = cyl_size * (max_cyl+1);
chunk = (!slow ? 15 * SECTORSIZE : 3 * SECTORSIZE);
nsectors = chunk/SECTORSIZE;
break;
case 1440:
cyl_size = 18*2*SECTORSIZE; /* bytes/cylinder */
max_cyl = 79; /* zero-based counting */
drive_size = cyl_size * (max_cyl+1);
chunk = (!slow ? 18 * SECTORSIZE : 3 * SECTORSIZE);
nsectors = chunk/SECTORSIZE;
break;
default:
msg("fdvol: First parameter must be one of: 360, 720, 1200, or 1440");
}
#if !TEST
biosdisk(RESET, drive, 0, 0, 0, 0, testbuf);
#endif
/*
* Start writing data to diskette until there is no more data to write.
* Optionally read and write in units of 3 sectors. Folk tradition says
* that this makes fewer buggy BIOSes unhappy than doing a whole track at a
* time.
*/
offset = 0;
i = 0;
fdin = -1;
while(1) {
if (done > 0) {
if (done == 1) msg("User abort");
#if !TEST
biosdisk(READ, drive, 0, 0, 1, 1, testbuf); /* Retract head */
#endif
fprintf(stderr, "Done. \n");
exit(done == 1 ? 1 : 0);
}
/* Until a chunk is read. */
count = 0;
while (count < chunk) {
if (fdin == -1) { /* open next file */
#if !TEST
_fmode = O_BINARY;
#endif
fdin = open(files[i], O_RDONLY);
if (fdin < 0) {
perror(files[i]);
exit(1);
}
}
/* read from file */
ct = read(fdin, buffer + count, chunk - count);
if (ct < 0) {
perror(files[i]);
exit(1);
}
if (ct == 0) { /* end of file */
close(fdin);
fdin = -1;
/* choose next file */
if (++i >= nfiles) break; /* no more files */
}
count += ct;
}
if (count == 0) { /* absolute EOF */
done = 2;
continue;
}
if (count < chunk) { /* pad last track */
/* Pad out buffer with zeroes. */
p = &buffer[count];
while (p < &buffer[chunk]) *p++ = 0;
done = 2;
}
r = offset % drive_size;
if (r == 0) {
/* An integral number of diskettes have been filled. Prompt. */
fprintf(stderr, "Please insert formatted diskette #%d in drive %c, then hit Enter%c\n", disknr, c, 7);
disknr++;
#if !TEST
while(bioskey(1) == 0) ; /* wait for input */
if ((bioskey(0) & 0x7F) == 3) exit(1); /* CTRL-C */
biosdisk(READ, drive, 0, 0, 1, 1, testbuf); /* get it going */
#endif
}
/* Compute cyl, head, sector. */
cyl = r/cyl_size;
r -= cyl * cyl_size;
head = (r < cyl_size/2 ? 0 : 1);
r -= head * cyl_size/2;
sector = r/SECTORSIZE;
fprintf(stderr, "Track: %2d Head: %d Sector: %2d File offset: %ld\r",
cyl, head, sector+1,offset);
#if !TEST
status = biosdisk(WRITE, drive, head, cyl, sector+1, nsectors, buffer);
if (status != 0) Error(status, cyl, head, sector);
#else
write(1, buffer, chunk);
#endif
offset += chunk;
}
}

BIN
Minix/CD-ROM-2.0/FDVOL.EXE Normal file

Binary file not shown.

View File

@@ -0,0 +1,254 @@
Table of Contents of MINIX Source Code Contained in the Book
Page Line File
Directory: include/
1 00000 include/ansi.h
2 00100 include/limits.h
3 00200 include/errno.h
5 00400 include/unistd.h
8 00600 include/string.h
9 00700 include/signal.h
11 00900 include/fcntl.h
12 01000 include/stdlib.h
14 01100 include/termios.h
17 01400 include/a.out.h
Directory: include/sys
19 01600 include/sys/types.h
22 01800 include/sys/ioctl.h
24 02000 include/sys/sigcontext.h
27 02200 include/sys/ptrace.h
27 02300 include/sys/stat.h
29 02400 include/sys/dir.h
29 02500 include/sys/wait.h
Directory: include/minix
30 02600 include/minix/config.h
34 02900 include/minix/const.h
36 03100 include/minix/type.h
38 03300 include/minix/syslib.h
39 03400 include/minix/callnr.h
40 03500 include/minix/com.h
44 03700 include/minix/boot.h
44 03800 include/minix/keymap.h
47 04000 include/minix/partition.h
Directory: include/ibm
47 04100 include/ibm/partition.h
Directory: src/kernel
48 04200 src/kernel/kernel.h
48 04300 src/kernel/const.h
51 04500 src/kernel/type.h
53 04700 src/kernel/proto.h
57 05000 src/kernel/glo.h
58 05100 src/kernel/proc.h
60 05200 src/kernel/protect.h
62 05400 src/kernel/sconst.h
63 05500 src/kernel/assert.h
64 05600 src/kernel/table.c
66 05800 src/kernel/mpx.s
67 05900 src/kernel/mpx386.s
77 06500 src/kernel/start.c
79 06700 src/kernel/main.c
82 06900 src/kernel/proc.c
91 07500 src/kernel/exception.c
92 07600 src/kernel/i8259.c
94 07700 src/kernel/protect.c
99 08000 src/kernel/klib.s
99 08100 src/kernel/klib386.s
110 08800 src/kernel/misc.c
113 09000 src/kernel/driver.h
114 09100 src/kernel/driver.c
119 09400 src/kernel/drvlib.h
120 09500 src/kernel/drvlib.c
123 09700 src/kernel/memory.c
128 10000 src/kernel/wini.c
129 10100 src/kernel/at_wini.c
144 11000 src/kernel/clock.c
153 11600 src/kernel/tty.h
155 11700 src/kernel/tty.c
177 13000 src/kernel/keyboard.c
186 13600 src/kernel/console.c
202 14600 src/kernel/dmp.c
204 14700 src/kernel/system.c
Directory: src/mm
221 15800 src/mm/mm.h
222 15900 src/mm/const.h
222 16000 src/mm/type.h
223 16100 src/mm/proto.h
224 16200 src/mm/glo.h
225 16300 src/mm/mproc.h
226 16400 src/mm/param.h
226 16500 src/mm/table.c
228 16600 src/mm/main.c
231 16800 src/mm/forkexit.c
236 17100 src/mm/exec.c
244 17600 src/mm/break.c
247 17800 src/mm/signal.c
258 18500 src/mm/getset.c
259 18600 src/mm/trace.c
261 18800 src/mm/alloc.c
266 19100 src/mm/utility.c
268 19300 src/mm/putk.c
Directory: src/fs
269 19400 src/fs/fs.h
269 19500 src/fs/const.h
271 19600 src/fs/type.h
271 19700 src/fs/proto.h
274 19900 src/fs/glo.h
275 20000 src/fs/fproc.h
275 20100 src/fs/buf.h
277 20200 src/fs/dev.h
277 20300 src/fs/file.h
277 20400 src/fs/lock.h
278 20500 src/fs/inode.h
279 20600 src/fs/param.h
280 20700 src/fs/super.h
281 20800 src/fs/table.c
283 21000 src/fs/cache.c
290 21500 src/fs/inode.c
297 21900 src/fs/super.c
301 22200 src/fs/filedes.c
303 22300 src/fs/lock.c
306 22500 src/fs/main.c
312 22900 src/fs/open.c
321 23400 src/fs/read.c
329 24000 src/fs/write.c
334 24300 src/fs/pipe.c
339 24700 src/fs/path.c
345 25100 src/fs/mount.c
349 25400 src/fs/link.c
357 25900 src/fs/stadir.c
360 26100 src/fs/protect.c
364 26400 src/fs/time.c
366 26600 src/fs/misc.c
372 27000 src/fs/device.c
378 27400 src/fs/utility.c
380 27600 src/fs/putk.c
Index to MINIX Source Code Files in the Book (alphabetical by pathname)
Page Line File
17 01400 include/a.out.h
1 00000 include/ansi.h
3 00200 include/errno.h
11 00900 include/fcntl.h
47 04100 include/ibm/partition.h
2 00100 include/limits.h
44 03700 include/minix/boot.h
39 03400 include/minix/callnr.h
40 03500 include/minix/com.h
30 02600 include/minix/config.h
34 02900 include/minix/const.h
44 03800 include/minix/keymap.h
47 04000 include/minix/partition.h
38 03300 include/minix/syslib.h
36 03100 include/minix/type.h
9 00700 include/signal.h
12 01000 include/stdlib.h
8 00600 include/string.h
29 02400 include/sys/dir.h
22 01800 include/sys/ioctl.h
27 02200 include/sys/ptrace.h
24 02000 include/sys/sigcontext.h
27 02300 include/sys/stat.h
19 01600 include/sys/types.h
29 02500 include/sys/wait.h
14 01100 include/termios.h
5 00400 include/unistd.h
275 20100 src/fs/buf.h
283 21000 src/fs/cache.c
269 19500 src/fs/const.h
277 20200 src/fs/dev.h
372 27000 src/fs/device.c
277 20300 src/fs/file.h
301 22200 src/fs/filedes.c
275 20000 src/fs/fproc.h
269 19400 src/fs/fs.h
274 19900 src/fs/glo.h
290 21500 src/fs/inode.c
278 20500 src/fs/inode.h
349 25400 src/fs/link.c
303 22300 src/fs/lock.c
277 20400 src/fs/lock.h
306 22500 src/fs/main.c
366 26600 src/fs/misc.c
345 25100 src/fs/mount.c
312 22900 src/fs/open.c
279 20600 src/fs/param.h
339 24700 src/fs/path.c
334 24300 src/fs/pipe.c
360 26100 src/fs/protect.c
271 19700 src/fs/proto.h
380 27600 src/fs/putk.c
321 23400 src/fs/read.c
357 25900 src/fs/stadir.c
297 21900 src/fs/super.c
280 20700 src/fs/super.h
281 20800 src/fs/table.c
364 26400 src/fs/time.c
271 19600 src/fs/type.h
378 27400 src/fs/utility.c
329 24000 src/fs/write.c
63 05500 src/kernel/assert.h
129 10100 src/kernel/at_wini.c
144 11000 src/kernel/clock.c
186 13600 src/kernel/console.c
48 04300 src/kernel/const.h
202 14600 src/kernel/dmp.c
114 09100 src/kernel/driver.c
113 09000 src/kernel/driver.h
120 09500 src/kernel/drvlib.c
119 09400 src/kernel/drvlib.h
91 07500 src/kernel/exception.c
57 05000 src/kernel/glo.h
92 07600 src/kernel/i8259.c
48 04200 src/kernel/kernel.h
177 13000 src/kernel/keyboard.c
99 08000 src/kernel/klib.s
99 08100 src/kernel/klib386.s
79 06700 src/kernel/main.c
123 09700 src/kernel/memory.c
110 08800 src/kernel/misc.c
66 05800 src/kernel/mpx.s
67 05900 src/kernel/mpx386.s
82 06900 src/kernel/proc.c
58 05100 src/kernel/proc.h
94 07700 src/kernel/protect.c
60 05200 src/kernel/protect.h
53 04700 src/kernel/proto.h
62 05400 src/kernel/sconst.h
77 06500 src/kernel/start.c
204 14700 src/kernel/system.c
64 05600 src/kernel/table.c
155 11700 src/kernel/tty.c
153 11600 src/kernel/tty.h
51 04500 src/kernel/type.h
128 10000 src/kernel/wini.c
261 18800 src/mm/alloc.c
244 17600 src/mm/break.c
222 15900 src/mm/const.h
236 17100 src/mm/exec.c
231 16800 src/mm/forkexit.c
258 18500 src/mm/getset.c
224 16200 src/mm/glo.h
228 16600 src/mm/main.c
221 15800 src/mm/mm.h
225 16300 src/mm/mproc.h
226 16400 src/mm/param.h
223 16100 src/mm/proto.h
268 19300 src/mm/putk.c
247 17800 src/mm/signal.c
226 16500 src/mm/table.c
259 18600 src/mm/trace.c
222 16000 src/mm/type.h
266 19100 src/mm/utility.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,539 @@
Table of Contents of Complete MINIX Source Code
Page Line File
Directory: include/
1 00000 include/a.out.h
3 00200 include/alloca.h
3 00300 include/ansi.h
4 00400 include/assert.h
5 00500 include/ctype.h
6 00600 include/curses.h
10 00900 include/dirent.h
11 01000 include/errno.h
13 01200 include/fcntl.h
15 01300 include/float.h
16 01400 include/grp.h
16 01500 include/lib.h
17 01600 include/limits.h
19 01700 include/locale.h
20 01800 include/math.h
20 01900 include/mathconst.h
21 02000 include/pwd.h
22 02100 include/regexp.h
22 02200 include/setjmp.h
25 02400 include/sgtty.h
27 02500 include/signal.h
29 02700 include/stdarg.h
30 02800 include/stddef.h
31 02900 include/stdio.h
34 03100 include/stdlib.h
35 03200 include/string.h
36 03300 include/tar.h
37 03400 include/termcap.h
38 03500 include/termios.h
41 03800 include/time.h
43 03900 include/tools.h
45 04100 include/ttyent.h
45 04200 include/unistd.h
48 04400 include/utime.h
49 04500 include/utmp.h
Directory: include/sys
49 04600 include/sys/asynchio.h
50 04700 include/sys/dir.h
50 04800 include/sys/ioctl.h
53 05000 include/sys/mtio.h
54 05100 include/sys/ptrace.h
54 05200 include/sys/sigcontext.h
57 05400 include/sys/stat.h
58 05500 include/sys/times.h
59 05600 include/sys/types.h
61 05800 include/sys/utsname.h
61 05900 include/sys/wait.h
Directory: include/minix
62 06000 include/minix/boot.h
63 06100 include/minix/callnr.h
64 06200 include/minix/cdrom.h
65 06300 include/minix/com.h
69 06500 include/minix/config.h
72 06800 include/minix/const.h
74 07000 include/minix/dl_eth.h
75 07100 include/minix/fslib.h
75 07200 include/minix/jmp_buf.h
77 07300 include/minix/keymap.h
79 07500 include/minix/minlib.h
80 07600 include/minix/partition.h
80 07700 include/minix/sound.h
81 07800 include/minix/syslib.h
82 07900 include/minix/type.h
Directory: include/ibm
84 08100 include/ibm/diskparm.h
85 08200 include/ibm/partition.h
Directory: src/kernel/
85 08300 src/kernel/assert.h
86 08400 src/kernel/const.h
89 08600 src/kernel/dp8390.h
94 08900 src/kernel/driver.h
95 09000 src/kernel/drvlib.h
95 09100 src/kernel/glo.h
97 09200 src/kernel/kernel.h
97 09300 src/kernel/ne2000.h
98 09400 src/kernel/proc.h
100 09600 src/kernel/protect.h
102 09800 src/kernel/proto.h
109 10200 src/kernel/sb16.h
112 10400 src/kernel/sconst.h
113 10500 src/kernel/tty.h
114 10600 src/kernel/type.h
117 10800 src/kernel/wdeth.h
118 10900 src/kernel/aha_scsi.c
155 13100 src/kernel/at_wini.c
170 14000 src/kernel/bios_wini.c
178 14500 src/kernel/clock.c
188 15100 src/kernel/console.c
204 16100 src/kernel/dmp.c
208 16400 src/kernel/dp8390.c
238 18200 src/kernel/driver.c
243 18600 src/kernel/drvlib.c
247 18800 src/kernel/esdi_wini.c
259 19600 src/kernel/exception.c
260 19700 src/kernel/floppy.c
280 21000 src/kernel/i8259.c
283 21200 src/kernel/keyboard.c
292 21800 src/kernel/main.c
294 22000 src/kernel/mcd.c
316 23300 src/kernel/memory.c
320 23600 src/kernel/misc.c
323 23800 src/kernel/ne2000.c
329 24200 src/kernel/printer.c
335 24600 src/kernel/proc.c
345 25300 src/kernel/protect.c
351 25700 src/kernel/pty.c
359 26200 src/kernel/rs232.c
374 27200 src/kernel/sb16_dsp.c
386 27900 src/kernel/sb16_mixer.c
394 28400 src/kernel/start.c
396 28600 src/kernel/system.c
415 29800 src/kernel/table.c
418 30000 src/kernel/tty.c
447 31800 src/kernel/wdeth.c
453 32200 src/kernel/wini.c
454 32300 src/kernel/xt_wini.c
470 33300 src/kernel/klib.s
470 33400 src/kernel/klib386.s
483 34200 src/kernel/klib88.s
503 35400 src/kernel/mpx.s
503 35500 src/kernel/mpx386.s
513 36100 src/kernel/mpx88.s
Directory: src/kernel/keymaps
527 36900 src/kernel/keymaps/genmap.c
528 37000 src/kernel/keymaps/french.src
530 37200 src/kernel/keymaps/german.src
533 37400 src/kernel/keymaps/italian.src
535 37600 src/kernel/keymaps/japanese.src
538 37800 src/kernel/keymaps/latin-am.src
541 38000 src/kernel/keymaps/olivetti.src
543 38200 src/kernel/keymaps/scandin.src
546 38400 src/kernel/keymaps/spanish.src
548 38600 src/kernel/keymaps/uk.src
551 38800 src/kernel/keymaps/us-std.src
553 39000 src/kernel/keymaps/us-swap.src
Directory: src/mm/
556 39200 src/mm/const.h
556 39300 src/mm/glo.h
557 39400 src/mm/mm.h
557 39500 src/mm/mproc.h
558 39600 src/mm/param.h
559 39700 src/mm/proto.h
560 39800 src/mm/type.h
561 39900 src/mm/alloc.c
565 40200 src/mm/break.c
568 40400 src/mm/exec.c
578 41000 src/mm/forkexit.c
583 41300 src/mm/getset.c
584 41400 src/mm/main.c
587 41600 src/mm/putk.c
588 41700 src/mm/signal.c
599 42400 src/mm/table.c
601 42500 src/mm/trace.c
603 42700 src/mm/utility.c
Directory: src/fs/
605 42900 src/fs/buf.h
606 43000 src/fs/const.h
608 43100 src/fs/dev.h
608 43200 src/fs/file.h
608 43300 src/fs/fproc.h
609 43400 src/fs/fs.h
610 43500 src/fs/glo.h
610 43600 src/fs/inode.h
611 43700 src/fs/lock.h
612 43800 src/fs/param.h
613 43900 src/fs/proto.h
616 44100 src/fs/super.h
617 44200 src/fs/type.h
617 44300 src/fs/cache.c
624 44800 src/fs/cache2.c
627 45000 src/fs/device.c
633 45400 src/fs/filedes.c
635 45500 src/fs/inode.c
642 45900 src/fs/link.c
649 46400 src/fs/lock.c
652 46600 src/fs/main.c
659 47000 src/fs/misc.c
665 47400 src/fs/mount.c
669 47700 src/fs/open.c
677 48200 src/fs/path.c
683 48600 src/fs/pipe.c
689 49000 src/fs/protect.c
692 49300 src/fs/putk.c
693 49400 src/fs/read.c
702 50000 src/fs/stadir.c
705 50200 src/fs/super.c
710 50500 src/fs/table.c
713 50700 src/fs/time.c
715 50900 src/fs/utility.c
717 51100 src/fs/write.c
Directory: include/net/
722 51400 include/net/hton.h
723 51500 include/net/netlib.h
Directory: include/net/gen
724 51600 include/net/gen/eth_hdr.h
724 51700 include/net/gen/eth_io.h
726 51800 include/net/gen/ether.h
726 51900 include/net/gen/icmp.h
727 52000 include/net/gen/icmp_hdr.h
728 52100 include/net/gen/if_ether.h
728 52200 include/net/gen/in.h
729 52300 include/net/gen/inet.h
729 52400 include/net/gen/ip_hdr.h
730 52500 include/net/gen/ip_io.h
731 52600 include/net/gen/nameser.h
733 52800 include/net/gen/netdb.h
735 53000 include/net/gen/oneCsum.h
735 53100 include/net/gen/resolv.h
737 53300 include/net/gen/route.h
738 53400 include/net/gen/socket.h
739 53500 include/net/gen/tcp.h
739 53600 include/net/gen/tcp_hdr.h
740 53700 include/net/gen/tcp_io.h
741 53800 include/net/gen/udp.h
741 53900 include/net/gen/udp_hdr.h
742 54000 include/net/gen/udp_io.h
Directory: src/inet
743 54100 src/inet/config.h
743 54200 src/inet/const.h
744 54300 src/inet/inet.h
745 54400 src/inet/mq.h
746 54500 src/inet/osdep_eth.h
746 54600 src/inet/proto.h
747 54700 src/inet/buf.c
761 55600 src/inet/clock.c
764 55800 src/inet/inet.c
767 56000 src/inet/mnx_eth.c
776 56600 src/inet/mq.c
777 56700 src/inet/putk.c
778 56800 src/inet/sr.c
Directory: src/inet/generic
792 57700 src/inet/generic/arp.h
793 57800 src/inet/generic/assert.h
793 57900 src/inet/generic/buf.h
796 58100 src/inet/generic/clock.h
797 58200 src/inet/generic/eth.h
797 58300 src/inet/generic/eth_int.h
798 58400 src/inet/generic/icmp.h
799 58500 src/inet/generic/icmp_lib.h
799 58600 src/inet/generic/io.h
800 58700 src/inet/generic/ip.h
800 58800 src/inet/generic/ip_int.h
803 59000 src/inet/generic/ipr.h
804 59100 src/inet/generic/sr.h
805 59200 src/inet/generic/tcp.h
806 59300 src/inet/generic/tcp_delay.h
806 59400 src/inet/generic/tcp_int.h
810 59600 src/inet/generic/type.h
810 59700 src/inet/generic/udp.h
811 59800 src/inet/generic/arp.c
830 61000 src/inet/generic/eth.c
846 62000 src/inet/generic/icmp.c
861 62900 src/inet/generic/io.c
861 63000 src/inet/generic/ip.c
870 63500 src/inet/generic/ip_ioctl.c
877 64000 src/inet/generic/ip_lib.c
880 64200 src/inet/generic/ip_read.c
893 65100 src/inet/generic/ip_write.c
911 66200 src/inet/generic/ipr.c
918 66600 src/inet/generic/tcp.c
952 68700 src/inet/generic/tcp_lib.c
961 69300 src/inet/generic/tcp_recv.c
987 70900 src/inet/generic/tcp_send.c
1008 72200 src/inet/generic/udp.c
Index to Complete MINIX Source Code Files (alphabetical by pathname)
Page Line File
1 00000 include/a.out.h
3 00200 include/alloca.h
3 00300 include/ansi.h
4 00400 include/assert.h
5 00500 include/ctype.h
6 00600 include/curses.h
10 00900 include/dirent.h
11 01000 include/errno.h
13 01200 include/fcntl.h
15 01300 include/float.h
16 01400 include/grp.h
84 08100 include/ibm/diskparm.h
85 08200 include/ibm/partition.h
16 01500 include/lib.h
17 01600 include/limits.h
19 01700 include/locale.h
20 01800 include/math.h
20 01900 include/mathconst.h
62 06000 include/minix/boot.h
63 06100 include/minix/callnr.h
64 06200 include/minix/cdrom.h
65 06300 include/minix/com.h
69 06500 include/minix/config.h
72 06800 include/minix/const.h
74 07000 include/minix/dl_eth.h
75 07100 include/minix/fslib.h
75 07200 include/minix/jmp_buf.h
77 07300 include/minix/keymap.h
79 07500 include/minix/minlib.h
80 07600 include/minix/partition.h
80 07700 include/minix/sound.h
81 07800 include/minix/syslib.h
82 07900 include/minix/type.h
724 51600 include/net/gen/eth_hdr.h
724 51700 include/net/gen/eth_io.h
726 51800 include/net/gen/ether.h
726 51900 include/net/gen/icmp.h
727 52000 include/net/gen/icmp_hdr.h
728 52100 include/net/gen/if_ether.h
728 52200 include/net/gen/in.h
729 52300 include/net/gen/inet.h
729 52400 include/net/gen/ip_hdr.h
730 52500 include/net/gen/ip_io.h
731 52600 include/net/gen/nameser.h
733 52800 include/net/gen/netdb.h
735 53000 include/net/gen/oneCsum.h
735 53100 include/net/gen/resolv.h
737 53300 include/net/gen/route.h
738 53400 include/net/gen/socket.h
739 53500 include/net/gen/tcp.h
739 53600 include/net/gen/tcp_hdr.h
740 53700 include/net/gen/tcp_io.h
741 53800 include/net/gen/udp.h
741 53900 include/net/gen/udp_hdr.h
742 54000 include/net/gen/udp_io.h
722 51400 include/net/hton.h
723 51500 include/net/netlib.h
21 02000 include/pwd.h
22 02100 include/regexp.h
22 02200 include/setjmp.h
25 02400 include/sgtty.h
27 02500 include/signal.h
29 02700 include/stdarg.h
30 02800 include/stddef.h
31 02900 include/stdio.h
34 03100 include/stdlib.h
35 03200 include/string.h
49 04600 include/sys/asynchio.h
50 04700 include/sys/dir.h
50 04800 include/sys/ioctl.h
53 05000 include/sys/mtio.h
54 05100 include/sys/ptrace.h
54 05200 include/sys/sigcontext.h
57 05400 include/sys/stat.h
58 05500 include/sys/times.h
59 05600 include/sys/types.h
61 05800 include/sys/utsname.h
61 05900 include/sys/wait.h
36 03300 include/tar.h
37 03400 include/termcap.h
38 03500 include/termios.h
41 03800 include/time.h
43 03900 include/tools.h
45 04100 include/ttyent.h
45 04200 include/unistd.h
48 04400 include/utime.h
49 04500 include/utmp.h
605 42900 src/fs/buf.h
617 44300 src/fs/cache.c
624 44800 src/fs/cache2.c
606 43000 src/fs/const.h
608 43100 src/fs/dev.h
627 45000 src/fs/device.c
608 43200 src/fs/file.h
633 45400 src/fs/filedes.c
608 43300 src/fs/fproc.h
609 43400 src/fs/fs.h
610 43500 src/fs/glo.h
635 45500 src/fs/inode.c
610 43600 src/fs/inode.h
642 45900 src/fs/link.c
649 46400 src/fs/lock.c
611 43700 src/fs/lock.h
652 46600 src/fs/main.c
659 47000 src/fs/misc.c
665 47400 src/fs/mount.c
669 47700 src/fs/open.c
612 43800 src/fs/param.h
677 48200 src/fs/path.c
683 48600 src/fs/pipe.c
689 49000 src/fs/protect.c
613 43900 src/fs/proto.h
692 49300 src/fs/putk.c
693 49400 src/fs/read.c
702 50000 src/fs/stadir.c
705 50200 src/fs/super.c
616 44100 src/fs/super.h
710 50500 src/fs/table.c
713 50700 src/fs/time.c
617 44200 src/fs/type.h
715 50900 src/fs/utility.c
717 51100 src/fs/write.c
747 54700 src/inet/buf.c
761 55600 src/inet/clock.c
743 54100 src/inet/config.h
743 54200 src/inet/const.h
811 59800 src/inet/generic/arp.c
792 57700 src/inet/generic/arp.h
793 57800 src/inet/generic/assert.h
793 57900 src/inet/generic/buf.h
796 58100 src/inet/generic/clock.h
830 61000 src/inet/generic/eth.c
797 58200 src/inet/generic/eth.h
797 58300 src/inet/generic/eth_int.h
846 62000 src/inet/generic/icmp.c
798 58400 src/inet/generic/icmp.h
799 58500 src/inet/generic/icmp_lib.h
861 62900 src/inet/generic/io.c
799 58600 src/inet/generic/io.h
861 63000 src/inet/generic/ip.c
800 58700 src/inet/generic/ip.h
800 58800 src/inet/generic/ip_int.h
870 63500 src/inet/generic/ip_ioctl.c
877 64000 src/inet/generic/ip_lib.c
880 64200 src/inet/generic/ip_read.c
893 65100 src/inet/generic/ip_write.c
911 66200 src/inet/generic/ipr.c
803 59000 src/inet/generic/ipr.h
804 59100 src/inet/generic/sr.h
918 66600 src/inet/generic/tcp.c
805 59200 src/inet/generic/tcp.h
806 59300 src/inet/generic/tcp_delay.h
806 59400 src/inet/generic/tcp_int.h
952 68700 src/inet/generic/tcp_lib.c
961 69300 src/inet/generic/tcp_recv.c
987 70900 src/inet/generic/tcp_send.c
810 59600 src/inet/generic/type.h
1008 72200 src/inet/generic/udp.c
810 59700 src/inet/generic/udp.h
764 55800 src/inet/inet.c
744 54300 src/inet/inet.h
767 56000 src/inet/mnx_eth.c
776 56600 src/inet/mq.c
745 54400 src/inet/mq.h
746 54500 src/inet/osdep_eth.h
746 54600 src/inet/proto.h
777 56700 src/inet/putk.c
778 56800 src/inet/sr.c
118 10900 src/kernel/aha_scsi.c
85 08300 src/kernel/assert.h
155 13100 src/kernel/at_wini.c
170 14000 src/kernel/bios_wini.c
178 14500 src/kernel/clock.c
188 15100 src/kernel/console.c
86 08400 src/kernel/const.h
204 16100 src/kernel/dmp.c
208 16400 src/kernel/dp8390.c
89 08600 src/kernel/dp8390.h
238 18200 src/kernel/driver.c
94 08900 src/kernel/driver.h
243 18600 src/kernel/drvlib.c
95 09000 src/kernel/drvlib.h
247 18800 src/kernel/esdi_wini.c
259 19600 src/kernel/exception.c
260 19700 src/kernel/floppy.c
95 09100 src/kernel/glo.h
280 21000 src/kernel/i8259.c
97 09200 src/kernel/kernel.h
283 21200 src/kernel/keyboard.c
528 37000 src/kernel/keymaps/french.src
527 36900 src/kernel/keymaps/genmap.c
530 37200 src/kernel/keymaps/german.src
533 37400 src/kernel/keymaps/italian.src
535 37600 src/kernel/keymaps/japanese.src
538 37800 src/kernel/keymaps/latin-am.src
541 38000 src/kernel/keymaps/olivetti.src
543 38200 src/kernel/keymaps/scandin.src
546 38400 src/kernel/keymaps/spanish.src
548 38600 src/kernel/keymaps/uk.src
551 38800 src/kernel/keymaps/us-std.src
553 39000 src/kernel/keymaps/us-swap.src
470 33300 src/kernel/klib.s
470 33400 src/kernel/klib386.s
483 34200 src/kernel/klib88.s
292 21800 src/kernel/main.c
294 22000 src/kernel/mcd.c
316 23300 src/kernel/memory.c
320 23600 src/kernel/misc.c
503 35400 src/kernel/mpx.s
503 35500 src/kernel/mpx386.s
513 36100 src/kernel/mpx88.s
323 23800 src/kernel/ne2000.c
97 09300 src/kernel/ne2000.h
329 24200 src/kernel/printer.c
335 24600 src/kernel/proc.c
98 09400 src/kernel/proc.h
345 25300 src/kernel/protect.c
100 09600 src/kernel/protect.h
102 09800 src/kernel/proto.h
351 25700 src/kernel/pty.c
359 26200 src/kernel/rs232.c
109 10200 src/kernel/sb16.h
374 27200 src/kernel/sb16_dsp.c
386 27900 src/kernel/sb16_mixer.c
112 10400 src/kernel/sconst.h
394 28400 src/kernel/start.c
396 28600 src/kernel/system.c
415 29800 src/kernel/table.c
418 30000 src/kernel/tty.c
113 10500 src/kernel/tty.h
114 10600 src/kernel/type.h
447 31800 src/kernel/wdeth.c
117 10800 src/kernel/wdeth.h
453 32200 src/kernel/wini.c
454 32300 src/kernel/xt_wini.c
561 39900 src/mm/alloc.c
565 40200 src/mm/break.c
556 39200 src/mm/const.h
568 40400 src/mm/exec.c
578 41000 src/mm/forkexit.c
583 41300 src/mm/getset.c
556 39300 src/mm/glo.h
584 41400 src/mm/main.c
557 39400 src/mm/mm.h
557 39500 src/mm/mproc.h
558 39600 src/mm/param.h
559 39700 src/mm/proto.h
587 41600 src/mm/putk.c
588 41700 src/mm/signal.c
599 42400 src/mm/table.c
601 42500 src/mm/trace.c
560 39800 src/mm/type.h
603 42700 src/mm/utility.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,527 @@
Index to MINIX SOURCE CODE
Page Line File
1 00000 src/lib/ansi/ext_fmt.h
1 00100 src/lib/ansi/loc_time.h
2 00200 src/lib/ansi/abort.c
2 00300 src/lib/ansi/abs.c
3 00400 src/lib/ansi/asctime.c
4 00500 src/lib/ansi/assert.c
4 00600 src/lib/ansi/atexit.c
5 00700 src/lib/ansi/atof.c
5 00800 src/lib/ansi/atoi.c
6 00900 src/lib/ansi/atol.c
6 01000 src/lib/ansi/bsearch.c
7 01100 src/lib/ansi/calloc.c
7 01200 src/lib/ansi/chartab.c
12 01500 src/lib/ansi/clock.c
13 01600 src/lib/ansi/ctime.c
14 01700 src/lib/ansi/difftime.c
14 01800 src/lib/ansi/div.c
15 01900 src/lib/ansi/errlist.c
16 02000 src/lib/ansi/exit.c
17 02100 src/lib/ansi/ext_comp.c
30 02900 src/lib/ansi/getenv.c
30 03000 src/lib/ansi/gmtime.c
31 03100 src/lib/ansi/isalnum.c
31 03200 src/lib/ansi/isalpha.c
32 03300 src/lib/ansi/isascii.c
32 03400 src/lib/ansi/iscntrl.c
32 03500 src/lib/ansi/isdigit.c
32 03600 src/lib/ansi/isgraph.c
33 03700 src/lib/ansi/islower.c
33 03800 src/lib/ansi/isprint.c
33 03900 src/lib/ansi/ispunct.c
33 04000 src/lib/ansi/isspace.c
34 04100 src/lib/ansi/isupper.c
34 04200 src/lib/ansi/isxdigit.c
34 04300 src/lib/ansi/labs.c
35 04400 src/lib/ansi/ldiv.c
35 04500 src/lib/ansi/localeconv.c
36 04600 src/lib/ansi/localtime.c
37 04700 src/lib/ansi/malloc.c
40 05000 src/lib/ansi/mblen.c
41 05100 src/lib/ansi/mbstowcs.c
41 05200 src/lib/ansi/mbtowc.c
42 05300 src/lib/ansi/memchr.c
42 05400 src/lib/ansi/memcmp.c
43 05500 src/lib/ansi/memcpy.c
43 05600 src/lib/ansi/memmove.c
44 05700 src/lib/ansi/memset.c
44 05800 src/lib/ansi/misc.c
53 06400 src/lib/ansi/mktime.c
55 06600 src/lib/ansi/qsort.c
58 06800 src/lib/ansi/raise.c
58 06900 src/lib/ansi/rand.c
59 07000 src/lib/ansi/setlocale.c
59 07100 src/lib/ansi/sigmisc.c
60 07200 src/lib/ansi/signal.c
61 07300 src/lib/ansi/strcat.c
61 07400 src/lib/ansi/strchr.c
62 07500 src/lib/ansi/strcmp.c
62 07600 src/lib/ansi/strcoll.c
63 07700 src/lib/ansi/strcpy.c
63 07800 src/lib/ansi/strcspn.c
64 07900 src/lib/ansi/strerror.c
64 08000 src/lib/ansi/strftime.c
67 08200 src/lib/ansi/strlen.c
68 08300 src/lib/ansi/strncat.c
68 08400 src/lib/ansi/strncmp.c
69 08500 src/lib/ansi/strncpy.c
69 08600 src/lib/ansi/strpbrk.c
70 08700 src/lib/ansi/strrchr.c
70 08800 src/lib/ansi/strspn.c
71 08900 src/lib/ansi/strstr.c
71 09000 src/lib/ansi/strtok.c
72 09100 src/lib/ansi/strtol.c
74 09300 src/lib/ansi/strxfrm.c
74 09400 src/lib/ansi/system.c
75 09500 src/lib/ansi/tolower.c
76 09600 src/lib/ansi/toupper.c
76 09700 src/lib/ansi/tzset.c
76 09800 src/lib/ansi/wcstombs.c
77 09900 src/lib/ansi/wctomb.c
77 10000 src/lib/curses/curspriv.h
78 10100 src/lib/curses/beep.c
78 10200 src/lib/curses/charpick.c
79 10300 src/lib/curses/curs_set.c
80 10400 src/lib/curses/cursesio.c
84 10700 src/lib/curses/endwin.c
84 10800 src/lib/curses/flash.c
84 10900 src/lib/curses/initscr.c
85 11000 src/lib/curses/longname.c
85 11100 src/lib/curses/move.c
86 11200 src/lib/curses/mvcursor.c
86 11300 src/lib/curses/newwin.c
89 11500 src/lib/curses/options.c
90 11600 src/lib/curses/overlay.c
92 11800 src/lib/curses/prntscan.c
95 12000 src/lib/curses/refresh.c
96 12100 src/lib/curses/scrreg.c
97 12200 src/lib/curses/setterm.c
99 12300 src/lib/curses/tabsize.c
100 12400 src/lib/curses/termmisc.c
101 12500 src/lib/curses/unctrl.c
102 12600 src/lib/curses/update.c
105 12800 src/lib/curses/waddch.c
106 12900 src/lib/curses/waddstr.c
107 13000 src/lib/curses/wbox.c
108 13100 src/lib/curses/wclear.c
108 13200 src/lib/curses/wclrtobot.c
109 13300 src/lib/curses/wclrtoeol.c
110 13400 src/lib/curses/wdelch.c
111 13500 src/lib/curses/wdeleteln.c
111 13600 src/lib/curses/werase.c
112 13700 src/lib/curses/wgetch.c
112 13800 src/lib/curses/wgetstr.c
113 13900 src/lib/curses/windel.c
114 14000 src/lib/curses/winmove.c
115 14100 src/lib/curses/winsch.c
115 14200 src/lib/curses/winscrol.c
116 14300 src/lib/curses/winsertln.c
117 14400 src/lib/curses/wintouch.c
118 14500 src/lib/editline/editline.h
119 14600 src/lib/editline/os9.h
120 14700 src/lib/editline/unix.h
120 14800 src/lib/editline/complete.c
124 15100 src/lib/editline/editline.c
148 16600 src/lib/editline/sysos9.c
149 16700 src/lib/editline/sysunix.c
151 16900 src/lib/editline/testit.c
152 17000 src/lib/end/edata.s
153 17100 src/lib/end/em_end.s
153 17200 src/lib/end/end.s
154 17300 src/lib/end/etext.s
154 17400 src/lib/float/FP_bias.h
155 17500 src/lib/float/FP_shift.h
156 17600 src/lib/float/FP_trap.h
156 17700 src/lib/float/FP_types.h
158 17900 src/lib/float/adder.h
159 18000 src/lib/float/byte_order.h
159 18100 src/lib/float/get_put.h
160 18200 src/lib/float/add_ext.c
161 18300 src/lib/float/adder.c
162 18400 src/lib/float/adf4.c
163 18500 src/lib/float/adf8.c
163 18600 src/lib/float/cff4.c
164 18700 src/lib/float/cff8.c
165 18800 src/lib/float/cfi.c
166 18900 src/lib/float/cfu.c
167 19000 src/lib/float/cif4.c
168 19100 src/lib/float/cif8.c
169 19200 src/lib/float/cmf4.c
170 19300 src/lib/float/cmf8.c
171 19400 src/lib/float/compact.c
174 19700 src/lib/float/cuf4.c
175 19800 src/lib/float/cuf8.c
176 19900 src/lib/float/div_ext.c
181 20200 src/lib/float/dvf4.c
182 20300 src/lib/float/dvf8.c
182 20400 src/lib/float/extend.c
184 20600 src/lib/float/fef4.c
185 20700 src/lib/float/fef8.c
186 20800 src/lib/float/fif4.c
187 20900 src/lib/float/fif8.c
188 21000 src/lib/float/mlf4.c
188 21100 src/lib/float/mlf8.c
189 21200 src/lib/float/mul_ext.c
191 21300 src/lib/float/ngf4.c
191 21400 src/lib/float/ngf8.c
192 21500 src/lib/float/nrm_ext.c
193 21600 src/lib/float/sbf4.c
193 21700 src/lib/float/sbf8.c
194 21800 src/lib/float/sft_ext.c
195 21900 src/lib/float/shifter.c
196 22000 src/lib/float/sub_ext.c
197 22100 src/lib/float/zrf4.c
198 22200 src/lib/float/zrf8.c
198 22300 src/lib/float/zrf_ext.c
199 22400 src/lib/float/fptrp.s
199 22500 src/lib/fphook/fltpr.c
199 22600 src/lib/fphook/fphook.c
203 22800 src/lib/fphook/strtod.c
203 22900 src/lib/ip/ether.h
206 23100 src/lib/ip/domainname.c
206 23200 src/lib/ip/ether_line.c
208 23300 src/lib/ip/ethera2n.c
208 23400 src/lib/ip/ethere2a.c
209 23500 src/lib/ip/etherh2n.c
210 23600 src/lib/ip/ethern2h.c
211 23700 src/lib/ip/getdomain.c
211 23800 src/lib/ip/gethnmadr.c
217 24200 src/lib/ip/gethostent.c
220 24400 src/lib/ip/gethostname.c
221 24500 src/lib/ip/getproto.c
222 24600 src/lib/ip/getprotoent.c
224 24800 src/lib/ip/getservent.c
226 25000 src/lib/ip/getsrvbyname.c
227 25100 src/lib/ip/getsrvbyport.c
228 25200 src/lib/ip/hton.c
229 25300 src/lib/ip/inet_addr.c
231 25500 src/lib/ip/inet_ntoa.c
232 25600 src/lib/ip/memcspn.c
233 25700 src/lib/ip/oneC_sum.c
234 25800 src/lib/ip/rcmd.c
244 26400 src/lib/ip/res_comp.c
250 26800 src/lib/ip/res_init.c
253 27000 src/lib/ip/res_mkquery.c
257 27300 src/lib/ip/res_query.c
262 27600 src/lib/ip/res_send.c
278 28600 src/lib/ip/strcasecmp.c
278 28700 src/lib/liby/main.c
279 28800 src/lib/liby/yyerror.c
280 28900 src/lib/math/localmath.h
281 29000 src/lib/math/asin.c
282 29100 src/lib/math/atan.c
284 29200 src/lib/math/atan2.c
285 29300 src/lib/math/ceil.c
285 29400 src/lib/math/exp.c
287 29500 src/lib/math/fabs.c
287 29600 src/lib/math/floor.c
288 29700 src/lib/math/fmod.c
288 29800 src/lib/math/frexp.s
289 29900 src/lib/math/hugeval.c
289 30000 src/lib/math/isnan.c
290 30100 src/lib/math/ldexp.c
291 30200 src/lib/math/log.c
292 30300 src/lib/math/log10.c
293 30400 src/lib/math/modf.s
294 30500 src/lib/math/pow.c
295 30600 src/lib/math/sin.c
296 30700 src/lib/math/sinh.c
298 30800 src/lib/math/sqrt.c
299 30900 src/lib/math/tan.c
300 31000 src/lib/math/tanh.c
301 31100 src/lib/other/_brk.c
302 31200 src/lib/other/_longjerr.c
303 31300 src/lib/other/_reboot.c
303 31400 src/lib/other/_seekdir.c
304 31500 src/lib/other/asynchio.c
307 31700 src/lib/other/bcmp.c
307 31800 src/lib/other/bcopy.c
307 31900 src/lib/other/bzero.c
308 32000 src/lib/other/crypt.c
309 32100 src/lib/other/ctermid.c
310 32200 src/lib/other/cuserid.c
311 32300 src/lib/other/environ.c
311 32400 src/lib/other/errno.c
311 32500 src/lib/other/execlp.c
315 32700 src/lib/other/fdopen.c
316 32800 src/lib/other/ffs.c
316 32900 src/lib/other/fslib.c
320 33100 src/lib/other/fsversion.c
321 33200 src/lib/other/getgrent.c
323 33400 src/lib/other/getlogin.c
324 33500 src/lib/other/getopt.c
325 33600 src/lib/other/getpass.c
327 33700 src/lib/other/getpwent.c
329 33900 src/lib/other/getttyent.c
332 34100 src/lib/other/getw.c
332 34200 src/lib/other/hypot.c
333 34300 src/lib/other/index.c
334 34400 src/lib/other/itoa.c
334 34500 src/lib/other/loadname.c
335 34600 src/lib/other/lock.c
336 34700 src/lib/other/lrand.c
337 34800 src/lib/other/lsearch.c
338 34900 src/lib/other/memccpy.c
339 35000 src/lib/other/mtab.c
342 35300 src/lib/other/nlist.c
344 35400 src/lib/other/peekpoke.c
345 35500 src/lib/other/popen.c
347 35700 src/lib/other/printk.c
350 35900 src/lib/other/putenv.c
352 36000 src/lib/other/putw.c
352 36100 src/lib/other/regexp.c
370 37200 src/lib/other/regsub.c
372 37300 src/lib/other/rindex.c
372 37400 src/lib/other/stderr.c
372 37500 src/lib/other/swab.c
373 37600 src/lib/other/syscall.c
373 37700 src/lib/other/sysconf.c
374 37800 src/lib/other/telldir.c
375 37900 src/lib/other/termcap.c
380 38300 src/lib/other/ttyname.c
381 38400 src/lib/other/ttyslot.c
383 38500 src/lib/posix/__exit.c
383 38600 src/lib/posix/_access.c
383 38700 src/lib/posix/_alarm.c
384 38800 src/lib/posix/_cfgetispeed.c
384 38900 src/lib/posix/_cfgetospeed.c
384 39000 src/lib/posix/_cfsetispeed.c
385 39100 src/lib/posix/_cfsetospeed.c
385 39200 src/lib/posix/_chdir.c
385 39300 src/lib/posix/_chmod.c
386 39400 src/lib/posix/_chown.c
386 39500 src/lib/posix/_chroot.c
386 39600 src/lib/posix/_close.c
387 39700 src/lib/posix/_closedir.c
387 39800 src/lib/posix/_creat.c
388 39900 src/lib/posix/_dup.c
388 40000 src/lib/posix/_dup2.c
389 40100 src/lib/posix/_exec.c
392 40300 src/lib/posix/_execn.c
392 40400 src/lib/posix/_fcntl.c
393 40500 src/lib/posix/_fork.c
394 40600 src/lib/posix/_fpathconf.c
395 40700 src/lib/posix/_fstat.c
395 40800 src/lib/posix/_getcwd.c
398 41000 src/lib/posix/_getegid.c
398 41100 src/lib/posix/_geteuid.c
399 41200 src/lib/posix/_getgid.c
399 41300 src/lib/posix/_getgroups.c
399 41400 src/lib/posix/_getpgrp.c
400 41500 src/lib/posix/_getpid.c
400 41600 src/lib/posix/_getppid.c
400 41700 src/lib/posix/_getuid.c
401 41800 src/lib/posix/_ioctl.c
401 41900 src/lib/posix/_isatty.c
401 42000 src/lib/posix/_kill.c
402 42100 src/lib/posix/_link.c
402 42200 src/lib/posix/_lseek.c
403 42300 src/lib/posix/_mkdir.c
403 42400 src/lib/posix/_mkfifo.c
403 42500 src/lib/posix/_mknod.c
404 42600 src/lib/posix/_mktemp.c
405 42700 src/lib/posix/_mount.c
405 42800 src/lib/posix/_open.c
406 42900 src/lib/posix/_opendir.c
407 43000 src/lib/posix/_pathconf.c
407 43100 src/lib/posix/_pause.c
408 43200 src/lib/posix/_pipe.c
408 43300 src/lib/posix/_ptrace.c
409 43400 src/lib/posix/_read.c
409 43500 src/lib/posix/_readdir.c
410 43600 src/lib/posix/_rename.c
411 43700 src/lib/posix/_rewinddir.c
411 43800 src/lib/posix/_rmdir.c
411 43900 src/lib/posix/_setgid.c
412 44000 src/lib/posix/_setsid.c
412 44100 src/lib/posix/_setuid.c
412 44200 src/lib/posix/_sigaction.c
413 44300 src/lib/posix/_sigpending.c
413 44400 src/lib/posix/_sigprocmask.c
414 44500 src/lib/posix/_sigreturn.c
415 44600 src/lib/posix/_sigset.c
416 44700 src/lib/posix/_sigsetjmp.c
417 44800 src/lib/posix/_sigsuspend.c
417 44900 src/lib/posix/_sleep.c
418 45000 src/lib/posix/_stat.c
419 45100 src/lib/posix/_stime.c
419 45200 src/lib/posix/_sync.c
419 45300 src/lib/posix/_tcdrain.c
420 45400 src/lib/posix/_tcflow.c
420 45500 src/lib/posix/_tcflush.c
421 45600 src/lib/posix/_tcgetattr.c
421 45700 src/lib/posix/_tcsendbreak.c
421 45800 src/lib/posix/_tcsetattr.c
422 45900 src/lib/posix/_time.c
422 46000 src/lib/posix/_times.c
423 46100 src/lib/posix/_umask.c
423 46200 src/lib/posix/_umount.c
423 46300 src/lib/posix/_uname.c
424 46400 src/lib/posix/_unlink.c
425 46500 src/lib/posix/_utime.c
425 46600 src/lib/posix/_wait.c
426 46700 src/lib/posix/_waitpid.c
426 46800 src/lib/posix/_write.c
427 46900 src/lib/stdio/loc_incl.h
428 47000 src/lib/stdio/clearerr.c
428 47100 src/lib/stdio/data.c
429 47200 src/lib/stdio/doprnt.c
434 47600 src/lib/stdio/doscan.c
442 48100 src/lib/stdio/ecvt.c
442 48200 src/lib/stdio/fclose.c
443 48300 src/lib/stdio/feof.c
443 48400 src/lib/stdio/ferror.c
444 48500 src/lib/stdio/fflush.c
445 48600 src/lib/stdio/fgetc.c
445 48700 src/lib/stdio/fgetpos.c
446 48800 src/lib/stdio/fgets.c
446 48900 src/lib/stdio/fileno.c
447 49000 src/lib/stdio/fillbuf.c
448 49100 src/lib/stdio/flushbuf.c
450 49300 src/lib/stdio/fopen.c
452 49500 src/lib/stdio/fprintf.c
453 49600 src/lib/stdio/fputc.c
453 49700 src/lib/stdio/fputs.c
454 49800 src/lib/stdio/fread.c
454 49900 src/lib/stdio/freopen.c
456 50000 src/lib/stdio/fscanf.c
457 50100 src/lib/stdio/fseek.c
458 50200 src/lib/stdio/fsetpos.c
458 50300 src/lib/stdio/ftell.c
459 50400 src/lib/stdio/fwrite.c
459 50500 src/lib/stdio/getc.c
460 50600 src/lib/stdio/getchar.c
460 50700 src/lib/stdio/gets.c
461 50800 src/lib/stdio/icompute.c
461 50900 src/lib/stdio/perror.c
462 51000 src/lib/stdio/printf.c
462 51100 src/lib/stdio/putc.c
463 51200 src/lib/stdio/putchar.c
463 51300 src/lib/stdio/puts.c
464 51400 src/lib/stdio/remove.c
464 51500 src/lib/stdio/rewind.c
464 51600 src/lib/stdio/scanf.c
465 51700 src/lib/stdio/setbuf.c
465 51800 src/lib/stdio/setvbuf.c
466 51900 src/lib/stdio/sprintf.c
467 52000 src/lib/stdio/sscanf.c
468 52100 src/lib/stdio/tmpfile.c
468 52200 src/lib/stdio/tmpnam.c
469 52300 src/lib/stdio/ungetc.c
470 52400 src/lib/stdio/vfprintf.c
470 52500 src/lib/stdio/vprintf.c
470 52600 src/lib/stdio/vsprintf.c
471 52700 src/lib/stdio/vscanf.c
471 52800 src/lib/stdio/vsscanf.c
472 52900 src/lib/syscall/_exit.s
472 53000 src/lib/syscall/access.s
472 53100 src/lib/syscall/alarm.s
473 53200 src/lib/syscall/brk.s
473 53300 src/lib/syscall/cfgetispeed.s
473 53400 src/lib/syscall/cfgetospeed.s
473 53500 src/lib/syscall/cfsetispeed.s
474 53600 src/lib/syscall/cfsetospeed.s
474 53700 src/lib/syscall/chdir.s
474 53800 src/lib/syscall/chmod.s
474 53900 src/lib/syscall/chown.s
475 54000 src/lib/syscall/chroot.s
475 54100 src/lib/syscall/close.s
475 54200 src/lib/syscall/closedir.s
475 54300 src/lib/syscall/creat.s
476 54400 src/lib/syscall/dup.s
476 54500 src/lib/syscall/dup2.s
476 54600 src/lib/syscall/execl.s
476 54700 src/lib/syscall/execle.s
477 54800 src/lib/syscall/execv.s
477 54900 src/lib/syscall/execve.s
477 55000 src/lib/syscall/fcntl.s
477 55100 src/lib/syscall/fork.s
478 55200 src/lib/syscall/fpathconf.s
478 55300 src/lib/syscall/fstat.s
478 55400 src/lib/syscall/getcwd.s
478 55500 src/lib/syscall/getegid.s
479 55600 src/lib/syscall/geteuid.s
479 55700 src/lib/syscall/getgid.s
479 55800 src/lib/syscall/getgroups.s
479 55900 src/lib/syscall/getpgrp.s
480 56000 src/lib/syscall/getpid.s
480 56100 src/lib/syscall/getppid.s
480 56200 src/lib/syscall/getuid.s
480 56300 src/lib/syscall/ioctl.s
481 56400 src/lib/syscall/isatty.s
481 56500 src/lib/syscall/kill.s
481 56600 src/lib/syscall/link.s
481 56700 src/lib/syscall/lseek.s
482 56800 src/lib/syscall/mkdir.s
482 56900 src/lib/syscall/mkfifo.s
482 57000 src/lib/syscall/mknod.s
482 57100 src/lib/syscall/mktemp.s
483 57200 src/lib/syscall/mount.s
483 57300 src/lib/syscall/open.s
483 57400 src/lib/syscall/opendir.s
483 57500 src/lib/syscall/pathconf.s
484 57600 src/lib/syscall/pause.s
484 57700 src/lib/syscall/pipe.s
484 57800 src/lib/syscall/ptrace.s
484 57900 src/lib/syscall/read.s
485 58000 src/lib/syscall/readdir.s
485 58100 src/lib/syscall/reboot.s
485 58200 src/lib/syscall/rename.s
485 58300 src/lib/syscall/rewinddir.s
486 58400 src/lib/syscall/rmdir.s
486 58500 src/lib/syscall/sbrk.s
486 58600 src/lib/syscall/seekdir.s
486 58700 src/lib/syscall/setgid.s
487 58800 src/lib/syscall/setsid.s
487 58900 src/lib/syscall/setuid.s
487 59000 src/lib/syscall/sigaction.s
487 59100 src/lib/syscall/sigaddset.s
488 59200 src/lib/syscall/sigdelset.s
488 59300 src/lib/syscall/sigemptyset.s
488 59400 src/lib/syscall/sigfillset.s
488 59500 src/lib/syscall/sigismember.s
489 59600 src/lib/syscall/sigpending.s
489 59700 src/lib/syscall/sigprocmask.s
489 59800 src/lib/syscall/sigreturn.s
489 59900 src/lib/syscall/sigsuspend.s
490 60000 src/lib/syscall/sleep.s
490 60100 src/lib/syscall/stat.s
490 60200 src/lib/syscall/stime.s
490 60300 src/lib/syscall/sync.s
491 60400 src/lib/syscall/tcdrain.s
491 60500 src/lib/syscall/tcflow.s
491 60600 src/lib/syscall/tcflush.s
491 60700 src/lib/syscall/tcgetattr.s
492 60800 src/lib/syscall/tcsendbreak.s
492 60900 src/lib/syscall/tcsetattr.s
492 61000 src/lib/syscall/time.s
492 61100 src/lib/syscall/times.s
493 61200 src/lib/syscall/umask.s
493 61300 src/lib/syscall/umount.s
493 61400 src/lib/syscall/uname.s
493 61500 src/lib/syscall/unlink.s
494 61600 src/lib/syscall/utime.s
494 61700 src/lib/syscall/wait.s
494 61800 src/lib/syscall/waitpid.s
494 61900 src/lib/syscall/write.s
495 62000 src/lib/syslib/syslib.h
495 62100 src/lib/syslib/sys_abort.c
495 62200 src/lib/syslib/sys_copy.c
496 62300 src/lib/syslib/sys_endsig.c
496 62400 src/lib/syslib/sys_exec.c
497 62500 src/lib/syslib/sys_fork.c
497 62600 src/lib/syslib/sys_fresh.c
498 62700 src/lib/syslib/sys_getmap.c
498 62800 src/lib/syslib/sys_getsp.c
499 62900 src/lib/syslib/sys_kill.c
499 63000 src/lib/syslib/sys_newmap.c
499 63100 src/lib/syslib/sys_oldsig.c
500 63200 src/lib/syslib/sys_sendsig.c
500 63300 src/lib/syslib/sys_sigret.c
500 63400 src/lib/syslib/sys_times.c
501 63500 src/lib/syslib/sys_trace.c
501 63600 src/lib/syslib/sys_xit.c
502 63700 src/lib/syslib/taskcall.c

146725
Minix/CD-ROM-2.0/LISTING/LIB.PS Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,750 @@
A #def 34727 34747
A1 #def 30659 30668 30671 30954 30962 30965
A2 #def 30660 30670 30672 30955 30964 30966
ABB_LEN #def 113 443 447 8059 8068
ALIGN #def 1103 1110
ANY #def 36177 36541 36870 37026 37133
ANYBUT #def 36179 36549 36892 37042 37101 37135
ANYOF #def 36178 36552 36887 37036 37101 37134
ASSERT #def 4711 4713 4754 4788 4789 4812 4875 4885 4892
ATR_MSK #def 10020 11640 11691 12633 12874 13213 13315 13422 13514
13613 14234 14313
ATR_NRM #def 10021 11348 11404 12694 12696
Align #def 4728 4757 4776 4781 4828
BACK #def 36183 36494 36504 36706 36899 37071 37139
BITMAPSHIFT #def 32917 32938 32939
BOL #def 36175 36334 36538 36864 37131
BRANCH #def 36181 36443 36493 36496 36502 36505 36509 36510 36722
36952 36955 36964 37136
BRKSIZE #def 4723 4725 4757
BTP #def 2534 2535 2682
BUF_SIZE #def 35043 35046 35047 35076 35082 35137 35144 35148 35152
35156 35176
BYTES_REVERSE #def 18115 18119 18131
CARRYBIT #def 17511 19483 19507 19593
CFAIL #def 36237 36381 36417 36420 36422 36486 36516 36563 36572
36585 36589 36591 36603
CHARBITS #def 37230 34912 34915 36231 36234 37231 37234
CHAR_SHIFT #def 5009
CHAR_UNSIGNED #def 18000 18109
CHR_MSK #def 10019 11650 11651 11703 11703 11704
CLOSE #def 36193 36409 36927 36928 36929 36930 36931 36932 36933
36934 36935 36939 37153 37154 37155 37156 37157 37158
37159 37160 37161 37162 39610
CONST #def 14530 14532 25863 25865 26452 26454 27359 27361 14528
14828 14829 14831 14832 14834 14835 15166 15168 15390
15583 15584 15725 15736 15741 16086 16103 25881 26268
26270 26275 26330 26363 26465 26469 26472 26547 26553
26627 26629 26659 26662 26665 26714 26721 27568
COPYFROMTO #def 14545 14887 14992 15014 15562 15571 15784 16180 16423
CRLF #def 14605 14705 15171
CROSS #def 10513 10594
CTL #def 15115 16293 16466 16467 16468 16469 16470 16471 16472
16473 16474 16475 16476 16477 16478 16479 16480 16481
16482 16483 16484 16485 16486 16487 16488 16489 16490
16491 16492 16493 16494 16495 16500
DATE_STR #def 409 441
DBL_BIAS #def 17414 19435 20487
DBL_CARRYOUT #def 17547 19481
DBL_EXACT #def 17541 19468 19471 19472
DBL_EXPSHIFT #def 17530 19505 20462
DBL_LPACK #def 17535 20489
DBL_LUNPACK #def 17544 19462
DBL_M1LEFT #def 17532 17534 17535 17543 20486 20934
DBL_MASK #def 17548 19478 19503
DBL_MAX #def 17424 2830 19436 19438 19489 30125 30248 30546 30653
30829 30948
DBL_MIN #def 17425 19444
DBL_ROUNDUP #def 17546 19471 19472 19473
DBL_RPACK #def 17534 20488
DBL_RUNPACK #def 17543 17544 19460 19461
DBL_ZERO #def 17539 19431
DEGREE #def 10507 10599
DEL #def 15114 15241 15983 16501
DIAMOND #def 10506 10597
DISPOSE #def 14540 14877 14888 14895 14939 14948 14980 14981 14998
15022 15023 15025 15026 15045 15046 15563 15694 15776
15911 16061 16110 16111 16195 16199 16200 16217 16224
16425 16460 16461
DOMIDLINE #def 10517
DOWNARROW #def 10500 10605
DOWNLEFT #def 10512 10585
DOWNLINE #def 10518 10596
DOWNRIGHT #def 10509 10587
ECONV #def 17620
EFDIVZ #def 17617 19948
EFOVFL #def 17614 19437 19538 20160 21284
EFUND #def 17619
EFUNFL #def 17615 20151 21293
EIDIVZ #def 17616
EIOVFL #def 17613 18841 18935
EIUND #def 17618
EMPTYSQUARE #def 10504 10607
END #def 36174 36328 36409 36995 37092 37140
ENTRY_INC #def 35909 35910 35910 35969
EOL #def 36176 36539 36867 37132
EPOCH_YR #def 106 3016 6467 6479 6480
ERR #def 33509 10223 10223 10237 10237 10542 11113 11214 11319
11324 11331 11337 11391 11392 11401 11430 11434 11435
11815 11815 11828 11828 11841 11841 11843 11843 11856
11856 11858 11858 11873 11874 11889 11890 11905 11905
11907 11908 11923 11923 11925 11926 12144 12841 12845
12845 12853 12865 12865 12871 12871 12886 12914 12914
13027 13712 13814 13815 13817 14030 33540 33551
ETHERSTRLEN #def 23024 23412 23429 23444
ETHER_ALLTYPE #def 23047 23049
ETHER_DST #def 23034
ETHER_MAX #def 23039
ETHER_MAXTYPE #def 23042
ETHER_MCAST #def 23044
ETHER_MIN #def 23038
ETHER_MINTYPE #def 23041
ETHER_PKT #def 23037
ETHER_SRC #def 23035
ETHER_TYPE #def 23036
EXACTLY #def 36184 36332 36347 36592 36609 36874 36980 37030 37088
37101 37137
EXP_STORE #def 17513 19505 19591
EXT_BIAS #def 17415
EXT_MAX #def 17426 19950 20156 20161 21283 21287
EXT_MIN #def 17427 20147 20152 21292 21294
FAIL #def 9418 9443 9453
FALSE #def 18318 11350 11351 11352 11353 11354 11503 12064 12237
12249 12255 12273 12689 13707 32971 32972 32993 32995
40207
FD_CLR #def 27703
FD_ISSET #def 27704 26184
FD_SET #def 27702 26180 26181 27699 28125
FD_SETSIZE #def 27701
FD_ZERO #def 27705 26179 28124
FIRSTDAYOF #def 111 6243
FIRSTSUNDAY #def 110 6217
FL_ALT #def 46930 22631 22659 22700 22708 22744 47281 47285 47343
47470
FL_LJUST #def 46927 47340 47362 47368 47477
FL_LONG #def 46933 47234 47249 47257 47375 47395 47614 47832 47856
47893 48031
FL_LONGDOUBLE #def 46934 22755 47376 47833 48028
FL_MSB_AT_LOW #def 18003 18115 21315 21415
FL_MSL_AT_LOW #def 18005 18117 19326 19347 19513 20446 20470 21415
FL_MSW_AT_LOW #def 18004 18116 20447 20453 21315 21415
FL_NOASSIGN #def 46938 47822 47853 47888 47904 47909 47925 47930 47938
47983 47987 47999 48026 48040
FL_NOMORE #def 46939 47345 47348
FL_PRECSPEC #def 46936 47357 47405 47420 47427 47437 47442
FL_SHORT #def 46932 47249 47250 47374 47393 47831 47854 47895
FL_SIGN #def 46928 22621 22653 22695 47277 47341 47366
FL_SIGNEDCONV #def 46937 47426 47448 47472 47480
FL_SPACE #def 46929 22623 22655 22697 47278 47342 47366
FL_WIDTHSPEC #def 46935 47352 47360 47364 47825 47872 47902 47923 47946
48009
FL_ZEROFILL #def 46931 47344 47368 47421 47428 47458 47469
FORWARD #def 14606 14706 15181 15182 44912
FULLSQUARE #def 10502 10609
GREYSQUARE #def 10503 10598
HASWIDTH #def 36244 36377 36397 36397 36404 36404 36448 36486 36487
36542 36574 36580 36595 36607
HIST_SIZE #def 15122 15121 15153 16058 16062
HOSTNAME_FILE #def 24409 24417
HOUR #def 5899 5902 5903 5904 5905 5906 5907 5908 5909
5910 5911 5912 5913 5914 5915 5916 5917 5918
5919 5920 5921 5922 5923 5924 5925 5926 5927
5928 5929 5930 5931 5932 5933 5934 5935 5936
5937 5938 5939 5940 5941 5942 5943 5944 5945
5946
IDLE #def 31524 31542 31552 31564 31596 31649
INPROGRESS #def 31525 31549 31559 31597
ISCTL #def 15116 15245 15401 15522 15805
ISMETA #def 15119 15249 15403 15526 15809 15961 15980
ISMULT #def 36239 36482 36516 36605
LATERN #def 10505 10608
LEAPYEAR #def 108 109 3032 3033 6219 6227 6456 6458 6459
6496
LEFTARROW #def 10499 10603
LEN #def 32023 32030 32037 32038 32064 32077
LN3D2 #def 31043 31044
LNV #def 30748 30750 30752
LOCKDIR #def 34615 34659
LONGS_REVERSE #def 18117
LOW_EXP #def 22681 22682
L_ctermid #def 32120 32119 32126
L_cuserid #def 32212 33412 32211 32218 33411 33417
M #def 34728 34749
MAGIC #def 36137 37228 36304 36319 36765 37255
MAXADDRS #def 23851 24260 23853 24274
MAXALIASES #def 23850 24259 24633 24831 23874 23969 24271 24343 24638
24698 24836 24901
MAXBIT #def 18319
MAXHOSTNAMELE #def 23028 25844 23027 26273 26334 26366 26386
MAXPACKET #def 23883 23885 27365 27367 23891 27388
MAXPATHLEN #def 25845 26303
MAXTRIES #def 34616 34641
MAX_EXP #def 2535 2616 2617 2625
MAX_NUM_ARGS #def 32549 32584 32646
MEM_INC #def 14537 14881 14882 15559 15566 16092 16404 16418 16424
META #def 15118 36240 36602
MIDLINE #def 10516 10592
MSB_AT_LOW_AD #def 18001 18115
MSW_AT_LOW_AD #def 18002 18116
M_1_PI #def 28913 30651
M_1_SQRT2 #def 28922 30252
M_2PI #def 28907
M_2_PI #def 28914 30946
M_3PI_4 #def 28908
M_3PI_8 #def 28910
M_4_PI #def 28915
M_E #def 28916
M_EULER #def 28923
M_LN10 #def 28920 30328
M_LN2 #def 28919 28940 28941 30752
M_LN_MAX_D #def 28940 29446 30746 30752 31040
M_LN_MIN_D #def 28941 29442
M_LOG10E #def 28918
M_LOG2E #def 28917 29455
M_PI #def 28906 29238 29240 30653
M_PI_2 #def 28909 29065 29065 29137 29225 29225 30645 30948
M_PI_4 #def 28911 29062 29062
M_PI_8 #def 28912
M_SQRT2 #def 28921
NAPTIME #def 34617 34642
NDIGINEXP #def 22680 22716 22718
NDIGITS #def 2650 2658 2665 2665 2716 2716
NEW #def 14541 14817 14882 14991 14993 15013 15559 15783 15904
16093 16101 16178 16405 16418
NEXITS #def 604 2009 606 612 2011
NEXT #def 36226 37068
NFDBITS #def 27700 27702 27702 27703 27703 27704 27704
NITER #def 30812 30838
NORMBIT #def 17512 18837 20505 20507 21277 21538 21539
NOTHING #def 36185 36456 36497 36506 36511 36897 37138
NO_ARG #def 15113 15737 15867 15898 15972 15990 16012 16150 16454
NR_CHARS #def 47621 47623 47956
NSIGNIFICANT #def 2651 2725
NULL #def 32547 715 1026 1113 1113 2017 2916 2916 2917
2918 2926 4773 4777 4780 4813 4826 4860 4861
5014 5212 5321 5947 5961 5981 5988 6006 6007
6015 6016 6024 6025 6059 6060 6074 6075 6079
6091 6095 6098 6100 6104 6107 6155 6168 7014
7025 7130 7136 7414 8620 8711 8916 9014 9016
9016 9021 9022 9026 9424 9425 10910 10910 10913
10913 10914 10914 10915 10915 11318 11322 11328 11333
11394 14817 14859 14862 14867 14882 14893 14913 14914
14935 14936 14938 14944 14947 14978 14982 14985 14991
14993 15013 15320 15327 15440 15559 15600 15606 15613
15631 15698 15699 15714 15718 15742 15749 15777 15783
15904 16022 16033 16047 16056 16091 16093 16094 16104
16124 16175 16178 16179 16405 16419 16420 16435 16447
16450 16496 16515 16946 16949 23323 23324 23330 23332
23428 23431 23519 23522 23622 23625 23929 23945 23948
23951 24031 24033 24040 24070 24074 24095 24111 24123
24126 24127 24273 24286 24298 24308 24308 24309 24311
24312 24316 24320 24336 24346 24349 24424 24635 24645
24657 24668 24668 24669 24671 24672 24676 24681 24687
24691 24701 24705 24833 24845 24857 24868 24868 24869
24871 24872 24876 24881 24887 24894 24904 24907 25898
26143 26306 26310 26367 26387 26561 26562 26563 26568
26571 26580 26582 26596 26597 26608 26609 26615 26616
26881 26890 26895 26897 26908 26923 27083 27098 27117
27398 27398 27520 27548 27577 27577 27578 27597 28126
28127 28426 28467 32128 32221 32225 32227 32546 32597
32597 32604 32625 32643 32657 32660 32718 32721 32733
32749 32750 32759 33422 33422 33539 33562 33633 33637
33670 34848 34929 34937 35332 35342 35927 35933 35934
35975 36237 36238 36297 36305 36305 36313 36320 36320
36325 36344 36346 36387 36392 36392 36393 36402 36402
36413 36444 36447 36447 36449 36455 36479 36479 36579
36579 36702 36722 36759 36759 36771 36773 36778 36786
36794 36826 36827 36855 36857 36888 36893 36920 36946
36964 37037 37043 37066 37069 37096 37115 37151 37163
37167 37169 37251 37251 37251 37273 37273 37938 37970
37973 37980 37981 37990 37992 38028 38028 38052 38052
38078 38078 38078 38082 38220 38327 38330 38331 38334
38351 38436 38445 40176 40178 40181 40183 40258 40267
44411 44419 44553 44943 46336 46513 47109 47109 47114
47114 47119 47119 47402 48821 48822 49354 49372 49403
49405 49407 49416 49955 49991 50720 50721 51827 52117
52127 52218
NUMLEN #def 47620 47624 47872 47873 48009 48010
NUNGETCH #def 10013
NextFree #def 4730 4791 4800 4800 4801 4804 4804 4806 4834
4840 4840 4842 4876 4879 4881 4888 4888 4895
4895
NextSlot #def 4729 4754 4760 4761 4784 4787 4792 4798 4799
4829 4838 4838 4843 4854 4855 4875 4885 4886
4887 4887 4892 4893 4894 4894
OFF #def 21315 21415 21323 21424
OP #def 36225 36328 36332 36334 36347 36706 36722 36863 36913
36939 36955 36964 36980 36981 37025 37071 37093 37130
37150 37162
OPEN #def 36190 36384 36901 36902 36903 36904 36905 36906 36907
36908 36909 36913 37141 37142 37143 37144 37145 37146
37147 37148 37149 37150 42828
OPERAND #def 36227 36329 36333 36347 36348 36349 36723 36878 36888
36893 36956 36960 36980 36983 37024
OP_IOCTL #def 31530 31582 31623
OP_READ #def 31528 31572 31615
OP_WRITE #def 31529 31577 31619
O_APPEND #def 49338 49923 49369 49952
O_CREAT #def 49336 49921 42818 49364 49369 49395 49947 49952 49975
O_RDONLY #def 49316 49917 24417 33130 33249 33633 33748 33944 35069
35425 42930 43023 46326 49359 49942
O_RDWR #def 49318 49919 25909 25977 28336 28396 49380 49963
O_TRUNC #def 49337 49922 49364 49393 49947 49973
O_WRONLY #def 49317 49918 35442 49363 49368 49946 49951
PARAGRAPH #def 10524
PLUS #def 36188 36499 36971 37166
PLUSMINUS #def 10508 10600
PMODE #def 49312 49912 49396 49976
POLYNOM1 #def 28926 28927
POLYNOM10 #def 28935 28936
POLYNOM11 #def 28936 28937
POLYNOM12 #def 28937 28938
POLYNOM13 #def 28938
POLYNOM2 #def 28927 28928 29468 30262 30971 31051
POLYNOM3 #def 28928 28929 29167 29470 30262 30743 30743 31051
POLYNOM4 #def 28929 28930 29057 29167 30972
POLYNOM5 #def 28930 28931 29057
POLYNOM6 #def 28931 28932
POLYNOM7 #def 28932 28933 30683
POLYNOM8 #def 28933 28934
POLYNOM9 #def 28934 28935
PTRSIZE #def 4727 40113 40283 4729 4776 4776 4776 4779 4781
4782 4796 4828 4828 4852 40212 40229 40231 40231
40248 40303 40313
Q #def 34729 34747 34747
R #def 34730 34747
RENEW #def 14543 15225
RESULT #def 31526 31562 31638
RFAIL #def 36238 36297 36309 36313
RIGHTARROW #def 10498 10604
RULE_LEN #def 5838 6119 6120 6145 6173
RUSAGE_CHILDR #def 1515
RUSAGE_SELF #def 1514 1568
SCREEN_INC #def 14538 15224 16100
SCREEN_ROWS #def 15112 15324 15342
SCREEN_WIDTH #def 15111 15323 15341
SECS_DAY #def 107 3018 3019 6508 6509
SEGSIZE #def 35416 35427 35444
SGL_BIAS #def 17413 19536 20501
SGL_CARRYOUT #def 17524 19572
SGL_EXACT #def 17520 19561 19564 19565
SGL_EXPSHIFT #def 17517 19591 20464
SGL_M1LEFT #def 17518 17521 20493 20833
SGL_MASK #def 17525 19568 19590
SGL_MAX #def 17422 19537 19539 19576
SGL_MIN #def 17423 19545
SGL_ROUNDUP #def 17523 19564 19565 19566
SGL_RUNPACK #def 17521 19555
SGL_ZERO #def 17519 19532
SIGBIT_0 #def 44578 44618 44621 44633 44645 44671
SIGMASK #def 44581 44621 44659
SIGN #def 19221 19318 19230 19231 19333 19334
SIMPLE #def 36245 36489 36498 36542 36574 36595 36608
SIZE_T #def 14517 14516 14854 14855 14856 14857 14971 14972 14973
14974 14975 15183 15184 15185 15278 15552 15783 16173
SPSTART #def 36246 36343 36398 36405 36450 36487 36580
STAR #def 36186 36490 36970 36981 37165
STATIC #def 14523 14525 36260 14706 14826 14843 14925 15165 15166
15167 15168 15169 15170 15171 15172 15173 15174 15175
15176 15177 15178 15179 15180 15183 15184 15185 15186
15187 15188 15196 15209 15218 15229 15237 15258 15266
15283 15291 15350 15383 15395 15412 15421 15429 15447
15472 15501 15507 15513 15537 15548 15580 15589 15597
15603 15609 15622 15637 15643 15649 15655 15664 15680
15721 15756 15770 15789 15832 15847 15862 15888 15915
15953 15976 16007 16050 16137 16147 16153 16167 16185
16206 16230 16237 16255 16263 16281 16288 16304 16312
16326 16343 16349 16363 16384 16393 16439 16465 16499
36259 36262 36263 36264 36265 36266 36267 36268 36269
36270 36271 36738 36739 36740 36745 37079
S_ISDIR #def 14720 14719 16813 40627 42928 42934
TEEHEAD #def 10521 10590
TEELEFT #def 10519 10589
TEENORMAL #def 10522 10591
TEERIGHT #def 10520 10588
TIME_MAX #def 112 6508 6513
TP #def 2533 2535 2545 2546 2687 2689 2700
TRUE #def 18317 10916 12010 12065 12231 12243 12261 12267 13112
18347 32992 32994 40211 40214 40220 40226 40230
TTYback #def 15281 15288 15399 15402 15404 15405 15534
TZ_LEN #def 5839 5845 5846 5964 5965 5967 5968 5983 6158
6164
UCHARAT #def 36232 36234 37232 37234 36560 36561 36765 37255
UNCTL #def 15117 15247
UNKNOWN #def 18316
UNMETA #def 15120 15252 15963
UNSCHAR #def 34913 34915 34933 34935
UPARROW #def 10501 10606
UPLEFT #def 10511 10584
UPLINE #def 10514 10595
UPMIDLINE #def 10515
UPRIGHT #def 10510 10586
USE_EXP #def 22682 22704
USE_TABLE #def 5887 5890 6124 6299
VD2M1 #def 30749 30754
VERTLINE #def 10523 10593
WORDS_REVERSE #def 18116 18131
WORST #def 36247 36441 36487 36487 36535
Xchar #def 18110 18112 18120 18120
Xput2 #def 18121 18125 18122 18126 18134 18135
YEAR0 #def 105 3029 6219 6227 6456 6458 6459 6468 6482
8147
YEARSIZE #def 109 3025 3026
_BREAKCHAR #def 10007
_CONST #def 25334 25336 27052 27054 28610 28612 25345 25365 27063
27065 27067 28617 31706 31707 31710 31710 31806 31810
32712 34306 34504 34920 34925 35536 35537 35912 35916
35918 35929 35955 37306 38605 39205 39305 39406 39505
39805 40160 40161 40168 40169 40170 40191 40192 40193
42106 42306 42407 42507 42810 43011 43606 43805 44209
44406 44805 45006 45816 46205 46405 46508 46509 46806
_DCCHAR #def 10008 12436
_DLCHAR #def 10009 12441
_ENDLINE #def 10002 11366
_FULLWIN #def 10003 11368 13710
_GOCHAR #def 10010
_MINIX_SOURCE #def 38411
_NO_CHANGE #def 10006 11648 11652 11659 11662 11700 11706 11713 11716
12041 12054 12058 12060 12742 12743 12764 12876 13055
13216 13221 13225 13226 13318 13323 13328 13329 13424
14127
_PRINTCHAR #def 10011
_PROTOTYPE #def 17767 17769 11309 12203 12612 12613 12614 12615 12616
12808 17771 17772 17773 17774 17775 17776 17777 17778
17779 17780 17781 17782 17783 17784 17785 17786 17787
17788 17789 17790 17791 17792 17793 17794 17795 17796
17797 17798 17799 17800 17801 17802 17803 17804 17805
17806 17808 17809 17810 17811 31209 32117 32805 34107
34213 34214 34406 34619 34620 34621 34622 34724 34725
34809 34812 34821 34840 34910 35051 35052 35053 35055
35057 35314 35413 35414 36007 36262 36263 36264 36265
36266 36267 36268 36269 36270 36271 36738 36739 36740
36745 37404 37505 38218 40304 44205 44509 44912
_SCROLLWIN #def 10004 11371
_STOPCHAR #def 10012
_SUBWIN #def 10001 11441 13932
_SYSTEM #def 62002
__FPTYPES #def 17725 17724
__execve PUBL 40190 32665 40186 54901 54906
_alfun PRIV 44914 44912 44935
_execn PUBL 40286 40304 40306
_exit PUBL 32012 38500 38504 2014 2034 9414 9443 32065 35529
35558
_loadname PUBL 34503 38611 39209 39311 39509 39811 42824 43809 46209
46409
_lseed PRIV 34732 34737 34739 34747 34747 34747 34749 34749 34751
_syscall PUBL 37602 31122 31322 38510 38612 38710 39210 39312 39416
39510 39610 39812 40274 40320 40442 40508 40712 41013
41113 41208 41408 41508 41613 41708 41815 42012 42114
42214 42314 42518 42716 42828 43108 43209 43316 43414
43614 43810 43910 44008 44110 44221 44309 44418 44558
44810 45014 45111 45208 45909 46011 46110 46210 46410
46522 46609 46713 46814
_taskcall PUBL 63708 62115 62229 62308 62418 62517 62616 62712 62812
62911 63012 63114 63210 63312 63412 63513 63615
access #def 38601 38604 42603 16644 42629
alarm PUBL 31508 38701 38704 26005 26007 28451 28474 28486 28488
28497 28499 31587 31603 31612 31629 31631 44930 44938
44941 44946 44953 44955 44957
arraylimit #def 33218 33718 33915 33273 33320 33772 33962 34009 34016
34019
arraysize #def 33217 33717 33914 33218 33718 33915
base PRIV 38314 1009 1017 1021 6614 6620 6620 9113 9116
9118 9122 9124 9131 9150 9153 9156 9157 9158
9174 9175 9176 25368 25378 25381 25383 25387 25391
34809 34812 34816 34818 34824 34826 34835 34837 34843
34845 35725 35793 35816 35823 35837 35838 38315 38330
38337 46914 47247 47292 47293 47296 47299 47302 47637
47643 47645 47646 47647 47656 47661 47669 47672 47673
47674 47675 47684 47685 47773 47876 47890 47892 50810
50814 50815 50817
bcmp #def 23869 24267 24382 31705
bcopy #def 23870 27039 27339 24025 26129 26151 27155 27189 27212
27555 31805 34829
between #def 9127 9163 9166 9169
bitmapsize PUBL 32933
brk PUBL 31101 31116 8609 8614 31137
bytes #def 23414 22906 23433 23433 23433 23434 23434 23434 62203
62210 62219 62228
bzero #def 27038 27085 27705 31905
chdir #def 39201 39204 40805 16914 16953 40852 40933
chmod PUBL 39301 39304
chown PUBL 39401 39405
chroot PUBL 39501 39504
close #def 32008 33209 33610 33709 33905 39601 39604 39705 40001
42905 43003 46310 24420 25927 26089 26091 26133 26176
26190 26194 26229 26231 26252 26257 27800 27819 27839
27877 27927 27940 27965 28008 28177 28261 28285 28292
28316 28349 28357 28407 32047 32048 32054 32058 32067
32070 32078 33142 33145 33236 33667 33735 33933 34644
35090 35124 39722 40026 42940 43025 46332
closedir #def 39706 40806 14903 38345 38350 39713 40899 40926 40931
conv2 PUBL 32947 32971 32972 33021 33022 33032 33035 33036 33042
33063 33064 33065 33066 33077 33078 33079 33080
conv4 PUBL 32961 33023 33024 33037 33038 33067 33068 33069 33070
33074 33081 33082 33083 33084 33086
conv_inode PUBL 32981
creat PUBL 39801 39804 34640 35110
dup PUBL 39901 39906
dup2 PUBL 32009 40002 40007 32053 32057
endhostent #def 24227 24294 24369 24384
ether_addr #def 23413 22909 22913 22914 22923 22924 22932 22937 22939
22939 22941 22941 22961 22963 22976 22978 22978 22980
22982 22982 22984 22986 22986 22988 22988 22993 22994
23006 23008 23010 23012 23013 23225 23314 23317 23422
23442 23513 23615 23619
ether_cmp #def 23019 23017
execl PUBL 32010 40101 40116 40118 32061
execle PUBL 40102 40137 40139
execv PUBL 40103 40159 32620
execve PUBL 40104 40167 40130 40153 40163
fail #def 35312 32037 32038 32040 32049 32071 32079 32083 32086
35338 35356
fcntl #def 33207 33707 33906 39902 40003 40401 40406 40408 42906
24403 25829 26127 27661 33115 33215 33250 33250 33612
33715 33749 33749 33912 33945 33945 34605 35037 35308
35410 38309 39802 39903 39909 40004 40020 40027 40402
42802 42916 42935 42936 43006 43512 46314
fork PUBL 32007 40501 40504 25996 32045
fpathconf PUBL 40604 40611 43024
fstat #def 40603 40701 40704 42907 26316 38326 40626 42933
get2 #def 18129
get4 #def 18132 18138 19225 19226 19327 19328 19330 19331 19348
19349 19351 19352 20471 20473 20475 20477 20492
getcwd #def 40807 40859
getegid PUBL 41001 41004
geteuid PUBL 41101 41104 32223
getgid PUBL 41201 41204
getgroups PUBL 41308 41312
gethostbyaddr #def 24230 24101 24374
gethostbyname #def 24229 24045 24354 25900 26110
gethostent #def 24228 24303 24361 24381
getlong #def 26440 26720
getpgrp PUBL 41401 41404
getpid #def 41501 41504 42604 16115 26109 42615
getppid PUBL 41601 41604
getshort #def 23866 26439 23961 23963 23965 26713
getuid PUBL 41701 41704 33420
hostalias #def 27341 27475 27567
index #def 26838 25874 26387 26908 26923 26974 26988 34305
io_testflag #def 46907 48225 48525 48526 48528 48531 48535 48539 48541
48550 48573 49022 49023 49025 49028 49031 49044 49045
49136 49137 49141 49159 49168 49172 49183 49186 49208
50126 50129 50132 50138 50138 50322 50324 50326 51820
52313
ioctl #def 31509 41801 41805 45307 45407 45504 45601 45704 45807
10403 10545 15307 15334 16746 16759 16762 16778 16782
16790 16795 16798 16799 25826 25922 25935 25946 25988
26012 26072 27657 28345 28353 28403 31516 31624 41803
45309 45314 45409 45415 45506 45510 45602 45610 45706
45710 45810 45827
isatty PUBL 41901 41906
isdigit #def 35707 824 924 2579 2611 2620 3502 3503 5982
15936 15937 24056 24086 25386 35768 35772 35782 35786
38120 47672 47674 47675 47711 47721 47744 47824 47826
kill PUBL 42001 42004 16115
link PUBL 42101 42105
lockpath PRIV 34654 34619 34638 34651
longjerr PUBL 31201 31211 31209
lseek PUBL 31405 42201 42204 31426 33137 35427 35444
m1 #def 9 17742 2146 2147 2150 2151 2183 2187 2188
2204 2208 2229 2229 2230 2230 2233 2235 2235
2241 2242 2242 2249 2253 2255 2256 2258 2262
2279 2570 2582 2626 2629 2631 2676 2720 2727
2735 2749 2758 2758 2759 2760 2760 2766 2767
2809 2810 2826 2836 2838 18217 18220 18227 18227
18228 18228 18235 18237 18237 18242 18243 18243 18250
18837 18845 18938 19049 19052 19148 19151 19431 19439
19460 19462 19532 19540 19555 19561 19564 19565 19566
19751 19848 19944 19949 19953 19993 19993 19994 19994
20000 20001 20001 20014 20045 20046 20050 20051 20153
20162 20471 20477 20479 20482 20486 20488 20492 20493
20494 20497 20505 20507 20624 20724 21235 21236 21239
21240 21272 21276 21277 21288 21528 21533 21534 21538
21542 22017 22020 22030 22034 22034 22035 22035 22038
22040 22040 22047 22048 22048 22317
m2 #def 10 17743 2148 2149 2152 2153 2184 2186 2204
2208 2230 2230 2232 2232 2236 2236 2240 2240
2243 2243 2253 2256 2256 2279 2570 2626 2629
2721 2736 2756 2812 2826 2836 2838 18217 18220
18228 18228 18234 18234 18238 18238 18241 18241 18244
18244 18838 19431 19440 19461 19468 19471 19472 19473
19541 19560 19944 19949 19953 19994 19994 19999 19999
20002 20002 20043 20047 20048 20052 20053 20153 20162
20483 20489 20498 20502 20624 20724 21237 21238 21241
21242 21273 21275 21288 21528 21534 21535 22017 22020
22035 22035 22037 22037 22041 22041 22046 22046 22049
22049 22318
max #def 10015 13060 35725 35775 35779 35783 35785 35785 35860
min #def 10016 11638 11639 11689 11690 13059 36975 36981 36984
mkdir PUBL 42301 42305
mkfifo PUBL 42401 42406
mknod PUBL 42402 42501 42506 42410
mktemp PUBL 42605 42608
mount PUBL 42701 42705
new_icopy PUBL 33050 32994 32995
next PRIV 34403 4770 4787 4787 4788 4792 4794 4796 4798
4819 4829 4830 4835 4837 4843 4851 4852 4854
4870 4876 4876 4876 4876 4876 4877 4879 4884
4885 4886 4887 4888 6908 6912 6912 6913 6918
26678 26682 26688 26699 34414 34416 34420 34426 34433
36475 36502 36503 36505 36511 36512 36513 36851 36861
36916 36942 36955 36956 36980 36980 36987 37004 37089
37095 37096 37099
nil #def 23703 31403 31507 32005 33205 33705 33903 35703 37803
39703 40804 42903 43503 43703 23717 31418 31428 31600
31601 31628 32061 33247 33289 33292 33305 33309 33311
33312 33313 33314 33319 33323 33335 33346 33746 33788
33802 33806 33808 33809 33810 33811 33812 33813 33814
33815 33816 33828 33839 33984 33989 33995 34008 34009
34015 34015 34016 34019 34020 34028 34032 34034 34049
37812 39718 40867 40867 40872 40876 40882 40882 40893
40902 40929 40933 40938 42927 42928 42930 42937 42942
43524 43524 43530
old_icopy PUBL 33003 32992 32993
open #def 33206 33603 33706 33904 42801 42807 42809 42908 43004
46308 24417 25909 25977 28336 28396 33130 33249 33633
33748 33944 35069 35425 35442 42930 43023 46326
opendir #def 40808 42909 14859 38330 40882 42919
path PRIV 38315 9415 14926 14927 14935 14938 14944 14946 16640
16641 16644 16806 16807 16812 34635 34638 34640 34657
34659 34660 38337 38338 38339 38340 38346 40167 40168
40186 40190 40191 40270 40272 40820 40830 40832 40859
40867 40869 40925 40940 40940 40941 43010 43011 43023
49340 49341 49925 49926 51407
pathconf PUBL 43005 43010
pause PUBL 43101 43104 44954
pipe PUBL 32006 43201 43204 32040
ptrace PUBL 43301 43304
ptrint #def 4717 4719 4757 4781
put2 #def 18122 18126
put4 #def 18133 18139 19514 19515 19518 19519 19599
putlong #def 26442 27042 26741 27132 27150 27184 27207
putshort #def 26441 27041 26731 27112 27114 27128 27130 27134 27146
27148 27152 27180 27182 27186 27203 27205 27209
qbuf PRIV 34404 24108 24112 24117 34416 34420 34426 34433 34434
read #def 31510 32011 33208 33609 33708 33907 43401 43404 43505
46309 15197 15278 24419 26054 26061 26213 26218 27829
27867 27891 27951 27994 28022 28476 31616 32064 32077
33138 33268 33658 33767 33957 35076 35428 43529 46330
readdir #def 31406 40809 43506 14867 31428 38334 40893 43519
reboot #def 31306 31310
reg PRIV 36367 36262 36305 36320 36578
regatom PRIV 36529 36265 36478
regbol PRIV 36732 36784 36786 36865
regbranch PRIV 36433 36263 36391 36401
regc PRIV 36648 36268 36304 36319 36553 36558 36565 36569 36571
36593 36594 36611 36614
regcode PRIV 36254 36303 36318 36631 36640 36651 36652 36670 36674
36675 36676
regdummy PRIV 36253 36303 36632 36651 36670 36696 36722 37066
regendp PRIV 36734 36821 36946 36946
reginput PRIV 36731 36819 36831 36865 36868 36871 36872 36880 36882
36884 36888 36888 36890 36893 36893 36895 36914 36940
36959 36962 36982 36986 36990 37023 37053
reginsert PRIV 36662 36269 36490 36493 36499 36509
regmatch PRIV 36847 36739 36829 36916 36942 36960 36987
regnext PRIV 37061 36267 36328 36346 36413 36701 36861 36963 37095
regnode PRIV 36625 36266 36384 36409 36443 36456 36494 36496 36497
36502 36504 36505 36506 36510 36511 36538 36539 36541
36549 36552 36592 36609
regnpar PRIV 36252 36301 36317 36381 36382 36383
regoptail PRIV 36717 36271 36413 36494 36495 36513
regparse PRIV 36251 36300 36316 36399 36400 36416 36418 36419 36445
36445 36445 36481 36515 36516 36537 36548 36550 36553
36553 36553 36554 36554 36555 36556 36557 36557 36560
36561 36566 36569 36572 36573 36591 36593 36601 36602
36604 36611
regpiece PRIV 36470 36264 36446
regprop PRIV 37122 36745 36855 36859 37079 37094
regrepeat PRIV 37016 36740 36983
regsize PRIV 36255 36302 36308 36312 36633 36654 36671
regstartp PRIV 36733 36820 36920 36921
regtail PRIV 36688 36270 36394 36403 36410 36452 36496 36497 36503
36504 36505 36506 36510 36512 36723
regtry PRIV 36811 36738 36789 36795 36801
rename PUBL 43601 43605
ret_val #def 35567 35569 35591 35595
rewinddir #def 40810 43705 40896 43710
rmdir PUBL 43801 43804
rounded #def 35910 35962 35970
sbrk #def 31102 31128 40105 40240 40277
seekdir #def 31407 43706 31413 43712
set_pointer #def 47232 47234 47237 47612 47614 47617 47413 47863
setgid PUBL 43901 43904
sethostent #def 24226 24283 24360 24380
setsid PUBL 44001 44004
setuid PUBL 44101 44104
sigaction PUBL 7203 31511 33604 44201 44207 7211 7232 31594 31607
31630 31630 33627 33637 33642 33670 44209 44210 44925
44936 44943 44943
sigaddset PUBL 44570 44585 44610 44625
sigdelset PUBL 44571 44597 44611 44637
sigemptyset PUBL 7204 33605 44572 44609 7217 33639 44612 44649 44939
sigfillset PUBL 31512 44501 44573 44616 31605 44552 44613 44656
sigismember PUBL 44574 44623 44614 44663
sigisvalid #def 44583 44623 44629 44641 44667
sigjmp PUBL 44502 44513 44509
siglongjmp PUBL 44704
signal PUBL 7207 209 6809 7112 7205 9410 15105 25834 25852
26006 27662 28450 28473 28487 28498 31522 33614 35508
35581 35582 35584 35585 35592 35593 42002 44203 44302
44402 44507 44615 44802 44909
sigpending PUBL 44301 44304
sigprocmask #def 44401 44404 44503 44553
sigreturn PUBL 44504 44539 44535
sigsuspend PUBL 44801 44804 44940
sleep PUBL 44908 44920 25949 26016 26040 26139 34642
stat PUBL 40811 42910 45001 45005 14709 16810 16812 25825 25854
26301 27658 38307 38322 38323 38340 39302 40605 40621
40702 40706 40813 40861 40872 40876 40918 42302 42403
42912 42924 42927 43508 45002 45007 46102
stime PUBL 45101 45105
sync PUBL 45201 45204
sys_abort PUBL 62104
sys_copy PUBL 62202
sys_endsig PUBL 62302
sys_exec PUBL 62402
sys_fork PUBL 62502
sys_fresh PUBL 62602
sys_getmap PUBL 62702
sys_getsp PUBL 62802
sys_kill PUBL 62902
sys_newmap PUBL 63002
sys_oldsig PUBL 63102
sys_sendsig PUBL 63202
sys_sigreturn PUBL 63302
sys_times PUBL 63402
sys_trace PUBL 63502
sys_xit PUBL 63602
sysconf PUBL 37713
tcdrain #def 45306 45311
tcflow #def 45406 45411
tcflush #def 45503 45508
tcgetattr #def 33606 41902 45600 10616 10617 16717 33646 41911 45606
tcsendbreak #def 45703 45708
tcsetattr #def 33607 45806 12226 16728 16731 33652 33665 45813
time PUBL 31513 45901 45904 406 1505 1605 1705 3005 3014
3018 3019 4605 5806 5827 6088 6095 6104 6193
6195 6196 6197 6408 8005 9707 27643 31521 31601
37711 41310 45103 45902 46003
times PUBL 46001 46005 46002
trap #def 17621 18841 18935 19437 19538 19948 20151 20160 21284
21293
ttyname PUBL 38317 38435
uget2 #def 18120 18124 18129 18132 18132 20448 20450 20454 20456
umask PUBL 46101 46104
umount PUBL 46201 46204
uname #def 46307 46320
unlink PUBL 46401 46404 34651
utime PUBL 46503 46507 46505
v7ent #def 43517 43545 43547
wait PUBL 46601 46604 28123 28166 28214 28249 32019 35512 35515
46602 46702
waitpid PUBL 32014 46701 46704 32069
write PUBL 31202 31514 32013 33608 46801 46804 4903 15198 15213
25969 26043 26051 26052 26053 26063 26163 26174 26210
26211 26212 26219 28376 28438 31215 31620 32043 33655
35117 35445 37412

29726
Minix/CD-ROM-2.0/LISTING/LIB.T Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,108 @@
Index to MINIX SOURCE CODE
Page Line File
1 00000 src/lib/i386/em/byte_order.h
1 00100 src/lib/i386/em/em_adf4.s
1 00200 src/lib/i386/em/em_adf8.s
2 00300 src/lib/i386/em/em_adi.s
2 00400 src/lib/i386/em/em_and.s
3 00500 src/lib/i386/em/em_blm.s
3 00600 src/lib/i386/em/em_cff4.s
4 00700 src/lib/i386/em/em_cff8.s
4 00800 src/lib/i386/em/em_cfi.s
5 00900 src/lib/i386/em/em_cfu.s
5 01000 src/lib/i386/em/em_cif4.s
6 01100 src/lib/i386/em/em_cif8.s
6 01200 src/lib/i386/em/em_cii.s
7 01300 src/lib/i386/em/em_cmf4.s
7 01400 src/lib/i386/em/em_cmf8.s
8 01500 src/lib/i386/em/em_cms.s
8 01600 src/lib/i386/em/em_com.s
9 01700 src/lib/i386/em/em_csa4.s
9 01800 src/lib/i386/em/em_csb4.s
10 01900 src/lib/i386/em/em_cuf4.s
10 02000 src/lib/i386/em/em_cuf8.s
11 02100 src/lib/i386/em/em_cuu.s
11 02200 src/lib/i386/em/em_dup.s
12 02300 src/lib/i386/em/em_dvf4.s
12 02400 src/lib/i386/em/em_dvf8.s
12 02500 src/lib/i386/em/em_dvi.s
13 02600 src/lib/i386/em/em_dvu.s
13 02700 src/lib/i386/em/em_error.s
14 02800 src/lib/i386/em/em_exg.s
15 02900 src/lib/i386/em/em_fat.s
15 03000 src/lib/i386/em/em_fef4.s
16 03100 src/lib/i386/em/em_fef8.s
17 03200 src/lib/i386/em/em_fif4.s
18 03300 src/lib/i386/em/em_fif8.s
19 03400 src/lib/i386/em/em_fp8087.s
19 03500 src/lib/i386/em/em_gto.s
19 03600 src/lib/i386/em/em_iaar.s
20 03700 src/lib/i386/em/em_ilar.s
20 03800 src/lib/i386/em/em_inn.s
21 03900 src/lib/i386/em/em_ior.s
21 04000 src/lib/i386/em/em_isar.s
22 04100 src/lib/i386/em/em_lar4.s
22 04200 src/lib/i386/em/em_loi.s
23 04300 src/lib/i386/em/em_mlf4.s
24 04400 src/lib/i386/em/em_mlf8.s
24 04500 src/lib/i386/em/em_mli.s
25 04600 src/lib/i386/em/em_mon.s
25 04700 src/lib/i386/em/em_ngf4.s
25 04800 src/lib/i386/em/em_ngf8.s
26 04900 src/lib/i386/em/em_ngi.s
26 05000 src/lib/i386/em/em_nop.s
26 05100 src/lib/i386/em/em_print.s
27 05200 src/lib/i386/em/em_rck.s
28 05300 src/lib/i386/em/em_rmi.s
28 05400 src/lib/i386/em/em_rmu.s
29 05500 src/lib/i386/em/em_rol.s
29 05600 src/lib/i386/em/em_ror.s
30 05700 src/lib/i386/em/em_sar4.s
31 05800 src/lib/i386/em/em_sbf4.s
31 05900 src/lib/i386/em/em_sbf8.s
31 06000 src/lib/i386/em/em_sbi.s
32 06100 src/lib/i386/em/em_set.s
33 06200 src/lib/i386/em/em_sli.s
33 06300 src/lib/i386/em/em_sri.s
34 06400 src/lib/i386/em/em_sti.s
35 06500 src/lib/i386/em/em_stop.s
35 06600 src/lib/i386/em/em_strhp.s
36 06700 src/lib/i386/em/em_trp.s
36 06800 src/lib/i386/em/em_unknown.s
36 06900 src/lib/i386/em/em_xor.s
37 07000 src/lib/i386/head/em_abs.h
38 07100 src/lib/i386/head/em_head.s
38 07200 src/lib/i386/misc/alloca.s
39 07300 src/lib/i386/misc/getprocessor.s
40 07400 src/lib/i386/misc/iolib.s
42 07600 src/lib/i386/rts/__sigreturn.s
42 07700 src/lib/i386/rts/_sendrec.s
43 07800 src/lib/i386/rts/brksize.s
44 07900 src/lib/i386/rts/crtso.s
45 08000 src/lib/i386/rts/setjmp.e
47 08200 src/lib/i386/string/_memmove.s
48 08300 src/lib/i386/string/_strncat.s
49 08400 src/lib/i386/string/_strncmp.s
50 08500 src/lib/i386/string/_strncpy.s
50 08600 src/lib/i386/string/_strnlen.s
51 08700 src/lib/i386/string/bcmp.s
51 08800 src/lib/i386/string/bcopy.s
52 08900 src/lib/i386/string/bzero.s
52 09000 src/lib/i386/string/index.s
53 09100 src/lib/i386/string/memchr.s
53 09200 src/lib/i386/string/memcmp.s
54 09300 src/lib/i386/string/memcpy.s
55 09400 src/lib/i386/string/memmove.s
55 09500 src/lib/i386/string/memset.s
56 09600 src/lib/i386/string/rindex.s
56 09700 src/lib/i386/string/strcat.s
57 09800 src/lib/i386/string/strchr.s
58 09900 src/lib/i386/string/strcmp.s
58 10000 src/lib/i386/string/strcpy.s
59 10100 src/lib/i386/string/strlen.s
59 10200 src/lib/i386/string/strncat.s
59 10300 src/lib/i386/string/strncmp.s
60 10400 src/lib/i386/string/strncpy.s
60 10500 src/lib/i386/string/strnlen.s
61 10600 src/lib/i386/string/strrchr.s

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,87 @@
Index to MINIX SOURCE CODE
Page Line File
1 00000 src/lib/i86/em/adi.s
1 00100 src/lib/i86/em/and.s
2 00200 src/lib/i86/em/blm.s
2 00300 src/lib/i86/em/cii.s
3 00400 src/lib/i86/em/cmi4.s
3 00500 src/lib/i86/em/cms.s
4 00600 src/lib/i86/em/cmu4.s
5 00700 src/lib/i86/em/com.s
5 00800 src/lib/i86/em/csa2.s
6 00900 src/lib/i86/em/csa4.s
6 01000 src/lib/i86/em/csb2.s
7 01100 src/lib/i86/em/csb4.s
8 01200 src/lib/i86/em/cuu.s
8 01300 src/lib/i86/em/dup.s
9 01400 src/lib/i86/em/dvi4.s
11 01500 src/lib/i86/em/dvu4.s
12 01600 src/lib/i86/em/error.s
13 01700 src/lib/i86/em/exg.s
13 01800 src/lib/i86/em/fat.s
13 01900 src/lib/i86/em/fp8087.s
24 02600 src/lib/i86/em/gto.s
24 02700 src/lib/i86/em/iaar.s
25 02800 src/lib/i86/em/ilar.s
25 02900 src/lib/i86/em/inn.s
26 03000 src/lib/i86/em/ior.s
26 03100 src/lib/i86/em/isar.s
26 03200 src/lib/i86/em/lar2.s
27 03300 src/lib/i86/em/lfr6.s
28 03400 src/lib/i86/em/lfr8.s
28 03500 src/lib/i86/em/loi.s
29 03600 src/lib/i86/em/mli4.s
29 03700 src/lib/i86/em/mon.s
30 03800 src/lib/i86/em/nop.s
30 03900 src/lib/i86/em/rck.s
30 04000 src/lib/i86/em/ret6.s
31 04100 src/lib/i86/em/ret8.s
31 04200 src/lib/i86/em/retarea.s
31 04300 src/lib/i86/em/return.s
32 04400 src/lib/i86/em/rmi4.s
33 04500 src/lib/i86/em/rmu4.s
34 04600 src/lib/i86/em/sar2.s
35 04700 src/lib/i86/em/sbi.s
36 04800 src/lib/i86/em/set.s
37 04900 src/lib/i86/em/stb.c
37 05000 src/lib/i86/em/sti.s
38 05100 src/lib/i86/em/stop.s
38 05200 src/lib/i86/em/strhp.s
38 05300 src/lib/i86/em/trp.s
41 05500 src/lib/i86/em/unknown.s
41 05600 src/lib/i86/em/vars.s
41 05700 src/lib/i86/em/xor.s
42 05800 src/lib/i86/misc/alloca.s
42 05900 src/lib/i86/misc/getprocessor.s
44 06000 src/lib/i86/misc/iolib.s
46 06200 src/lib/i86/rts/__sigreturn.s
47 06300 src/lib/i86/rts/_sendrec.s
47 06400 src/lib/i86/rts/brksize.s
48 06500 src/lib/i86/rts/ncrtso.s
49 06600 src/lib/i86/rts/setjmp.s
51 06800 src/lib/i86/string/_memmove.s
52 06900 src/lib/i86/string/_strncat.s
52 07000 src/lib/i86/string/_strncmp.s
53 07100 src/lib/i86/string/_strncpy.s
54 07200 src/lib/i86/string/_strnlen.s
54 07300 src/lib/i86/string/bcmp.s
55 07400 src/lib/i86/string/bcopy.s
55 07500 src/lib/i86/string/bzero.s
56 07600 src/lib/i86/string/index.s
56 07700 src/lib/i86/string/memchr.s
57 07800 src/lib/i86/string/memcmp.s
58 07900 src/lib/i86/string/memcpy.s
58 08000 src/lib/i86/string/memmove.s
59 08100 src/lib/i86/string/memset.s
59 08200 src/lib/i86/string/rindex.s
60 08300 src/lib/i86/string/strcat.s
60 08400 src/lib/i86/string/strchr.s
61 08500 src/lib/i86/string/strcmp.s
61 08600 src/lib/i86/string/strcpy.s
62 08700 src/lib/i86/string/strlen.s
62 08800 src/lib/i86/string/strncat.s
62 08900 src/lib/i86/string/strncmp.s
63 09000 src/lib/i86/string/strncpy.s
63 09100 src/lib/i86/string/strnlen.s
64 09200 src/lib/i86/string/strrchr.s

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,54 @@
This directory contains the full source code listing of MINIX in two variants:
the full code and the book version. The difference is that the code in the
book is an abridged version. To keep the length of the book (somewhat)
manageable, some of the less important parts of MINIX are not listed in the
book and not discussed there. The BOOK.* files here refer to the listing
as given in the book. The COMPLETE.* files here refer to the complete listing,
with everything. The LIB files are the various libraries. The files are
XXX.TXT - Flat ASCII text
XXX.PS - Postscript file
XXX.T - troff source for making XXX.PS
XXX.IDX - An index to XXX file names
XXX.REF - A cross-reference listing of all procedures, macros, etc.
where XXX is one of BOOK, COMPLETE, LIB, LIB386, or LIB86.
The listing in the book is printed in LucidaSans Typewriter, and the XXX.PS
files use this font too. If you have this font definition, please prepend it
to LISTING.PS before sending it to a PostScript printer. We cannot supply this
font because it is copyright by Bigelow and Holmes.
If you do not have the LucidaSans font available locally, change the
.fp 5 CW LucidaT
line in LISTING.T to a locally available monospace font (e.g. letter gothic)
and run troff again.
Alternatively, just print LISTING.PS, but it will print in Courier instead
of Lucida.
If you are unable to print the entire PostScript file in one blow (e.g.
because your paper tray is too small), you should copy it to the hard disk
and edit it. PostScript files are just ASCII and can be edited with any
editor. When editing XXX.PS, leave all the material up to and included the
line:
%%EndProlog
After that you will find the code for the various pages, in sequence. Each
one starts with a line like this:
%%Page: 1 1
and ends with a line like this:
EP
Just remove those pages you do not want to print on the next run, for
example, pages above 100. Next time edit the orginal file and remove all
pages except 101 to 200, etc.

Binary file not shown.

View File

@@ -0,0 +1,410 @@
Minix installation demo. Author: Kees J. Bot
+-------------------------------------------------------+
| This is a log of a Minix installation on my notebook |
| in the form of a number of screen images with bits of |
| explanatory text in these boxes. The floppy images |
| have already been made and the system is booted with |
| a diskette that contains both ROOT and USR combined. |
| That is why I typed 'fd0c' after starting Minix: |
+-------------------------------------------------------+
Minix 2.0.0 Copyright 1997 Prentice-Hall, Inc.
Executing in 32-bit protected mode
Memory size = 8010K MINIX = 295K RAM disk = 480K Available = 7236K
RAM disk loaded.
Tue Oct 1 16:21:37 MET 1996
Finish the name of device to mount as /usr: /dev/fd0c
/dev/fd0c is read-write mounted on /usr
Starting standard daemons: update.
Login as root and run 'setup' to install Minix.
Minix Release 2.0 Version 0
noname login:
+-------------------------------------------------------+
| As suggested I log in as root and enter 'setup' to |
| start the installation script. |
+-------------------------------------------------------+
noname login: root
# setup
This is the Minix installation script.
Note 1: If the screen blanks suddenly then hit F3 to select "software
scrolling".
Note 2: If things go wrong then hit DEL and start over.
Note 3: The installation procedure is described in the manual page
usage(8). It will be hard without it.
Note 4: Some questions have default answers, like this: [y]
Simply hit RETURN (or ENTER) if you want to choose that answer.
Note 5: If you see a colon (:) then you should hit RETURN to continue.
:
+-------------------------------------------------------+
| I hit the ENTER key and am asked about my keyboard |
+-------------------------------------------------------+
What type of keyboard do you have? You can choose one of:
french italian latin-am scandinavn uk us-swap
german japanese olivetti spanish us-std
Keyboard type? [us-std]
+-------------------------------------------------------+
| I'm blessed with a standard U.S. keyboard so I type |
| ENTER again. Now it gets serious: |
+-------------------------------------------------------+
Minix needs one primary partition of at least 30 Mb (it fits in 20 Mb, but
it needs 30 Mb if fully recompiled. Add more space to taste.)
If there is no free space on your disk then you have to back up one of the
other partitions, shrink, and reinstall. See the appropriate manuals of the
the operating systems currently installed. Restart your Minix installation
after you have made space.
To make this partition you will be put in the editor "part". Follow the
advice under the '!' key to make a new partition of type MINIX. Do not
touch an existing partition unless you know precisely what you are doing!
Please note the name of the partition (hd1, hd2, ..., hd9, sd1, sd2, ...
sd9) you make. (See the devices section in usage(8) on Minix device names.)
:
+-------------------------------------------------------+
| ENTER brings up the 'part' partition editor. The |
| question marks indicate that no partition table is |
| loaded yet. I must first choose a disk. |
+-------------------------------------------------------+
Select device ----first---- --geom/last-- ------sectors-----
Device Cyl Head Sec Cyl Head Sec Base Size Kb
/dev/hd0 ? ? ?
? ? ? ? ? ? ? ? ?
Num Sort Type
? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ?
Type '+' or '-' to change, 'r' to read, '?' for more help, '!' for advice
+-------------------------------------------------------+
| This notebook has only one disk, so I type 'r': |
+-------------------------------------------------------+
Select device ----first---- --geom/last-- ------sectors-----
Device Cyl Head Sec Cyl Head Sec Base Size Kb
/dev/hd0 485 16 63
0 0 0 488 15 62 0 492912 246456
Num Sort Type
1 hd1 12 0 1 0 4 15 62 63 4977 2488
2* hd2 81 MINIX 5 0 0 426 14 52 5040 425303 212651
3 hd3 00 None 0 0 0 0 0 -1 0 0 0
4 hd4 00 None 0 0 0 0 0 -1 0 0 0
at-hd0: Conner Peripherals 240MB - CP2251
+-------------------------------------------------------+
| There are two partitions already present on the disk, |
| one that contains setup stuff for the notebook and a |
| 208 megabyte partition that already contains Minix. |
| The AT disk driver has tickled the IDE disk to make |
| it tell its type and make. It is a message from deep |
| in the kernel, not from part. |
| For this install I want a new partition, so I move |
| over to the Size field of the first unused slot, line |
| 3 with type "None". I could type a number now, but |
| I want to use the rest of the disk, so I hit 'm' |
| there once or twice to let part propose something. |
+-------------------------------------------------------+
Size in sectors ----first---- --geom/last-- ------sectors-----
Device Cyl Head Sec Cyl Head Sec Base Size Kb
/dev/hd0 485 16 63
0 0 0 488 15 62 0 492912 246456
Num Sort Type
1 hd1 12 0 1 0 4 15 62 63 4977 2488
2* hd2 81 MINIX 5 0 0 426 14 52 5040 425303 212651
3 hd3 81 MINIX 426 14 53 488 15 62 430343 62569 31284
4 hd4 00 None 0 0 0 0 0 -1 0 0 0
+-------------------------------------------------------+
| Note that the end of partition 2 and the start of |
| partition 3 are not on a cylinder boundary. Minix |
| doesn't care about that, but Linux fdisk would throw |
| a fit if it would see this. In this case I'm happy, |
| so I type 'q' to quit, and 'y' to save the table: |
+-------------------------------------------------------+
Size in sectors ----first---- --geom/last-- ------sectors-----
Device Cyl Head Sec Cyl Head Sec Base Size Kb
/dev/hd0 485 16 63
0 0 0 488 15 62 0 492912 246456
Num Sort Type
1 hd1 12 0 1 0 4 15 62 63 4977 2488
2* hd2 81 MINIX 5 0 0 426 14 52 5040 425303 212651
3 hd3 81 MINIX 426 14 53 488 15 62 430343 62569 31284
4 hd4 00 None 0 0 0 0 0 -1 0 0 0
Save partition table? (y/n) y
Please finish the name of the primary partition you have created:
(Just type RETURN if you want to rerun "part") /dev/hd3
You have created a partition named: /dev/hd3
The following subpartitions are about to be created on /dev/hd3:
Root subpartition: /dev/hd3a 1440 kb
/usr subpartition: /dev/hd3c rest of hd3
Hit return if everything looks fine, or hit DEL to bail out if you want to
think it over. The next step will destroy /dev/hd3.
:
+-------------------------------------------------------+
| Let's destroy some zeros and ones, I hit ENTER: |
+-------------------------------------------------------+
Migrating from floppy to disk...
Scanning /dev/hd3c for bad blocks. (Hit DEL to stop the scan if are absolutely
sure that there can not be any bad blocks. Otherwise just wait.)
cp /fd0/etc/hostname.file /mnt/etc/hostname.file
cp /fd0/etc/motd /mnt/etc/motd
+-------------------------------------------------------+
| Lots of files are put on the disk. It is a combined |
| ROOT+USR diskette, so both parts are installed with- |
| out pause. When done I am greeted with the following |
| message, showing that Minix has a short memory, |
| because at boot it said: Memory size = 8010K. I |
| could type 8010, but ENTER will do.
+-------------------------------------------------------+
mkdir /mnt/root
mkdir /mnt/tmp
cp /fd0/.ellepro.b1 /mnt/.ellepro.b1
/dev/fd0 unmounted from /fd0
/dev/hd3a unmounted from /mnt
What is the memory size of this system in kilobytes? [4096 or more]
Second level file system block cache set to 1024 kb.
+-------------------------------------------------------+
| Setup is now done with the migration to disk, so it |
| wants me to type 'halt' and 'boot hd3'. It says |
| "please", so I comply: |
+-------------------------------------------------------+
Please insert the installation ROOT floppy and type 'halt' to exit Minix.
You can type 'boot hd3' to try the newly installed Minix system. See
"TESTING" in the usage manual.
# halt
System Halted
fd0>boot hd3
Minix 2.0.0 Copyright 1997 Prentice-Hall, Inc.
Executing in 32-bit protected mode
at-hd0: Conner Peripherals 240MB - CP2251
Memory size = 8010K MINIX = 295K RAM disk = 1024K Available = 6692K
Tue Oct 1 16:39:24 MET 1996
/dev/hd3c is read-write mounted on /usr
Starting standard daemons: update.
Login as root and run 'setup /usr' to install floppy sets.
Minix Release 2.0 Version 0
noname login:
+-------------------------------------------------------+
| Type 'root' and 'setup /usr'. ENTER, ENTER, input |
| floppy 1 of the USR.TAZ set, and ENTER. |
+-------------------------------------------------------+
noname login: root
# setup /usr
What is the size of the images on the diskettes? [all]
What floppy drive to use? [0]
Please insert input volume 1 and hit return
created directory: local/lib
created directory: local/man
created directory: local/src
created directory: man
Can't make directory mdec: File exists
+-------------------------------------------------------+
| Usage(8) warns about this "File exists" message, and |
| that it doesn't matter. Otherwise this would go |
| wrong: |
+-------------------------------------------------------+
mdec/boot, 050 tape blocks
mdec/bootblock, 01 tape blocks
mdec/extboot, 01 tape blocks
+-------------------------------------------------------+
| Lots of files installed, I add floppy 2 and 3 of |
| USR.TAZ when it asks for them. When done I type |
| "setup /usr" again for SYS.TAZ, and once more for |
| CMD.TAZ. Five floppies later and I'm done. |
+-------------------------------------------------------+
src/commands/talkd/talk.h, 03 tape blocks
src/commands/talkd/talkd.c, 03 tape blocks
src/commands/talkd/talkd.h, 01 tape blocks
/tmp/LAST, 0 tape blocks
Done.
+-------------------------------------------------------+
| As an example I give the system the name "finiah", |
| but seeing one of Michael Temari's network programs |
| extracted inspires me to make a network kernel. Log |
| in as 'bin' and bring <minix/config.h> into the one |
| true editor of the aging computer geek: |
+-------------------------------------------------------+
# echo finiah >/etc/hostname.file
# ^D
Minix Release 2.0 Version 0
finiah login: bin
! vi /usr/include/minix/config.h
+-------------------------------------------------------+
| I change the following parameters for more processes, |
| a bigger cache, no 2nd level cache, networking, only |
| the AT/IDE disk driver and 4 pseudo ttys for remote |
| login: |
+-------------------------------------------------------+
#define NR_PROCS 40
#if (MACHINE == IBM_PC && _WORD_SIZE == 4)
#define NR_BUFS 1024 /* # blocks in the buffer cache */
#define NR_BUF_HASH 2048 /* size of buf hash table; MUST BE POWER OF 2*/
#endif
#define ENABLE_CACHE2 0
#define ENABLE_NETWORKING 1 /* enable TCP/IP code */
#define ENABLE_AT_WINI 1 /* enable AT winchester driver */
#define ENABLE_BIOS_WINI 0 /* enable BIOS winchester driver */
#define ENABLE_ESDI_WINI 0 /* enable ESDI winchester driver */
#define ENABLE_XT_WINI 0 /* enable XT winchester driver */
#define ENABLE_ADAPTEC_SCSI 0 /* enable ADAPTEC SCSI driver */
#define NR_PTYS 4 /* # pseudo terminals (0 to 64) */
+-------------------------------------------------------+
| The main kernel Makefile is in /usr/src/tools. The |
| command 'make hdboot' compiles a new image and puts |
| it in /minix/, next to the distribution kernel: |
+-------------------------------------------------------+
! cd tools/
! make hdboot
+-------------------------------------------------------+
generic/tcp_send.o generic/udp.o
exec cc -c -m -I. -I.. -I/usr/include putk.c
exec cc -o inet -i inet.a putk.o
install -S 10k inet
exec cc -O -D_MINIX -D_POSIX_SOURCE init.c -o init
install -S 192w init
installboot -image image ../kernel/kernel ../mm/mm ../fs/fs ../inet/inet init
text data bss size
54432 9000 38624 102056 ../kernel/kernel
12544 1176 32072 45792 ../mm/mm
28816 2196 1101676 1132688 ../fs/fs
66480 7420 94400 168300 ../inet/inet
6828 2032 1356 10216 init
------ ------ ------ -------
169100 21824 1268128 1459052 total
exec sh mkboot hdboot
cp image /dev/hd3a:/minix/2.0.0r0
Done.
+-------------------------------------------------------+
| Shut the system down to return to the boot monitor. |
| The 2nd level cache is no longer needed, so I set the |
| RAM disk size to zero. The NE2000 card of the note- |
| book is at I/O address 300, IRQ 5. Save and boot. |
+-------------------------------------------------------+
! shutdown
Broadcast message from bin@finiah (console)
Tue Oct 1 18:08:49 1996...
The system will shutdown NOW
System Halted
hd3a>unset ramsize
hd3a>DPETH0=300:5
hd3a>save
hd3a>boot
+-------------------------------------------------------+
| The new boot messages show that things have changed. |
| The ethernet driver has found an NE2000, the larger |
| block cache has made the kernel (MINIX) larger, and |
| the RAM disk is done away with. One of my other PC's |
| has seen fit to answer the RARP request (here is my |
| ethernet address, what is my IP address?) of my |
| notebook, but the notebook doesn't yet know how to |
| translate 127.36.93.27 to its own name yet. |
+-------------------------------------------------------+
Minix 2.0.0 Copyright 1997 Prentice-Hall, Inc.
Executing in 32-bit protected mode
ne2000: NE2000 at 300:5
at-hd0: Conner Peripherals 240MB - CP2251
Memory size = 8010K MINIX =1441K RAM disk = 0K Available = 6569K
Tue Oct 1 18:12:41 MET 1996
/dev/hd3c is read-write mounted on /usr
Starting standard daemons: update.
Starting network daemons: rarpd nonamed irdpd talkd.
Starting network services: shell login telnet ftp.
Minix Release 2.0 Version 0
127.36.93.27 login: root
#
+-------------------------------------------------------+
| Let's be lazy and make this machine get its naming |
| information from its neighbour. To make it stand on |
| its own I would have to create an /etc/ethers and an |
| /etc/hosts. Reboot and all is well. |
+-------------------------------------------------------+
# echo nameserver 127.36.93.25 >/etc/resolv.conf
# shutdown -r

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,920 @@
.TH USAGE 8
.SH NAME
usage \- installing and using MINIX
.SH DESCRIPTION
.de SP
.if t .sp 0.4
.if n .sp
..
.de XB \" An example in bold print.
.RS
.nf
.ft B
\&\\$1
.ft R
.fi
.RE
..
This manual page describes the installation and use of MINIX from a
System Administrators point of view. It contains an installation guide,
instructions on how to do the initial configuration and some other info.
Please read this document entirely before attempting to install MINIX.
The installation steps are in the proper order, but not all the
information you may need is presented at the right moment.
Other detailed information that may be useful can be found in
.BR boot (8)
and
.BR hier (7).
.SS "1. REQUIREMENTS"
The minimum system MINIX can be installed on comfortably is an IBM PC/AT
or PS/2 with a 286 processor, 640 KB memory, a 720 kb diskette drive, and
25-30 MB free space on an AT,
.ig
PS/2,
..
ESDI, or SCSI hard disk (the latter controlled by an Adaptec 1540.) MINIX
for the 386 (MINIX-386 for short) can be installed on a machine with at
least a 386sx processor, 3 MB memory and at least 25-30 MB of disk space.
.SS "2. MINIX INSTALLATION BACKGROUND"
The objective of the installation is to create a partition on your disk
and to put MINIX into it. MINIX really requires two partitions however, so
the single "primary" partition is split into two subpartitions. The
.B a
subpartition will contain the root file system, and the
.B c
subpartition will contain the
.B /usr
file system. What MS-DOS calls
"drives", i.e C:, D:, E:, MINIX calls "file systems". MINIX does not use
drive letters, but requires that one file system is made a part of another
file system by "mounting" one on the other. The "root" file system is
always present and starts with the directory "/", the root of the directory
tree. The root file system contains a few programs in
.BR /bin ,
device files in
.BR /dev ,
and configuration files in
.BR /etc .
This is just enough to get the system started. MINIX will soon extend
its directory tree by mounting a file system on the
.B /usr
directory. What is henceforth known as the /usr file system contains all
MINIX programs in
.BR /usr/bin ,
file system sources in
.BR /usr/src ,
etc, etc.
The \s-2ROOT\s+2 image contains the complete MINIX root file system, but
\s-2USR\s+2 contains just a small subset of the /usr file system, with just
enough utilities to install MINIX. The complete /usr file system is
split up into the \s-2USR.TAZ\s+2, \s-2SYS.TAZ\s+2 and \s-2CMD.TAZ\s+2
archives that are installed later to fill /usr.
.PP
Let's suppose your first hard disk, which has
device name
.BR /dev/hd0 ,
has MS-DOS already present in the first primary partition
.RB ( /dev/hd1 ),
and some free space left after that. After MINIX is installed in that
free space the disk will look like this:
.PP
.ta +12n
.nf
.in +4n
/dev/hd0 Whole hard disk #0
.in +2n
/dev/hd1 MS-DOS C: drive
/dev/hd2 MINIX primary partition
.in +2n
/dev/hd2a MINIX root partition
/dev/hd2c MINIX /usr partition
.in -8n
.fi
.PP
/dev/hd0 is the sum of a partition table, /dev/hd1 and /dev/hd2.
Likewise is /dev/hd2 the sum of a subpartition table, /dev/hd2a and
/dev/hd2c. Read the "DEVICES" sections for more information on MINIX
devices.
.SS "3. INSTALLATION"
If you have not already copied MINIX to floppy disks, please read
the README.TXT file in the MINIX directory now.
It tells how to do this.
You should also print out EXAMPLE.TXT and read it in parallel with this
document. This one tells you what to do; that one shows you what the
screen is supposed to look like at each step, so you can see if everything
is OK.
.PP
You can install MINIX automatically or manually as described the sections
below. The end result is the same, but manual installation allows
one to deviate from the preconfigured choices. You may wish to read the
manual pages of the programs used below before you start. You may especially
want to read
.BR boot (8)
if your machine is different from what the majority buys, because you
may need to set a few boot parameters to configure drivers. To do this type
.B ESC
to get to the Boot Monitor prompt, set the appropriate variables, use
.B save
to store the settings and
.B menu
to continue where you left off.
.PP
To install the system you need two diskettes: a bootable root diskette and a
diskette full of binaries to use as
.BR /usr .
These diskettes are named
.B \s-2ROOT\s+2
and
.BR \s-2USR\s+2 .
These two diskettes may also be combined on a single high density diskette.
In that case the \s-2USR\s+2 part is on the
.B c
partition.
.PP
Insert the \s-2ROOT\s+2 diskette, boot the machine and type '=' to the menu.
The MINIX kernel is loaded and takes control when you see the copyright
banner. After loading the root diskette into the RAM disk you will be asked
to finish the name of the device to mount on
.BR /usr .
Type
.BR fd0c
for a diskette that contains both \s-2ROOT\s+2 and \s-2USR\s+2, otherwise
replace \s-2ROOT\s+2 by \s-2USR\s+2 and type
.BR fd0 .
Login as
.BR root .
.SS "4. AUTOMATIC INSTALLATION"
Before starting the installation, you must either have a free partition
available or have at least 25-30 MB not in any partition so you can create
a MINIX partition.
Splitting an MS-DOS partition can be done using fips, and is discussed in the
main README.TXT file.
.PP
Type
.B setup
to start the installation script. First it offers to install a national
keyboard map. The names should be clear, except for
.BR us-swap ,
which swaps the CTRL and CAPS LOCK keys of a standard US style keyboard
for people who believe that the natural place of CTRL is next to A.
The default suggested between [ and ] is the US standard keyboard.
.PP
The next thing to do is to make a partition, for this you are placed in a
partition table editor named
.BR part .
This partition table editor is very easy to use (in the author's opinion),
but you will probably hate it. You can move all over the place with the
arrow keys, change values, and make a mess of your partition table real quick.
So if you get into trouble, type 'q' to quit, 'n' to not write the table,
and RETURN to start over. Use the '?' key to get help.
.PP
With the '+' and '\-' keys you can select the disk device to install on,
probably
.BR /dev/hd0 ,
the first hard disk. Type 'r' to load the partition table of the selected
disk. Either create one new partition by modifying a partition marked
"None", or reuse an existing partition by changing its type to "MINIX" (hex
code 81). The FIPS program can be used under MS-DOS to shrink an MS-DOS
partition. FIPS splits the MS-DOS partition in two, so one of the two can be
used for MINIX. You have to be absolutely sure which one. When in doubt,
first use the FDISK program under MS-DOS to delete the extra partition, and
let MINIX part create a new one. DO NOT use part to shrink an existing
partition! MINIX needs a partition of at least 25-30 MB, but not larger
than 128 MB (MINIX-86) or 1 GB (MINIX-386). The system needs
30 MB in compiled state.
.PP
The script then wants to know the name of the partition you've created, this
name is probably still visible on the screen (hd2, hd6, something like
that.) The new partition table is reloaded into the disk driver, and the
new MINIX partition is carved up into two subpartitions, a 1440 kb root and
the rest for /usr.
.PP
After making /usr, it is immediately put to use to replace the installation
/usr file system so that you can remove the \s-2USR\s+2 diskette and insert
the \s-2ROOT\s+2 diskette (unless they are one and the same). The root file
system is filled with the contents of the \s-2ROOT\s+2 diskette and slightly
patched up to work on the hard disk (/etc/fstab.)
.PP
To compute the size of the so-called "second level block cache" you are
asked to specify the RAM size of your machine. If you have plenty, i.e
4 MB or more then simply hit RETURN, otherwise enter the size of your system
RAM in kilobytes.
.PP
You can now skip the next section and move to "TESTING", but it may be
instructive to read it anyway.
.SS "5. MANUAL INSTALLATION"
The instructions that follow are at a very low level and require you to be
very careful. The big advantage is that you know precisely what
tools have been used and how everything works. The disadvantage is that
you may easily make a mistake that either forces you to start over if you
are lucky, or wipes out the contents of your hard disk if you are not.
Only if you really want to do something different should you use a manual
installation. Slavishly following the steps shown below will only make
you end up with the same result as an automatic installation.
.PP
Run
.B part
to make partitions to load the system into. The best thing to do is to make
one large primary partition of type "MINIX" and to carve this partition up
into three subpartitions for root and /usr. The assumption is that you will
use the second partition on the first hard disk,
.BR /dev/hd2 ,
and that
.B hd2a
is the root subpartition and
.B hd2c
is /usr. If you want to use the first partition on
the second hard disk for instance, then substitute hd6 and hd6[ac] for the
above. On a \s-2SCSI\s+2 disk it will be /dev/sd2 for the second partition
on the disk at target 0. See the section on devices below, and the manual
pages of
.BR part (8),
.BR hd (4),
and
.BR sd (4).
Start
.B part
and select the whole hard disk device (the "multiple of 5" device) that you
want to install MINIX onto. In our example it will be
.BR /dev/hd0 .
.PP
Use
.B part
to make a single partition in the primary partition table of type "MINIX",
then hit '>' on this new partition to make a subpartition table.
.PP
For the root subpartition you are advised to use 1440 kb exactly. You can
make it larger if you want to, but it is advisable never to let the contents
outgrow a floppy. (The \s-2ROOT\s+2 diskette is a copy of a root file
system, and will be used to fill your root subpartition.)
.PP
The second subpartition is either empty or a "scratch" partition. MINIX no
longer uses the
.B b
subpartition for anything useful anymore, but it has become customary to
have root on
.B a
and /usr on
.BR c .
(You are free to ignore this convention, of course.)
.PP
Use the rest of the partition for the /usr
.B c
subpartition.
.PP
When you are done check that /dev/hd2a is active (the * after the partition
number) so you can boot from it later.
.PP
If your disk has bad blocks then don't put the root or scratch subpartition
on top of them. Make sure the inode tables in the other partitions don't
have bad blocks either. You can put the subpartitions out of order on the
disk if that helps. Subpartition tables, other than the main partition
table, are not sorted by the driver.
.PP
After making the partitions you do not have to reboot. The disk driver
reloads the partition tables on the next access if the disk is not in use.
(Open or mounted.)
.PP
To be able to boot from /dev/hd2a you must place a master bootstrap in
/dev/hd2. It has been placed there by
.B part
if it told you that it was creating a new partition table, but
.PP
.XB "installboot\0\-m\0/dev/hd2\0/usr/mdec/masterboot"
.RE
.PP
will put it there for sure.
.PP
You will start by making a file system for /usr and filling it partially.
This may seem to be out of order, but you can't insert the \s-2ROOT\s+2
floppy right now.
.PP
.XB "mkfs\0/dev/hd2c"
.XB "readall\0\-b\0/dev/hd2c | sh"
.XB "mount\0/dev/hd2c\0/mnt"
.XB "cpdir\0\-v\0/usr\0/mnt"
.PP
This will create a file system on /dev/hd2c, mount it on /mnt, and copy the
contents of the \s-2USR\s+2 floppy onto it. The call to
.B readall
marks bad blocks on the file system as unusable, you can omit this on a
drive known to be spotless (\s-2IDE\s+2 or \s-2SCSI\s+2.)
.PP
You can now use the new /usr in place of the \s-2USR\s+2 floppy:
.PP
.XB "umount\0/dev/hd2c"
.XB "umount\0/dev/fd0\0\0\0\0\0# fd0c if combined"
.XB "mount\0/dev/hd2c\0/usr"
.PP
This little dance has freed up your floppy drive, so please remove the
\s-2USR\s+2 diskette and replace it by the \s-2ROOT\s+2 diskette. Make a
file system for the root with at least 512 inodes (files), and
fill it from the floppy:
.PP
.XB "mkfs\0\-i\0512\0/dev/hd2a"
.XB "mount\0/dev/fd0\0/fd0"
.XB "mount\0/dev/hd2a\0/mnt"
.XB "cpdir\0\-v\0/fd0\0/mnt"
.XB "umount\0/dev/fd0"
.PP
Remove
.B /mnt/etc/issue
to get rid of the "use setup" message that greets you when you boot, and
edit the file
.B /mnt/etc/fstab
to name the devices MINIX has been installed on. In our example it
should look like this:
.PP
.XB "root=/dev/hd2a"
.XB "usr=/dev/hd2c"
.PP
Unmount the new root:
.PP
.XB "umount\0/dev/hd2a"
.PP
Make it bootable:
.PP
.XB "installboot\0\-d\0/dev/hd2a\0/usr/mdec/bootblock\0boot"
.PP
The automatic script would now set the
.B rootdev
and
.B ramimagedev
boot variables. You can do this now using the
.B edparams
command, but it is easier to postpone it until the testing phase. The
settings should be:
.PP
.XB "rootdev=hd2a"
.XB "ramimagedev=hd2a"
.SS "6. TESTING"
By now a new MINIX system is present on your hard disk. Time to see if
it works. Leave the \s-2ROOT\s+2 diskette in the drive and type
.BR halt .
You are now going to use the power of the Boot Monitor on the diskette to
boot the MINIX partition on the hard disk. Use the monitor command
.B boot hd2
to boot the primary partition MINIX has been installed in. (It is "hd2" in
our example.) For a \s-2SCSI\s+2 disk you will have to use a 'hd' name too.
The monitor uses the BIOS, so you will have to treat it as a "normal" disk
at this point.
.PP
The hard disk bootstrap is now showing the menu again. You can type '='
to start MINIX, but you probably want to change the boot parameters.
Hit
.B ESC
once more to get to the command prompt. The command
.B set
shows what the current parameters are. Here is an example that shows how
to make a menu to either start MINIX or boot MS-DOS:
.PP
.XB "minix(=,MINIX)\0{boot}"
.XB "dos(d,MS-DOS)\0{boot\0hd1}"
.XB "save"
.PP
MS-DOS is assumed to be in the first partition in the example above (hd1).
When finished type
.B menu
to see if the menu looks right. If so hit '=' to start MINIX. Log in as root.
.SS "7. ADDING PROGRAMS AND SOURCES TO /usr"
The
.B setup
command can also be used to add files from floppy sets to the system. The
.B \s-2USR.TAZ\s+2
(programs and stuff),
.B \s-2SYS.TAZ\s+2
(system sources), and
.B \s-2CMD.TAZ\s+2
(commands sources)
are all installed relative to the
.B /usr
directory, so the command to use three times is
.PP
.XB setup\0/usr
.PP
.B Setup
will ask for the size of data on the floppies, which is by default simply
the entire floppy. You will see some "Cannot make directory" errors
while extracting, as some directories already exist. Ignore these messages.
You need the
.B \s-2USR.TAZ\s+2
set if you want a working MINIX system,
.B \s-2SYS.TAZ\s+2
if you want recompile the system or study it, and
.B \s-2CMD.TAZ\s+2
if you also want the sources of the commands. On a disk space
starved machine you could opt to do without the commands sources, as they
are not absolutely necessary to understand MINIX.
.PP
If your machine does not have enough memory to run
.B setup\0/usr
then type these commands manually:
.PP
.XB "cd\0/usr"
.XB "vol\0/dev/fd0 | uncompress | tar\0xvfp\0\-"
.SS "8. NAMES"
A standalone machine will have to be given a name. As
.B root
type
.PP
.XB "echo\0\fIname\fB\0>/etc/hostname.file"
.PP
to change the host name of your machine to
.IR name .
.SS "9. ACTIVE ON BOOT"
You may want to make the MINIX partition active so that it is automatically
booted. With MS-DOS
.B fdisk
or MINIX
.BR part ,
mark the primary partition that contains MINIX active. Using the menu you
made earlier you can boot either MINIX or MS-DOS at a keypress. You can even
set timeouts. To boot MINIX automatically after 5 seconds:
.PP
.XB "main()\0{trap\05000\0minix;\0menu}"
.PP
See
.BR monitor (8)
for all the details on the monitor.
.PP
If you don't trust this then you can rig up a diskette that boots the MINIX
partition when left in the drive:
.PP
.XB "installboot\0\-m\02\0/dev/fd0\0/usr/mdec/masterboot"
.PP
The number 2 indicates the hard disk partition that must be booted, you can
use the numbers 1 to 9 for hd1 to hd9.
.SS "10. DEVICES"
A crash course on the MINIX devices in
.BR /dev :
The two hard disks are named
.BR hd0
and
.BR hd5 .
These "multiple of five" devices address the entire hard disk, from the
first to the last byte. Each disk has four partitions, for disk 0 they are
.BR hd1 ,
.BR hd2 ,
.BR hd3 ,
and
.BR hd4 .
And for disk 1 they are named
.BR hd6 ,
.BR hd7 ,
.BR hd8 ,
and
.BR hd9 .
These partitions may contain file systems,
.B hd1
often contains the MS-DOS "C:" file system. MINIX can use these partitions
for file systems too, but you can also partition one of these "primary
partitions" into four so-called "subpartitions". The subpartitions of
.B hd1
are named
.BR hd1a ,
.BR hd1b ,
.BR hd1c ,
and
.BR hd1d .
The other partitions may have four subpartitions that are named in the same
way by adding a letter from
.B a
to
.BR d .
So one disk may have four partitions, and 16 subpartititions total. SCSI
disks are named in the same way, from
.BR sd0
to
.BR sd39d
for all possible devices for all eight SCSI targets.
The two floppy disks are
.BR fd0
and
.BR fd1 .
Each may have four partitions named
.BR fd0a ,
.BR fd0b ", ..."
.BR fd1d .
The command
.B MAKEDEV
knows how to make devices, and
.B DESCRIBE
can tell you what an unknown device may be, or even what all devices in
.B /dev
may be if called without arguments. Devices are described fully in
.BR dev (4),
and in the device specific manual pages like
.BR fd (4)
and
.BR hd (4).
.SS "11. EDITORS"
The editors available are
.B elvis
(a
.B vi
clone),
.B elle
(a simple
.B emacs
clone),
and the old MINIX
.B mined
editor. Of these editors only elvis can recover your file after a system
crash. Only
.B mined
is available at installation time. (All you need to know about mined right
now is that CTRL-X gets you out of it.)
.SS "12. INSTALLING ON A SCSI DISK"
Using a disk other than an (IDE)
.B hd
disk complicates things a bit. The Boot Monitor uses the BIOS, so it names
all disks with
.B hd
names. So it is
.B boot hd1
to boot partition 1, and
.B "ramimagedev=sd2a"
to tell MINIX its root partition. If you have both a normal and a SCSI disk
then the disks may be
.B hd0
and
.B hd5
to the Monitor, and
.B hd0
and
.B sd0
to MINIX.
.SS "13. NATIONAL KEYBOARDS"
The directory
.B /usr/lib/keymaps
contains keymap tables for several national keyboards. If you have a German
keyboard for instance, then
.PP
.XB "loadkeys\0/usr/lib/keymaps/german.map"
.PP
will load the German key translation table into the keyboard driver. Copy
the map to
.B /etc/keymap
once MINIX is installed on the hard disk, because having to type a key
sequence like one of these:
.PP
.XB "loadkezs\0\-usr\-lib\-kezmaps\-german.map"
.XB "loqdkeys\0=usr=lib=key,qps=french.,qp"
.PP
on a reboot gets a bit annoying after a while. Send corrections and new
keymaps to the person named below. (Do not send a Dutch keymap, buy
yourself a real keyboard instead.)
.SH SUGGESTIONS
Below are a few useful suggestions. Some of the information can be of use
in other situations than described here.
.SS "14. VIRTUAL CONSOLES"
Hold down the ALT key and press the left or right arrow key, F1, or F2.
This switches the console between two login sessions. (Unless you have
an old mono adapter, because virtual consoles sit in video memory, and
a mono adapter only has memory for one.)
.PP
Note that kernel messages, including function key output, only appear on
the first console. This may be confusing, but it keeps the other consoles
clean.
.SS "15. LOW ON MEMORY"
The normal installation requires that you have enough memory for a large RAM
disk. You can still install MINIX normally if you either have a high density
diskette drive for a combined root+usr floppy, or you have two floppy drives
of at least 720 kb. Before booting you have to set the variable
.B rootdev
to the same value as
.BR ramimagedev .
This is slower then a RAM disk, but saves a lot of memory.
.PP
The automatic installation script knows how to handle this new situation.
If you install manually then you have to use
.PP
.XB "cpdir\0\-vx\0/\0/mnt"
.PP
to copy the root device to disk. When it is time to fill /usr and you only
have one floppy drive then hit DEL to get out of the installation script and
reboot as described in "TESTING". You can then finish the installation
manually.
See the XT640K.TXT file for more advice on small machines.
.SS "16. LOW ON MEMORY AND ONLY ONE 720 KB FLOPPY DRIVE"
If you only have one 720 kb floppy drive and your system is low on memory
then you can use the \s-2TINYROOT\s+2 boot image. This image contains a
small kernel with only the BIOS disk driver, and a small root file system.
You can use this disk to boot your machine. Use the normal \s-2ROOT\s+2 to
install the root file system. Keep booting your machine with
\s-2TINYROOT\s+2 until you have compiled a small kernel for your system.
Use the
.B rootdev
boot variable to select the hard disk root file system. Do
.B not
use \s-2TINYROOT\s+2 for anything other than booting, always use
\s-2ROOT\s+2 when mentioned.
.SS "17. FLOPPY DRIVE 1 IS A HIGH DENSITY DRIVE"
If you would like to install from floppy drive 1 then you need to copy at
least one sector from the \s-2USR\s+2 image onto a diskette for drive 0.
The \s-2USR\s+2 bootstrap has been rigged to boot the other drive.
.SS "18. INSTALLING ON A SECOND HARD DISK"
MINIX doesn't care if it is installed on the second disk of a system with
two disks. The only problem is to get it booted. You can either rig up
a diskette to boot MINIX as shown earlier, or you can use the same trick
on the first disk. The command
.PP
.XB "installboot\0\-m\05\0/dev/hd0\0/usr/mdec/masterboot"
.PP
will lock the first disk into booting the second disk. Note that this
command modifies the disk outside a MINIX partition, overwriting a bit of
code that has likely been put there by MS-DOS fdisk. First verify that the
Boot Monitor can boot an MS-DOS partition, because then the MINIX master
bootstrap can do it too.
.SS "19. LOTS OF MEMORY ON A 286"
You will have a hard time making MINIX use up 3 MB memory. Memory you
can spare can be used for a "second level block cache" on the RAM disk. The
File System uses the second level cache to store copies of disk blocks that
are pushed out of the normal (primary) block cache. The size of the primary
cache is compiled into the FS server, but the size of the second level cache
can be set with the
.B ramsize
boot variable. Set it to a number between 0 and 512. 512 kilobytes is
enough to keep most of the compiler cached.
You must have extended memory; expanded memory is not supported.
.SS "20. LOTS OF MEMORY ON A 386+"
Processes can be as big as you would like on a 386, but in practice 4 MB is
plenty for all your processes.
The installation script sets up a second level cache for MINIX-386
of up to 1024 kilobytes. This is because the default file system cache
is only 80 kb. Your first point of call is to get rid of the poorly
performing second level cache by setting
.B ENABLE_CACHE2
to 0 and to assign the memory used by it to the
normal block cache by enlarging the appropriate
.B NR_BUFS
and
.B NR_BUF_HASH
constants in <minix/config.h> with as much as you can spare. (1024 for
NR_BUFS is the minimum to keep
.B "cc \-c"
cached. 2048 is then a nice value for NR_BUF_HASH.)
Disable the second level cache, compile a new kernel, reboot and set
.B ramsize
to 0.
.SS "21. LOTS OF DISK SPACE"
The maximum file system size is 1 GB for MINIX-386 and 128 MB for
MINIX-86. (MINIX-86 can handle larger file systems, but
.B fsck
can't check them.) Note that a MINIX file system can only contain 65535
inodes (files), so the average file should be 16 kb to completely fill it.
It may be better to make two smaller file systems. Besides, fsck takes
forever on a large file system.
.SH SYSTEM ADMINISTRATION
The system has been set up with the idea that working as root is a bad thing
to do. As root you are in no way protected from doing stupid things. So
don't do development as root, but work as
.BR bin !
Only in exceptional cases do you want to become root. Being root is fun for
wannabe hackers; administrators know better.
.PP
To make life easier for bin, some programs like
.BR su (1),
.BR install (1)
and
.BR shutdown (8)
treat bin and other members of the operator group as special and allow them
the privileges of root. (One is an operator if one's
group id is zero.) Operators should share the shadow password of root by
having
.B ##root
in their password field. This way they all have one face (password)
to the outside world, forming no greater security risk than root alone.
.PP
The home directory of bin contains one important Makefile. You can use it
to recompile all the commands and libraries of the system. Type
.B make
to see the usage message. If you want to compile just one command then you
can simply type
.B make
to do so. To put it in its proper place you have to type
.BR "make install" .
Read the Makefiles in the
.B commands
and
.B lib
subdirectories to understand how everything is put together. If you are
tight on memory then
.B make
may fail to traverse down the source tree and also compile things. You will
have to type
.B make
in each subdirectory. You can run make in /usr/src at the end to see if
you've missed something or not.
.PP
The login shell of bin is
.BR ash ,
the BSD shell. It has been modified to offer simple line editing using the
.BR editline (3)
library.
.B Ash
is rather big, so you may have to change bin's shell back to
.B /bin/sh
with
.BR chsh (1)
if you are low on memory. Do not change root's shell to ash, and do not
replace /bin/sh by ash. It may run out of memory at the wrong moment.
.PP
The kernel is not compiled from the master Makefile. To make a new kernel
you have to step into the
.B tools
directory. There you can run four different make commands:
.PP
.TP
.B make
This makes all the different kernel parts and combines them in the file
named
.BR image .
.TP
.B make fdboot
As above and then makes a boot floppy that you can use to restart your
system with. You are prompted for the floppy device name.
.TP
.B make hdboot
First makes the image file and then copies it into the directory
.BR /minix .
If there are already two images in that directory then the newest image will
be removed to make space for this newer image. It is assumed that the
oldest image is the most stable system image, one that always works, and
that the newest image is experimental. Check beforehand what
.B /minix
contains before you run
.BR "make hdboot" .
Remove the oldest image if you want another image to become the stable
image. The Boot Monitor chooses the newest image in
.B /minix
to boot. You can use the monitor command
.B ls minix
to view the images present, and set the
.B image
variable to the full name of the image you want to use instead if the newest
doesn't work. The images in
.B /minix
are named using the MINIX release and version numbers with an extra revision
number added to distinguish the images.
.PP
The first new kernel you would like to make is one configured for your
system. The kernel you are running now contains several hard disk drivers
you don't need, and it does not have a TCP/IP server that you may want to
have. In <minix/config.h> you can find a number of
.BI ENABLE_ XXX
variables that can be set to
.B 0
to exclude, or
.B 1
to include a particular driver. Another driver related variable is
.BR DMA_SECTORS .
This variable sets the size of a buffer used by DMA based disk drivers (all
but the floppy, AT/IDE, and Adaptec drivers). Raise its value to greatly
improve throughput, especially writing. A value of 16 shows good results.
(The BIOS driver benefits most, because it is a long way to the BIOS from
protected mode, especially from 286 protected mode.) You can increase
.B NR_CONS
if you want to have more virtual consoles. Having more consoles costs
little memory, because all the consoles are kept in video memory. Scrolling
speed of the console will go down if more virtual consoles share the
available memory. CGA cards have space for 4 consoles, EGA and VGA can
have 8 consoles. The
.B NR_PTYS
variable sets the number of pseudo-ttys. You need pseudo-ttys to be able to
login remotely over a network with the
.B rlogin
command. Each remote login session needs one pseudo-tty. If you fear that
the system will now run out of processes then increase
.BR NR_PROCS .
Configuring a new kernel is sometimes not enough to enable new devices, you
sometimes need to use the
.B MAKEDEV
command to make new device files in
.BR /dev .
For pseudo-ttys you also have to check if
.B /etc/ttytab
mentiones the new devices.
.PP
New additions to the system can be made in the
.B /usr/local
tree. An empty directory tree has been set up for you and binaries and
manual pages are already in the search paths. You can make a new user entry
with the
.B adduser
command.
.PP
The
.B TZ
variable in
.B /etc/profile
tells the time zone offset from the wall clock time to GMT. You have to
change it for your time zone. (See
.BR TZ (5).)
.PP
The function keys produce debug dumps, showing various interesting data
about the system. F1 lists processes and F5 shows ethernet stats, which
may be of use now. Read
.BR console (4)
to know all the details of the screen and keyboard.
.SS "22. SYSTEM SHUTDOWN"
You can't just turn a MINIX system off. MINIX must be told to flush the
modified data in the file system cache first. The following
commands/keystrokes can be used to exit MINIX properly:
.TP
.B shutdown
First alert all users and then all processes of the impending shutdown
then halt or reboot the system in one of various ways. See
.BR shutdown (8).
.TP
.B reboot / halt
Alert all processes of the system shutdown then reboot or halt.
.TP
.B \s-2CTRL\-ALT\-DEL\s+2
Halt the system by running
.BR "shutdown \-h now" .
.PP
MINIX halts by returning to the Boot Monitor, MINIX reboots by instructing
the monitor to reboot MINIX. (MINIX is just a subprocess to the monitor.)
Either halt MINIX and use monitor commands to escape MINIX, or use
.B shutdown \-R
to reset the system.
.SH FILES
.TP 12
.B /usr/ast
Honorary home directory of Andew S. Tanenbaum. Doubles as the place where
the default setup for a new user is found.
.SH "SEE ALSO"
.BR monitor (8),
.BR boot (8),
.BR part (8),
.BR mkfs (1),
.BR mount (8),
.BR M (8),
.BR fstab (5),
.BR hier (7),
.BR console (4),
.BR dev (4),
.BR adduser (8),
.BR TZ (5),
.BR mkdist (8),
.BR shutdown (8).
.br
"Operating Systems \- Design and Implementation 2/e" by Andrew S. Tanenbaum
and Albert S. Woodhull.
.SH NOTES
The notation
.BI < file .h>
refers to a C language include file in /usr/include.
.PP
.B Root
and
.B bin
do not have the current directory in their program search path to avoid
executing programs left around by malicious people. This means that to run
.B foo
from the current directory,
.B ./foo
must be typed.
.PP
Some of the commands have changed since earlier MINIX versions. For instance
.B mkfs
doesn't need a size argument anymore, and
.B vol
automagically determines if it needs to read or write. Keep this in mind
if you use an older MINIX version to examine the newer system.
.SH BUGS
There are many PS/2 models, all different. Some will run MINIX, some won't,
some crippled if you lie to MINIX by setting
.B processor
to
.BR 86 .
Almost no PS/2 has a standard disk, so setting
.B hd
to
.B esdi
or
.B bios
will be necessary.
.PP
While testing a full library rebuild of this distribution it sometimes
happened that some things were not put back into the library. This seems
to be fixed, but we do not understand why the fix fixed the problem. So
if you see strange "undefined" errors when compiling a program after a
library rebuild then run
.B make install
again in
.B /usr/src/lib/
to try and add the missing pieces.
.PP
Except for the floppy driver, none of the DMA based drivers know about DMA
being limited to a 24 bits address, i.e. the first 16 MB. So under MINIX-386
you run a slight risk that a
.B tar
or
.B dd
command may use a buffer above 16 MB for reading or writing to a character
device. This only happens if the low 16 MB is taken by some huge processes,
and you have more than 16 MB, of course.
.SH AUTHOR
Kees J. Bot (kjb@cs.vu.nl)

View File

@@ -0,0 +1,856 @@
USAGE(8) Maintenance Procedures USAGE(8)
NAME
usage - installing and using MINIX
DESCRIPTION
This manual page describes the installation and use of MINIX
from a System Administrators point of view. It contains an
installation guide, instructions on how to do the initial
configuration and some other info. Please read this docu-
ment entirely before attempting to install MINIX. The ins-
tallation steps are in the proper order, but not all the
information you may need is presented at the right moment.
Other detailed information that may be useful can be found
in boot(8) and hier(7).
1. REQUIREMENTS
The minimum system MINIX can be installed on comfortably is
an IBM PC/AT or PS/2 with a 286 processor, 640 KB memory, a
720 kb diskette drive, and 25-30 MB free space on an AT,
ESDI, or SCSI hard disk (the latter controlled by an Adaptec
1540.) MINIX for the 386 (MINIX-386 for short) can be
installed on a machine with at least a 386sx processor, 3 MB
memory and at least 25-30 MB of disk space.
2. MINIX INSTALLATION BACKGROUND
The objective of the installation is to create a partition
on your disk and to put MINIX into it. MINIX really
requires two partitions however, so the single "primary"
partition is split into two subpartitions. The a subparti-
tion will contain the root file system, and the c subparti-
tion will contain the /usr file system. What MS-DOS calls
"drives", i.e C:, D:, E:, MINIX calls "file systems". MINIX
does not use drive letters, but requires that one file sys-
tem is made a part of another file system by "mounting" one
on the other. The "root" file system is always present and
starts with the directory "/", the root of the directory
tree. The root file system contains a few programs in /bin,
device files in /dev, and configuration files in /etc. This
is just enough to get the system started. MINIX will soon
extend its directory tree by mounting a file system on the
/usr directory. What is henceforth known as the /usr file
system contains all MINIX programs in /usr/bin, file system
sources in /usr/src, etc, etc. The ROOT image contains the
complete MINIX root file system, but USR contains just a
small subset of the /usr file system, with just enough util-
ities to install MINIX. The complete /usr file system is
split up into the USR.TAZ, SYS.TAZ and CMD.TAZ archives that
are installed later to fill /usr.
Let's suppose your first hard disk, which has device name
/dev/hd0, has MS-DOS already present in the first primary
partition (/dev/hd1), and some free space left after that.
After MINIX is installed in that free space the disk will
1
USAGE(8) Maintenance Procedures USAGE(8)
look like this:
/dev/hd0 Whole hard disk #0
/dev/hd1 MS-DOS C: drive
/dev/hd2 MINIX primary partition
/dev/hd2a MINIX root partition
/dev/hd2c MINIX /usr partition
/dev/hd0 is the sum of a partition table, /dev/hd1 and
/dev/hd2. Likewise is /dev/hd2 the sum of a subpartition
table, /dev/hd2a and /dev/hd2c. Read the "DEVICES" sections
for more information on MINIX devices.
3. INSTALLATION
If you have not already copied MINIX to floppy disks, please
read the README.TXT file in the MINIX directory now. It
tells how to do this. You should also print out EXAMPLE.TXT
and read it in parallel with this document. This one tells
you what to do; that one shows you what the screen is sup-
posed to look like at each step, so you can see if every-
thing is OK.
You can install MINIX automatically or manually as described
the sections below. The end result is the same, but manual
installation allows one to deviate from the preconfigured
choices. You may wish to read the manual pages of the pro-
grams used below before you start. You may especially want
to read boot(8) if your machine is different from what the
majority buys, because you may need to set a few boot param-
eters to configure drivers. To do this type ESC to get to
the Boot Monitor prompt, set the appropriate variables, use
save to store the settings and menu to continue where you
left off.
To install the system you need two diskettes: a bootable
root diskette and a diskette full of binaries to use as
/usr. These diskettes are named ROOT and USR. These two
diskettes may also be combined on a single high density
diskette. In that case the USR part is on the c partition.
Insert the ROOT diskette, boot the machine and type '=' to
the menu. The MINIX kernel is loaded and takes control when
you see the copyright banner. After loading the root
diskette into the RAM disk you will be asked to finish the
name of the device to mount on /usr. Type fd0c for a
diskette that contains both ROOT and USR, otherwise replace
ROOT by USR and type fd0. Login as root.
4. AUTOMATIC INSTALLATION
Before starting the installation, you must either have a
free partition available or have at least 25-30 MB not in
any partition so you can create a MINIX partition.
2
USAGE(8) Maintenance Procedures USAGE(8)
Splitting an MS-DOS partition can be done using fips, and is
discussed in the main README.TXT file.
Type setup to start the installation script. First it
offers to install a national keyboard map. The names should
be clear, except for us-swap, which swaps the CTRL and CAPS
LOCK keys of a standard US style keyboard for people who
believe that the natural place of CTRL is next to A. The
default suggested between [ and ] is the US standard key-
board.
The next thing to do is to make a partition, for this you
are placed in a partition table editor named part. This
partition table editor is very easy to use (in the author's
opinion), but you will probably hate it. You can move all
over the place with the arrow keys, change values, and make
a mess of your partition table real quick. So if you get
into trouble, type 'q' to quit, 'n' to not write the table,
and RETURN to start over. Use the '?' key to get help.
With the '+' and '-' keys you can select the disk device to
install on, probably /dev/hd0, the first hard disk. Type
'r' to load the partition table of the selected disk.
Either create one new partition by modifying a partition
marked "None", or reuse an existing partition by changing
its type to "MINIX" (hex code 81). The FIPS program can be
used under MS-DOS to shrink an MS-DOS partition. FIPS
splits the MS-DOS partition in two, so one of the two can be
used for MINIX. You have to be absolutely sure which one.
When in doubt, first use the FDISK program under MS-DOS to
delete the extra partition, and let MINIX part create a new
one. DO NOT use part to shrink an existing partition!
MINIX needs a partition of at least 25-30 MB, but not larger
than 128 MB (MINIX-86) or 1 GB (MINIX-386). The system
needs 30 MB in compiled state.
The script then wants to know the name of the partition
you've created, this name is probably still visible on the
screen (hd2, hd6, something like that.) The new partition
table is reloaded into the disk driver, and the new MINIX
partition is carved up into two subpartitions, a 1440 kb
root and the rest for /usr.
After making /usr, it is immediately put to use to replace
the installation /usr file system so that you can remove the
USR diskette and insert the ROOT diskette (unless they are
one and the same). The root file system is filled with the
contents of the ROOT diskette and slightly patched up to
work on the hard disk (/etc/fstab.)
To compute the size of the so-called "second level block
cache" you are asked to specify the RAM size of your
3
USAGE(8) Maintenance Procedures USAGE(8)
machine. If you have plenty, i.e 4 MB or more then simply
hit RETURN, otherwise enter the size of your system RAM in
kilobytes.
You can now skip the next section and move to "TESTING", but
it may be instructive to read it anyway.
5. MANUAL INSTALLATION
The instructions that follow are at a very low level and
require you to be very careful. The big advantage is that
you know precisely what tools have been used and how every-
thing works. The disadvantage is that you may easily make a
mistake that either forces you to start over if you are
lucky, or wipes out the contents of your hard disk if you
are not. Only if you really want to do something different
should you use a manual installation. Slavishly following
the steps shown below will only make you end up with the
same result as an automatic installation.
Run part to make partitions to load the system into. The
best thing to do is to make one large primary partition of
type "MINIX" and to carve this partition up into three sub-
partitions for root and /usr. The assumption is that you
will use the second partition on the first hard disk,
/dev/hd2, and that hd2a is the root subpartition and hd2c is
/usr. If you want to use the first partition on the second
hard disk for instance, then substitute hd6 and hd6[ac] for
the above. On a SCSI disk it will be /dev/sd2 for the
second partition on the disk at target 0. See the section
on devices below, and the manual pages of part(8), hd(4),
and sd(4). Start part and select the whole hard disk device
(the "multiple of 5" device) that you want to install MINIX
onto. In our example it will be /dev/hd0.
Use part to make a single partition in the primary partition
table of type "MINIX", then hit '>' on this new partition to
make a subpartition table.
For the root subpartition you are advised to use 1440 kb
exactly. You can make it larger if you want to, but it is
advisable never to let the contents outgrow a floppy. (The
ROOT diskette is a copy of a root file system, and will be
used to fill your root subpartition.)
The second subpartition is either empty or a "scratch" par-
tition. MINIX no longer uses the b subpartition for any-
thing useful anymore, but it has become customary to have
root on a and /usr on c. (You are free to ignore this con-
vention, of course.)
Use the rest of the partition for the /usr c subpartition.
4
USAGE(8) Maintenance Procedures USAGE(8)
When you are done check that /dev/hd2a is active (the *
after the partition number) so you can boot from it later.
If your disk has bad blocks then don't put the root or
scratch subpartition on top of them. Make sure the inode
tables in the other partitions don't have bad blocks either.
You can put the subpartitions out of order on the disk if
that helps. Subpartition tables, other than the main parti-
tion table, are not sorted by the driver.
After making the partitions you do not have to reboot. The
disk driver reloads the partition tables on the next access
if the disk is not in use. (Open or mounted.)
To be able to boot from /dev/hd2a you must place a master
bootstrap in /dev/hd2. It has been placed there by part if
it told you that it was creating a new partition table, but
installboot -m /dev/hd2 /usr/mdec/masterboot
will put it there for sure.
You will start by making a file system for /usr and filling
it partially. This may seem to be out of order, but you
can't insert the ROOT floppy right now.
mkfs /dev/hd2c
readall -b /dev/hd2c | sh
mount /dev/hd2c /mnt
cpdir -v /usr /mnt
This will create a file system on /dev/hd2c, mount it on
/mnt, and copy the contents of the USR floppy onto it. The
call to readall marks bad blocks on the file system as unus-
able, you can omit this on a drive known to be spotless (IDE
or SCSI.)
You can now use the new /usr in place of the USR floppy:
umount /dev/hd2c
umount /dev/fd0 # fd0c if combined
mount /dev/hd2c /usr
This little dance has freed up your floppy drive, so please
remove the USR diskette and replace it by the ROOT diskette.
Make a file system for the root with at least 512 inodes
(files), and fill it from the floppy:
mkfs -i 512 /dev/hd2a
mount /dev/fd0 /fd0
mount /dev/hd2a /mnt
cpdir -v /fd0 /mnt
5
USAGE(8) Maintenance Procedures USAGE(8)
umount /dev/fd0
Remove /mnt/etc/issue to get rid of the "use setup" message
that greets you when you boot, and edit the file
/mnt/etc/fstab to name the devices MINIX has been installed
on. In our example it should look like this:
root=/dev/hd2a
usr=/dev/hd2c
Unmount the new root:
umount /dev/hd2a
Make it bootable:
installboot -d /dev/hd2a /usr/mdec/bootblock boot
The automatic script would now set the rootdev and ram-
imagedev boot variables. You can do this now using the
edparams command, but it is easier to postpone it until the
testing phase. The settings should be:
rootdev=hd2a
ramimagedev=hd2a
6. TESTING
By now a new MINIX system is present on your hard disk.
Time to see if it works. Leave the ROOT diskette in the
drive and type halt. You are now going to use the power of
the Boot Monitor on the diskette to boot the MINIX partition
on the hard disk. Use the monitor command boot hd2 to boot
the primary partition MINIX has been installed in. (It is
"hd2" in our example.) For a SCSI disk you will have to use
a 'hd' name too. The monitor uses the BIOS, so you will
have to treat it as a "normal" disk at this point.
The hard disk bootstrap is now showing the menu again. You
can type '=' to start MINIX, but you probably want to change
the boot parameters. Hit ESC once more to get to the com-
mand prompt. The command set shows what the current parame-
ters are. Here is an example that shows how to make a menu
to either start MINIX or boot MS-DOS:
minix(=,MINIX) {boot}
dos(d,MS-DOS) {boot hd1}
save
MS-DOS is assumed to be in the first partition in the exam-
ple above (hd1). When finished type menu to see if the menu
looks right. If so hit '=' to start MINIX. Log in as root.
6
USAGE(8) Maintenance Procedures USAGE(8)
7. ADDING PROGRAMS AND SOURCES TO /usr
The setup command can also be used to add files from floppy
sets to the system. The USR.TAZ (programs and stuff),
SYS.TAZ (system sources), and CMD.TAZ (commands sources) are
all installed relative to the /usr directory, so the command
to use three times is
setup /usr
Setup will ask for the size of data on the floppies, which
is by default simply the entire floppy. You will see some
"Cannot make directory" errors while extracting, as some
directories already exist. Ignore these messages. You need
the USR.TAZ set if you want a working MINIX system, SYS.TAZ
if you want recompile the system or study it, and CMD.TAZ if
you also want the sources of the commands. On a disk space
starved machine you could opt to do without the commands
sources, as they are not absolutely necessary to understand
MINIX.
If your machine does not have enough memory to run
setup /usr then type these commands manually:
cd /usr
vol /dev/fd0 | uncompress | tar xvfp -
8. NAMES
A standalone machine will have to be given a name. As root
type
echo name >/etc/hostname.file
to change the host name of your machine to name.
9. ACTIVE ON BOOT
You may want to make the MINIX partition active so that it
is automatically booted. With MS-DOS fdisk or MINIX part,
mark the primary partition that contains MINIX active.
Using the menu you made earlier you can boot either MINIX or
MS-DOS at a keypress. You can even set timeouts. To boot
MINIX automatically after 5 seconds:
main() {trap 5000 minix; menu}
See monitor(8) for all the details on the monitor.
If you don't trust this then you can rig up a diskette that
boots the MINIX partition when left in the drive:
installboot -m 2 /dev/fd0 /usr/mdec/masterboot
7
USAGE(8) Maintenance Procedures USAGE(8)
The number 2 indicates the hard disk partition that must be
booted, you can use the numbers 1 to 9 for hd1 to hd9.
10. DEVICES
A crash course on the MINIX devices in /dev: The two hard
disks are named hd0 and hd5. These "multiple of five" dev-
ices address the entire hard disk, from the first to the
last byte. Each disk has four partitions, for disk 0 they
are hd1, hd2, hd3, and hd4. And for disk 1 they are named
hd6, hd7, hd8, and hd9. These partitions may contain file
systems, hd1 often contains the MS-DOS "C:" file system.
MINIX can use these partitions for file systems too, but you
can also partition one of these "primary partitions" into
four so-called "subpartitions". The subpartitions of hd1
are named hd1a, hd1b, hd1c, and hd1d. The other partitions
may have four subpartitions that are named in the same way
by adding a letter from a to d. So one disk may have four
partitions, and 16 subpartititions total. SCSI disks are
named in the same way, from sd0 to sd39d for all possible
devices for all eight SCSI targets. The two floppy disks
are fd0 and fd1. Each may have four partitions named fd0a,
fd0b, ... fd1d. The command MAKEDEV knows how to make dev-
ices, and DESCRIBE can tell you what an unknown device may
be, or even what all devices in /dev may be if called
without arguments. Devices are described fully in dev(4),
and in the device specific manual pages like fd(4) and
hd(4).
11. EDITORS
The editors available are elvis (a vi clone), elle (a simple
emacs clone), and the old MINIX mined editor. Of these edi-
tors only elvis can recover your file after a system crash.
Only mined is available at installation time. (All you need
to know about mined right now is that CTRL-X gets you out of
it.)
12. INSTALLING ON A SCSI DISK
Using a disk other than an (IDE) hd disk complicates things
a bit. The Boot Monitor uses the BIOS, so it names all
disks with hd names. So it is boot hd1 to boot partition 1,
and ramimagedev=sd2a to tell MINIX its root partition. If
you have both a normal and a SCSI disk then the disks may be
hd0 and hd5 to the Monitor, and hd0 and sd0 to MINIX.
13. NATIONAL KEYBOARDS
The directory /usr/lib/keymaps contains keymap tables for
several national keyboards. If you have a German keyboard
for instance, then
loadkeys /usr/lib/keymaps/german.map
8
USAGE(8) Maintenance Procedures USAGE(8)
will load the German key translation table into the keyboard
driver. Copy the map to /etc/keymap once MINIX is installed
on the hard disk, because having to type a key sequence like
one of these:
loadkezs -usr-lib-kezmaps-german.map
loqdkeys =usr=lib=key,qps=french.,qp
on a reboot gets a bit annoying after a while. Send correc-
tions and new keymaps to the person named below. (Do not
send a Dutch keymap, buy yourself a real keyboard instead.)
SUGGESTIONS
Below are a few useful suggestions. Some of the information
can be of use in other situations than described here.
14. VIRTUAL CONSOLES
Hold down the ALT key and press the left or right arrow key,
F1, or F2. This switches the console between two login ses-
sions. (Unless you have an old mono adapter, because vir-
tual consoles sit in video memory, and a mono adapter only
has memory for one.)
Note that kernel messages, including function key output,
only appear on the first console. This may be confusing,
but it keeps the other consoles clean.
15. LOW ON MEMORY
The normal installation requires that you have enough memory
for a large RAM disk. You can still install MINIX normally
if you either have a high density diskette drive for a com-
bined root+usr floppy, or you have two floppy drives of at
least 720 kb. Before booting you have to set the variable
rootdev to the same value as ramimagedev. This is slower
then a RAM disk, but saves a lot of memory.
The automatic installation script knows how to handle this
new situation. If you install manually then you have to use
cpdir -vx / /mnt
to copy the root device to disk. When it is time to fill
/usr and you only have one floppy drive then hit DEL to get
out of the installation script and reboot as described in
"TESTING". You can then finish the installation manually.
See the XT640K.TXT file for more advice on small machines.
16. LOW ON MEMORY AND ONLY ONE 720 KB FLOPPY DRIVE
If you only have one 720 kb floppy drive and your system is
low on memory then you can use the TINYROOT boot image.
This image contains a small kernel with only the BIOS disk
driver, and a small root file system. You can use this disk
9
USAGE(8) Maintenance Procedures USAGE(8)
to boot your machine. Use the normal ROOT to install the
root file system. Keep booting your machine with TINYROOT
until you have compiled a small kernel for your system. Use
the rootdev boot variable to select the hard disk root file
system. Do not use TINYROOT for anything other than boot-
ing, always use ROOT when mentioned.
17. FLOPPY DRIVE 1 IS A HIGH DENSITY DRIVE
If you would like to install from floppy drive 1 then you
need to copy at least one sector from the USR image onto a
diskette for drive 0. The USR bootstrap has been rigged to
boot the other drive.
18. INSTALLING ON A SECOND HARD DISK
MINIX doesn't care if it is installed on the second disk of
a system with two disks. The only problem is to get it
booted. You can either rig up a diskette to boot MINIX as
shown earlier, or you can use the same trick on the first
disk. The command
installboot -m 5 /dev/hd0 /usr/mdec/masterboot
will lock the first disk into booting the second disk. Note
that this command modifies the disk outside a MINIX parti-
tion, overwriting a bit of code that has likely been put
there by MS-DOS fdisk. First verify that the Boot Monitor
can boot an MS-DOS partition, because then the MINIX master
bootstrap can do it too.
19. LOTS OF MEMORY ON A 286
You will have a hard time making MINIX use up 3 MB memory.
Memory you can spare can be used for a "second level block
cache" on the RAM disk. The File System uses the second
level cache to store copies of disk blocks that are pushed
out of the normal (primary) block cache. The size of the
primary cache is compiled into the FS server, but the size
of the second level cache can be set with the ramsize boot
variable. Set it to a number between 0 and 512. 512 kilo-
bytes is enough to keep most of the compiler cached. You
must have extended memory; expanded memory is not supported.
20. LOTS OF MEMORY ON A 386+
Processes can be as big as you would like on a 386, but in
practice 4 MB is plenty for all your processes. The instal-
lation script sets up a second level cache for MINIX-386 of
up to 1024 kilobytes. This is because the default file sys-
tem cache is only 80 kb. Your first point of call is to get
rid of the poorly performing second level cache by setting
ENABLE_CACHE2 to 0 and to assign the memory used by it to
the normal block cache by enlarging the appropriate NR_BUFS
and NR_BUF_HASH constants in <minix/config.h> with as much
as you can spare. (1024 for NR_BUFS is the minimum to keep
10
USAGE(8) Maintenance Procedures USAGE(8)
cc -c cached. 2048 is then a nice value for NR_BUF_HASH.)
Disable the second level cache, compile a new kernel, reboot
and set ramsize to 0.
21. LOTS OF DISK SPACE
The maximum file system size is 1 GB for MINIX-386 and 128
MB for MINIX-86. (MINIX-86 can handle larger file systems,
but fsck can't check them.) Note that a MINIX file system
can only contain 65535 inodes (files), so the average file
should be 16 kb to completely fill it. It may be better to
make two smaller file systems. Besides, fsck takes forever
on a large file system.
SYSTEM ADMINISTRATION
The system has been set up with the idea that working as
root is a bad thing to do. As root you are in no way pro-
tected from doing stupid things. So don't do development as
root, but work as bin! Only in exceptional cases do you
want to become root. Being root is fun for wannabe hackers;
administrators know better.
To make life easier for bin, some programs like su(1),
install(1) and shutdown(8) treat bin and other members of
the operator group as special and allow them the privileges
of root. (One is an operator if one's group id is zero.)
Operators should share the shadow password of root by having
##root in their password field. This way they all have one
face (password) to the outside world, forming no greater
security risk than root alone.
The home directory of bin contains one important Makefile.
You can use it to recompile all the commands and libraries
of the system. Type make to see the usage message. If you
want to compile just one command then you can simply type
make to do so. To put it in its proper place you have to
type make install. Read the Makefiles in the commands and
lib subdirectories to understand how everything is put
together. If you are tight on memory then make may fail to
traverse down the source tree and also compile things. You
will have to type make in each subdirectory. You can run
make in /usr/src at the end to see if you've missed some-
thing or not.
The login shell of bin is ash, the BSD shell. It has been
modified to offer simple line editing using the editline(3)
library. Ash is rather big, so you may have to change bin's
shell back to /bin/sh with chsh(1) if you are low on memory.
Do not change root's shell to ash, and do not replace
/bin/sh by ash. It may run out of memory at the wrong
moment.
11
USAGE(8) Maintenance Procedures USAGE(8)
The kernel is not compiled from the master Makefile. To
make a new kernel you have to step into the tools directory.
There you can run four different make commands:
make This makes all the different kernel parts and combines
them in the file named image.
make fdboot
As above and then makes a boot floppy that you can use
to restart your system with. You are prompted for the
floppy device name.
make hdboot
First makes the image file and then copies it into the
directory /minix. If there are already two images in
that directory then the newest image will be removed to
make space for this newer image. It is assumed that
the oldest image is the most stable system image, one
that always works, and that the newest image is experi-
mental. Check beforehand what /minix contains before
you run make hdboot. Remove the oldest image if you
want another image to become the stable image. The
Boot Monitor chooses the newest image in /minix to
boot. You can use the monitor command ls minix to view
the images present, and set the image variable to the
full name of the image you want to use instead if the
newest doesn't work. The images in /minix are named
using the MINIX release and version numbers with an
extra revision number added to distinguish the images.
The first new kernel you would like to make is one config-
ured for your system. The kernel you are running now con-
tains several hard disk drivers you don't need, and it does
not have a TCP/IP server that you may want to have. In
<minix/config.h> you can find a number of ENABLE_XXX vari-
ables that can be set to 0 to exclude, or 1 to include a
particular driver. Another driver related variable is
DMA_SECTORS. This variable sets the size of a buffer used
by DMA based disk drivers (all but the floppy, AT/IDE, and
Adaptec drivers). Raise its value to greatly improve
throughput, especially writing. A value of 16 shows good
results. (The BIOS driver benefits most, because it is a
long way to the BIOS from protected mode, especially from
286 protected mode.) You can increase NR_CONS if you want
to have more virtual consoles. Having more consoles costs
little memory, because all the consoles are kept in video
memory. Scrolling speed of the console will go down if more
virtual consoles share the available memory. CGA cards have
space for 4 consoles, EGA and VGA can have 8 consoles. The
NR_PTYS variable sets the number of pseudo-ttys. You need
pseudo-ttys to be able to login remotely over a network with
the rlogin command. Each remote login session needs one
12
USAGE(8) Maintenance Procedures USAGE(8)
pseudo-tty. If you fear that the system will now run out of
processes then increase NR_PROCS. Configuring a new kernel
is sometimes not enough to enable new devices, you sometimes
need to use the MAKEDEV command to make new device files in
/dev. For pseudo-ttys you also have to check if /etc/ttytab
mentiones the new devices.
New additions to the system can be made in the /usr/local
tree. An empty directory tree has been set up for you and
binaries and manual pages are already in the search paths.
You can make a new user entry with the adduser command.
The TZ variable in /etc/profile tells the time zone offset
from the wall clock time to GMT. You have to change it for
your time zone. (See TZ(5).)
The function keys produce debug dumps, showing various
interesting data about the system. F1 lists processes and
F5 shows ethernet stats, which may be of use now. Read con-
sole(4) to know all the details of the screen and keyboard.
22. SYSTEM SHUTDOWN
You can't just turn a MINIX system off. MINIX must be told
to flush the modified data in the file system cache first.
The following commands/keystrokes can be used to exit MINIX
properly:
shutdown
First alert all users and then all processes of the
impending shutdown then halt or reboot the system in
one of various ways. See shutdown(8).
reboot / halt
Alert all processes of the system shutdown then reboot
or halt.
CTRL-ALT-DEL
Halt the system by running shutdown -h now.
MINIX halts by returning to the Boot Monitor, MINIX reboots
by instructing the monitor to reboot MINIX. (MINIX is just
a subprocess to the monitor.) Either halt MINIX and use
monitor commands to escape MINIX, or use shutdown -R to
reset the system.
FILES
/usr/ast Honorary home directory of Andew S. Tanenbaum.
Doubles as the place where the default setup for
a new user is found.
SEE ALSO
monitor(8), boot(8), part(8), mkfs(1), mount(8), M(8),
13
USAGE(8) Maintenance Procedures USAGE(8)
fstab(5), hier(7), console(4), dev(4), adduser(8), TZ(5),
mkdist(8), shutdown(8).
"Operating Systems - Design and Implementation 2/e" by
Andrew S. Tanenbaum and Albert S. Woodhull.
NOTES
The notation <file.h> refers to a C language include file in
/usr/include.
Root and bin do not have the current directory in their pro-
gram search path to avoid executing programs left around by
malicious people. This means that to run foo from the
current directory, ./foo must be typed.
Some of the commands have changed since earlier MINIX ver-
sions. For instance mkfs doesn't need a size argument
anymore, and vol automagically determines if it needs to
read or write. Keep this in mind if you use an older MINIX
version to examine the newer system.
BUGS
There are many PS/2 models, all different. Some will run
MINIX, some won't, some crippled if you lie to MINIX by set-
ting processor to 86. Almost no PS/2 has a standard disk,
so setting hd to esdi or bios will be necessary.
While testing a full library rebuild of this distribution it
sometimes happened that some things were not put back into
the library. This seems to be fixed, but we do not under-
stand why the fix fixed the problem. So if you see strange
"undefined" errors when compiling a program after a library
rebuild then run make install again in /usr/src/lib/ to try
and add the missing pieces.
Except for the floppy driver, none of the DMA based drivers
know about DMA being limited to a 24 bits address, i.e. the
first 16 MB. So under MINIX-386 you run a slight risk that
a tar or dd command may use a buffer above 16 MB for reading
or writing to a character device. This only happens if the
low 16 MB is taken by some huge processes, and you have more
than 16 MB, of course.
AUTHOR
Kees J. Bot (kjb@cs.vu.nl)
14

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More