Procházet zdrojové kódy

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 před 17 roky
rodič
revize
b90d321dfb
1 změnil soubory, kde provedl 16 přidání a 11 odebrání
  1. 16
    11
      src/arch/i386/interface/pcbios/int13.c

+ 16
- 11
src/arch/i386/interface/pcbios/int13.c Zobrazit soubor

@@ -466,23 +466,28 @@ static void hook_int13 ( void ) {
466 466
 			     /* Overwrite flags for iret */
467 467
 			     "pushfw\n\t"
468 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 475
 			     "cmpb $0x15, -1(%%bp)\n\t"
479 476
 			     "je 2f\n\t"
480 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 485
 			     /* Return */
486
+			     "\n2:\n\t"
483 487
 			     "movw %%bp, %%sp\n\t"
484 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 492
 	hook_bios_interrupt ( 0x13, ( unsigned int ) int13_wrapper,
488 493
 			      &int13_vector );

Načítá se…
Zrušit
Uložit