From owner-freebsd-questions@FreeBSD.ORG Mon Apr 7 10:03:54 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 094F61065672 for ; Mon, 7 Apr 2008 10:03:54 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from web57011.mail.re3.yahoo.com (web57011.mail.re3.yahoo.com [66.196.97.115]) by mx1.freebsd.org (Postfix) with SMTP id 9E5C98FC0C for ; Mon, 7 Apr 2008 10:03:53 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: (qmail 57909 invoked by uid 60001); 7 Apr 2008 09:37:11 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=ZYwmm0m7IoFt4iPpB586b9m5SOWvnktpBym614qNfIbln6yKzynbaPlV3ScCt8bHCl8Sh6/sVitxwTAKatdonrRrjdkTVyZBSfp4NRqPVXvMTPympDMpzI3zwURTSEdSj9XHw5Z7jWnnu+rbCUZm+edcTaDsS+P2qYSHJ94nL2I=; X-YMail-OSG: MdgydbcVM1kI_zcXM5wGKlEKyekcZ9B4HdTOvUwvr1zJcTlsm8GFHeyqeN2PZNc_z0akz3d62LFFnR1f8g.g_S2Yr0QG_AbuuVp6m3XbGOlEe13Irw1NYv8OsRIpnRByUWzlKkWti9caNaaquyEVm3WkcA-- Received: from [220.255.7.215] by web57011.mail.re3.yahoo.com via HTTP; Mon, 07 Apr 2008 02:37:11 PDT Date: Mon, 7 Apr 2008 02:37:11 -0700 (PDT) From: Unga To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <687872.53069.qm@web57011.mail.re3.yahoo.com> Subject: Inline assembly under FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2008 10:03:54 -0000 Hi all I'm trying to execute following inline assembly code in a C function under FreeBSD 7.0: typedef unsigned char u8; typedef unsigned short u16; u8 devno= 0x80; static int check_extensions(u8 devno) { u16 ax, bx, cx, dx, di; ax = 0x4100; bx = 0x55AA; dx = devno; asm("pushfl; stc; int $0x13; setc %%al; popfl" : "+a" (ax), "+b" (bx), "=c" (cx), "+d" (dx) : : "esi", "edi"); if ((u8)ax) return -1; /* No extended information */ else return 1; /* Extended information available */ } When it is executing the int $0x13, it crashes with "Program received signal SIGBUS, Bus error." Could you guys give me a helping hand to identify what's the problem? Input and return values are at: http://en.wikipedia.org/wiki/INT_13 Thanks in advance. Kind regards Unga ____________________________________________________________________________________ You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com