Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Aug 2005 21:14:15 +0530
From:      Joseph Koshy <joseph.koshy@gmail.com>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        hackers@freebsd.org
Subject:   Re: hello world but not in 32bit x86 but in amd64 for amd64 platform
Message-ID:  <84dead7205081708447a981452@mail.gmail.com>
In-Reply-To: <20050817145510.GD26422@dan.emsphone.com>
References:  <20050817122049.29529.qmail@web52009.mail.yahoo.com> <20050817145510.GD26422@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?84dead7205081708447a981452>