03-18-2008
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 04:01 PM..
Reason: change
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to write a program that calls two differant scripts. One sets a variable's value and the other one needs to be able to access that value. Can I pass the variable back to the program from the first script? (3 Replies)
Discussion started by: coughlin74
3 Replies
2. Programming
Dear All,
Would you tell me how I can passing a message along pipes?
I have built a token ring connected with pipes, but I don't know how to pass the message along it through the command line...
Thx.
Yours,
i- (1 Reply)
Discussion started by: iminus
1 Replies
3. Linux Benchmarks
Is there any benchmark programs for Message Passing like SPLASH-2 for Shared Memory. (0 Replies)
Discussion started by: gkreddy
0 Replies
4. Programming
Hii can anyone pls tell how to limit the max no of message in a posix message queue. I have made changes in proc/sys/fs/mqueue/msg_max
But still whenever i try to read the value of max. message in the queue using attr.mq_curmsgs (where struct mq_attr attr) its giving the default value as 10.... (0 Replies)
Discussion started by: mohit3884
0 Replies
5. Solaris
Hello,
Has somebody download it before oracle deleted from support section?
I tried dl it from:
oracle.com/us/products/tools/message-passing-toolkit-070499.html Oracle Message Passing Toolkit
but:
section decommissioned. Same in support and edelivery
I phoned to oracle support and... (2 Replies)
Discussion started by: time0ut
2 Replies
6. Programming
Hi guys,
I'm in a job of converting a restful webservice to soap. Tool for convertation uses XQuery.
Now i need to convert a message like this:
{
"firstName": "John",
"midName": null,
"lastName": "Smith",
"married": false,
"address": {
"streetAddress": "21 2nd... (5 Replies)
Discussion started by: tien86
5 Replies
7. Shell Programming and Scripting
I have an for loop that reads the following file
cat param.cfg
val1:env1:opt1
val2:env2:opt2
val3:env3:opt3
val4:env4:opt4
.
.
The for loop extracts the each line of the file so that at any one point, the value of i is
val1:env1:opt1 etc...
I would like to extract each... (19 Replies)
Discussion started by: goddevil
19 Replies
8. Shell Programming and Scripting
I have one script that calls another script during execution. The other script does some processing, then either returns with exit 0 (if successful), or exits with error code numbers (if failed). However, in addition to the error code, I would like for that second script to be able to pass a... (4 Replies)
Discussion started by: AcerAspirant
4 Replies
9. UNIX and Linux Applications
ssmtp has been running well under Kubuntu 12.04.1 for plain text messages. I would like to send html messages with ssmtp -t < /path/to/the/message.txt, but I cannot seem to get the message.txt file properly formatted. I have tried various charsets,
Content-Transfer-Encoding, rearranging the... (0 Replies)
Discussion started by: Ronald B
0 Replies
10. IP Networking
Hi,
I am trying my hand in networking programming in C, and got stuck in piping.
I was following some tutorial and did the forking like :
while (1)
{
newsockfd = accept(sockfd,
(struct sockaddr *) &cli_addr, &clilen);
if (newsockfd < 0)
... (4 Replies)
Discussion started by: abhi1988sri
4 Replies
mp(3) Library Functions Manual mp(3)
NAME
madd, msub, mult, mdiv, gcd, invert, rpow, msqrt, mcmp, min, omin, fmin, m_in, mout, omout, fmout, m_out, sdiv, itom - Performs multiple
precision integer arithmetic
LIBRARY
Object Code Library (libmp.a)
SYNOPSIS
#include <mp.h> #include <stdio.h>
typedef struct mint { int len; short *val; } MINT; madd( MINT *a, MINT *b, MINT *c );
msub( MINT *a, MINT *b, MINT *c );
mult( MINT *a, MINT *b, MINT *c );
mdiv( MINT *a, MINT *b, MINT *q, MINT *r );
pow( MINT *a, MINT *b, MINT *m, MINT *c );
gcd( MINT *a, MINT *b, MINT *c );
invert( MINT *a, MINT *b, MINT *c );
rpow( MINT *a, int n, MINT *c );
msqrt( MINT *a, MINT *b, MINT *r );
mcmp( MINT *a, MINT *b );
move( MINT *a, MINT *b );
min( MINT *a );
omin( MINT *a );
fmin( MINT *a, FILE *f );
m_in( MINT *a, int n, FILE *f );
mout( MINT *a );
omout( MINT *a );
fmout( MINT *a, FILE *f );
m_out( MINT *a, int n, FILE *f );
sdiv( MINT *a, short n, MINT *q, short *r );
*itom( short n );
DESCRIPTION
These functions perform arithmetic on integers of arbitrary length. The integers are stored using the defined type MINT. Pointers to a
MINT can be initialized using the itom() function, which sets the initial value to n. After that, space is managed automatically by the
routines.
The madd(), msub() , and mult() functions assign to c the sum, difference, and product, respectively, of a and b.
The mdiv() function assigns to q and r the quotient and remainder obtained from dividing a by b. The sdiv() function is like the mdiv()
function except that the divisor is a short integer n and the remainder is placed in a short integer whose address is given as r.
The msqrt() function produces the integer square root of a in b and places the remainder in r.
The rpow() function calculates in c the value of a raised to the (``regular'' integral) power n, while the pow() function calculates this
with a full multiple precision exponent b and the result is reduced modulo m.
The gcd() function returns the greatest common denominator of a and b in c, and the invert() function computes c such that a*c mod b = 1,
for a and b relatively prime.
The mcmp() function returns a negative, zero, or positive integer value when a is less than, equal to, or greater than b, respectively.
The move() function copies a to b.
The min() and mout() functions do decimal input and output while the omin() and omout() functions do octal input and output. More gener-
ally, the fmin() and fmout() functions do decimal input and output using file f, and m_in() and m_out do input and output with arbitrary
radix n.
On input, records should have the form of strings of digits terminated by a newline; output records have a similar form.
NOTES
Programs which use the multiple-precision arithmetic library must be compiled with -lmp. delim off
mp(3)