Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Bad Address when adding system call Post 302522330 by majid.merkava on Saturday 14th of May 2011 07:36:26 PM
Old 05-14-2011
Bad Address when adding system call

Hi guys.

I have downloaded kernel 2.6.38-5 to add a system call.
I did the following steps:

1. I have added my system call to system call table
Code:
<src folder>/arc/x86/kernel/syscall_table_32.S

.long sys_mycall

2. i have added the system cal number in
Code:
<src folder>/include/asm-generic/unistd.h

#define __NR_mycall 244
__SYSCALL(__NR_mycall, sys_mycall)

3. I have added the prototype to syscalls.h
Code:
<src follder>/include/linux/syscalls.h

asmlinkage long sys_mycall(long input);

4. here is my system call
Code:
asmlinkage long sys_mycall(long input)
{
return (input * 2);
}

5. I have edited the Makfiles
Now after compilation when i use it via syscall() it gives me "BAD ADDRESS" with errno set to 14.

What should i do?

---------- Post updated 2011-05-15 at 04:06 AM ---------- Previous update was 2011-05-14 at 08:39 PM ----------

On x86, system call number 244 is already taken by get_thread_area(), which takes as first argument a pointer to a struct user_desc:
Code:
int get_thread_area(struct user_desc *u_info);

You are passing a number instead of a pointer, the kernel is trying to interpret it as a pointer, it's determining that it points outside of your process, and returning -EFAULT.

According to this file
Code:
/usr/include/asm/unistd_32.h

the only system call number available is 251. so i changed my system call number to 251.
But this time it says: Function not implemented with errno = 38
 

9 More Discussions You Might Find Interesting

1. Solaris

ifconfig bad address

hi all iam trying to set my eri0 interface but with little luck . when i set the ip using ipconfig i always get "bad adress".. moreover when i use ifconfig eri0 i can notice that the inet is 0.0.0.0 and the netmask 0 i am runnig solaris 9 on sparc . any helpis highly appreciated ... ... (2 Replies)
Discussion started by: ppass
2 Replies

2. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

3. IP Networking

Bad Address

I am trying to write a C server code that will handle WWW request from client. i am very new to socket programming. i can very well setup the socket...but when an incomin request comes from a browser, the progrom exits with an error message "Bad address". the following is the code. please do help... (1 Reply)
Discussion started by: shankarramv
1 Replies

4. Solaris

File system is bad

Hi all, we have a 280R with Solaris 10 11/06 and Oracle 10 installed. For unknown reason the system become instable and after a reboot (init 6) we got the message to run fsck manually. We did the check many time and now we have this result: # fsck /dev/md/dsk/d0 IS CURRENTLY MOUNTED... (5 Replies)
Discussion started by: Petrucci
5 Replies

5. IP Networking

ifconfig: ce401001: bad address

HI All, My interface card has failed.If i am giving the command to uplumb it i am getting an error. ce401001: flags=219040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,FAILED,CoS> mtu 1500 index 3 inet 10.188.24.18 netmask ffffffc0 broadcast 10.188.24.63 # ifconfig... (2 Replies)
Discussion started by: sag71155
2 Replies

6. Programming

Adding custom ("Hello") system call: help

I'm trying to add a custom ("Hello world" :o) system call. In /usr/src/linux/hello/ I put simple hello.c ...#include "linux/linkage.h" // for linking a system call #include "linux/kernel.h" // for "printk" asmlinkage int sys_hello() { printk(KERN_ALERT "Hello!"); return 1; }... and in... (5 Replies)
Discussion started by: courteous
5 Replies

7. Red Hat

Adding our system call Fedora 18 -new syscall

Hi, I wanna add my own system call to Fedora 18 kernel 3.8.2. From kernel 3.3 I heard there is a new system to add system calls. So where i can find a guides ? I wanna print this text: "Hello world!" in terminal, not dmesg. (4 Replies)
Discussion started by: googz
4 Replies

8. Shell Programming and Scripting

Adding 'from' email address alias in Linux.

Hi Experts, We want to add the 'from' email address to mailx command in all our linux script. After searching this site I am able to find the command '-- -f' to add the from the email address. Bu the problem is our from email address is :- "Proper Support Name <support@company.com>" Now when I... (6 Replies)
Discussion started by: Amey Joshi
6 Replies

9. Solaris

Bad system call (core dumped) Solaris 11.2 (installation of Sybase 12.5.4)

Dear all, I am trying to install Sybase ASE 12.5.4 on a Sun OS Solaris 11.2 (sparcv9) machine but I am getting the following messages when launching the setup file : -bash-4.1$ ./setup InstallShield Wizard Initializing InstallShield Wizard... Searching for Java(tm) Virtual Machine...... (2 Replies)
Discussion started by: clement_te
2 Replies
Locale::Codes::LangExt(3)				User Contributed Perl Documentation				 Locale::Codes::LangExt(3)

NAME
Locale::Codes::LangExt - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangExt; $lext = code2langext('acm'); # $lext gets 'Mesopotamian Arabic' $code = langext2code('Mesopotamian Arabic'); # $code gets 'acm' @codes = all_langext_codes(); @names = all_langext_names(); DESCRIPTION
The "Locale::Codes::LangExt" module provides access to standard codes used for identifying language extensions, such as those as defined in the IANA language registry. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default IANA language registry codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language extensions. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langext('acm','alpha'); $lext = code2langext('acm',LOCALE_LANGEXT_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from the IANA language registry, such as 'acm' for Mesopotamian Arabic. This is the default code set. ROUTINES
code2langext ( CODE [,CODESET] ) langext2code ( NAME [,CODESET] ) langext_code2code ( CODE ,CODESET ,CODESET2 ) all_langext_codes ( [CODESET] ) all_langext_names ( [CODESET] ) Locale::Codes::LangExt::rename_langext ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangExt::add_langext ( CODE ,NAME [,CODESET] ) Locale::Codes::LangExt::delete_langext ( CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_alias ( NAME ,NEW_NAME ) Locale::Codes::LangExt::delete_langext_alias ( NAME ) Locale::Codes::LangExt::rename_langext_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::add_langext_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangExt::delete_langext_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iana.org/assignments/language-subtag-registry The IANA language subtag registry. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-02-27 Locale::Codes::LangExt(3)
All times are GMT -4. The time now is 05:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy