Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

log to file from kext

 
   Macintosh computer (Home) -> General Discussion RSS
Next:  DVD+R in my iBook  
Author Message
Braden

External


Since: Sep 06, 2004
Posts: 2



(Msg. 1) Posted: Mon Sep 06, 2004 1:14 pm
Post subject: log to file from kext
Archived from groups: comp>sys>mac>programmer>misc (more info?)

I have been trying to get my kext to log to an arbitrary logfile, and
have been experiencing an unending stream of kernel panics with no
success. I started using VOP_LOOKUP directly on the rootvnode with no
luck, and have since been trying namei() without any luck. A code
snippet follows of where I stand right now (a stripped down and
simplified version of my intentions), and I would appreciate any help!
Thanks, I have tried almost endless permutations of what I perceive
to be the possibilities and all have failed...

   int error;
   size_t size;
   struct nameidata ndp;
   const char pathBuf[]="/logKext";
   char * kpathBuf;

   MALLOC(kpathBuf,char *,16,M_NAMEI,M_WAITOK);
   copyinstr(pathBuf,kpathBuf,16,&size);

   NDINIT(&ndp,CREATE,FOLLOW,UIO_SYSSPACE,kpathBuf,current_proc());
  
   error = namei(&ndp);
   if (error)
    printf("namei returns %u\n",error);<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: log to file from kext 
Back to top
Login to vote
Sean McBride

External


Since: Jan 05, 2004
Posts: 498



(Msg. 2) Posted: Mon Sep 06, 2004 4:25 pm
Post subject: Re: log to file from kext [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <53f284ee.0409061114.118eec81.TakeThisOut@posting.google.com>,
braden127.TakeThisOut@myrealbox.com (Braden) wrote:

 > I have been trying to get my kext to log to an arbitrary logfile, and

You are not supposed to write to disk from a kext. This is a FAQ on the
darwin development list, and everytime people say don't do it. I
believe it IS possible, but you need to have superpowers. You might
check the list archives.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: log to file from kext 
Back to top
Login to vote
Braden

External


Since: Sep 06, 2004
Posts: 2



(Msg. 3) Posted: Mon Sep 13, 2004 12:43 pm
Post subject: Re: log to file from kext [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

 > You are not supposed to write to disk from a kext. This is a FAQ on the
 > darwin development list, and everytime people say don't do it. I
 > believe it IS possible, but you need to have superpowers. You might
 > check the list archives.

Therefore, would I be correct in saying that the best way to get data
out of the kext and into a file would be to communicate it to a daemon
(Mach RPC?) and then have the daemon log it to a file?<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: log to file from kext 
Back to top
Login to vote
Sean McBride

External


Since: Jan 05, 2004
Posts: 498



(Msg. 4) Posted: Mon Sep 13, 2004 3:29 pm
Post subject: Re: log to file from kext [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <53f284ee.0409131043.372f9dad.TakeThisOut@posting.google.com>,
braden127.TakeThisOut@myrealbox.com (Braden) wrote:

 > Therefore, would I be correct in saying that the best way to get data
 > out of the kext and into a file would be to communicate it to a daemon

Yup. A userland daemon and some kind of user client or something in
your kext to pass the data to/from userland.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: log to file from kext 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
file location on Mac OSX - i would like to locate the files that store my email msgs from the Mail app. i have a form online that, when submited from my site, emails the content to me. i would like to write a C++ program that would automatically parse the info DIRECTLY from my..

Creating a file of a particular type on Mac OSX - Hi, I am trying to create a file of a particular type and since I am not a regular Macintosh developer, I have run into problems. Firstly I don't know the right way to create a file(I am using CARBON). Are there any samples anywhere on the web? Secondl...

BOMArchiveHelper ignoring protections in ZIP file - We have a small Java tool that we have been distributing for 10.1 and 10.2 as a simple ZIP file because it is unpacked automatically and is ready to go. The user drags the tool wherever they want it. With 10.3, the default opener for ZIP files has become...

problem creating a file (rather long) - hello, I write an application (carbon), both for OS9 and OS X. By the way, I'm still looking for an IDE able to produce the two executables on a single plateform. I'm currently working alternatively with ProjectBuilder and CodeWarrior to do that. But it...

Running a DOS Batch File on a Macintosh - I created a batch file that posts an announcement to a website. Obviously this works great in a Windows environment. The problem is that the user of the batch file does not have a Windows PC -- Just a MAC. Anyone have any ideas on how to execute the....
   Macintosh computer (Home) -> General Discussion All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]