From: "Edison M. Castro" Newsgroups: comp.os.msdos.djgpp Subject: Problem with biosdisk Date: Mon, 20 Apr 1998 10:02:32 -0400 Organization: Merrill Lynch Lines: 43 Message-ID: <6hfksc$rov$1@news.ml.com> NNTP-Posting-Host: 165.177.116.209 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I have written an fdisk replacement program to manage disk partitions. This program works without problem when compiled with djgcc v1.x. I decided to migrate it to version 2.x, I compile it , put it in a dos floppy, boot up the machine and when my code executed in some machines, it frozed. I can not, for the life of me, discern the possible causes for this problem. It is not tie up to any special type of hardware or processor. I have replaced the call to biosdisk with __int86x, __dpmi_int, __go32_int, etc with the same results. I think I have found some type of problem with the dpmi host or something like that. Here is the code int getGeometry(int dev, unsigned *c, unsigned *h,unsigned *s) { int i; unsigned char buf[4]; if (dev < 0 || dev > 9) { fprintf(stderr,"%s: Incorrect device number\n", dev); return(1); } i=biosdisk(8,dev | 0x80,0,0,0,0,buf); <<===========>> Machine freeze right here if (i!=0) /* fprintf(stderr,"%s: can't get disk parameters\n", dev); */ return (1); } *c = ((buf[0] & 0xc0 ) << 2) + buf[1] + 1; *h = buf[3] + 1; *s = buf[0] & 0x3f; return (0); }