INT BIOS

Fermé
Thierry - 9 déc. 2003 à 07:56
 Thierry - 9 déc. 2003 à 10:52
Bonjour,

J'aimerai savoir si il existe une Interruption BIOS dédiée aux opérations sur CD ROM ?

Merci d'avance.
A voir également:

1 réponse

sebsauvage Messages postés 32893 Date d'inscription mercredi 29 août 2001 Statut Modérateur Dernière intervention 21 octobre 2019 15 655
9 déc. 2003 à 09:42
L'interruption 21 permet de lire les fichiers, comme pour un disque normal.

Après, je ne me souviens plus...

Tu pourra peut-être trouver ça là:
http://www.gstation.ru/dochard.htm
0
Bonjour,

OK,

Mais je souhaite lire le cd rom secteur par secteur (cf Interrupt 13h) ...
Exemple :
#include <dos.h> /* for int86x(), macros FP_SEG() and
FP_OFF(), segread(), union REGS
and struct SREGS */
#include <stdio.h> /* for printf() */
#include <stdlib.h> /* for _doserrno */

char buf [1024];

main()
{
char far * bufptr;
union REGS inregs, outregs;
struct SREGS segregs;
segread(&segregs); /* set the segment registers */
bufptr = (char far *) buf; /* need a far pointer to 'buf' */
segregs.es = FP_SEG(bufptr); /* ...to set the address of */
inregs.x.bx = FP_OFF(bufptr);/* ...'buf' for the BIOS */


inregs.h.ah = 2; /* set the BIOS function number*/
inregs.h.al = 1; /* set # of sectors to read */
inregs.h.ch = 0; /* set track # of boot sector */
inregs.h.cl = 0; /* set sector # of boot sector */
inregs.h.dh = 0; /* set disk side number */
inregs.h.dl = 0; /* set drive number to A: */
int86x(0x13, &inregs, &outregs, &segregs); /* read sector */

if (outregs.x.cflag)
printf("Lecture disque -ERROR #%d: status = %d, # sectors read = %d\n",
_doserrno, outregs.h.ah, outregs.h.al);


}
Sur lecteur disquette, ça marche nickel, mais HDD et autres cd rom ....

@+
0