Solved

Master Boot Record

Posted on 2000-03-09
28
456 Views
Last Modified: 2013-12-29
1) What r the things stored in MBR?
2) Is Master Boot Record stored in the Harddisk or EPROM on motherbrd?
3) How the Processor know where/how to load the operating system?
0
Comment
Question by:recce
  • 6
  • 6
  • 5
  • +6
28 Comments
 
LVL 2

Expert Comment

by:vipat
ID: 2603103
1. It contains the whole partition table for that hard drive and master boot code for loading OS into your system.

2. It is stored in the FIRST sector of the drive (cylinder 0, head 0 sector 1).
The EPROM on your mainboard store only BIOS code.

3. The partition table also contains info where OS boot record (a.k.a. DOS boot sector) is. (Generic) Master boot code will load OS's boot record up and run it.
0
 
LVL 10

Expert Comment

by:trekie1
ID: 2603149
What r the things stored in MBR?
the master boot record contains these files, (command.com, Drivespace.bin, lo.sys, Msdos.sys, )
The master boot record is stored on the  sector 0 ,of the Hard disk...

How the Processor know where/how to load the operating system? your guess is as good as mine but heres a little something I copyed that might make sence to you....

Computer operations are performed in the CPU/processor, which contains the LOGIC CIRCUITS for arithmetic and logical operations and for control of the other units that make up a computing system. The CPU also contains the registers, a relatively small number of storage locations that can be accessed faster than main storage and are used to hold the intermediate results of calculations. The main storage is contained in the storage unit, or memory, of the computer. each of which contains thousands of SEMICONDUCTORS.  Random access memory (RAM), which both can be read from and written to,

hope this answers at least some of your question.....James
0
 
LVL 10

Expert Comment

by:trekie1
ID: 2603155
: vipat
didnt mean to say anything that you have said, your comment wasn't showing when i typed mine ( i type slowwwww )
0
 
LVL 2

Expert Comment

by:vipat
ID: 2603464
Hihi, what a pretty joke! How does MBR  keep all of those 3 files in it?
0
 
LVL 5

Expert Comment

by:johnsavior
ID: 2603802
Hi reece,

Q1 : What r the things stored in MBR?
A1 : MB contains information about your
     DISK like :
     - OEM name and version
     - bytes per sector
     - sector per cluster
     - reserved sector
     - number ofcopies FAT
     - maximum number of root dir entries
     - total number of sector in logical image
     - media descriptor type
     - number of sectors in FAT
     - number of sector per track
     - number of heads
     - number of hidden sector.

Q2 : Is Master Boot Record stored in the Harddisk or EPROM on motherbrd?
A2 : MBR stored in HARDDISK but not on
     EPROM or MotherBoard

Q3 : How the Processor know where/how to load the operating system?
A3 : CPU know to load the operating system caused it's controlled by ROM-BIOS

Thanks.
0
 
LVL 10

Expert Comment

by:trekie1
ID: 2604457
disregard my comment , dont think my brain was kicked in gear on this one..
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2605254
the bootsector is only 255 bytes long, you would have a good time trying t fit them all into it :)

The BIOS then sees if a byte is a $80 is present at a certain offset, on the floppy if then it can not see one, it will try the HD, then CD / Zip etc etc.. been a while since i di stuff like this, so it may not be 100% accurate, but hey you can look for yourself... once its found a bootsector....

The bootsector then is loaded at $7C00 (Off the top off my head) then, it goes into memory, you boot sector then contains fat and stuff etc etc but the most important part is setting up memory so that programs can be loaded, then Io.sys is loaded, in turn loads the rest as Trekie pointed out...

command.com, Drivespace.bin, lo.sys, Msdos.sys.... I have had a go with my own bootsector, way too hard (at the time) to understand for me....

ITs fun :)

But John has it covered, i as just adding additional info :)
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2605261
i think somone has spilt coffie on my keyboard, having to hit keys for them to work!


Craig C.
0
 
LVL 2

Expert Comment

by:vipat
ID: 2605282
reece, please reject his answer.

johnsavior, your answer is really wrong. Why?
- The vital logical DOS disk information you said are stored in DBR, not in MBR! FAT is native file system on DOS, not on the other OSs. (ex: Linux).
- BIOS knows where OS stored in disk from partition table, which is stored in MBR, right?

Don't you believe? try using some direct disk access utils such as Norton Utilities's DISKEDIT.EXE (It's old but it still worked) and checking out the 2 sectors.
0
 

Author Comment

by:recce
ID: 2606624
No one seem to know how the processor know how to load OS.
processor->BIOS->MBR->harddisk OS ?

Where is BIOS stored? EPROM?
0
 
LVL 1

Expert Comment

by:Awmytie
ID: 2606886
It's a complex process.  BIOS data is stored in EPROM and in CMOS equivalents.  The CPU, once it gets a signal that power is available, loads an "address" into one of the Registers, the location of WHERE the next instruction can be found -- somewhere in the BIOS -- which, in turn provides a "next address".  A whole cascade of these operations occur to verify that the machine is working, memory is available, where in memory to store certain functions, etc., etc.
0
 
LVL 24

Expert Comment

by:SunBow
ID: 2607026
I'll approach it with recollections as well, for your q: looks to be more on theory than precision programming.

1) What things are there?
a) signature (hex) for 'validity' of O/S used.
b) code. not much in that small space. This is just the first little bit to get the system going. Just enough to locate the real boot sectors and its (their) more elaborate bootup code. With some minimal error checking.
c) error text. Not much, perhaps something like "incorrect disk". No room for a lot here
d) the disk info including partition table. A list perhaps like johnsavior (I am not reviewing at moment). For your familiarity, it has the numbers you employ for setting up to four partition tables with fDisk, including all of its options like which partition is 'active', in that you want to boot up into that one with its O/S. It has the disk 'logical' geometry info here to help locate the next sectors to load and execute.

2) MBR is first sector of 1st HD. This is not called logical sector zero, for other programs get to access logical sectors. It is before that, and often called 'absolute' sector zero.

3) How does it know? It is bios. But mfr may vary. As I recall, a while back if I left a non-boot disk in drive a: , the machine would try to load its boot program(s) [no mbr] but the "invalid system" message came from the code in MBR.  The BIOS now has other options for order of bootup, sometimes offering disable of floppy boot or giving a boot from CD a higher priority - if found present.  When you tell BIOS which to goto, that is what makes it decide where to go. That information is maintained in 'volatile' memory, such that you will retain a h/w option to undo. It may be CMOS needing low power battery use like your time-of-day information.  But not the partitioning information. That remains on the HD where it will follow with your data if you move it to another machine. You won't lose that without a battery. It remains stored.
------------------------
>> Where is BIOS stored? EPROM?
It is stored in a big fat chip or two of non-valatile memory. It is only programs which never change, so it is 'usually' referred to as ROM.  Due to needs to maintain updates more frequently than our desire to physically remove and change chipsets, many BIOS are really less like ROM.  They have many using 'flashing' for example to provide a BIOS upgrade. [do that wrong and you may now need a new chipset]
--------------------------
>how the processor know how to load OS.
>processor->BIOS->MBR->harddisk OS ?

Yes, more like
processor->BIOS->harddisk OS

Processor knows RAM location to kick off bios. Bios knows to get only one sector of HD and run it. It has no clue on the content being MBR or whatever. That is to keep its loading up program similar to diskette (which has no MBR).

The harddisk recognizes it is MBR then loads up the boot-up programs beginning in the logical first sector (according to its table of HD information) which are really similar to the bootup programs on the diskette.

So MBR can in theory point to four different operating systems (user choices) residing in four different 'partitions'.  Your choice of which boot sector (O/S) should be enabled through products like fDisk.

Does that help any? Or confuse   :(
0
 
LVL 12

Expert Comment

by:Housenet
ID: 2607192
-Dude the BIOS is on an EPROM ...YES!
-Bois starts..loads extended info in RAM...Connects to BIOS listed startup device (Hard Disk)...Hard disk has boot files ....OS boots... If you need more than that the read a freaken book.
0
 
LVL 24

Expert Comment

by:SunBow
ID: 2607346
Answer is "Bois starts" ? what of "goils starts"?
Answer is that books are freaken? Which in mind?
What is "loads extended info in RAM" - from what book?
If you have heard of topic of
"Master Boot Record"
I fail to see how Proposal correlates MBR
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Expert Comment

by:vipat
ID: 2607453
I agreed with SunBow , too. How I can find where those info he refering are?

I'd proposed my 1st comment as an answer, which I think it is the best words to this question. :-I
0
 
LVL 23

Expert Comment

by:Tim Holman
ID: 2612877
>No one seem to know how the processor >know how to load OS.

Using NT as an example :

Intel boot sequence

·      POST
·      BIOS reads MBR from HDD, this contains NTLDR.  If a SCSI without its own BIOS is in use, a driver is loaded from NTBOOTDD.SYS file.
·      NTLDR -  switches processor to 32 bit flat model, starts minifile system & reads BOOT.INI
·      If DOS / Windows selected, a DOS boot sector is loaded from BOOTSEC.DOS, otherwise NT loads.
·      NTLDR calls NTDETECT.COM – tests & detects hardware, displays error messages if problems found and then passes control to NTOSKRNL.EXE
·      NTOSKRNL loads HAL.DLL to mask interrupts / exceptions from kernel
·      SYSTEM hive loaded into HKLM (WINNT\SYSTEM32\CONFIG\SYSTEM)
·      Kernel initialised, creates HARDWARE hive, SYSTEM drivers loaded.  DRIVERS.EXE from resource kit will say what’s loaded
·      Services loaded (eg AUTOCHK), SOFTWARE hive loaded, AUTO drivers loaded
·      Windows started, user logs on, LastKnownGood set.

RISC boot sequence

·      Looks for OSLOADER.EXE > NTKRNL > HAL > SYSTEM. Simpler, OSLOADER replaces NTLDR and NTDETECT.
·      Hardware config downloaded from non volatile RAM

Easy.
Damn... If only Housenet hadn't got there first, with his perfect A grade answer that's bound to be accepted in order for him to get the points...

:)
0
 
LVL 24

Expert Comment

by:SunBow
ID: 2613277
johnsavior, Now I revisit, your A1 does filing system info, such as also needed for diskettes.  I think you referring to Boot sector, also present on floppies, not the Partition Sector (MBR).

>> 1) What r the things stored in MBR?
Code, Signature, and THE table having the items of fDisk:

For Exactly Four Partitions, each has:

a) Where it Begins
b) Where it ends
c) How big it is
d) Whether Bootable (only one can be active)
e) Operating System using it (Dos, Unix etc.), for M$.O/S the code is usually associated with one of its types of FAT usage
f)  Locator for the Boot Program for that Partition

Note that all this is compressed into 16 bytes. This small area for counting, locating, and sizing underlies some of the problems associated with larger hard drives.

The code part has minimal checks on its own sector contents, for example: is there a partition that is to be booted. If there are none, it will provide brief error on screen.

vipat, I had agreed your 1st was likley better also, tho' it missed a few points it did cover bases more concisely than respondees such as I. Sometimes more words can confuse people, but i oft err on side or more is better. Still, I would have moved on had recce not continued with a "nobody knows"...
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2615557
recce, is this a homework question?.....
0
 

Author Comment

by:recce
ID: 2626047
Housenet, ur ans is too brief.
sorry.
Please tell me this:
1) How BIOS decide to load from driveA or driveC? The code use to ID this.

2) From the small 16 bytes (if I am not wrong), which sector, cylinder, etc, where can I find the no. of partitions, which drive to load, what type of FAT is used, etc?

Don't tell me to read from a freaken book!

I will increase pts for good ans.
From my record, I have always given either A grade or just reject ans.
0
 
LVL 2

Accepted Solution

by:
vipat earned 150 total points
ID: 2626392
0
 
LVL 24

Expert Comment

by:SunBow
ID: 2626542
recce, Sorry i did not notice your return.  I thought your interest lay more general. To ask for specific code would need refinement. It is also unlike how I originally read requests. If you have some interest in programatically retrieving the likes of the 16 bytes, and if the links vipat provide are insufficient, please state after viewing them. I'll try to get the time to visit them myself tomorrow. I am less literate on any new methods partitioners may embed beyond the original four. With these newer huge gigabyte drives, some things may be different.

If we missed it, the tradition was that the first sector went to the MBR, while the next logical sector (for boot) was not the next physical sector, but the first one in the next track, leaving a gap for some later potential use (?).
0
 
LVL 24

Expert Comment

by:SunBow
ID: 2629191
recce, I just checked vipat links, I think you have been dealt good justice there for about anything you want to do with MBR. Satisfied now?
0
 

Author Comment

by:recce
ID: 2635434
Adjusted points from 100 to 150
0
 

Author Comment

by:recce
ID: 2635435
vipat, thanks a lot
increase 50pts for u.
Thanks a lot to others who contributed
0
 

Author Comment

by:recce
ID: 2635439
vipat, please lock on
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2635503
Recce, simple accept his comment as an answer...... See it in light gree on the green bar?....
0
 

Author Comment

by:recce
ID: 2638212
thanks craig_capel.
0
 
LVL 2

Expert Comment

by:vipat
ID: 13588577
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now