来自 《自己动手编写操作系统》
"我们得到了一个512B的boot.bin,使用软盘绝对扇区读写工具将这个文件写到一张空白软盘的第一扇区。"
书上的环境是win,没有提及linux如何操作
方法如下:
1.用bximage来创建img文件(注意:红色的部分是我们需要输入的部分).
sike@sike-Founder-PC:~/file/os$ bximage
========================================================================
bximage
Disk Image Creation Tool for Bochs
$Id: bximage.c,v 1.34 2009/04/14 09:45:22 sshwarts Exp $
========================================================================
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.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
2.用dd命令
sike@sike-Founder-PC:~/file/os$ dd if=boot.bin of=boot.img bs=512 count=1 conv=notrunc
记录了1+0 的读入
记录了1+0 的写出
512字节(512 B)已复制,0.000920263 秒,556 kB/秒
至此,已经制作好了
完结.