Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!hc!pprg.unm.edu!unmvax!deimos.cis.ksu.edu!uxc!uxc.cso.uiuc.edu!fthood!egray From: egray@fthood.UUCP Newsgroups: comp.sys.ibm.pc Subject: BIOS parameter block from C program Message-ID: <7000012@fthood> Date: 26 Apr 89 01:09:00 GMT Lines: 43 Nf-ID: #N:fthood:7000012:000:1187 Nf-From: fthood.UUCP!egray Apr 25 20:09:00 1989 Howdy netlanders.... Question: How do you get a peek at the BIOS parameter block in a C program? I'm using Zortech C 1.07 (small model) on a Zenith 248 (AT clone) with Zenith's DOS 3.21. My program needs access to the floppy disk drive parameters, so I'm using BIOS function 32h (which I understand is somewhat undocumented). It is suppose to return the pointer to the drive parameter block in DS:BX. Unfortunately, the stuff at BX is garbage. What gives? Is there a better way? Code fragment: static struct param_block { char drive_number; char unit_number; int bytes_per_sector; ...... } table union REGS regs; regs.h.ah = 0x32; /* Get Drive Parameter Block */ regs.h.dl = 0x01; /* drive a: */ intdos(®s, ®s); if (regs.h.al) error(); /* in small model, BX == a pointer */ memcpy(&table, (struct param_block *) regs.x.bx, sizeof table); printf("bytes per sector is %d\n", table.bytes_per_sector); Emmet P. Gray US Army, HQ III Corps & Fort Hood ...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV fthood!egray@uiucuxc.cso.uiuc.edu Directorate of Engineering & Housing Environmental Management Office Fort Hood, TX 76544-5057