[haiku-commits] r35718 - haiku/trunk/src/bin/writembr

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 2 Mar 2010 02:28:49 +0100 (CET)

Author: mmlr
Date: 2010-03-02 02:28:49 +0100 (Tue, 02 Mar 2010)
New Revision: 35718
Changeset: http://dev.haiku-os.org/changeset/35718/haiku

Modified:
   haiku/trunk/src/bin/writembr/mbr.S
Log:
* The MBR boot code did execute the check for disk extensions with the wrong
  magic code. This would lead to them not being detected on systems where the
  BIOS (rightfully) returns an error in this case. Since the CHS fallback can't
  work it would then fail with "Missing Operating System".
* Fixed a typo, an 80 char limit violation.
* Automatic whitespace cleanup.


Modified: haiku/trunk/src/bin/writembr/mbr.S
===================================================================
--- haiku/trunk/src/bin/writembr/mbr.S  2010-03-02 01:22:11 UTC (rev 35717)
+++ haiku/trunk/src/bin/writembr/mbr.S  2010-03-02 01:28:49 UTC (rev 35718)
@@ -37,7 +37,7 @@
 /*
  * Relocate ourself to a lower address so that we are out of the way when
  * we load in the bootstrap from the partition to boot.
- */ 
+ */
                movw $main-EXEC+LOAD, %si               // Source
                movw $main, %di                                 // Destination
                movw $0x200-(main-start), %cx   // Byte count
@@ -94,7 +94,7 @@
                jnz main.7                                              // No.
                pushw %cx                                               // Save 
%cx
                pushw %bx                                               // Save 
%bx
-               movw $MAGIC, %bx                                // Magic
+               movw $0x55aa, %bx                               // Reversed 
Magic
                movb $0x41, %ah                                 // BIOS:        
EDD extensions present?
                int $0x13                                               //
                jc main.6                                               // No.
@@ -109,7 +109,7 @@
                pushw %bx                                               //  the 
transfer buffer
                pushw $0x1                                              // Read 
1 sector
                pushw $0x10                                             // 
Packet length
-               movw %sp, %si                                   // Packer 
pointer
+               movw %sp, %si                                   // Packet 
pointer
                movw $0x4200, %ax                               // BIOS:        
LBA Read from disk
                jmp main.8                                              // Skip 
the CHS setup
 main.6:        popw %bx                                                // 
Restore %bx
@@ -119,8 +119,8 @@
                movw %di,%sp                                    // Restore stack
                jc err_loading_os                               // If error
 /*
- * Now that we've loaded the bootstrap, check for the magic 0xaa55 signature.  
If it
- * is present, execute the bootstrap we just loaded.
+ * Now that we've loaded the bootstrap, check for the magic 0xaa55 signature.
+ * If it is present, execute the bootstrap we just loaded.
  */
                cmpw $MAGIC, 0x1fe(%bx)                 // Bootable?
                jne err_missing_os                              // No
@@ -141,7 +141,7 @@
                jmp putString                                   //
 /*
  * Output an ASCIZ string to the console via the BIOS.
- */ 
+ */
 putString.0:
                movw $0x7, %bx                                  // 
Page:attribute
                movb $0xe, %ah                                  // BIOS: 
Display character


Other related posts:

  • » [haiku-commits] r35718 - haiku/trunk/src/bin/writembr - mmlr