Krishna iResearch Intelligent Cloud Platform - VIRtual Generic Os - VIRGO - Linux kernel extensions for cloud
 All Classes
test_virgo_clone.c
1 /***************************************************************************************
2 VIRGO - a linux module extension with CPU and Memory pooling with cloud capabilities
3 
4 Copyright (C) 2009-2013 Ka.Shrinivaasan
5 
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 --------------------------------------------------------------------------------------------------
20 Srinivasan Kannan (alias) Ka.Shrinivaasan (alias) Shrinivas Kannan
21 Independent Open Source Developer, Researcher and Consultant
22 Ph: 9003082186, 9791165980
23 Open Source Products Profile(Krishna iResearch): http://sourceforge.net/users/ka_shrinivaasan
24 Personal website(research): https://sites.google.com/site/kuja27/
25 emails: ka.shrinivaasan@gmail.com, shrinivas.kannan@gmail.com, kashrinivaasan@live.com
26 --------------------------------------------------------------------------------------------------
27 
28 *****************************************************************************************/
29 
30 #include <stdio.h>
31 #include <linux/kernel.h>
32 #include <sys/syscall.h>
33 #include <unistd.h>
34 
35 int main(int argc, char* argv[])
36 {
37  /*
38  long int ret=syscall(350,"int clone_func(void* args)",NULL,0,NULL);
39  */
40 
41  /*
42  Mangled name for function prototype "void* virgo_cloud_test(void*)" is sent to virgo_cloudexec kernel service which does
43  upcall to userspace to invoke the function (within libvirgo.so) in remote cloud node. Kernel upcall usermode helper
44  requires mangled names for dlsym(). This also is a unique id for a function. Library libvirgo.so needs to be prebuilt
45  with all functions that need to be on cloud and should be replicated in all cloud nodes.
46  For executable parameter, complete path to binary is passed in.
47  \r\n or " " padded is stripped off by kernel recv code in virgo_cloudexec by strsep tokenizer. It is intriguing that telnet
48  connection works without any padding.
49 
50  - Ka.Shrinivaasan
51  */
52 
53 
54  long int ret=syscall(350,"virgo_cloud_test_kernelspace ",NULL,0,NULL);
55  /*long int ret=syscall(350,"_Z16virgo_cloud_testPv ",NULL,0,NULL);*/
56  /*long int ret=syscall(350,"/home/kashrinivaasan/linux-3.7.8/drivers/virgo/cpupooling/virgocloudexec/virgo_cloud_test_main ",NULL,0,NULL);*/
57  /*long int ret=syscall(350,argv[1],NULL,0,NULL);*/
58  return 0;
59 }