Solved

Bios Interrupt under Optima++

Posted on 1997-04-02
4
384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Expert Comment

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

Author Comment

by:eal
ID: 1162537
Edited text of question
0
 

Author Comment

by:eal
ID: 1162538
Edited text of question
0
 
LVL 1

Accepted Solution

by:
white wolf earned 100 total points
ID: 1162539
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 175
How to gracefully close the c++ 11 thread? 3 160
C++ question 3 84
Need some help with mailto 16 45
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

752 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