Browse Source

Change %dl fixup rules for INT13:

INT 13,08 : read number of drives from 40:75
INT 13,15 : do nothing
all others : restore original value of %dl
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
b90d321dfb
1 changed files with 16 additions and 11 deletions
  1. 16
    11
      src/arch/i386/interface/pcbios/int13.c

+ 16
- 11
src/arch/i386/interface/pcbios/int13.c View File

466
 			     /* Overwrite flags for iret */
466
 			     /* Overwrite flags for iret */
467
 			     "pushfw\n\t"
467
 			     "pushfw\n\t"
468
 			     "popw 6(%%bp)\n\t"
468
 			     "popw 6(%%bp)\n\t"
469
-			     /* Restore %dl (except for %ah=0x08 or 0x15) */
470
-			     "cmpb $0x08, -1(%%bp)\n\t"
471
-
472
-			     "jne 7f\n\t"
473
-			     "movb $2, %%dl\n\t"
474
-			     "jmp 2f\n\t"
475
-			     "\n7:\n\t"
476
-
477
-			     "je 2f\n\t"
469
+			     /* Fix up %dl:
470
+			      *
471
+			      * INT 13,15 : do nothing
472
+			      * INT 13,08 : load with number of drives
473
+			      * all others: restore original value
474
+			      */
478
 			     "cmpb $0x15, -1(%%bp)\n\t"
475
 			     "cmpb $0x15, -1(%%bp)\n\t"
479
 			     "je 2f\n\t"
476
 			     "je 2f\n\t"
480
 			     "movb -4(%%bp), %%dl\n\t"
477
 			     "movb -4(%%bp), %%dl\n\t"
481
-			     "\n2:\n\t"
478
+			     "cmpb $0x08, -1(%%bp)\n\t"
479
+			     "jne 2f\n\t"
480
+			     "pushw %%ds\n\t"
481
+			     "pushw %1\n\t"
482
+			     "popw %%ds\n\t"
483
+			     "movb %c2, %%dl\n\t"
484
+			     "popw %%ds\n\t"
482
 			     /* Return */
485
 			     /* Return */
486
+			     "\n2:\n\t"
483
 			     "movw %%bp, %%sp\n\t"
487
 			     "movw %%bp, %%sp\n\t"
484
 			     "popw %%bp\n\t"
488
 			     "popw %%bp\n\t"
485
-			     "iret\n\t" ) : : "i" ( int13 ) );
489
+			     "iret\n\t" )
490
+	       : : "i" ( int13 ), "i" ( BDA_SEG ), "i" ( BDA_NUM_DRIVES ) );
486
 
491
 
487
 	hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
492
 	hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
488
 			      &int13_vector );
493
 			      &int13_vector );

Loading…
Cancel
Save