Assembler Error:"Unsupported Relocation type "while compile my code with kernel

2001-03-01 Thread aprasad

Hi,
sorry for this post, but this message i got when  tried to compile my code
in the kernel..
I am unable to figure out the problem.

I have put the my code in drivers/misc directory and made the appropriate
entry in Makefile.

Thanks,
Anil.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Assembler Error:Unsupported Relocation type while compile my code with kernel

2001-03-01 Thread aprasad

Hi,
sorry for this post, but this message i got when  tried to compile my code
in the kernel..
I am unable to figure out the problem.

I have put the my code in drivers/misc directory and made the appropriate
entry in Makefile.

Thanks,
Anil.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



query about sending udp packets in kernel mode

2001-02-16 Thread aprasad

Hi All,

I need to send  udp packets in a kernel module. but i am unable to figure
out how to specify fill the struct msghdr to be used by the sendmsg handler
of the socket.

my skeleton is something like (by going through the kernel code:>)

struct socket *sock;
struct sockaddr_in sin;
struct msghdr msg;

sock_creat(PF_INET, SOCK_DGRAM, IPPROTO_UDP, );
sin.sin_family = AF_INET;
sin.sin_port = htons((unsigned short)serv_port);
sin.sin_addr.s_addr = htonl(INADDR_ANY); /*i am not sure about this*/

msg.msg_name = 
msg.msglen = sizeof(struct sockaddr_in);
msg.msg_iov = iovec_containg the message;
msg.msg_iovlen = 1;
msg.msg_control = NULL;
msg.msg_controllen=0;
msg.msg_flags =0;

sock->ops->sendmsg(sock,,count,0);



i am getting EFAULT.

or can anybody suggest me how to fill the address field of sin_addr in
kernel of any known remote address(corresponding inet_addr) so that
sendto/send can be used.
Any pointers will be greatly appreciated.

Thanks,
Anil.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



query about sending udp packets in kernel mode

2001-02-16 Thread aprasad

Hi All,

I need to send  udp packets in a kernel module. but i am unable to figure
out how to specify fill the struct msghdr to be used by the sendmsg handler
of the socket.

my skeleton is something like (by going through the kernel code:)

struct socket *sock;
struct sockaddr_in sin;
struct msghdr msg;

sock_creat(PF_INET, SOCK_DGRAM, IPPROTO_UDP, sock);
sin.sin_family = AF_INET;
sin.sin_port = htons((unsigned short)serv_port);
sin.sin_addr.s_addr = htonl(INADDR_ANY); /*i am not sure about this*/

msg.msg_name = sin;
msg.msglen = sizeof(struct sockaddr_in);
msg.msg_iov = iovec_containg the message;
msg.msg_iovlen = 1;
msg.msg_control = NULL;
msg.msg_controllen=0;
msg.msg_flags =0;

sock-ops-sendmsg(sock,msg,count,0);



i am getting EFAULT.

or can anybody suggest me how to fill the address field of sin_addr in
kernel of any known remote address(corresponding inet_addr) so that
sendto/send can be used.
Any pointers will be greatly appreciated.

Thanks,
Anil.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: Problems in 2.4 kernel

2001-01-17 Thread aprasad

Sanjeev Wrote:
I am not able to mount my floppy drive. When I try to mount it gives me the
following error
'mount: /dev/fd0 has wrong major or minor number'
_
i think kernel is unable to find the driver for the filesystem type you are
trying to mount.
The supporting module is missing(if its compiled as module)or module path
is not correct

Regards,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Problems in 2.4 kernel

2001-01-17 Thread aprasad

Sanjeev Wrote:
I am not able to mount my floppy drive. When I try to mount it gives me the
following error
'mount: /dev/fd0 has wrong major or minor number'
_
i think kernel is unable to find the driver for the filesystem type you are
trying to mount.
The supporting module is missing(if its compiled as module)or module path
is not correct

Regards,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Normal Response Mode of HDLC for linux

2001-01-07 Thread aprasad

Hi all,
Has anybody written any support for HDLC normal response mode. I could only
find the support of HDLC  asynchronous balanced mode (LAPB).
Any pointers will highly be appreciated.

Thanks,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Normal Response Mode of HDLC for linux

2001-01-07 Thread aprasad

Hi all,
Has anybody written any support for HDLC normal response mode. I could only
find the support of HDLC  asynchronous balanced mode (LAPB).
Any pointers will highly be appreciated.

Thanks,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: How to transfer memory from PCI memory directly to user space safely and portable?

2000-11-26 Thread aprasad


>I'm writing a sound card driver where I need to transfer memory from the
card
>to user space using the CPU. Ideally I'd like to do that without needing
to
>have an intermediate buffer in kernel memory. I have implemented the copy
>functions like this:

>From user space to the sound card:
>
>if (verify_area(VERIFY_READ, user_space_src, count) != 0) {
>return -EFAULT;
>}
>memcpy_toio(iobase, user_space_src, count);
>return 0;

>From the sound card to user space:
>
>if (verify_area(VERIFY_WRITE, user_space_dst, count) != 0) {
>return -EFAULT;
>}
>memcpy_fromio(user_space_dst, iobase, count);
>return 0;


>These functions are called on the behalf of the user, so the current
process
>should be the correct one. The iobase is ioremapped:
>
>iobase = ioremap(sound_card_port, sound_card_io_size);


The best solution will be to let the user mmap the device memory to his
address space.The driver need to provide the interface through ioctl cmd or
mmap file operations.


http://www2.linuxjournal.com/lj-issues/issue28/1287.html
The above link might be usefull though this is for pre2.4 kernel, it needs
some modification for 2.4 kernels.

Regards
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: max memory limits ???

2000-11-25 Thread aprasad


>Matti Aarnio <[EMAIL PROTECTED]> wrote:
>On Wed, Nov 22, 2000 at 03:37:09PM +0200, BenHanokh Gabriel wrote:

>> can some1 explain the memory limits on the 2.4 kernel

>> - what is the limit for user-space apps ?

>At 32 bit systems:  3.5 GB with extreme tricks, 3 GB for more
usual.
user space apps will get killed by OOM if its memory required exceeds the
available physical memory+total swapping space.

Regards
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: max memory limits ???

2000-11-25 Thread aprasad


Matti Aarnio [EMAIL PROTECTED] wrote:
On Wed, Nov 22, 2000 at 03:37:09PM +0200, BenHanokh Gabriel wrote:

 can some1 explain the memory limits on the 2.4 kernel

 - what is the limit for user-space apps ?

At 32 bit systems:  3.5 GB with extreme tricks, 3 GB for more
usual.
user space apps will get killed by OOM if its memory required exceeds the
available physical memory+total swapping space.

Regards
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: "unable to handle paging request..."

2000-11-17 Thread aprasad

but EVERY TIME shut my machine down, I always get the following message,
just after
>the line "stopping all md devices":
I also used to get the same messages on my celeron machine, but after i
disabled the support of RAID in kernel, it started working nicely.
I don't know the reason.

regards,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Bug in 2.4.0-test9 and test10 with sys_shmat()

2000-11-17 Thread aprasad


>Sending -1 as the shmid to shmat will cause an oops.  2.2.16 caught this
>with simple boundry checking, so replace the lines

>if (!shm_sb || (shmid % SEQ_MULTIPLIER) == zero_id)
return -EINVAL;

>with

>if (!shm_sb || shmid < 0 || (shmid % SEQ_MULTIPLIER) == zero_id)
return -EINVAL;

-1 shmid is causing oops only when used with superuser privileges,
otherwise it returns -EINVAL.
regards
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Bug in 2.4.0-test9 and test10 with sys_shmat()

2000-11-17 Thread aprasad


Sending -1 as the shmid to shmat will cause an oops.  2.2.16 caught this
with simple boundry checking, so replace the lines

if (!shm_sb || (shmid % SEQ_MULTIPLIER) == zero_id)
return -EINVAL;

with

if (!shm_sb || shmid  0 || (shmid % SEQ_MULTIPLIER) == zero_id)
return -EINVAL;

-1 shmid is causing oops only when used with superuser privileges,
otherwise it returns -EINVAL.
regards
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: unable to handle paging request...

2000-11-17 Thread aprasad

but EVERY TIME shut my machine down, I always get the following message,
just after
the line "stopping all md devices":
I also used to get the same messages on my celeron machine, but after i
disabled the support of RAID in kernel, it started working nicely.
I don't know the reason.

regards,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



keyboard lockup after kdb session

2000-11-15 Thread aprasad

Hi,
I am new to kdb. my keyboard is locked after kdb-session (either by
generating oops or manual).
is there any way to restore it without rebooting...
thanks
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



keyboard lockup after kdb session

2000-11-15 Thread aprasad

Hi,
I am new to kdb. my keyboard is locked after kdb-session (either by
generating oops or manual).
is there any way to restore it without rebooting...
thanks
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Oops when using MAP_SHARED with do_mmap

2000-11-14 Thread aprasad

Hi,
I have written a simple char device which allocate a page size buffer and
maps this to user-land via mmap-ing. it works if i specify MAP_PRIVATE as
flag in do_mmap but i am getting oops with MAP_SHARED flag.
i am using 2.4-test10 kernel.

attached are files.
(See attached file: char.c)code for the module.
(See attached file: mmap.c)test code.

thanks and regards,
anil

 char.c
 mmap.c


Oops when using MAP_SHARED with do_mmap

2000-11-14 Thread aprasad

Hi,
I have written a simple char device which allocate a page size buffer and
maps this to user-land via mmap-ing. it works if i specify MAP_PRIVATE as
flag in do_mmap but i am getting oops with MAP_SHARED flag.
i am using 2.4-test10 kernel.

attached are files.
(See attached file: char.c)code for the module.
(See attached file: mmap.c)test code.

thanks and regards,
anil

 char.c
 mmap.c


reliability of linux-vm subsystem

2000-11-13 Thread aprasad

Hi,

When i run following code many times.
System becomes useless till all of the instance of this programming are
killed by vmm.
Till that time linux doesn't accept any command though it switches from one
VT to another but its useless.
The above programme is run as normal user previleges.
Theoretically load should increase but system should services other users
too.
but this is not behaving in that way.
___
main()
{
 char *x[1000];
 int count=1000,i=0;
 for(i=0; i http://www.tux.org/lkml/



reliability of linux-vm subsystem

2000-11-13 Thread aprasad

Hi,

When i run following code many times.
System becomes useless till all of the instance of this programming are
killed by vmm.
Till that time linux doesn't accept any command though it switches from one
VT to another but its useless.
The above programme is run as normal user previleges.
Theoretically load should increase but system should services other users
too.
but this is not behaving in that way.
___
main()
{
 char *x[1000];
 int count=1000,i=0;
 for(i=0; i count; i++)
  x[i] = (char*)malloc(1024*1024*10); /*10MB each time*/

}
___
If i run above programm for 10 times , then system is useless for around
5-7minutes on PIII/128MB.

regards,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Oddness in i_shared_lock and page_table_lock nesting hierarchies ?

2000-11-09 Thread aprasad

>I was looking into the vmm code and trying to work out exactly how to fix
>this, and there are
>  some questions in my mind - mainly a few cases (involving multiple vma
>updates) which
>  I'm not sure about the cleanest way to tackle.
>  But before I bother anyone with those, I thought I ought to go through
>the earlier discussions
>  that you had while coming up with what the fix should be. Maybe you've
>already gone over
>  this once.
>  Could you point me to those ? Somehow I haven't been successful in
>locating them.

this link might be useful
http://mail.nl.linux.org/linux-mm/2000-07/msg00038.html

Anil Kumar Prasad,
Hardware Design,
IBM Global Services,
Pune,
INDIA
Phone:6349724 , 4007117 extn:1310


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Oddness in i_shared_lock and page_table_lock nesting hierarchies ?

2000-11-09 Thread aprasad

I was looking into the vmm code and trying to work out exactly how to fix
this, and there are
  some questions in my mind - mainly a few cases (involving multiple vma
updates) which
  I'm not sure about the cleanest way to tackle.
  But before I bother anyone with those, I thought I ought to go through
the earlier discussions
  that you had while coming up with what the fix should be. Maybe you've
already gone over
  this once.
  Could you point me to those ? Somehow I haven't been successful in
locating them.

this link might be useful
http://mail.nl.linux.org/linux-mm/2000-07/msg00038.html

Anil Kumar Prasad,
Hardware Design,
IBM Global Services,
Pune,
INDIA
Phone:6349724 , 4007117 extn:1310


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Userland -> Kernel communication

2000-11-08 Thread aprasad


>I wish to give me some pointers to how to communicate with a kernel module
>from userland.
>May I use sockets?

You can use copy_to/from_user functions present in kernel space, provided
you have valid userland pointers
also put_user/get_user for single datum transfer.

regards
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Userland - Kernel communication

2000-11-08 Thread aprasad


I wish to give me some pointers to how to communicate with a kernel module
from userland.
May I use sockets?

You can use copy_to/from_user functions present in kernel space, provided
you have valid userland pointers
also put_user/get_user for single datum transfer.

regards
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



to resize shared memory segment by using shmctl

2000-11-06 Thread aprasad

Hi,
is it possible to change the size of a preexisting shared memory segment by
using shmctl?

AIX has comand  SHM_SIZE to shmctl to resize any existing shared memory
segment.
can it be done without recreating the whole thing in linux?

thanks
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



to resize shared memory segment by using shmctl

2000-11-06 Thread aprasad

Hi,
is it possible to change the size of a preexisting shared memory segment by
using shmctl?

AIX has comand  SHM_SIZE to shmctl to resize any existing shared memory
segment.
can it be done without recreating the whole thing in linux?

thanks
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



processes> 2^15

2000-11-04 Thread aprasad

Hi all,
after reaching process count something around 30568, processes start
getting pid from start, which ever is the first free entry slot in process
table. that means we can't have simultaneously more than roughly 2^15
processes?
am i correct?

regards,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



processes 2^15

2000-11-04 Thread aprasad

Hi all,
after reaching process count something around 30568, processes start
getting pid from start, which ever is the first free entry slot in process
table. that means we can't have simultaneously more than roughly 2^15
processes?
am i correct?

regards,
Anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



RE: MAP_NR for 2.4

2000-10-20 Thread aprasad

for using MAP_NR with 2.4, i think you can use
macro like

#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) >>PAGE_SHIFT)

regards
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



RE: MAP_NR for 2.4

2000-10-20 Thread aprasad

for using MAP_NR with 2.4, i think you can use
macro like

#define MAP_NR(addr) (((unsigned long)(addr)-PAGE_OFFSET) PAGE_SHIFT)

regards
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: remap_page_range

2000-10-16 Thread aprasad


>suppose i allocate an buffer by calling kmalloc.

>i want to map this buffer to user address space.
>will remap_page_range will automatically map this
>buffer to calling process's address space.

it should do if have the struct vm_area_struct of the calling process.
as far as i know if you implement mmap file operation then this structure
is there.

but how will one get this structure if one is not using mmap file
operation??
Some Linux Guru might be able to tell..

regards,
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: mapping user space buffer to kernel address space

2000-10-15 Thread aprasad

Linus Torvalds wrote:
>> In article <[EMAIL PROTECTED]>,
>>  <[EMAIL PROTECTED]> wrote:
>> >
>> >I have a user buffer and i want to map it to kernel address space
>> >can anyone tell how to do this like in AIX we have xmattach
>
>> Note that it is usually MUCH better to do this the other way around:
>> having a kernel-side buffer, and mapping that into user space. I don't
>> understand why so many people always want to do it the wrong way
around..

>if you could lock the userspace, the interface simplfies: The
>"read" systemcall can lock the userspace buffer given, and then
>initiate the DMA and return when done. Easy.

then is it like every buffer you pass to read system call is pinned down in
memory(user space)??


thanks,


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: mapping user space buffer to kernel address space

2000-10-15 Thread aprasad

Linus Torvalds wrote:
 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] wrote:
 
 I have a user buffer and i want to map it to kernel address space
 can anyone tell how to do this like in AIX we have xmattach

 Note that it is usually MUCH better to do this the other way around:
 having a kernel-side buffer, and mapping that into user space. I don't
 understand why so many people always want to do it the wrong way
around..

if you could lock the userspace, the interface simplfies: The
"read" systemcall can lock the userspace buffer given, and then
initiate the DMA and return when done. Easy.

then is it like every buffer you pass to read system call is pinned down in
memory(user space)??


thanks,


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



getting physical memory of buffer mapped bu kiobuf

2000-10-13 Thread aprasad

hi,
I am mapping user space buffer to kernel space by using kiobufs.
as
..
..
struct kiobuf *iobuf,
alloc_kiovec(1, *iobuf);

map_user_kiobuf() /*for user buffer*/
lock_kiovec();

but to start dma transfers, i must know physical address of mapped pages..
is there any way out???


Anil Kumar Prasad,
Hardware Design Services,
IBM Global Services,
Pune,
INDIA
Phone:6349724 , 4007117 extn:1310


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



getting physical memory of buffer mapped bu kiobuf

2000-10-13 Thread aprasad

hi,
I am mapping user space buffer to kernel space by using kiobufs.
as
..
..
struct kiobuf *iobuf,
alloc_kiovec(1, *iobuf);

map_user_kiobuf() /*for user buffer*/
lock_kiovec();

but to start dma transfers, i must know physical address of mapped pages..
is there any way out???


Anil Kumar Prasad,
Hardware Design Services,
IBM Global Services,
Pune,
INDIA
Phone:6349724 , 4007117 extn:1310


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: calling system call from kernel module

2000-10-12 Thread aprasad


>> Is there any way to call system call from a kernel module???

>yes, just call it. system calls are just functions (mostly exported and
>when otherwise, use sys_call_table[] which is exported, but it won't work
>on __mips__)  so you can just call them.

thanks tigran, but i am new to kernel programming and can you please tell
me how to pass arguments.

suppose i want to open a file
than soemthing like sys_call_table[__NR_OPEN] should be used, but i am
unable to figure out how to pass the arguments.

thanks again,

anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



kmap for dma buffer

2000-10-12 Thread aprasad

hi all,
For dma transfers to/from user space buffer, one need to lock that user
space buffer so that it won't be swaped out. and also
its bus address is obtained by call virt_to_bus and then this bus address
is written to dma controller.
but do we explicitly need to map that user buffer into kernel space by
calling kmap after obtaining the user buffer's page struct??

thanks.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



calling system call from kernel module

2000-10-12 Thread aprasad

hi,
Is there any way to call system call from a kernel module???



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



calling system call from kernel module

2000-10-12 Thread aprasad

hi,
Is there any way to call system call from a kernel module???



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



kmap for dma buffer

2000-10-12 Thread aprasad

hi all,
For dma transfers to/from user space buffer, one need to lock that user
space buffer so that it won't be swaped out. and also
its bus address is obtained by call virt_to_bus and then this bus address
is written to dma controller.
but do we explicitly need to map that user buffer into kernel space by
calling kmap after obtaining the user buffer's page struct??

thanks.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: calling system call from kernel module

2000-10-12 Thread aprasad


 Is there any way to call system call from a kernel module???

yes, just call it. system calls are just functions (mostly exported and
when otherwise, use sys_call_table[] which is exported, but it won't work
on __mips__)  so you can just call them.

thanks tigran, but i am new to kernel programming and can you please tell
me how to pass arguments.

suppose i want to open a file
than soemthing like sys_call_table[__NR_OPEN] should be used, but i am
unable to figure out how to pass the arguments.

thanks again,

anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



ioremap of pci base addresses

2000-10-11 Thread aprasad

hi,
once i have got the pci_dev structure( by calling pci_find*), do i
explicitly need to call ioremap for remapping mmio.
i think pci_enable_device does this. correct me if i am wrong..

thanks,
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: executing function in kernel whose name is known

2000-10-11 Thread aprasad

>
>>
>> >> i know the name of a function which is stored in some string in a
kernel
>> >> module, is there any way to execute that function.
>> >> That function is implemented in a module and has been exported.
>> >> thanks,
>> >> anil
>
>> >you mean execute from userspace? No.
>> >You mean execute from kernel space? Yes, but you would need to ensure
the
>> >module cannot be unloaded (by incrementing its module reference
>> >counter) while the function is invoked.
>> >Tigran
>>
>> module having that function won't be unloaded. but my problem is i know
>> only name (a string containing name of the function) but not function
>> pointer. could you please elaborate on how to do this??
>>

>Indeed, there is a function called get_module_symbol() (in
>kernel/module.c) which gets the address of a symbol in the given module.
>Actually, this doesn't even require kdb -- it is in the plain vanilla
>kernel and is even exported to modules...


thanks Tigran,
i got it working by using get_module_symbol();

its something like

void(*f)(int)


(void*)f = get_module_symbol(NULL, "name of the function");

..
now you have the funtion pointer you can call as you like



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: executing function in kernel whose name is known

2000-10-11 Thread aprasad



>> i know the name of a function which is stored in some string in a kernel
>> module, is there any way to execute that function.
>> That function is implemented in a module and has been exported.
>> thanks,
>> anil

>you mean execute from userspace? No.
>You mean execute from kernel space? Yes, but you would need to ensure the
>module cannot be unloaded (by incrementing its module reference
>counter) while the function is invoked.
>Tigran

module having that function won't be unloaded. but my problem is i know
only name (a string containing name of the function) but not function
pointer. could you please elaborate on how to do this??




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



executing function in kernel whose name is known

2000-10-11 Thread aprasad

hi,
i know the name of a function which is stored in some string in a kernel
module, is there any way to execute that function.
That function is implemented in a module and has been exported.
thanks,
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



executing function in kernel whose name is known

2000-10-11 Thread aprasad

hi,
i know the name of a function which is stored in some string in a kernel
module, is there any way to execute that function.
That function is implemented in a module and has been exported.
thanks,
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: executing function in kernel whose name is known

2000-10-11 Thread aprasad



  i know the name of a function which is stored in some string in a
kernel
  module, is there any way to execute that function.
  That function is implemented in a module and has been exported.
  thanks,
  anil

 you mean execute from userspace? No.
 You mean execute from kernel space? Yes, but you would need to ensure
the
 module cannot be unloaded (by incrementing its module reference
 counter) while the function is invoked.
 Tigran

 module having that function won't be unloaded. but my problem is i know
 only name (a string containing name of the function) but not function
 pointer. could you please elaborate on how to do this??


Indeed, there is a function called get_module_symbol() (in
kernel/module.c) which gets the address of a symbol in the given module.
Actually, this doesn't even require kdb -- it is in the plain vanilla
kernel and is even exported to modules...


thanks Tigran,
i got it working by using get_module_symbol();

its something like

void(*f)(int)


(void*)f = get_module_symbol(NULL, "name of the function");

..
now you have the funtion pointer you can call as you like



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



ioremap of pci base addresses

2000-10-11 Thread aprasad

hi,
once i have got the pci_dev structure( by calling pci_find*), do i
explicitly need to call ioremap for remapping mmio.
i think pci_enable_device does this. correct me if i am wrong..

thanks,
anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: getting "struct pci_dev" from "struct netdevice"

2000-10-10 Thread aprasad

>>
>> Since struct pci_dev is probably going to morph into a more generic
>> struct hw_dev, maybe struct netdevice needs a pci_dev member...

> alan cox wrote:
>There is no guarantee there would be a meaningful pci_dev. In addition in
>a hot pluggable box the pointer is useless since it will change arbitarily

i searched through pci net drivers. all the drivers are setting their
pci_dev->driver_data field to net_device structure. this is working for
single device being controlled by driver but i am not sure about multiple
pci devices being controlled by same driver.

anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



getting "struct pci_dev" from "struct netdevice"

2000-10-10 Thread aprasad

hi all,
given struct netdevice for any pci network device, is there any way to get
corresponding
"struct pci_dev".


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



getting struct pci_dev from struct netdevice

2000-10-10 Thread aprasad

hi all,
given struct netdevice for any pci network device, is there any way to get
corresponding
"struct pci_dev".


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: getting struct pci_dev from struct netdevice

2000-10-10 Thread aprasad


 Since struct pci_dev is probably going to morph into a more generic
 struct hw_dev, maybe struct netdevice needs a pci_dev member...

 alan cox wrote:
There is no guarantee there would be a meaningful pci_dev. In addition in
a hot pluggable box the pointer is useless since it will change arbitarily

i searched through pci net drivers. all the drivers are setting their
pci_dev-driver_data field to net_device structure. this is working for
single device being controlled by driver but i am not sure about multiple
pci devices being controlled by same driver.

anil


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



atoi() in kernel

2000-10-08 Thread aprasad

hi!
is there anything exported for kernel for use with modules that does
coversion from alphnumeric to interger or anything like sscanf()


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



atoi() in kernel

2000-10-08 Thread aprasad

hi!
is there anything exported for kernel for use with modules that does
coversion from alphnumeric to interger or anything like sscanf()


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Problem with console level while switching from kernel mode to user mode

2000-10-04 Thread aprasad

hi everybody,
i am writting a character device driver. i am pritting some debugging
messages using  printk in kernel. now the problem is after switching from
kernel space to user space when any system call (read/write ) is done, i am
unable to print any messages using printf calls. but if write is working
fine with fd =1,
thanks,
anil

note: please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Problem with console level while switching from kernel mode to user mode

2000-10-04 Thread aprasad

hi everybody,
i am writting a character device driver. i am pritting some debugging
messages using  printk in kernel. now the problem is after switching from
kernel space to user space when any system call (read/write ) is done, i am
unable to print any messages using printf calls. but if write is working
fine with fd =1,
thanks,
anil

note: please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



problem with kmalloc

2000-09-23 Thread aprasad

hi!
this is related to previous problem,
when i tried to allocate 64k of physical memory by calling
kmalloc(64*1024-1, GFP_KERNEL), it allocated the memory, also wrote the
memory, but when i read it, it gave Ayeei message, saying interrupt
handlers has been killed..and computer hanged, its kernel-2.2.14-5.0
what could be the reason??

note:please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



kmalloc and get_free_pages failure

2000-09-23 Thread aprasad

i tried to allocate physical memory of 128k by calling kmalloc function,
passing parameter of (128k-1)bytes, but the computer hanged. when i made it
to 32k , the computer rebooted,
i am using 2.2.14-5.0 kernel.
same was the case with get_free_pages() service..

note:please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



kmalloc and get_free_pages failure

2000-09-23 Thread aprasad

i tried to allocate physical memory of 128k by calling kmalloc function,
passing parameter of (128k-1)bytes, but the computer hanged. when i made it
to 32k , the computer rebooted,
i am using 2.2.14-5.0 kernel.
same was the case with get_free_pages() service..

note:please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



problem with kmalloc

2000-09-23 Thread aprasad

hi!
this is related to previous problem,
when i tried to allocate 64k of physical memory by calling
kmalloc(64*1024-1, GFP_KERNEL), it allocated the memory, also wrote the
memory, but when i read it, it gave Ayeei message, saying interrupt
handlers has been killed..and computer hanged, its kernel-2.2.14-5.0
what could be the reason??

note:please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



PCI-DMA

2000-09-18 Thread aprasad

hi,
 can anybody tell, where to find information about dma usage by pci
-devices in linux

note:please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



PCI-DMA

2000-09-18 Thread aprasad

hi,
 can anybody tell, where to find information about dma usage by pci
-devices in linux

note:please cc the answer


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



can kernel memory allocated by kmalloc be swapped out??

2000-09-17 Thread aprasad

hi everyone,

suppose i allocate some kernel memory in a module by calling kmalloc,
can that memory be swapped out, for example in AIX even the kernel memory
which is allocated by rmalloc is swappable!!

Note: please cc the answer as i am not registered to kernel mailing list


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



can kernel memory allocated by kmalloc be swapped out??

2000-09-17 Thread aprasad

hi everyone,

suppose i allocate some kernel memory in a module by calling kmalloc,
can that memory be swapped out, for example in AIX even the kernel memory
which is allocated by rmalloc is swappable!!

Note: please cc the answer as i am not registered to kernel mailing list


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



insmod failure in kernel-2.2.14

2000-09-16 Thread aprasad

i am using kernel-2.2.14-5.0,
i wrote a simple module to just printk a a message and tried to insmod it,
but
it gave error message: resource/device busy (EBUSY)
but the message gets printed in /var/log/messages

the code is:
--
#define MODULE
#include
int init_module(void)
{
 printk("this is amodule");
}
void cleanup_module(void)
{
 printk("removing the module");
}

NOTE:kindly cc the message to [EMAIL PROTECTED]


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/