الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

The Master Boot Record & Boot Sector

مغلق
بدأه The Falcon في 19 يناير 2006 · 9 رد · 2,299 مشاهدة · في لغة Assembly لأنظمة 16, 32, 64 بت
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

مرحبا جميعا,أنا عضو جديد و جاي اختبر كيف بستقبلو الأعضاء الجدد :D

{; if (you don't want me) don't answer ; else { try to answer ; than you

ما الفرق بين MBR و Boot Sector .

اقتباس
Master Boot Record : The first sector of the first hard disk.

Partiton Boot Sector :The first sector in the system (startup) partition of a computer’s bootable hard disk, or the first sector of a bootable floppy disk.

2 -

الـ Partition table وين موجود( ع الماستر بووت ولا ع البووت سكتور )

اقتباس
Partition Table : A table of information in the first sector of a computer’s hard disk that tells where each partition on the disk begins and ends ...

3 -

ماذا يحتوي "The First Sector" , ماهو DBR )DOS Boot Record) و أين موجود؟

4-

- حسب الاقتباس فوق - فهمت انو الماستر بووت و البارتيشن تيبل بس للهارد ديسك هل ذلك يعني انهما غير موجودان على القرص المرن.( يمكن كلام غير منطقي ومتناقض مع اللي بعده لذلك أطلب التوضيح )

5-

بعرف كمان انو البووت سكتور هو اللي بحدد اذا " القرص " اقلاعي او لا من خلال البايتين الأخيرين .طيب شو رأيكن بـ هالحكي

اقتباس
The Partition Table identifies whether the partition is bootable - whether it can be used to start the computer.

6-

اذا كان البارتيشن C له بووت سكتور و البارتيشن D له بووت سكتور (و الـ E و الـF و...) يعني ممكن نغير الاقلاع ليصبح من الـ D (مثلا) بدل السي ; كيف ؟

أخيرا اذا في حدا بيعمل معروف و بيحط وصلة لشي كتاب أو موقع بيتناول هيك مواضيع بكون ممنونهُ.

==============================

للمشرف العزيز Xacker :

مقالاتك و مواضيعك حلوة ومفيدة جدا و خاصة للمبتدئين أمثالي (قصدي على " مقدمة في الكيان الصلب /1-2-3/ "+"مقدمة في لغة التجميع" ) وبخصوص الجزء الثالث ممكن أعرف المرجع(وصلة ان امكن) - بالنسبة لـ" البناء التنظيمي للنظام DOS " + "عملية الإقلاع"

........(وبعتذر اذا كنت كتبت الطلب بغير مكانه)

#2

الـ boot sector هو اول 512 بايت من القرص الصلب والذي يحوي على معلومات متسلسلة حول تحميل نظام التشغيل للعمل عليه ونقل التحكم الى الدوز وهذه المعلومات تكون موجودة في جزء رئيسي فيه هو الـ MBR

الـ Partition table موجود على الـ MBR ويكون بطول 64 بايت..

بخصوص الاقلاع, لكل partition شئ اسمه flag هو الدليل على ان القرص هو الذي سيتم منه الاقلاع ام لا.. حاول استخدم برنامج تجزئة واعمل الـ C: والـ D: اقلاع ورح تروح فيها :) القرص الذي تم تنصيب النظام عليه اول مرة هو الذي يحوي الجزء الخاص بالاقلاع

راجع هذه المقالات: http://www.ata-atapi.com/hiwmbr.htm

http://www.compphix.com/dosboot.html

http://en.wikipedia.org/wiki/Category:Computer_file_systems

http://www.geocities.com/thestarman3/asm/m...R_in_detail.htm

واعتقد فيها اجابات اسئلتك حول السلسلة.

بالتوفيق

Do as I say, not as I do

We are Anonymous. We are Legion. We don't forgive. We don't forget

#4

بالاضافة الى المواقع التي تفضل بها الاخ xacker

احببت ان اضع هذه اللمحة التعريفية بين ايديكم وهي ماخوذة من احدى الـ manuals

A word about the MBR 
- introduction

The Master Boot Record (or MBR) is the very first sector of a harddisk. This very important sector contains a number of things that the Operating System and the computer BIOS need to start the system. If the contents of this sector are lost or damaged you can not access the data on the harddisk. Please note that each harddisk has a MBR, so if you have 2 or more harddisks in your computer, each has it's own MBR. If multiple disks are configured as an array there is usually 1 MBR that services the entire array, placed on the 1st disk in the array (there are exceptions to this rule, but that is beyond the scope of this manual). It should be clear that the MBR is one of the most important (and, strangely enough, overlooked)  sectors on your harddisk.
The following explanation is mainly about using the MBR with Windows or DOS based operating systems. The MBR is somewhat different when used with Unix based systems. I will come back to this later on.

- details

The smallest addressable space on a harddisk is 512 bytes at a time. A harddisk sector is 512 bytes long, so 1 sector is the smallest addressable space on a harddisk. The MBR is 1 sector, so the MBR is 512 bytes long. These 512 bytes are divided into several parts that each have their own function in getting the computer to start. The 4 main parts of the MBR are (in the order they appear in the MBR) :

the bootcode 
the volume bytes 
the partition table 
the signature bytes 
The bootcode : this part of the MBR gets read by the computer BIOS when the computer is started. When the computer finishes it's own startup procedures (getting the disks spinning, doing some checks) and gets ready to start the operating system, the bootcode in the MBR is read first. This allows the computer to interpret the rest of the MBR.

The volume bytes : these are 4 bytes that are located after the bootcode and just before the partition table. Windows 2000 and Windows XP use these 4 bytes to identify the mountable volumes on the harddisk. If these bytes are changed or erased from the MBR, Windows 2000/XP will go through a simple hardware detection round that will re-identify all the volumes on the disk. This is done during the next Windows startup after changing the volume bytes. Driveletters assigned to volumes might change after this. This goes for simple volumes, i have at this point no information on the effect of removing the volume bytes when using dynamic volumes.

The partition table : this is a sequence of 64 bytes (4 x 16) that identify the first 4 (or less) primary partitions on a harddisk. There is space for identifying 4 partitions. Each partition-identification is made up of 16 bytes that describe a number of things about the partition, such as : where it starts, what type it is, how big it is, is it an active partition or not, etc. One of these 4 partition descriptions can be used to describe an extended partition, which itself can then contain logical drives. The logical drives are not described in the MBR.
An active partition is the partition from which the Operating System is started. This must be a primary partition, and there can only be 1 primary partition active at any time.
If there are for instance only 2 partitions on a harddisk, the first 32 bytes of the partition table (2 x 16) would contain the descriptions of those partitions. The other 32 bytes would contain all zeros. So deleting a partition consists of putting zeros in the chosen partition description.

The signature bytes : these are 2 bytes that are used to signify an important sector. They can be found trailing the MBR, but there are other sectors that contain these bytes as well. If they are not trailing the MBR the computer will not be able to read the MBR (because it will not be recognised as an important sector).

So, the MBR consists of :

440 bytes of bootcode, followed by 
4 bytes with volume information, followed by 
2 bytes that are (as far as i know) not used, followed by 
64 bytes that contain the partition descriptions, followed by 
2 bytes that "close up" the MBR 
This makes a total of 512 bytes.

A word about Unix based Operating Systems :
The main difference between a Unix based MBR and a Windows based MBR is the bootcode. Unix based bootcode has the ability to look for partition information outside the MBR. So it should be clear that replacing Unix bootcode with Windows bootcode could render a system unstartable. MBRtool is not Unix bootcode aware, so be careful when playing with the bootcode. MBRtool only writes Windows based bootcode. However, all none bootcode-related actions (backups, editing partition tables, etc.) can be used for all platforms.

MBRtool is the only tool that let's you play with each part of the MBR, so be sure to understand that MBRtool is a very powerful piece of equipment.
#5

يعني عن جد غير شكل , بصراحة أذهلتني سرعة الرد و التفاعل مع الموضوع

شكرا اخواني ع اللنكات الشافية

بفهم انو الPartition table بالـ MBR و الMBR ع الBootSector يعني الMBR و BootSector مش قطاعين مختلفين متل ما كنت مفكر.. ( حلو الكلام ;) )

اقتباس
الـ boot sector هو اول 512 بايت من القرص الصلب
1- يعني مش أول 512 بايت من كل partition ( على فكرة .. بعرف انو في شي اسمو Boot Sector وفي Partiton Boot Sector , شو الفرق? )

2-الـ 512 بايت كيف بتتوزع ( يعني قديش حصة الMBR و الباقي حصة مين )

اقتباس
بخصوص الاقلاع, لكل partition شئ اسمه flag هو الدليل على ان القرص هو الذي سيتم منه الاقلاع ام لا..
ممكن توضح أكثر :rolleyes:

**************

بالنسبة للينكات :

اللينك 1 :

اقتباس
The MBR is the sector at cylinder 0, head 0, sector 1 of a hard disk

هل ترقيم القطاعات يبدأ من 0 ام من 1 ?! طيب ليش بالـ Debug نكتب مثلا L 0 0 0 1 لتحميل القطاع الأول( رقم 0) في القرص المرن إلى العنوان 0 في الذاكرة , ليش ما نكتب L 0 0 1 1 ?

اللينك 2 :

اقتباس
At the beginning of the boot drive the DOS boot record that loads the first program file of the OS

ما حدا جاوبنا ع سؤال الDBR..وين موجود و شو بيختلف عن ال MBR.

اللينك 3 :

جاري تحميل المقالات...

اللينك 4 :

"Sorry, this site GeoCities site is currently unavailable"

عم انتظر الرد..

شكرا أخي allko بالظاهر انو موضوعك دسم :) جاري القراءة و الفهم

( ياشي ياشي - تشوكوزال - ميرسي - ثانكس ) يعني شكرا... بلغات العالم

#6

1- اعتقد انهما مرادفين لمعنى واحد

فكما هو واضح من المشاركة رقم 4 فال boot sector هو اول 512 بايت من الهادسك ككل اي انه يوجد في اول بارتشن من هذا الهاردسك

2- اعتقد ان لديك سوء فهم...

انظر هنا :

So, the MBR consists of :

440 bytes of bootcode, followed by 
4 bytes with volume information, followed by 
2 bytes that are (as far as i know) not used, followed by 
64 bytes that contain the partition descriptions, followed by 
2 bytes that "close up" the MBR 
This makes a total of 512 bytes.

اللنك واحد : لا ادري

لكن اعتقد ان الترقيم يبدا من 0

اللنك اثنان : لا ادري ...لم اسمع عن ال DBR

#7

بخصوص ال DBR فالمعلومات عنها شحيحة

هذا ما وجدته ربما يفيدك

What is a Master Boot Record (MBR)? 
At the end of the ROM BIOS bootstrap routine (which occurs when your PC first boots up), the BIOS reads and executes the first physical sector of the first boot device (floppy, hard disk, or CD-ROM) on the system. This first sector is called the Master Boot Record (also known as the partition table, or master boot block). At the start of this sector is a small program. This program uses the partition information (or partition table) stored at the end of the sector to determine which partition is bootable (usually the first primary DOS partition), then attempts to boot from it. 

The values in the partition table (contained in the MBR) depend directly on the size of the physical disk and on the logical partitioning on that disk. The DOS Boot Record (DBR) holds the Boot Parameter Block (BPB), which contains the logical mapping information for that particular partition. The values in the Boot Parameter Block are absolutely dependent on the size of the partition and the type of file system. 

These two sectors contain the information necessary to locate and identify the file system used to access the data on the drive. If either of these are damaged, the data becomes inaccessible, even though there may be no damage to the data or the file system itself. You may be able to fix this by using the Recovery Console in Windows XP, your Emergency Repair Disk sets in Windows 2000 or NT, your Recovery Disks in Windows 95 or 98, some specialty utilities, or, in some cases, Recovery Disk sets built from a virus protection program, such as Symantec/Norton AntiVirus. 

The most commonly used utility for repairing problems with the MBR is the fixmbr command (XP and 2000) or the fdisk /mbr command (95, 98, Me, and NT).

تم تعديل هذه المشاركة بواسطة allko في 19 يناير 2006 في 22:21

#8

كما ذكر علي, الـ partition boot sector والـ boot sector هو شئ واحد في المعنى وليس بالمادة.. يعني, كلاهما سيكتور واحد (قطاع يتالف من 512 بايت), الـ partition boot sector هو سيكتور من قرص (مع التحفظ على الترجمة :P) الاقلاع

بخصوص الـ DBR في موضوع الـ geocities ستجد بعض المعلومات.. يجب ان تنتظر قليلا وتحاول الوصول للموضوع مرة اخرى.. البارحة كان يعمل بدون اي مشاكل, اما ان الضغط كبير وبالتالي يتم الحد من الوصول الى المواقع المجانية.. او ان الموقع تم نقله!!! (شوف على حظك شوف :))

Do as I say, not as I do

We are Anonymous. We are Legion. We don't forgive. We don't forget

#9

الأخ العزيز allko : شكرا ؛ أولا على تفاعلك مع الموضوع, ثانيا على " اللمحة " التعريفية اللي كانت متل البلسم ع الجرح...

1- بالنسبة للفرق بين الـBoot Sector و الـ Partition Boot Sector قدرت احصل على تعريفين , أضعهما للفائدة :

اقتباس
boot sector : The portion of a disk reserved for the bootstrap loader (the self-starting portion) of an operating system. The boot sector typically contains a short machine language program that loads the operating system.

Partition Boot Sector : The first sector in the system (startup) partition of a computer’s bootable hard disk, or the first sector of a bootable floppy disk. On an x86-based computer, the Partition Boot Sector is read into memory at startup by the Master Boot Record. It is the Partition Boot Sector that contains the instructions required to begin the process of loading and starting the computer’s operating system.

2- اذا انتبهت انا شو كتبت بالأخير

اقتباس
شكرا أخي allko بالظاهر انو موضوعك دسم  :)  جاري القراءة و الفهم
يعني الحمد لله ؛ لا في سوء فهم ولا في شي , كل ما في الأمر أنني كتبت الرد قبل ما أقرأ مشاركتك.. وبكل الأحوال بيضل في أسئلة بدا مناقشة :

الأخ Xacker كتب

اقتباس
الـ boot sector هو اول 512 بايت من القرص الصلب والذي يحوي على معلومات متسلسلة حول تحميل نظام التشغيل للعمل عليه ونقل التحكم الى الدوز وهذه المعلومات تكون موجودة في جزء رئيسي فيه هو الـ MBR
و انت كتبت انو ال MBR يشغل 512 بايت من القطاع هيك بيكون الـ Boot Sector كله عبارة عن الـ MBR فقط :wacko:

بالنسبة لـ DBR كل ما يهمني معرفته : مكانه , عمله .

3-

اقتباس
If there are for instance only 2 partitions on a harddisk, the first 32 bytes of the partition table (2 x 16) would contain the descriptions of those partitions
if there were more than 4 partitions on a harddisk ( is n't it allowed ?) SO what would happen ?

شكرا أخي Xacker و رح حاول ادخل ع الموقع -اذا لم ينقل - وبالنسبة للحظ ؛ ما في أحلا من حظي من يوم كسبت مشاركتك ومشاركة الأخ allko و إن شاء الله بقية الأعضاء يتكرموا علينا شوي ببعض معلوماتهم.

#10

وينكون شباب .... ردوا علينا ( بالعربي الفصيح .... عيل صبرنا )

أعتقد أن هذا الموضوع مهم بعض الشيء للمبتدئين :D Like Me

اقتباس
if there were more than 4 partitions on a harddisk ( is n't it allowed ?) SO what would happen

This is solved by Extended Partition principle. Partition Table considers whole Extended Partition as one Primary partition and lists it in the table!

So a Partition Table can have two possible entries:-

1. up to 4 Primary Partitions .

2. up to 3 Primary Partitions and 1 Extended Partition.(Total not exceeding 4)

اعود للسؤال :

اقتباس
- حسب الاقتباس فوق - فهمت انو الماستر بووت و البارتيشن تيبل بس للهارد ديسك هل ذلك يعني انهما غير موجودان على القرص المرن

هل هذا صحيح ... لماذا؟

اتمنى الرد على بقية الأسئلة :)

هذا الموضوع مغلق.

مواضيع مشابهة