Han Boetes wrote:
> Could you be so kind as to provide us with a unified patch? You
> can make one with: cvs diff -u

Please find attached the diff you requested.

Best regards,

Giuseppe
? diff
? mbr
Index: mbr.S
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/mbr/mbr.S,v
retrieving revision 1.21
diff -u -r1.21 mbr.S
--- mbr.S       25 Jun 2007 14:10:17 -0000      1.21
+++ mbr.S       20 Feb 2010 15:40:04 -0000
@@ -35,6 +35,13 @@
  * with the other copyrights as long as you retain my pseudonym and
  * this copyright notice in the file.
  */
+/* Copyright (c) 2010 Giuseppe Magnotta <[email protected]>
+ * last edited 20 Feb 2010
+ * Added the check for a single bootable partition.
+ * You may use this code or fragments thereof in a manner consistent
+ * with the other copyrights as long as you retain my pseudonym and
+ * this copyright notice in the file.
+ */
 
        .file   "mbr.S"
 
@@ -224,12 +231,26 @@
 
 drive_ok:
        /* Find the first active partition.
-        * Note: this should be the only active partition.  We currently
-        * don't check for that.
+        * Note: this should be the only active partition. We check for that.
         */
        movw    $pt, %si
 
        movw    $NDOSPART, %cx
+       xorw    %ax, %ax
+       xorw    %bx, %bx
+
+test_pt:
+       movb    (%si), %al
+       addw    %ax, %bx
+       addw    $PARTSZ, %si
+       loop    test_pt
+
+       cmpw    $DOSACTIVE, %bx
+       jne     no_part
+
+       movw    $pt, %si
+       movw    $NDOSPART, %cx
+
 find_active:
        DBGMSG(CHAR_L)
        movb    (%si), %al
@@ -533,7 +554,7 @@
 efdmbr:        .asciz          "MBR on floppy or old BIOS\r\n"
 eread: .asciz          "\r\nRead error\r\n"
 enoos: .asciz          "No O/S\r\n"
-enoboot: .ascii                "No active partition"   /* runs into crlf... */
+enoboot: .ascii                "Error selecting bootable partition" /* runs 
into crlf... */
 crlf:  .asciz          "\r\n"
 
 endofcode:

Reply via email to