BIOS是否将512字节的bootloader复制到0x7c00
Does the BIOS copy the 512-byte bootloader to 0x7c00
我正在写内核;在写这么复杂的东西之前,我认为对内核、引导加载程序、寄存器、BIOS 等进行一些理论阅读不仅会有所帮助,而且是必要的
This article 说(我引用):
The boot sector loader.
This loads the first 512-byte sector from the boot disk into RAM and jumps to it.
然后接着说:
The first sector of a diskette can be loaded at address 0000:7C00.
因此,引导扇区加载程序将驻留在内存地址 0x7C00(如果我没记错的话)的软盘数据的 512 字节加载到 RAM 中;现在,我的问题是:
- 由于机器正在启动,RAM 必须 是空的,所以引导加载程序加载到 RAM 的 0x0000?
- (与此上下文无关)是否有任何方法可以获取 GRUB Legacy (v .9x) 引导加载程序的源代码解释?
- 最后,我应该阅读任何 articles/books 以熟悉内核等内容吗?
我有 6 年的编程经验,但他们都是在内核使之成为可能的系统上使用高级语言。
感谢任何帮助。谢谢! :)
... the boot-sector loader loads the 512 bytes of the data of a diskette which resides at the memory address 0x7C00 (if I am right) into the RAM
...
Since the machine is booting up, the RAM has to be empty, so the bootloader it loaded at 0x0000 of the RAM?
没有。 0000:7C00
指的是 RAM 地址。 RAM的意思是“Random Access Memory”,意思是内存中的每个位置都可以直接访问。没有什么比“空 RAM”更好的了。也可以参考INT13中断函数"Read Sectors From Drive":其中一个参数(传入ES:BX
)需要指向要存放扇区内容的目的地址。因此,BIOS 所做的是从驱动器加载 512 字节并将其存储到 0000:7C00
到 0000:7DFF
,然后跳转到 0000:7C00
以执行主引导加载程序代码。
Any articles/books I should read to get myself familiar with Kernels, etc?
这个 Wiki 非常有用:http://wiki.osdev.org/Main_Page. For the boot process, look at http://wiki.osdev.org/Boot_Sequence。
Since the machine is booting up, the RAM has to be empty, so the
bootloader it loaded at 0x0000 of the RAM?
即使是启动,RAM也不会为空。因此它将无法使用 0x00000。因为在 O/S 执行 BIOS 之前也会在 RAM 中创建中断 table。 (这就是为什么您可以按 f2、f10 或删除等键并进入 BIOS 设置。如果没有中断处理程序,您将无法执行此操作。)。这就是 RAM 不为空的原因。
我正在写内核;在写这么复杂的东西之前,我认为对内核、引导加载程序、寄存器、BIOS 等进行一些理论阅读不仅会有所帮助,而且是必要的
This article 说(我引用):
The boot sector loader.
This loads the first 512-byte sector from the boot disk into RAM and jumps to it.
然后接着说:
The first sector of a diskette can be loaded at address 0000:7C00.
因此,引导扇区加载程序将驻留在内存地址 0x7C00(如果我没记错的话)的软盘数据的 512 字节加载到 RAM 中;现在,我的问题是:
- 由于机器正在启动,RAM 必须 是空的,所以引导加载程序加载到 RAM 的 0x0000?
- (与此上下文无关)是否有任何方法可以获取 GRUB Legacy (v .9x) 引导加载程序的源代码解释?
- 最后,我应该阅读任何 articles/books 以熟悉内核等内容吗?
我有 6 年的编程经验,但他们都是在内核使之成为可能的系统上使用高级语言。
感谢任何帮助。谢谢! :)
... the boot-sector loader loads the 512 bytes of the data of a diskette which resides at the memory address 0x7C00 (if I am right) into the RAM
...
Since the machine is booting up, the RAM has to be empty, so the bootloader it loaded at 0x0000 of the RAM?
没有。 0000:7C00
指的是 RAM 地址。 RAM的意思是“Random Access Memory”,意思是内存中的每个位置都可以直接访问。没有什么比“空 RAM”更好的了。也可以参考INT13中断函数"Read Sectors From Drive":其中一个参数(传入ES:BX
)需要指向要存放扇区内容的目的地址。因此,BIOS 所做的是从驱动器加载 512 字节并将其存储到 0000:7C00
到 0000:7DFF
,然后跳转到 0000:7C00
以执行主引导加载程序代码。
Any articles/books I should read to get myself familiar with Kernels, etc?
这个 Wiki 非常有用:http://wiki.osdev.org/Main_Page. For the boot process, look at http://wiki.osdev.org/Boot_Sequence。
Since the machine is booting up, the RAM has to be empty, so the bootloader it loaded at 0x0000 of the RAM?
即使是启动,RAM也不会为空。因此它将无法使用 0x00000。因为在 O/S 执行 BIOS 之前也会在 RAM 中创建中断 table。 (这就是为什么您可以按 f2、f10 或删除等键并进入 BIOS 设置。如果没有中断处理程序,您将无法执行此操作。)。这就是 RAM 不为空的原因。