From: jitubhai a. <jit...@re...> - 2008-01-15 11:03:16
|
Hi,=0AI use colinux version 0.8.0 on linux as a host.=0AI was able to inser= t a simplistic kernel module in the guest.=0A=0AHowever, when I include lin= ux/cooperative_internal.h it gives me errors. following is a simple kernel= module that dosen't work =0A=0A#include <linux/kernel.h> /* Needed for KER= N_ALERT */=0A#include <linux/module.h> /* Needed by all modules */=0A#inclu= de <linux/unistd.h>=0A#include <linux/cooperative_internal.h>=0A#include <l= inux/string.h>=0A=0A=0Aint init_module(void)=0A{=0A unsigned long flags;= =0A co_passage_page_assert_valid();=0A co_passage_page_acquire(&flags= );=0A co_passage_page->operation =3D CO_OPERATION_PRINTK;=0A co_passa= ge_page->params[0] =3D strlen("We did this!");=0A strcpy(co_passage_page= ->params[1], "We did this!");=0A co_switch_wrapper();=0A co_passage_p= age_release(flags);=0A printk("Hello world 1.\n");=0A return 0;=0A}= =0Avoid cleanup_module(void)=0A{=0A printk("Goodbye world 1.\n");=0A}=0A= =0A=0Athe errors we get are as follows :=0A=0Amake -C /lib/modules/2.6.15-= co-0.8.0/build M=3D/root modules=0Amake[1]: Entering directory `/root/linux= -2.6.15'=0A CC [M] /root/hello.o=0A/root/hello.c: In function `init_modul= e':=0A/root/hello.c:18: warning: passing arg 1 of `strcpy' makes pointer fr= om integer without a cast=0A Building modules, stage 2.=0A MODPOST=0A*** = Warning: "co_passage_page_release" [/root/hello.ko] undefined!=0A*** Warnin= g: "co_switch_wrapper" [/root/hello.ko] undefined!=0A*** Warning: "co_passa= ge_page_acquire" [/root/hello.ko] undefined!=0A*** Warning: "co_passage_pag= e_held" [/root/hello.ko] undefined!=0A CC /root/hello.mod.o=0A LD [M= ] /root/hello.ko=0Amake[1]: Leaving directory `/root/linux-2.6.15'=0A=0A= =0AWhy can't it find the functions if linux/cooperative_internal.h is inclu= ded?... do i have to insert this module in the host kernel??=0A(Another obs= ervation.. don't know how relevant it is in the context.. but anyways, all = symbols NOT defined extern in cooperative_internal.h work fine.. all declar= ed extern don't) |