LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-13-2010, 01:10 AM   #1
asma kousar
LQ Newbie
 
Registered: Mar 2010
Location: Hyderabad
Posts: 3

Rep: Reputation: 0
Lightbulb 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???????

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.
 
Old 03-13-2010, 12:32 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,961

Rep: Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693Reputation: 3693
Quote:
Originally Posted by asma kousar View Post
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?
 
Old 03-14-2010, 03:08 AM   #3
asma kousar
LQ Newbie
 
Registered: Mar 2010
Location: Hyderabad
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] program with frame buffer lwhat Programming 6 03-10-2010 09:18 AM
about frame buffer yugandhar Linux - Kernel 2 06-03-2006 06:07 PM
Disable Frame Buffer metamaverick SUSE / openSUSE 4 03-18-2006 09:01 AM
Cedega - Morrowind: no more "unknown frame buffer" error (inc. my config file) fonejack Linux - Games 6 06-19-2005 06:02 PM
Frame buffer bkeating Linux - Newbie 6 04-22-2003 07:09 PM


All times are GMT -5. The time now is 08:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration