![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#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 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
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 |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|