2957cf6f52
1. upddate kernel module to support i386 2. update libdl to support open *.so by absolute path 3. new test case bsp/x86/src/hello.c to test i386 module feature Signed-off-by: parai <parai@foxmail.com>
37 lines
536 B
C
37 lines
536 B
C
|
|
#include <stdio.h>
|
|
const char* g_str = "Hello World!";
|
|
|
|
static int a = 1234;
|
|
int b = 5678;
|
|
|
|
extern void rt_kprintf(const char* fmt,...);
|
|
|
|
int add(int a, int b)
|
|
{
|
|
return a+b;
|
|
}
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
int i;
|
|
char str[32] = "Hello World\n";
|
|
|
|
for(i=0; i<argc; i++)
|
|
{
|
|
printf("argv[%d]='%s'\n", i, argv[i]);
|
|
}
|
|
|
|
printf(str);
|
|
|
|
printf("g_str address is %ph\n",g_str);
|
|
puts(g_str);
|
|
|
|
rt_kprintf("\nnative rt_kprintf a(%ph)=%d, b(%ph)=%d\n", &a, a, &b, b);
|
|
|
|
printf("%d+%d=%d\n", 4, 5, add(4, 5));
|
|
|
|
return 0xdeadbeef;
|
|
}
|
|
|