From owner-freebsd-questions Tue Dec 29 14:48:13 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA23486 for freebsd-questions-outgoing; Tue, 29 Dec 1998 14:48:13 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from bursa01.cuneydi.com (bursa01.cuneydi.com [206.109.102.130]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA23481 for ; Tue, 29 Dec 1998 14:48:09 -0800 (PST) (envelope-from cucu@cuneydi.com) Received: from ibmlaptop.texascommerce.com ([206.109.102.140]) by bursa01.cuneydi.com (Netscape Mail Server v1.1) with SMTP id AAA201 for ; Tue, 29 Dec 1998 16:47:15 -0600 From: "cucu" To: Subject: DOS->FreeBSD port - int86x() Software Interrupt replacement Help. Date: Tue, 29 Dec 1998 16:49:30 -0600 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2212 (4.71.2419.0) X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Importance: Normal Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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