From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 14 17:12:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60EC316A4CF for ; Mon, 14 Jun 2004 17:12:10 +0000 (GMT) Received: from noconname.org (19.Red-80-26-109.pooles.rima-tde.net [80.26.109.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFB3743D1F for ; Mon, 14 Jun 2004 17:12:09 +0000 (GMT) (envelope-from jncastellano@noconname.org) Received: from peron (hugo.noconname.org [192.168.0.2]) by noconname.org (Postfix) with SMTP id F0DDE25; Mon, 14 Jun 2004 19:17:21 +0200 (CEST) Message-ID: <005001c45233$42d8f120$0200a8c0@peron> From: =?iso-8859-1?Q?Jos=E9_Nicol=E1s_Castellano?= To: "ari edelkind" , References: <003801c45207$01ddfa70$0200a8c0@peron> <20040614164040.GN14968@episec.com> Date: Mon, 14 Jun 2004 19:15:58 +0200 Organization: Asoc. No cON Name MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2739.300 Subject: Re: freebsd asm X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jun 2004 17:12:10 -0000 ----- Original Message ----- > ... which doesn't exit, therefore your program accesses memory addresses > that aren't meant to supply program code, and it crashes. > > Freebsd system calls are generally accessed using interrupt vector 0x80. > The function that deals with this interrupt in the kernel expects the > number of the system call in eax, and it expects the program to have > called a function along the way. Thus, it's looking for the following > stack structure: > > [RRRR][DDDD][SSSS][NNNN] > > RRRR: return address, inserted by 'call' instruction > DDDD: descriptor vector > SSSS: string address > NNNN: number of bytes to write. > > ... > > You can find the necessary system call numbers in > /usr/include/sys/syscall.h . Tnaks a lot! i understand all perfectly ;-)