linux下img编辑器,linux下用bin文件制作img

本文介绍了如何在Linux环境下使用bximage创建软盘映像文件,并通过dd命令将boot.bin文件写入该映像,以用于操作系统的引导。首先,通过bximage工具创建一个1.44MB的floppy disk image,命名为boot.img。然后,使用dd命令将boot.bin的内容写入boot.img,完成文件的写入操作。
摘要由CSDN通过智能技术生成

来自 《自己动手编写操作系统》

"我们得到了一个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/秒

至此,已经制作好了

完结.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值