Open-source Master Boot Record's Bootstrap code
Posted: Sat Jul 07, 2007 3:06 am
I finished coding the bootstrap for my Hard Disk Drive's MBR and I thought of releasing it as an open-source bootstrap(Coded in NASM). Below are the details of this bootstrap code:
I am going to be using it for my own file system SSFS (Schematically Structured File System). Let me know what you guys think of this.
ATTN: To download the bootstrap code, scroll down the page for the newer version.
Code: Select all
; | SSFS 00.01 BootStrap 0.1's tasks: | ;
; | • Relocates the HDD's MBR into memory at 0x0000:0x0600. | ;
; | • Searches in the Partition Table of the HDD to find | ;
; | an active partition (Flag = 0x80). | ;
; | • If an active partition is not found, it will display a | ;
; | relevant error message. | ;
; | • If an active partition is found, it will check its | ;
; | Starting C/H/S value to see if it is valid. | ;
; | • If the Starting C/H/S value is valid, it will load the | ;
; | Boot Sector of that drive into memory at 0x0000:0x7C00 using | ;
; | INT 0x13 (Disk Operations). | ;
; | • If the Starting C/H/S value is not valid, it will | ;
; | use IDE ports to load the Boot Sector of that partition | ;
; | using its LBA28/32 address to the memory location at | ;
; | 0x0000:0x7C000. | ;
; | • After the Boot Sector of the active partition is loaded | ;
; | in 0x0000:0x7C00, it will check for the Boot Sector's | ;
; | Boot Signature (0xAA55). | ;
; | • If the Boot Signature of the active partition's Boot Sector | ;
; | is valid, it will jump to the Boot Sector and give the | ;
; | control to it. | ;
; | • If the Boot Signature of the active partition's Boot Sector | ;
; | is not valid, it will display an error message. | ;
; | | ;
; | | ;
; | SSFS 00.01 BootStrap 0.1's code details: | ;
; | • Compiled code's size in bytes = 446. | ;
; | • Used bytes = 340. | ;
; | • Free bytes filled with null = 106 (Free to program) | ;
; | • Instruction set used = x86. | ;
; | • Original code location = 0x0000:0x7C00. | ;
; | • Relocated code location = 0x0000:0x0600. | ;
; | • Loads the boot sector at = 0x0000:0x7C00. | ;
; | • Uses stack at = 0x0000:0xFFFF. | ;
; | • CS/DS/ES/FS at = 0x0000. | ;
ATTN: To download the bootstrap code, scroll down the page for the newer version.