Why is the memory address of the master boot record 0x7c00?

Source: Internet
Author: User

Turn: Source

Http://www.ruanyifeng.com/blog/2015/09/0x7c00.html

The computer principles textbook says that the master boot record is stored in memory address 0x7c00 at startup.

This strange address, how to come, the textbook will not explain. I have always wondered, why not put in the memory of the head, tail, or other location, and just deposit this 1024 bytes smaller than 32KB place?

Yesterday, I read an article, finally solved the mystery.

First of all, if you don't know what the Master boot record (Master boot record, abbreviated as MBR) is, you can read first how does the computer start? 》。

Simply put, computer startup is such a process.

  1. Power
  2. Read the BIOS inside the ROM to check the hardware
  3. Hardware check through
  4. The BIOS checks the first sector of the boot device (that is, the master boot record) according to the specified order, loading the memory address 0x7c00
  5. Master boot Record give operation right to operating system

Therefore, the master boot Record is a small program that directs the "operating system" into memory, with a size of no more than 1 sectors (512 bytes).

0X7C00 This address comes from Intel's first-generation PC chip 8088, which is used by future CPUs to stay compliant.

IBM's first PC, IBM PC 5150, went public in August 1981, using the chip.

At that time, the operating system was 86-dos. The minimum memory required for this operating system is 32KB. We know that the memory address is numbered from 0x0000, and 32KB of memory is 0x0000~0x7FFF .

8088 the chip itself needs to be occupied to 0x0000~0x03FF save the various interrupt handlers stored in the location. (The master boot record itself is a handler for interrupt signal int 19h.) So, memory is only 0x0400~0x7FFF available for use.

to leave as much contiguous memory as possible to the operating system, the master boot record is placed at the tail end of the memory address. since a sector is 512 bytes, the master boot record itself produces data that requires an additional 512 bytes to be saved. So, its reserved position becomes:

   0x7FFF-512-512+1=0x7C00  

That's how 0x7c00 came.

After the computer starts, 32KB memory is used as follows.

 +--------------------- 0x0
|Interrupts vectors
+--------------------- 0x400
|BIOS Data area
+--------------------- 0x5??
|OS Load Area
+--------------------- 0x7c00
|Boot sector
+--------------------- 0x7e00
|Boot data/Stack
+--------------------- 0x7FFF
| (Not used)
+--------------------- (...)

Finish

Why is the memory address of the master boot record 0x7c00?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.