swapper_pd_dir error in loading kernel module

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

 



Hi all,
I've a problem with the kernel module I'm developing.
I need to do a fork of a process p and I think to
duplicate the do_fork system call (kernel/fork.c).
To do this I've copied the whole fork.c files in a
header file CMC_fork.h and changed the function
parameters adding a struct task_struct parameter in
each function that use the current pointer. Then I've
replaced current with the p pointer.
I've no problem in compiling the module (that includes
the CMC_fork.h header just created), but insmod
returns the error:

./thread_module.o: unresolved symbol swapper_pg_dir

Note that there's no direct reference to
swapper_pd_dir in my module or in CMC_fork.h (and
therefore in kernel/fork.c). 
The headers included by CMC_fork.h are the same
included by kernel/fork.c:

#include <linux/config.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/unistd.h>
#include <linux/smp_lock.h>
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/completion.h>
#include <linux/personality.h>

#include <asm/pgtable.h>
#include <asm/pgalloc.h>
#include <asm/uaccess.h>
#include <asm/mmu_context.h>

I've tried to declare 

extern pgd_t swapper_pg_dir[1024];

as in asm/pgtable.h (line 24). But insmod returns the
same error.

I've also tried to declare

extern pgd_t *swapper_pg_dir;

but the error 

/usr/src/linux/include/asm/pgtable.h:24: previous
declaration of `swapper_pg_dir'

is returned. This error is also returned if I declare

pgd_t *swapper_pg_dir = (pgd_t *) 0xc0101000;

How can I resolve this problem?
Thanks all.

Vincenzo Mallozzi.




		
___________________________________ 
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica? Scaricalo ora! 
http://it.messenger.yahoo.it

--
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