Re: [PATCH] implement-system-call-mini-HOWTO.txt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Nov 12 2006 22:14, Amit Choudhary wrote:
>+*How is it invoked?
>+--A library routine issues a trap to the OS by executing INT 0x80 assembly instruction.
>+--The system call number is passed through the EAX register.
>+--The arguments are passed through registers  EBX, ECX, etc.

A nice short description, however, not all of the world runs x86 and may 
not know E?X. Just mention that you will describe the process based on 
x86.

>+*The Makefile in dir "mycall" will have only one line:
>+
>+#####Makefile Start#####
>+obj-y := mycall.o
>+#####Makefile End#######

I am tempted to use  obj-y += mycall.o

Generally, one does not need a new directory for a new syscall, or a new 
source file. You can edit kernel/sys.c if you like.

>+--Line 3:
>+	_syscall1(long, mycall, int, i)
>+	This is needed for system calls with 1 argument. It is explained in detail
>+        below.

This was deprecated in favor of syscall().

>+#include<stdio.h>
>+#include "testmycall.h"
>+
>+main()
>+{
>+        printf("%d\n", mycall(15));
>+}

Care to use ANSI C?


	-`J'
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux