如何内核加载到利用大会CD-ROM的内存(NASM) [英] How to load kernel into memory from CD-ROM using Assembly (NASM)

查看:191
本文介绍了如何内核加载到利用大会CD-ROM的内存(NASM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个引导程序和内核为自己和两个引导程序和内核会在CD-R烧坏,并作为CD-肝功能。它不是一个Linux的CD-Live或其他什么东西,完全是我自己的引导程序和内核。我不想使用其他booloaders(即GRUB),所以请不要建议我使用它们。

I'm writing a bootstrap and kernel for myself and both bootstrap and kernel will be burn on a CD-R and will function as a CD-live. It is not a linux CD-Live or something else,is totally my own bootloader and kernel. I do not want to use other booloaders (i.e. GRUB) so please don't suggest me to use them.

下面是我的问题:
在我的引导程序ASM code,我想我的内核和内核入口加载到RAM中的从CD-ROM ​​(而不是从硬盘或软盘),并让我们假设,我们知道在哪里内核恰好位于在CD-ROM(扇区号)上。
据我知道我必须使用INT 0x13,AH = 02H将在到RAM读取硬盘扇区。
为了使用该中断服务,我必须设置寄存器的情侣,我将波纹管列出:
参数:
AH 02H
AL部门阅读次数
CX轨道+行业/见注
DH头
DL驱动器
ES:BX缓冲区地址指针

Here is my question: In my bootloader ASM code, I want to load my kernel and kernel entry into the RAM from CD-ROM (not from hard disk or floppy disk), and lets assume that we know where the kernel located exactly on the CD-ROM (sector number). As far as I know I have to use int 0x13, AH = 02h which will read sectors from Drive in to the RAM. In order to use this interrupt service,I have to set couple of registers that I'll list bellow: Parameters: AH 02h AL Sectors To Read Count CX Track + Sector / See remark DH Head DL Drive ES:BX Buffer Address Pointer

我的问题是关于DL和DH.In以点带面1硬盘驱动器进行读取,就可以将其设置为80H,或者对于软盘,我们可以将其设置为00h。但我想从CD-ROM读取,我不知道是什么值我必须使用DH和DL。

My problem is about DL and DH.In order to point to 1st hard drive to read from, we can set it to 80h or, for floppy disk we can set it to 00h. But I want to read from CD-ROM and I don't know what values I have to use for DH and DL.

在为从CD-ROM读取夫妇行业的进入到RAM 它是一个正确的中断(INT 0x13)均禁用?如果是,我应该有什么样的价值将用于DH和DL。

In order to read from CD-ROM couple of sectors into to the RAM is it a right interrupt (int 0x13)? if yes, what value should I have to put for DH and DL.

问候,
Pooria。

Regards, Pooria.

推荐答案

有关在BIOS加载从光盘引导扇区,你需要使用的厄尔尼诺Torito的标准。

For the BIOS to load your boot sector from CD, you'll need to make the CD bootable by using the "El Torito" standard.

一旦你开始使用,你有两个选择结果
一个。仿真 - BIOS的模拟或者是软盘或硬盘驱动器,可以读取你的内核通过INT13,两种器件00或设备80结果调用
湾该设备不效仿,你可以从CD使用INT13 ExtendedRead功能直接读取。

Once you use that, you have two options
a. Emulation - the BIOS emulates either a floppy or hard drive, and you can read your kernel through the INT13 calls with either device 00 or device 80.
b. The device doesn't emulate, and you can read directly from the CD using the INT13 ExtendedRead function.

要看到这是如何实现的,看一下Linux的ISOLINUX装载机 - ISOLINUX.ASM

To see how this is done, look at the Linux "ISOLINUX" loader - ISOLINUX.ASM

要提供更具体的起点,你的问题,萨尔瓦多Torito的规范,5.3节:

To provide a more specific starting point to your question, El Torito spec,section 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.

这篇关于如何内核加载到利用大会CD-ROM的内存(NASM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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