Master Boot Record
This is the master boot record, loaded by the BIOS on powerup/reset/reboot.
This boot record is located in the first physical sector
of the disk drive (i.e. cylinder 0, head 0, sector 1).
This is a ZIP archive that contains the master boot record source code
and some batch files to construct the boot record.
This contents of this ZIP archive are:
This source file can be assembled, linked, extracted, and written to your hard
drive as real working boot code.
Click on the heading to view the source code.
- MBR.ASM - Master boot record source code (see below)
- MAKEFILE.BAT - Batch file to assemble/link/extract
- VERCODE.BAT - Batch file to verify the code
- MBRRAW.BAT - Batch file to extract and dasm the boot code using DEBUG
- MBRRAW.CMD - DEBUG commands used by MBRRAW.BAT
- MBROLD.TXT - Original info found on the net
This batch file assembles, links, and extracts the boot code.
MBR.ASM is assembled with MASM used version 5.10 into MBR.OBJ.
MBR.OBJ is linked with LINK version 5.31 into MBR.EXE.
MBR.EXE is processed by the BOOTEXE utility to extract the boot record into MBR.BIN.
This batch file verifies the new boot code with what's in the actual
boot record, or what's in a file. Customize to your preference.
Note that not all assemblers work the same -
some add slack bytes (nop's), other's don't.
This batch file uses DEBUG to disassemble the raw boot code.
The DEBUG commands are in the file MBRRAW.CMD.
The DEBUG output is then processed by the DBLFIX utility to clean it up.
This is some old disassebled boot code I found on the net. Comments
are sparse and sometimes inaccurate. It took the better part of a morning
to clean up the code, comment it, and make it usable. I really should
be spraying weeds...
Utility programs used by this archive are:
You can get more info on these utilities and others by following the above links.