English 中文(简体)
OS bootstraping process
原标题:

I try to understand os bootstraping process. Some questions are not clear to me. One of them is : How does bootstrap code in Volume boot record know about absolute LBA address of 0 sector of patition where Volume boot record resides?

问题回答

Within the VBR is a structure called a BIOS Parameter Block, named after the BIOS, the bottom-half of the traditional MS-DOS kernel structure. Within the BIOS Parameter Block is a field denoting the number of hidden sectors between the partition and the (MBR-style) partition table entry that encloses it. The VBR code simply reads that field out of itself and adds it to the Volume-relative Block Address to produce the LBA to read from the disc.

This is why it is impossible to boot operating systems such as Windows NT, MS/PC/DR-DOS, and OS/2 from secondary partitions directly, without assistance. In primary partitions, the BPB field is simply the start LBA of the start of the volume, because the partition table that it is relative to is the primary MBR in block #0 of the disc, and everything works. In secondary partitions, because of a quirk of MS-DOS version 3 that everyone has had to remain compatible with ever since, the BPB field is only the offset of the "logical drive" within the "extended partition" containing it, and the boot code doesn t work because it looks for the rest of the boot volume in completely the wrong place on the disc.

Boot managers provide assistance by fixing up the BPB on the fly. The VBR code of course reads the in-memory copy of itself, not the on-disc copy. So boot managers simply adjust the field of the BPB for secondary partitions to the correct absolute value, as they are loading the VBR into memory. Then everything works.





相关问题
Develop a Bootloader In Assembly

I ve already done a part of my OS in Assembly, but now I want to build a own bootloader for it too instead of using GRUB. When I was developing my test OS in Assembly I remember that I boot it like ...

Basic OS boot question

I have some kinda basic question to the boot process of a computer and the part where the bootloader calls the OS. So I know that the BIOS copies the first 512 bytes from a bootable drive into memory ...

Graphics on a bootloader

Managed to create a simple bootloader... and with VESA 2.0 I managed to change the resolution to 1024x768x32, also managed to setup a Linear Frame Buffer... Where can I find tutorials for using the ...

OS bootstraping process

I try to understand os bootstraping process. Some questions are not clear to me. One of them is : How does bootstrap code in Volume boot record know about absolute LBA address of 0 sector of patition ...

Sample Android BSP(Source) for ARM

I am looking for a ARM processor version of Android BSP to port it for one of my experimental boards. Where can I download this?

热门标签