LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   conver .o file into .ko file and frame buffer refresh (https://www.linuxquestions.org/questions/linux-newbie-8/conver-o-file-into-ko-file-and-frame-buffer-refresh-795083/)

asma kousar 03-13-2010 12:10 AM

conver .o file into .ko file and frame buffer refresh
 
Hi,
I'm using linux kernel 2.6, while compiling a program with gcc only the filename.o is created, whereas filename.ko is required to do insmod.

Is there anyway to convert .o file into .ko file. I'm using bash shell, specifying shell name because most of the commands i searched on the net are not working.?????????

Make is giving stdio.h:No such file or directory but it is there in every include directory. Please help me its urgent???????:banghead:

Im using hawkboard to display images created through qt4, for this i need a frame buffer and i have created a frame buffer(using mknod) but how to make it permanent, fb is getting disappear after every restart/shutdown and even if i do not shut down then also cat is not working it is giving the error /dev/fb0:No such device, but if i check the /dev directory fb0 is there. How can i make my fb0 so that it won't disappear?????????

Thanku.

Please reply me.
:newbie:

TB0ne 03-13-2010 11:32 AM

Quote:

Originally Posted by asma kousar (Post 3896473)
Hi,
I'm using linux kernel 2.6, while compiling a program with gcc only the filename.o is created, whereas filename.ko is required to do insmod.

Is there anyway to convert .o file into .ko file. I'm using bash shell, specifying shell name because most of the commands i searched on the net are not working.?????????

Make is giving stdio.h:No such file or directory but it is there in every include directory. Please help me its urgent???????:

Im using hawkboard to display images created through qt4, for this i need a frame buffer and i have created a frame buffer(using mknod) but how to make it permanent, fb is getting disappear after every restart/shutdown and even if i do not shut down then also cat is not working it is giving the error /dev/fb0:No such device, but if i check the /dev directory fb0 is there. How can i make my fb0 so that it won't disappear?????????

Thanku.

Please reply me.

No, it's not urgent for anyone here. We volunteer our time, so telling us to hurry and help you is fairly rude.

And if it's **URGENT**, how about telling us what version/distro of Linux you're using? What 'program' you're trying to compile, where you got it, and what you're trying to do?

asma kousar 03-14-2010 01:08 AM

I understood and will not repeat it again.
I am using redhat4 linux
I have written a code for hello world, which is like this
//hello.c
#include<linux/kernel.h>
#include<linux/kernel.h>

int init_module(void)
{
printk(KERN_INFO"HELLO WORLD\n");
return 0;
}
void clean_module(void)
{
printk(KERN_INFO"GOODBYE WORLD\n");
}


#Makefile

obj-m += hello.o
all:
make -C /lib/modules/'$shell(uname -r)'/build modules
clean:
make -C /lib/modules/'$shell(uname -r)'/build clean

now cd /path to hello.c
make

it generates 6 files incl: hell.ko, hello.o, modulesymvers, modulemarkers, hello.mod.o, hello.mod.c

now i did insmod hello.ko and it got inserted into the kernel modules...... successfully completed

now i did mknod /dev/fb0 c 29 0
which created a a frame buffer node in /dev
1. cat /dev/fb0 > myfile is giving No such device error, where as it is there in /dev/fb0
2. Every time i switch on the system i have to recreate a /dev/fb0, as /dev/fb0 is disappearing when i shut down my system

I have created a /dev/fb0 now, and trying to execute the following program
//file.c
#include<linux/fcntl.h>
#include<linux/unistd.h>
#include<stdio.h>

int main(void)
{
int fbfd=0;
fbfd=open("/dev/fb0",O_RDWQ);
if(!fbfd)
{
printf(KERN_INFO"error\n");
exit(1);
}
printf("PASS\n");
close(fbfd);
return 0;
}
Makefile is same as above

when i try to make, it is giving errors,
1.stdio.h: no such file or directory
2.implicit declaration of prototype open, close, exit, printf

Please help me.


All times are GMT -5. The time now is 09:23 AM.