linux子进程映像的重新加载,linux – 使用自定义引导加载程序创建可引导的ISO映像...

我试图将我在汇编语言中编写的引导加载程序转换为ISO映像文件.以下是

MikeOS bootloader的代码.这是我的引导程序代码:

BITS 16

start:

mov ax, 07C0h ; Set up 4K stack space after this bootloader

add ax, 288 ; (4096 + 512) / 16 bytes per paragraph

mov ss, ax

mov sp, 4096

mov ax, 07C0h ; Set data segment to where we're loaded

mov ds, ax

mov si, text_string ; Put string position into SI

call print_string ; Call our string-printing routine

jmp $ ; Jump here - infinite loop!

text_string db 'This is my cool new OS!', 0

print_string: ; Routine: output string in SI to screen

mov ah, 0Eh ; int 10h 'print char' function

.repeat:

lodsb ; Get character from string

cmp al, 0

je .done ; If char is zero, end of string

int 10h ; Otherwise, print it

jmp .repeat

.done:

ret

times 510-($-$$) db 0 ; Pad remainder of boot sector with 0s

dw 0xAA55 ; The standard PC boot signature

我输入以下命令:

nasm -f bin -o boot.bin boot.asm

此命令工作正常,它提供.bin输出.接下来我输入以下命令:

dd if=boot.bin of=floppy.img count=1 bs=512

这也很好,并给了我.img输出文件.当我输入此命令时:

dd if=boot.bin of=floppy.img skip seek=1 count=1339

我收到以下错误:dd:无法识别的操作数’skip’.我在DD文档中读到skip属性必须分配一个编号.任何想法我应该使用skip属性键入什么数字(例如,skip = 1).

接下来我输入以下命令:

mkdosfs -C floppy.img 1440

我收到以下错误:mkdosfs:无法创建floppy.img.我如何解决我遇到的问题?还有另一种更简单的方法可以将我的bootloader .bin文件转换为ISO映像吗?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值