如何制作可启动的iso(非CD或闪存驱动器)以测试您自己的启动加载程序? [英] How to make an bootable iso(not cd or flash drive) for testing your own boot loader?

查看:98
本文介绍了如何制作可启动的iso(非CD或闪存驱动器)以测试您自己的启动加载程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试写一个引导程序(你好,世界排序).我正在使用Bochs进行仿真(平台Linux-Ubuntu).但是我无法为我的二进制文件创建可启动的iso.尽管在教程中使用了VFD(虚拟软盘),但它是针对Windows平台的.这是我用于引导程序的代码(仅用于测试)

i am trying to write a boot loader(hello world sort). i am using Bochs for simulation (platform Linux-Ubuntu). But i am unable to make an bootable iso for my binary file. Though in tutorial VFD(virtual floppy disk) is used but it is for windows platform. Here is my code for bootloader ( just for testing)

;*********************************************
;    Boot1.asm
;        - A Simple Bootloader for testing if cd is booting or not
;
;    Operating Systems Development Tutorial
;*********************************************

[BITS 16]    ;tell the assembler that its a 16 bit code
[ORG 0x7C00]    ;Origin, tell the assembler that where the code will

Start:

    cli                    ; Clear all Interrupts
    hlt                    ; halt the system

times 510 - ($-$$) db 0                ; We have to be 512 bytes. Clear the rest of the bytes with 0

dw 0xAA55                    ; Boot Signature

我在Ubuntu上尝试了主ISO.它将二进制文件转换为ISO,但不转换为可启动的ISO. Bochs显示错误"cd is not eltorito",我在Google上搜索发现它是可启动ISO的标准配置.我还必须添加其他一些内容以使其可启动.我已经在最后添加了启动签名. 谁能建议一个可靠的应用程序在Ubuntu上制作可启动的ISO? 由于这个原因,我的工作被卡住了. 或者 我敢肯定,很多人必须参与Linux平台上的OS开发.你们如何测试?

i tried master ISO on Ubuntu. It is converting the binary file to ISO but not to bootable ISO. Bochs is showing error "cd is not eltorito" which i googled and found to be standard for bootable ISO.What additional things i have to add to it to make it bootable. i have already added boot signature in the end. Can anyone suggest a reliable application to make a bootable ISO on Ubuntu? My work is stuck due to this.... OR i am pretty sure a lot of people must be involved in OS development on Linux platform. How do you people test?

我用Bootloader程序的iso用Unetbootin制作了可启动的闪存驱动器. 切换到Virtual-box并扭曲了一点以从pendrive引导,但是仍然显示它是不可引导的. 我认为有人正确地说,您需要在OS开发中耐心等待.

I have made a bootable flash-drive with Unetbootin with the iso of my bootloader program. switched to Virtual-box and twisted a bit to boot from pendrive, but still its showing it to be non-bootable. I think someone said it correctly that u need a lot of patience in OS development.

:phe,终于我的引导程序运行了...
我使用虚拟软盘映像在虚拟"框中启动程序.如果有人在努力挣扎,请按以下步骤操作.
1.创建包含您的引导加载程序的boot.asm.
2.用nasm编译. nasm -f bin boot.asm -o boot.bin.
3. sudo mkfs.msdos -C/home/用户名/floppy.img 1440
4. sudo chown 用户名 ./floppy.img. 链接文本
5.用dd复制. dd if =./boot.bin of =./floppy.img.
6.运行VirtualBox并选择floppy.img作为新虚拟机中的启动设备.
PS:您还可以将floppy.img附加到设备"loop"上,然后将其作为真实的软盘安装.

:phew finally my bootloader program ran...
I used virtual floppy image to boot my program on Virtual box. Here are the steps in case somebody is struggling with it.
1.Create boot.asm which have your bootloader program.
2.Compile with nasm. nasm -f bin boot.asm -o boot.bin.
3.sudo mkfs.msdos -C /home/username/floppy.img 1440
4.sudo chown username ./floppy.img. link text
5.Copy with dd. dd if=./boot.bin of=./floppy.img.
6.Run VirtualBox and select floppy.img as booting device in your new virtual machine.
PS: you can also attach floppy.img to device "loop" and mount it just as a real floppy disk.

推荐答案

一个非常简单的脚本将在linux中执行以下操作:-

a very simple script will do this in linux as below :-

rm -f disk_images/myos.iso
mkisofs -quiet -V 'MYOS' -input-charset iso8859-1 -o disk_images/myos.iso -b myos.flp disk_images/ || exit

软盘驱动器的结构如下:-

The floppy drive is made as below :-

nasm -f bin -o boot.bin boot.asm
dd if=boot.bin of=floppy.img count=1 bs=512 //for the bootloader

dd if=boot.bin of=floppy.img skip seek=1 count=1339 //assuming a 1.44Mb floppy

然后您就拥有了文件系统

and then you have the file system

mkdosfs (or whatever system you want ) -C floppy.img 1440

如果您需要Windows的帮助,请告诉我:)

If you ned help for windows , let me know :)

这篇关于如何制作可启动的iso(非CD或闪存驱动器)以测试您自己的启动加载程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆