From owner-freebsd-hackers@FreeBSD.ORG Thu Jul 31 15:41:14 2003 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 C931537B478 for ; Thu, 31 Jul 2003 15:41:10 -0700 (PDT) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 704AA44053 for ; Thu, 31 Jul 2003 15:40:38 -0700 (PDT) (envelope-from marcov@stack.nl) Received: by mailhost.stack.nl (Postfix, from userid 65534) id B386A1F018; Fri, 1 Aug 2003 00:40:21 +0200 (CEST) Received: from toad.stack.nl (zen.stack.nl [2001:610:1108:5010::130]) by mailhost.stack.nl (Postfix) with ESMTP id 5A4541F014; Fri, 1 Aug 2003 00:40:15 +0200 (CEST) Received: by toad.stack.nl (Postfix, from userid 816) id 37EF19A; Fri, 1 Aug 2003 00:40:15 +0200 (CEST) In-Reply-To: <20030731201227.28952.qmail@neuroflux.com> "from Ryan Sommers at Jul 31, 2003 04:12:27 pm" To: Ryan Sommers Date: Fri, 1 Aug 2003 00:40:15 +0200 (CEST) X-Mailer: ELM [version 2.4ME+ PL88 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Message-Id: <20030731224015.37EF19A@toad.stack.nl> From: marcov@stack.nl (Marco van de Voort) X-Spam-Status: No, hits=-1.0 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT version=2.55 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-hackers@freebsd.org Subject: Re: Assembly Syscall Question 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: Thu, 31 Jul 2003 22:41:18 -0000 > When making a system call to the kernel why is it necessary to push the > syscall value onto the stack when you don't call another function? You have to push anything the size of an address. Because the call return pushes the return adress on the stack. The 1st and 3rd both push 4 bytes, so they work. _why_ this is needed is probably because the routine that does the int 80h can also check and process the int 80h returnvalue and errorcode, and people wanted to avoid duplication of that code, at least that is my guess :-)