Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 1998 16:49:30 -0600
From:      "cucu" <cucu@cuneydi.com>
To:        <freebsd-questions@FreeBSD.ORG>
Subject:   DOS->FreeBSD port - int86x() Software Interrupt replacement Help.
Message-ID:  <NCBBLKJGGKLDJPCBEPGOGEHOCIAA.cucu@cuneydi.com>

next in thread | raw e-mail | index | archive | help
Let me try again,
I would like convert the following piece of code from DOS to FreeBSD.

This piece of code is accessing the ROM BIOS by software interrupts.
Basically in DOS world,int86x, copies register values to correspanding
resgisters in the microprocessor.Saves the DS register,copies new values
from
segs structure into DS and ES.Generate software interrupt(0x15 in this case)
via
INT instruction.Return from interrupt,copies registers to out structure,and
system
carry flag.Restore DS back. (I hope I remember evrything ...)

What is the right way doing this? Can someone point me to the right
direction?

Thanks
...
int GetNo(unsigned char *dest)
{                           
        in.x.ax = 0xd820; 
        in.x.si = FP_OFF(dest);
        segs.ds = FP_SEG(dest);
        int86x(0x15, &in, &out, &segs);
        if (out.x.cflag)
                return -1;                      // Error
        return (int)(*dest);
}
...


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?NCBBLKJGGKLDJPCBEPGOGEHOCIAA.cucu>