The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What are the benchmark programs for Message passing? gkreddy Linux Benchmarks 0 10-25-2007 09:58 PM
passing value to a variable in a SQL kamitsin UNIX for Advanced & Expert Users 4 08-30-2007 12:21 PM
Passing Variables to Awk Bab00shka Shell Programming and Scripting 2 10-05-2004 04:18 AM
how to passing message along pipes?? iminus High Level Programming 1 09-19-2001 07:02 PM
passing a value coughlin74 UNIX for Dummies Questions & Answers 3 09-18-2001 11:33 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-18-2008
Registered User
 

Join Date: Mar 2008
Posts: 1
Message passing to kernel in minix

i want to add a system call(successfuly added) and pass the message(which contains int and a string)

/*code i used my program calling system call printmsg*/

message mm;
mm.m1_i1=10;
mm.m1_p1="hello";
printmsg(&mm);

/*user library*/

printmsg(*m1)
{
printf("integer is:%d",m1->m1_i1); /*getting correct output as 10*/
printf("str:%s",%s",m_in->m1_p1); /*getting output as hello*/
return(_syscall(FS,PRINTMSG,m1));
}


/* my system call code in misc.c */

int printmsg()
{
printf("integer is:%d",m_in.m1_i1); /*getting correct output as 10*/
printf("str:%s",%s",m_in.m1_p1); /*getting str: all_nr=%d slot1=%d */
return ok;
}

m_in which is a global varaible..m1 will be assigned to m_in once syscall is made. correct me if am wrong.

i could not able to pass the string to system call(kernel). am getting something like "str: all_nr=%d slot1=%d ".but if i print in user library am getting correct output.
i have sent lot of times to debug.. can onyone help me out..

Last edited by kathir_dz; 03-18-2008 at 12:01 PM. Reason: change
Reply With Quote
Forum Sponsor
  #2  
Old 03-19-2008
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 4,298
The firs probelm I see is that you seem to have created a kernel module that calls the STDC user-space module: printf I am guessing you are on Linux. This probably will not work. Some implementations of the printf family call malloc, for example.

read up on kprintf
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:16 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0