代码之家  ›  专栏  ›  技术社区  ›  Pooria

如何使用汇编(NASM)将内核从CD-ROM加载到内存中

  •  4
  • Pooria  · 技术社区  · 16 年前

    我的问题是: 在我的引导加载程序ASM代码中,我想将我的内核和内核条目加载到RAM中 (不是从硬盘或软盘),并且假设我们知道内核在CD-ROM上的确切位置(扇区号)。 据我所知,我必须使用int 0x13,AH=02h,它将从驱动器输入读取扇区到RAM。 为了使用该中断服务,我必须设置下面列出的两个寄存器: 参数: 要读取计数的所有扇区 卫生署署长

    我的问题是关于DL和DH。为了指向要读取的第一个硬盘驱动器,我们可以将其设置为80h,对于软盘,我们可以将其设置为00h。但我想从CD-ROM中读取,我不知道DH和DL必须使用什么值。

    为了 从光盘读取 两个部门 进入公羊

    当做 普奥里亚。

    1 回复  |  直到 9 年前
        1
  •  9
  •   sarnold    13 年前

    "El Torito" 标准

    一旦你使用它,你有两个选择
    A.模拟-BIOS模拟软盘或硬盘驱动器,您可以使用设备00或设备80通过INT13调用读取内核。
    B设备不模拟,您可以使用INT13 ExtendedRead函数直接从CD读取。

    ISOLINUX.ASM

    要为您的问题提供更具体的起点,请参见《El Torito规范》,第5.3节:

    Once the system jumps to segment:0, the program can retrieve its boot
    information by issuing INT 13, Function 4B, AL=01.  After the boot process
    has been initiated the INT 13 Extensions (functions 41-48) will access the
    CD using 800 byte sectors and the LBA address provided to INT 13 is an
    absolute sector number. This gives any program running in no emulation mode
    the ability to locate the boot catalog, and any other information on the
    CD, without providing a device driver.