gpt4 book ai didi

boot - xorriso : boot. 目录和-eltorito-目录不工作

转载 作者:行者123 更新时间:2023-12-04 04:15:46 32 4
gpt4 key购买 nike

我一直在尝试使用自定义 boot.catalog 文件用 xorriso 创建可引导 CD,以便 - 这是我的目标 - 指定我的 LBA引导扇区应放在。但是,xorriso 选项 -eltorito-catalog 似乎没有使用我的自定义 boot.catalog,而是创建了一个新目录,它是然后放入最终的 ISO 镜像中。

我的自定义 boot.catalog 看起来像这样(缩短了,其余部分被清除):

 $ xxd boot.catalog | head -n 8
00000000: 0100 0000 0000 0000 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 0000 0000 aa55 55aa .............UU.
00000020: 8800 0000 0000 0400 2000 0000 0000 0000 ........ .......
00000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
[...]

我的理解是0x00000028处的DWORD(2000 0000,LBA 32)用于将启动镜像放在指定的LBA在可引导 CD 介质中。我正在使用以下命令创建一个新的可引导 ISO 镜像:

 $ xorriso -as mkisofs -iso-level 3 -full-iso9660-filenames -eltorito-boot bootimg.bin -eltorito-catalog boot.catalog -no-emul-boot -boot-load-size 4 -boot-info-table -o test2.iso build

生成的 ISO 镜像如下所示:

 $ isoinfo -i test2.iso -l -s

Directory listing of /
d--------- 0 0 0 1 Mar 17 2020 [ 19 02] .
d--------- 0 0 0 1 Mar 17 2020 [ 19 02] ..
---------- 0 0 0 1 Mar 17 2020 [ 33 00] boot.catalog;1
---------- 0 0 0 1 Mar 17 2020 [ 34 00] bootimg.bin;1
---------- 0 0 0 1 Mar 17 2020 [ 35 00] bootstrap.bin;1

如您所见,bootimg.bin 引导镜像位于 LBA 34(而不是我的 boot.catalog 中所写的 32)。此外,从生成的 ISO 中提取并转储 boot.catalog 给我:

 $ xxd boot.catalog | head -n 8
00000000: 0100 0000 0000 0000 0000 0000 0000 0000 ................
00000010: 0000 0000 0000 0000 0000 0000 aa55 55aa .............UU.
00000020: 8800 0000 0000 0400 2200 0000 0000 0000 ........".......
00000030: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000040: 0000 0000 0000 0000 0000 0000 0000 0000 ................
00000050: 0000 0000 0000 0000 0000 0000 0000 0000 ................
[...]

我的问题是,根据我的理解:为什么启动镜像位于不同的扇区(为什么我的 boot.catalog 被替换为一个新的、不同的扇区)?

如果我对 -eltorito-catalog 选项的理解是错误的:有没有办法告诉 xorriso 在 ISO 镜像中从哪里开始写入文件?有没有办法告诉 xorriso 将文件放在 CD 中的什么位置?

最佳答案

似乎 xorriso 实际上提供了一个选项,它通过将附加信息(如加载引导镜像的扇区)放入可以从汇编代码访问的结构中来修改引导镜像。选项 -boot-info-table 在偏移 8 处放置一个结构,如下所示:

DWORD boot_image_pvd
DWORD boot_image_lba
DWORD boot_image_len
DWORD boot_image_checksum

整个结构写在启动镜像中的字节 863 之间。

  • boot_image_pvd 是主卷描述符的 block
  • boot_image_lba 是从中加载引导镜像的前 2 KB 的 block
  • boot_image_len是整个启动镜像的长度(以字节为单位)

更多信息 here .

关于boot - xorriso : boot. 目录和-eltorito-目录不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60731231/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com