[okl4-developer] Adding another L4 system call

Peter Nguyen petern at cs.adelaide.edu.au
Tue Sep 11 23:35:52 EST 2007


Hi,

I'm working with the OKL4 ia32 build at the moment.  One of the  
features i'm wanting to use now are the performance counters on the  
intel archictecture.  Given that the only way these counters can be  
set is via supervisor level access, i figured that one solution to  
this is to provide another system call that provides access for the  
developer to decide the events that should be counted.  I am able to  
do this on the PowerPC build of pistachio and currently, i'm trying  
to achieve the same task on the ia32 architecture and i am currently  
encountering some difficulties, especially with what some of the code  
is doing for these system calls.  At this current stage, i have added  
code for this additional call to the following files:

pistachio/arch/ia32/include/syscalls.h
pistachio/include/syscalls.h
libs/l4/include/kip.h
libs/l4/arch/ia32/src/ia32-syscall-init.c
libs/l4/arch/ia32/src/ia32-syscall-stubs.spp
pistachio/src/kernelinterface.cc
	
pistachio/include/kernelinterface.h
libs/l4/arch/ia32/include/syscalls.h
pistachio/arch/ia32/src/user.cc
pistachio/include/user.h
pistachio/arch/ia32/src/kip.order

I should note a couple of points:

- I have not made the size of the KIP larger in trying to add the  
system call as I have replaced one of the existing kip elements.  In  
this case, i replaced an entry that was stated as being unused in the  
block of declarations for the system calls.
- I'm also doing this assuming that the system calls can actually be  
used directly in iguana ie. if i, for instance, add a threadcontrol  
call in the naming example, i was thinking that this should be fine  
(obviously it's better to use the iguana functionality for creating  
threads).  Of course, i am bound to be incorrect on this so  
clarification on this would be great.

At this point, i have a couple of questions, mainly in reference to  
certain parts of the code:

- In syscalls.h (libs/l4/arch/ia32/include/syscalls.h), the asm for  
these system calls have this common pattern:

     __asm__(
             "mov $8, %%eax\n"
             "int $0x30\n"	-> I'm assuming here that this represents  
a jump to the given system call.
             : : :"eax");

Although the value after '$' is different for all the system calls.   
What is the purpose of (what seems to be) moving the immediate value  
to the given register?

- The code above is common in the system call implementation in the  
#ifdef in relation to a certain mode (X86_64_COMPATIBILITY_MODE).   
What the difference between the code within the #ifdef and the  
"standard" code ie. the implementation in the #else component?

- With regards to iguana functionality, does invoking the creation  
function via iguana ultimately invoke ThreadControl?

Thanks
Peter Nguyen

PS. Even if you find my reasoning behind trying to provide another  
system call wrong, just suppose hypothetically that this was a valid  
reason for wanting another system call.



More information about the Developer mailing list