LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-07-2006, 10:07 AM   #1
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Rep: Reputation: 15
Question kernel compilation problem


i hav a file as temp.c as following.

-----------------------------------------

#include<linux/module.h>
#include<linux/kernel.h>

void func(void);

void func(void)
{
printk("hello world....");
}

EXPORT_SYMBOL(func);

-------------------------------------------

i have added this file into the kernel source code in kernel directiry.


i have called this func() function in "start_kernel "
function in the main.c file (init directory ) .

also added the prototype of the "func() " in main.c file.

i have made entries in the makefile in kernel directory . ( temp.o as required )

but still i am getting the error regarding the
"ata_piix " module when i give the command " make install " at last stage of compilation.
and if reboot the kernel then it crashes.

if i compile the kernel without adding any of the code as mentioned it gets compiled successful.
and i can reboot the pc in that kernel.


how to go around that?

help me out.
 
Old 02-07-2006, 10:17 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,499

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Kernel hacking is not for the faint of heart ...

What is the problem you are trying to solve by patching the kernel ?
 
Old 02-07-2006, 01:04 PM   #3
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Original Poster
Rep: Reputation: 15
Above example i am just trying to see whether it works out not.
actually i want to call such function in start_kernel which will
access one file from hard disk and read its contents into kernel data structure.
 
Old 02-07-2006, 01:08 PM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,499

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Hmmm, and you believe the file will be readable before its file-system has been mounted ?
 
Old 02-07-2006, 03:07 PM   #5
vishalbutte
Member
 
Registered: Dec 2005
Posts: 80

Original Poster
Rep: Reputation: 15
i am calling my own written function before call to "init_rest()"
in "start_kernel()" in main.c ( fs directory )
If i am not wrong then before that root file system gets mounted.
i can always access any file ( at least hope so ).
 
Old 02-07-2006, 04:07 PM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,499

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Well, you may be right, good luck so.
 
Old 02-07-2006, 10:55 PM   #7
Matir
Moderator
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 118Reputation: 118
First off, the kernel (for several reasons) never handles files in userspace I/O. But you can try. I'm sure it's possible, I'm just not sure of the wisdom.

On another note, what error do you get pertaining to ata_piix?
 
  


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
Kernel compilation problem JJX Linux - Software 4 08-31-2005 05:50 AM
Kernel compilation problem LinuxLover Linux - Enterprise 3 05-11-2005 11:03 AM
Kernel 2.6.8 compilation problem. Mingthefirst Debian 5 08-23-2004 01:57 PM
Kernel Compilation Problem 2.6.7 ultrix Slackware 4 08-11-2004 05:31 AM
Problem after 2.6.3 kernel compilation frzburn Linux - General 3 03-11-2004 07:12 AM


All times are GMT -5. The time now is 09:21 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration