Jump to content

Problem with set_fs function in linux 2.4 kernel module

Recommended Posts



I'm writing kernel module for embedded system working on Linux kernel 


CPU on the device is ARM926ejs. Communication with device - serial port 

(COM). Here is a code fragment:


if( sock->ops && sock->ops->ioctl ) {

   old_fs = get_fs();

   printk( KERN_ALERT "aaa\n" );

   set_fs( KERNEL_DS );

   printk( KERN_ALERT "bbb\n" );

   retval = sock->ops->ioctl( ... );

   set_fs( old_fs );




Module loads perfectly and works until the function "set_fs(KERNEL_DS)" 

is called. In HyperTerminal i see message "aaa", but cannot see "bbb". 

The behavior of device is strange: no kernel_panic, no error messages, 

nothing, it "dies" silently and absolutely till power switching. I 

suppose that the problem dialed with domain switching but cannot see 

where is error. I tried to write local_irq_disable()/local_irq_enable() 

around set_fs() - no effect. Does anybody know how to fix problem?

P.S. On x86 processors module works.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...