Installing Freebsd With Other Oss
Installing Freebsd With Other Oss
6 August 1996
FreeBSD is a registered trademark of the FreeBSD Foundation.
IBM, AIX, EtherJet, Netfinity, OS/2, PowerPC, PS/2, S/390, and ThinkPad are trademarks of International
Business Machines Corporation in the United States, other countries, or both.
Linux is a registered trademark of Linus Torvalds.
Microsoft, IntelliMouse, MS-DOS, Outlook, Windows, Windows Media and Windows NT are either
registered trademarks or trademarks of Microsoft Corporation in the United States and/or other
countries.
PowerQuest and PartitionMagic are registered trademarks of PowerQuest Corporation in the United
States and/or other countries.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this document, and the FreeBSD Project was
aware of the trademark claim, the designations have been followed by the or the symbol.
This document discusses how to make FreeBSD coexist nicely with other popular operating systems such
as Linux, MS-DOS, OS/2, and Windows 95. Special thanks to: Annelise Anderson
<[email protected]>, Randall Hopper <[email protected]>, and Jordan K. Hubbard
<[email protected]>.
Table of Contents
1 Overview .....................................................................................................................................................................1
2 Overview of Boot Managers......................................................................................................................................2
3 A Typical Installation ................................................................................................................................................2
4 Special Considerations ..............................................................................................................................................4
5 Examples.....................................................................................................................................................................4
6 Other Sources of Help ...............................................................................................................................................5
7 Technical Details ........................................................................................................................................................5
1
Installing and Using FreeBSD With Other Operating Systems
1 Overview
Most people can not fit these operating systems together comfortably without having a larger hard disk, so special
information on large EIDE drives is included. Because there are so many combinations of possible operating systems
and hard disk configurations, the Section 5 section may be of the most use to you. It contains descriptions of specific
working computer setups that use multiple operating systems.
This document assumes that you have already made room on your hard disk for an additional operating system. Any
time you repartition your hard drive, you run the risk of destroying the data on the original partitions. However, if
your hard drive is completely occupied by DOS, you might find the FIPS utility (included on the FreeBSD CDROM
in the \TOOLS directory or via ftp (ftp://ftp.FreeBSD.org/pub/FreeBSD/tools/)) useful. It lets you repartition your
hard disk without destroying the data already on it. There is also a commercial program available called
PartitionMagic, which lets you size and delete partitions without consequence.
Boot Easy
This is the default boot manager used with FreeBSD. It has the ability to boot most anything, including BSD,
OS/2 (HPFS), Windows 95 (FAT and FAT32), and Linux. Partitions are selected with the function keys.
OS-BS
This is an alternative to Boot Easy. It gives you more control over the booting process, with the ability to set the
default partition to boot and the booting timeout. The beta version of this programs allows you to boot by
selecting the OS with your arrow keys. It is included on the FreeBSD CD in the \TOOLS directory, and via ftp
(ftp://ftp.FreeBSD.org/pub/FreeBSD/tools/).
About FAT32: FAT32 is the replacement to the FAT filesystem included in Microsofts OEM SR2 Beta release,
which started replacing FAT on computers pre-loaded with Windows 95 towards the end of 1996. It converts the
normal FAT filesystem and allows you to use smaller cluster sizes for larger hard drives. FAT32 also modifies the
traditional FAT boot sector and allocation table, making it incompatible with some boot managers.
2
Installing and Using FreeBSD With Other Operating Systems
3 A Typical Installation
Lets say I have two large EIDE hard drives, and I want to install FreeBSD, Linux, and Windows 95 on them.
Here is how I might do it using these hard disks:
1. I boot from a MS-DOS or Windows 95 boot disk that contains the FDISK.EXE utility and make a small 50 MB
primary partition (35-40 for Windows 95, plus a little breathing room) on the first disk. Also create a larger
partition on the second hard disk for my Windows applications and data.
2. I reboot and install Windows 95 (easier said than done) on the C: partition.
3. The next thing I do is install Linux. I am not sure about all the distributions of Linux, but Slackware
(http://www.slackware.com) includes LILO (see Section 2). When I am partitioning out my hard disk with Linux
fdisk, I would put all of Linux on the first drive (maybe 300 MB for a nice root partition and some swap space).
4. After I install Linux, and are prompted about installing LILO, make sure that I install it on the boot sector of my
root Linux partition, not in the MBR (master boot record).
5. The remaining hard disk space can go to FreeBSD. I also make sure that my FreeBSD root slice does not go
beyond the 1024th cylinder. (The 1024th cylinder is 528 MB into the disk with our hypothetical 720 MB disks).
I will use the rest of the hard drive (about 270 MB) for the /usr and / slices if I wish. The rest of the second
hard disk (size depends on the amount of my Windows application/data partition that I created in step 1) can go
to the /usr/src slice and swap space.
6. When viewed with the Windows 95 fdisk utility, my hard drives should now look something like this:
---------------------------------------------------------------------
---------------------------------------------------------------------
3
Installing and Using FreeBSD With Other Operating Systems
---------------------------------------------------------------------
** May say FAT16 or FAT32 if you are using the OEM SR2 update. See Section 2.
7. Install FreeBSD. I make sure to boot with my first hard disk set at NORMAL in the BIOS. If it is not, I will
have the enter my true disk geometry at boot time (to get this, boot Windows 95 and consult Microsoft
Diagnostics (MSD.EXE), or check your BIOS) with the parameter hd0=1416,16,63 where 1416 is the number
of cylinders on my hard disk, 16 is the number of heads per track, and 63 is the number of sectors per track on
the drive.
8. When partitioning out the hard disk, I make sure to install Boot Easy on the first disk. I do not worry about the
second disk, nothing is booting off of it.
9. When I reboot, Boot Easy should recognize my three bootable partitions as DOS (Windows 95), Linux, and
BSD (FreeBSD).
4 Special Considerations
Most operating systems are very picky about where and how they are placed on the hard disk. Windows 95 and DOS
need to be on the first primary partition on the first hard disk. OS/2 is the exception. It can be installed on the first or
second disk in a primary or extended partition. If you are not sure, keep the beginning of the bootable partitions
below the 1024th cylinder.
If you install Windows 95 on an existing BSD system, it will destroy the MBR, and you will have to reinstall your
previous boot manager. Boot Easy can be reinstalled by using the BOOTINST.EXE utility included in the \TOOLS
directory on the CDROM, and via ftp (ftp://ftp.FreeBSD.org/pub/FreeBSD/tools/). You can also re-start the
installation process and go to the partition editor. From there, mark the FreeBSD partition as bootable, select Boot
Manager, and then type W to (W)rite out the information to the MBR. You can now reboot, and Boot Easy should
then recognize Windows 95 as DOS.
Please keep in mind that OS/2 can read FAT and HPFS partitions, but not FFS (FreeBSD) or EXT2 (Linux)
partitions. Likewise, Windows 95 can only read and write to FAT and FAT32 (see Section 2) partitions. FreeBSD can
read most filesystems, but currently cannot read HPFS partitions. Linux can read HPFS partitions, but can not write
to them. Recent versions of the Linux kernel (2.x) can read and write to Windows 95 VFAT partitions (VFAT is what
gives Windows 95 long file names - it is pretty much the same as FAT). Linux can read and write to most filesystems.
Got that? I hope so.
5 Examples
(section needs work, please send your example to <[email protected]>).
FreeBSD + Windows 95: If you installed FreeBSD after Windows 95, you should see DOS on the Boot Easy menu.
This is Windows 95. If you installed Windows 95 after FreeBSD, read Section 4 above. As long as your hard disk
does not have 1024 cylinders you should not have a problem booting. If one of your partitions goes beyond the
1024th cylinder however, and you get messages like invalid system disk under DOS (Windows 95) and
FreeBSD will not boot, try looking for a setting in your BIOS called > 1024 cylinder support or
4
Installing and Using FreeBSD With Other Operating Systems
NORMAL/LBA mode. DOS may need LBA (Logical Block Addressing) in order to boot correctly. If the idea of
switching BIOS settings every time you boot up does not appeal to you, you can boot FreeBSD through DOS via the
FBSDBOOT.EXE utility on the CD (It should find your FreeBSD partition and boot it.)
FreeBSD + OS/2 + Windows 95: Nothing new here. The OS/2 boot manager can boot all of these operating systems,
so that should not be a problem.
FreeBSD + Linux: You can also use Boot Easy to boot both operating systems.
FreeBSD + Linux + Windows 95: (see Section 3)
7 Technical Details
(Contributed by Randall Hopper, <[email protected]>)
This section attempts to give you enough basic information about your hard disks and the disk booting process so
that you can troubleshoot most problems you might encounter when getting set up to boot several operating systems.
It starts in pretty basic terms, so you may want to skim down in this section until it begins to look unfamiliar and then
start reading.
5
Installing and Using FreeBSD With Other Operating Systems
For example, on my 1.6 Gig Western Digital AC31600 EIDE hard disk, that is:
ID (hex) Description
01 Primary DOS12 (12-bit FAT)
04 Primary DOS16 (16-bit FAT)
05 Extended DOS
06 Primary big DOS (> 32MB)
0A OS/2
83 Linux (EXT2FS)
6
Installing and Using FreeBSD With Other Operating Systems
ID (hex) Description
A5 FreeBSD, NetBSD, 386BSD (UFS)
Note that not all partitions are bootable (e.g. Extended DOS). Some aresome are not. What makes a partition
bootable is the configuration of the Partition Boot Sector that exists at the beginning of each partition.
When you configure your favorite boot manager, it looks up the entries in the MBR partition tables of all your hard
disks and lets you name the entries in that list. Then when you boot, the boot manager is invoked by special code in
the Master Boot Sector of the first probed hard disk on your system. It looks at the MBR partition table entry
corresponding to the partition choice you made, uses the Start Cylinder/Head/Sector information for that partition,
loads up the Partition Boot Sector for that partition, and gives it control. That Boot Sector for the partition itself
contains enough information to start loading the operating system on that partition.
One thing we just brushed past that is important to know. All of your hard disks have MBRs. However, the one that is
important is the one on the disk that is first probed by the BIOS. If you have only IDE hard disks, it is the first IDE
disk (e.g. primary disk on first controller). Similarly for SCSI only systems. If you have both IDE and SCSI hard
disks though, the IDE disk is typically probed first by the BIOS, so the first IDE disk is the first probed disk. The
boot manager you will install will be hooked into the MBR on this first probed hard disk that we have just described.
7.3.1 The dreaded 1024 cylinder limit and how BIOS LBA helps
The first part of the booting process is all done through the BIOS, (if that is a new term to you, the BIOS is a
software chip on your system motherboard which provides startup code for your computer). As such, this first part of
the process is subject to the limitations of the BIOS interface.
The BIOS interface used to read the hard disk during this period (INT 13H, Subfunction 2) allocates 10 bits to the
Cylinder Number, 8 bits to the Head Number, and 6 bits to the Sector Number. This restricts users of this interface
(i.e. boot managers hooked into your disks MBR as well as OS loaders hooked into the Boot Sectors) to the
following limits:
7
Installing and Using FreeBSD With Other Operating Systems
This is where BIOS LBA (Logical Block Addressing) comes in. BIOS LBA gives the user of the BIOS API calls
access to physical cylinders above 1024 though the BIOS interfaces by redefining a cylinder. That is, it remaps your
cylinders and heads, making it appear through the BIOS as though the disk has fewer cylinders and more heads than
it actually does. In other words, it takes advantage of the fact that hard disks have relatively few heads and lots of
cylinders by shifting the balance between number of cylinders and number of heads so that both numbers lie below
the above-mentioned limits (1024 cylinders, 256 heads).
With BIOS LBA, the hard disk size limitation is virtually removed (well, pushed up to 8 Gigabytes anyway). If you
have an LBA BIOS, you can put FreeBSD or any OS anywhere you want and not hit the 1024 cylinder limit.
To use my 1.6 Gig Western Digital as an example again, its physical geometry is:
giving the same effective size disk, but with cylinder and head counts within the BIOS APIs range (Incidentally, I
have both Linux and FreeBSD existing on one of my hard disks above the 1024th physical cylinder, and both
operating systems boot fine, thanks to BIOS LBA).
8
Installing and Using FreeBSD With Other Operating Systems
OS-BS 1.35
Boot Easy
LILO
These boot managers use a few additional sectors after the Master Boot Sector:
to put the original, simple DOS boot code back into the system. You can then boot DOS (and DOS only) off the hard
drive. Alternatively, just re-run your boot manager installation program off a bootable floppy.