From owner-freebsd-questions Mon Oct 28 4:58: 5 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7704037B401 for ; Mon, 28 Oct 2002 04:58:04 -0800 (PST) Received: from ant-on.net (ant-on.net [212.24.39.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12B7D43E42 for ; Mon, 28 Oct 2002 04:57:51 -0800 (PST) (envelope-from useperl@fastmail.fm) Received: from NEWTON.galaxy.net ([195.151.197.36]) by ant-on.net with ESMTP id g9SCvNi24765; Mon, 28 Oct 2002 15:57:26 +0300 Date: Mon, 28 Oct 2002 15:57:22 +0300 From: Anton Shcherbinin X-Mailer: The Bat! (v1.60m) Personal X-Priority: 3 (Normal) Message-ID: <12523076531.20021028155722@fastmail.fm> To: freebsd-questions@freebsd.org Subject: System calls: int $0x80 vs. lcall $7, $0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Gentlemen, I am new to FreeBSD programming and going to write a simple program which will not use libc. I tried to find out how to make a system call of FreeBSD kernel. But 2 different sources of information, a book on assembly programming and FreeBSD Developers' Handbook, say contrary things, and I got completely confused. My assembly book says (trying to translate from Russian into English): ``Numbers of system calls (which are in /usr/include/sys/syscall.h file) and way of getting to entry point (long call to 0007:00000000) are standardized in SysV/386 ABI, but for example Linux uses another convention -- interrupt 80H. [...] In more traditional Unix systems -- FreeBSD and Solaris -- system calls are implemented according to common SysV/386 standard.'' On the other hand, http://www.freebsd.org/doc/en/books/developers-handbook/x86-system-calls.html says: ``Further, although the kernel is accessed using int 80h [...]'' So what's the truth? int $0x80 or lcall $7,$0 ? Or are both possible? If both, which is better? What is "SysV/386 ABI standard" and does FreeBSD follow it? If it follows this standard, where could I get this standard from? (I did try Google search, but found nothing resembling a standard or official documents). Thanks a lot for any clues. If this maillist is not the most appropriate place to ask questions like this, please direct me to the right place. -- Anton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message