简体   繁体   English

从使用GRUB / NASM / C构建的内核生成iso

[英]Generating an iso from Kernel built with GRUB/NASM/C

I was following along with this series of articles , and on the last page, he linked an iso image of the kernel that he produced. 我跟随这一系列文章 ,在最后一页,他链接了他生成的内核的iso图像。 He doesn't mention this in the series, so that's my question... how do I generate an iso image from my kernel executable? 他在系列中没有提到这个,所以这是我的问题......如何从我的内核可执行文件中生成iso映像?

There are two approaches I generally use. 我通常使用两种方法。 The first is mkisofs , below is what I ripped out from a Makefile I use: 第一个是mkisofs ,下面是我从我使用的Makefile中删除的内容:

 mkisofs -quiet -R -b boot/grub/eltorito.img       \
         -no-emul-boot -boot-load-size 4           \
         -boot-info-table -o my_iso.iso iso_folder

You will need the El Torito image. 你需要El Torito图像。 You can find more information on this approach here . 您可以在此处找到有关此方法的更多信息。

The second approach (and the one I prefer) is to use grub-mkrescue : 第二种方法(也是我更喜欢的方法)是使用grub-mkrescue

grub-mkrescue -o bootable.iso iso

For this to work iso/boot/grub/grub.cfg will need to be a valid grub configuration file. 为此, iso/boot/grub/grub.cfg需要是一个有效的grub配置文件。 I prefer this approach because you can dd the result to a USB and boot. 我喜欢这种方法,因为你可以dd结果到USB和引导。 The first approach is using the El Torito which is only for bootable optical media (eg CDs, DVDs) so you can's easily create a bootable USB with the first iso. 第一种方法是使用El Torito,它仅用于可启动光学媒体(例如CD,DVD),因此您可以使用第一个iso轻松创建可启动USB。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM