[tortoise@sea floppies]$ pwd
/home/tortoise/Downloads/NetBSD-1.3/i386/installation/floppies
[tortoise@sea floppies]$ bximage
========================================================================
bximage
Disk Image Creation Tool for Bochs
$Id: bximage.c 11315 2012-08-05 18:13:38Z vruppert $
========================================================================
Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd] fd
Choose the size of floppy disk image to create, in megabytes.
Please type 0.16, 0.18, 0.32, 0.36, 0.72, 1.2, 1.44, 1.68, 1.72, or 2.88.
[1.44] -- 这里直接回车
I will create a floppy image with
cyl=80
heads=2
sectors per track=18
total sectors=2880
total bytes=1474560
What should I name the image?
[a.img] boot.img
Writing: [] Done.
I wrote 1474560 bytes to boot.img.
The following line should appear in your bochsrc:
floppya: image="boot.img", status=inserted
[tortoise@sea floppies]$ dd if=boot.fs of=boot.img
2880+0 records in
2880+0 records out
1474560 bytes (1.5 MB) copied, 0.0233093 s, 63.3 MB/s
[tortoise@sea floppies]$
光盘镜像文件包含的文件列表如下:
[iyunv@sea bin]# ls -l /mnt/cd
total 15550
-r-xr-xr-x. 1 root root 6722031 May 7 19:55 base.tgz
-r-xr-xr-x. 1 root root 4446591 May 7 19:57 comp.tgz
-r-xr-xr-x. 1 root root 51083 May 7 19:56 etc.tgz
-r-xr-xr-x. 1 root root 1074976 May 7 19:55 games.tgz
-r-xr-xr-x. 1 root root 349556 May 7 19:59 kern.tgz
-r-xr-xr-x. 1 root root 761644 May 7 19:56 man.tgz
-r-xr-xr-x. 1 root root 1711013 May 7 19:56 misc.tgz
-r-xr-xr-x. 1 root root 805086 May 7 19:57 text.tgz
[iyunv@sea bin]#
除了kern.tgz外,其他的每个文件都对应NetBSD-1.0/i386/binary下的一个目录,文件生成方式如下(以base.tgz文件为例,其他文件类似):
[tortoise@sea floppies]$ pwd
/home/tortoise/Downloads/NetBSD-1.0/i386/floppies
[tortoise@sea floppies]$ bximage
========================================================================
bximage
Disk Image Creation Tool for Bochs
$Id: bximage.c 11315 2012-08-05 18:13:38Z vruppert $
========================================================================
Do you want to create a floppy disk image or a hard disk image?
Please type hd or fd. [hd] fd
Choose the size of floppy disk image to create, in megabytes.
Please type 0.16, 0.18, 0.32, 0.36, 0.72, 1.2, 1.44, 1.68, 1.72, or 2.88.
[1.44] 1.2
I will create a floppy image with
cyl=80
heads=2
sectors per track=15
total sectors=2400
total bytes=1228800
What should I name the image?
[a.img]
Writing: [] Done.
I wrote 1228800 bytes to a.img.
The following line should appear in your bochsrc:
floppya: image="a.img", status=inserted
[tortoise@sea floppies]$ dd if=kcaha-10.fs of=a.img
2400+0 records in
2400+0 records out
1228800 bytes (1.2 MB) copied, 0.0181592 s, 67.7 MB/s
[tortoise@sea floppies]$ sudo mount -o loop -r a.img /mnt/floppy
[tortoise@sea floppies]$ ls -l /mnt/floppy/
total 659
drwxr-xr-x. 2 root root 512 Oct 24 1994 bin
-rwxr-xr-x. 1 root root 2005 Oct 24 1994 copy_kernel
drwxr-xr-x. 2 root root 2560 Oct 24 1994 dev
drwxr-xr-x. 2 root root 512 Oct 24 1994 mnt
-rwxr-xr-x. 1 root root 659600 Oct 24 1994 netbsd
drwxr-xr-x. 2 root root 512 Oct 24 1994 sbin
drwxr-xr-x. 3 root root 512 Oct 24 1994 usr
[tortoise@sea floppies]$ cp /mnt/floppy/netbsd ./
[tortoise@sea floppies]$ tar -cvf kern.tar ./netbsd
./netbsd
[tortoise@sea floppies]$ gzip kern.tar
[tortoise@sea floppies]$ mv kern.tar.gz kern.tgz
[tortoise@sea floppies]$ tar -tzvf kern.tgz
-rwxr-xr-x tortoise/tortoise 659600 2014-05-14 23:12 ./netbsd
[tortoise@sea floppies]$
8个tgz文件都创建好之后,放在同一个目录下生成iso镜像文件:
[tortoise@sea bin]$ ls -l
total 31468
-rw-rw-r--. 1 tortoise tortoise 6722031 May 7 19:55 base.tgz
-rw-rw-r--. 1 tortoise tortoise 4446591 May 7 19:57 comp.tgz
-rw-rw-r--. 1 tortoise tortoise 51083 May 7 19:56 etc.tgz
-rw-rw-r--. 1 tortoise tortoise 1074976 May 7 19:55 games.tgz
-rw-rw-r--. 1 tortoise tortoise 349556 May 7 19:59 kern.tgz
-rw-rw-r--. 1 tortoise tortoise 761644 May 7 19:56 man.tgz
-rw-rw-r--. 1 tortoise tortoise 1711013 May 7 19:56 misc.tgz
-rw-rw-r--. 1 tortoise tortoise 805086 May 7 19:57 text.tgz
[tortoise@sea bin]$ mkisofs -o NetBSD-1.0-bin.iso *.tgz
I: -input-charset not specified, using utf-8 (detected in locale settings)
62.91% done, estimate finish Wed May 14 23:19:53 2014
Total translation table size: 0
Total rockridge attributes bytes: 0
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
7952 extents written (15 MB)
[tortoise@sea bin]$
打包压缩成tgz文件格式,是为了符合NetBSD-1.3版本的安装文件格式要求。