From 148789847390df6b350e2ce5f3f06b4f73c2d9a8 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Tue, 2 Mar 2010 01:28:49 +0000 Subject: [PATCH] * 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. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35718 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/writembr/mbr.S | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/writembr/mbr.S b/src/bin/writembr/mbr.S index 907669e26a..163c2e573c 100644 --- a/src/bin/writembr/mbr.S +++ b/src/bin/writembr/mbr.S @@ -37,7 +37,7 @@ start: cld // String ops inc /* * 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 @@ main.5: movw %sp, %di // Save stack pointer 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 @@ main.5: movw %sp, %di // Save stack pointer 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 @@ main.8: int $0x13 // Call the BIOS 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 @@ err_missing_os: 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