Solved
Bios Interrupt under Optima++
Posted on 1997-04-02
Using Optima++ I am trying to call a bios interruption (0x13) to read a sector(partition sec) of the hard drive. Everything I code gives me always the same error: "intr_ is an undefined reference" at the Error Log.
YES, i86.h has an intr() prototype:
_WCRTLINK extern void intr( int, union REGPACK * );
(Thanks for the comment chensu)
What am I missing ???. Here is part of my code:
#include<i86.h>
...
union REGPACK regs;
unsigned char buffer[512];
// Will read head:0 cyl:0 sec:1
regs.h.ah = 0x02; // read function
regs.h.al = 0x01; // number of sectors to read
regs.h.ch = 0x00; // low 8 bits cylinder
regs.h.cl = 0x01; // sector + 2 high bits cylind
regs.h.dh = 0x00; // head number
regs.h.dl = 0x80; // drive letter (hard disk)
#if defined(__386__)
regs.x.ebx = FP_OFF(buffer); // offset of buffer
#else
regs.w.bx = FP_OFF(buffer); // offset if 16 bit
#endif
regs.w.es = FP_SEG(buffer); // segment of buffer
intr( 0x13, ®s ); // bios call
What I do not understand is why it compilies without errors in Borland C++.
Thanks in advance:
-eal-