Date: Fri, 25 Aug 2000 19:58:49 +0530 Message-Id: <200008251428.TAA03931@midpec.com> X-Authentication-Warning: midpec.com: tr set sender to tr AT eth DOT net using -f From: Prashant TR To: cropalat AT svn DOT com DOT br CC: djgpp AT delorie DOT com In-reply-to: (cropalat@svn.com.br) Subject: Re: Read a boot sector References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Use __dpmi_int rather than int86x. You can't load real-mode segment values into segment registers in protected mode. -- Prashant TR Web: http://www.midpec.com/ | From: "Ricardo Cropalato de Melo" | Date: Fri, 25 Aug 2000 09:12:51 -0300 | DJ-Gateway: from newsgroup comp.os.msdos.djgpp | | I write this single program to read a floppy boot sector. | | // Code | #include | #include | #include | | int main(void) | { | union REGS regs; | struct SREGS sregs; | unsigned char sector[512]; | | regs.h.ah =0x02; // read a sectors from a disk | regs.h.dl = 0x00; // drive number | regs.h.ch = k; // track 0 to 79 - max 80 | regs.h.cl = j; // sector 0 à 17 - max 18 | regs.h.dh = i; // head 0 e 1 - max 2 | regs.x.bx = (unsigned) sector; | sregs.es = _my_ds(); | | int86x(0x13,®s,®s,&sregs); | | return (regs.h.ah); // zero if ok | } | | And it is fine. But if a put it in a function and call this function, a get | a GPF. Anybody know why? Any idea? | | TIA | | Cropalato | cropalat AT svn DOT com DOT br |