LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 05-15-2004, 07:08 AM   #1
riquelme
LQ Newbie
 
Registered: May 2004
Posts: 5

Rep: Reputation: 0
Unhappy how to define variables in the c file of kernel


I want to write a system call to examine the frequecy of the page fault, so I defined two external variables to count, but that can't pass the make bzImage. I don't know why.

I'm a fresh man, and want to learn more about the linux kernel.

Thanks!
 
Old 05-15-2004, 07:57 AM   #2
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
You'll need to give us a detailed description of what you're doing and post the relavent piece of code. Good luck

Alex
 
Old 05-16-2004, 07:42 PM   #3
riquelme
LQ Newbie
 
Registered: May 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Thank you!
I defined the two external variables in linux/mm.h(2.4.22),they are fault_pages and mapped _pages.
And I used the former in do_page_fault() and the later in do_mmap() to count.
Then I wanted to use them in my system call in asm/i386/mm/fault.c, so I hadn't written code except for the two defining, which is the cause of the errors after implementing "make bzImage" .
I can't define external variables in the kernel file as I do in ordinary C program, can I?

Thank you!
 
  


Reply



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
Best way to define variables? Yig Linux - Software 3 08-24-2005 05:09 PM
Setting Bash Variables from outside data file llewis Programming 10 01-12-2005 04:30 AM
php projects: define each class in a seperate file? ldp Programming 4 09-16-2004 05:00 PM
using variables from a file tangle Linux - Software 0 06-25-2003 10:07 AM
define file as a directory? canon Linux - General 4 03-19-2003 02:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:25 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
Open Source Consulting | Domain Registration