problems testing syscall

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

 



Hi there,
I'm again here now with a problem testing a syscall that I've created.
Well, first of all, I have created a syscall that requests pages to the OS, I pass the address that I'm requesting and the kind of access that I want to do to it (read/write).
The behavior of this syscall is similar to the kernel function handle_pte_fault. To test it, I have a user program like this


#include <sys/syscall.h>
#include <errno.h>
#include <stdio.h>
#include <unistd.h>


_syscall2(int,read_page_async,unsigned long,address,int,write_access);

/*array ocuppying 200 pages, having 4KB pages*/
int vector[204800];


int main(void){

 int error_read;


error_read = read_page_async((unsigned long)vector[194560],0);
sleep(3);
printf(" The return value of the syscall %d \n",error_read);
if (error_read < 0){
printf("Error obtaining the requested page \n");
exit(-1);
}
return 0;
}
Well, when I execute this program I get 0 as return value of the syscall when I have to get 1 (minor fault) and following the execution, I've seen that it's executing do_no_page because the page that I'm requesting is not in memory but, it's not executing do_anonymous page as it has to do, because it's the first time that I use this page and it's not part of a mapped file.
One of my thoughts is that find_vma is giving me an vma that is not the vma that belongs to address and for this reason I'm having these problems
Any tricks for obtaining more information from the kernel of what am I doing wrong?


_________________________________________________________________
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en MSN Motor. http://motor.msn.es/researchcentre/



-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux