hello world but not in 32bit x86 but in amd64 for amd64 platform

Joseph Koshy joseph.koshy at gmail.com
Wed Aug 17 15:44:16 GMT 2005


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: 

  "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

-- 
FreeBSD Volunteer,     http://people.freebsd.org/~jkoshy


More information about the freebsd-hackers mailing list