boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

syscall.s (455B)


      1 .global __syscall
      2 .hidden __syscall
      3 .type __syscall,@function
      4 __syscall:
      5 	movq %rdi, %rax        /* syscall number       */
      6 	movq %rsi, %rdi        /* arg1 (was C arg2)    */
      7 	movq %rdx, %rsi        /* arg2 (was C arg3)    */
      8 	movq %rcx, %rdx        /* arg3 (was C arg4)    */
      9 	movq %r8,  %r10        /* arg4 (kernel uses r10, not rcx) */
     10 	movq %r9,  %r8         /* arg5                 */
     11 	movq 8(%rsp), %r9      /* arg6 from stack      */
     12 	syscall
     13 	ret