From owner-freebsd-hackers@FreeBSD.ORG Wed Aug 17 15:44:16 2005 Return-Path: X-Original-To: hackers@freebsd.org 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 A980116A41F for ; Wed, 17 Aug 2005 15:44:16 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id 427D643D48 for ; Wed, 17 Aug 2005 15:44:16 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by rproxy.gmail.com with SMTP id r35so160864rna for ; Wed, 17 Aug 2005 08:44:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EsvLh1n6GZ3Wcxeih54EnfUqvL7P3Gbe8jwJDytCRXvEKZdgOprC4X7xQBAUbPvlByld7J3Fv3cp5t1asPYsboJ01UXSA8JzpxkEMC7WeBpyk2XJh3LEsr5mMTb6dUf2V0Lja4cERPVFho81c2gQHl6QI78SLsyVxZnVOHWk6oI= Received: by 10.39.1.39 with SMTP id d39mr188903rni; Wed, 17 Aug 2005 08:44:15 -0700 (PDT) Received: by 10.38.13.79 with HTTP; Wed, 17 Aug 2005 08:44:15 -0700 (PDT) Message-ID: <84dead7205081708447a981452@mail.gmail.com> Date: Wed, 17 Aug 2005 21:14:15 +0530 From: Joseph Koshy To: Dan Nelson In-Reply-To: <20050817145510.GD26422@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050817122049.29529.qmail@web52009.mail.yahoo.com> <20050817145510.GD26422@dan.emsphone.com> Cc: hackers@freebsd.org Subject: Re: hello world but not in 32bit x86 but in amd64 for amd64 platform X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2005 15:44:16 -0000 av> "Hello World" assembly program written in 64bit assembly av> which I can compile and run on my FreeBSD,AMD64 platform You could also look at "src/lib/libc/amd64/SYS.h" for how system calls are implemented. In particular, #define KERNCALL movq %rcx, %r10; syscall A system call transfers control to:=20 "src/sys/amd46/amd64/exception.S": ... snip ... IDTVEC(fast_syscall) swapgs movq %rsp,PCPU(SCRATCH_RSP) movq PCPU(RSP0),%rsp ... etc ... The x86-64 ABI is defined in: http://x86-64.org/documentation/abi.pdf --=20 FreeBSD Volunteer, http://people.freebsd.org/~jkoshy