From: Jeff Dike <jdike@ka...> - 2002-03-21 16:56:04
> I am a TOTAL newbie to kernel code (and even worse, I may also be the
> dumbest person on earth!).
I doubt it. There's some pretty stiff competition out there.
> Will some REAL kernel developer comment on them? I can't possibly be
> sure by myself that this is the correct approach.
You can if you actually do it yourself. That would give you a good example
to include in the doc.
> I'll collect the
> comments and then prepare a nice little step-by-step doc which we may
> post to the list (or perhaps add it somewhere on the UML site).
> A) The following steps set-up an entry point for your system call:
> In include/asm-um/arch/unistd.h
> Add "#define __NR_yourcallname NNN"
> In /uml-code/arch/um/include/sysdep/syscalls.h
> Add "[ __NR_yourcallname ] = sys_yourcallname,"
> Change LAST_ARCH_SYSCALL to NNN
If it's not arch-specific, it would be better to add it to the main table
in sys_call_table.c and update LAST_SYSCALL if necessary.
> In arch/um/sys_call_table.c
> Add "extern syscall_handler_t sys_yourcallname;"
> B) You now need to provide a stub + an implementation. The positioning of
> files may vary, but I think the following are good "generic" choices.
Yeah, these aren't bad. Again, if it's a truly generic system, it may be
better to stick the implementation in the main kernel somewhere.
> In arch/um/include
> Create yourcallname.h
> In arch/um/kernel
> Create yourcallname.c
> Modify Makefile and add yourcallname.o to list of build targets