Solved

Bios Interrupt under Optima++

Posted on 1997-04-02
4
363 Views
Last Modified: 2006-11-17
   
  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-
 
0
Comment
Question by:eal
  • 2
4 Comments
 
LVL 23

Expert Comment

by:chensu
Comment Utility
Open the header file: i86.h to see whether there is the function prototype of intr.
0
 

Author Comment

by:eal
Comment Utility
Edited text of question
0
 

Author Comment

by:eal
Comment Utility
Edited text of question
0
 
LVL 1

Accepted Solution

by:
white wolf earned 100 total points
Comment Utility
Make sure your compiler settings are correct, specifically, that the linker includes the "standard runtime libraries" (or equivalent terminology for that compiler...)

This is the only possibility that I see...
Good luck!  Let me know...

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now