Teach you to make FreeBSD systems that you can carry with you.

Source: Internet
Author: User
Tags file system mkdir

Objective

We may have seen many Linux operating on floppy disk, can run on floppy disk FreeBSD instead of less, although there are PICOBSD, however, many times Picobsd does not meet our needs, then can we make a floppy disk run on the FreeBSD system? The answer is yes. I am maintaining a floppy firewall project, which is a firewall system based on FreeBSD and IPFilter running on floppy disks, and many netizens are using floppy After firewall email to ask how to make FreeBSD run on a small floppy disk. But because the previous period of time things too much has been no time, and finally found time today, so the production of the FreeBSD on the floppy disk in the process of writing to share with you, due to the haste of time, the article will inevitably have the wrong place, but also please advise.

1. Introduction to FreeBSD start-up process

After the BIOS is read into the MBR, the program in the MBR reads the bootstrapper in the hard disk FreeBSD Slice (FreeBSD partition), the bootstrapper loads/boot/loader by default, and loader loads/kernel. Kernel began to detect some hardware and do some initialization. After the initialization is complete, kernel will mount root device, and then start the system initialization process/sbin/init,init will initialize according to the settings in/ETC/RC.

As you can see, the part we need to address is: Bootstrapper->/boot/loader->/kernel->/sbin/init-> After understanding the startup process and the problem, We can start making the FreeBSD on the floppy disk.

2. Initialize floppy disk

The first thing to do is to initialize the floppy disk, including setting up Disklabel and creating the file system (formatted in a UFS format).

bsd# disklabel -r -w fd0a fd1440

The next step is to install the bootstrapper.

bsd# disklabel -B fd0a

Now the floppy disk has been able to boot, but because we want to place the program on it, we want to create the file system.

bsd# newfs fd0a

The bootstrapper has just been done, because the bootstrapper will load the/boot/loader, so we also need to copy the/boot/loader from the system to the floppy disk.

bsd# MKDIR/FD

bsd# mount /dev/fd0a /fd
bsd# mkdir /fd/boot
bsd# cp /boot/loader /fd/boot/loader

According to the FreeBSD boot process, now that we are ready for the bootstrapper and loader, we have to prepare the kernel.

3. Custom kernel

Floppy disk space is limited, so we need to customize a small kernel, not directly using the system's original kernel. Since we only use floppy disks, the kernel's SCSI, ATA, ATAPI, and RAID items should be removed because we don't need IPv6 so INET6 should also be deleted, what's left to see their own use, there is no standard. But there are a few things that are necessary:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.