[PLUG] Creating a proc entry

2005-02-22 Thread Shrinand Javadekar
Hi!!

I want to create a file in /proc which I would be using for
some of interprocess communication.

The code snippet is given below.  However, it just does not seem to work
:((. The code compiles perfectly but the function create_proc_entry returns
NULL everytime :(.

Is there something I'm missing out on? All suggestions are welcome :)

COde:
==

struct proc_dir_entry *entry;
char * filename = "spoon";
entry = create_proc_entry(filename,0444,(struct proc_dir_entry *)0);
...



Thanks in advance
-Shri
--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] [PROG]Writing to a /proc entry

2005-03-20 Thread Shrinand Javadekar
Hi,

I have a problem regarding a /proc entry.

I created a /proc entry (/proc/spoon) from a kernel module. Now, there
is a user mode process which has to access this entry and write some
data into it. I am using the regular 'open' and 'write' system calls
in the user mode process to open /proc/spoon and write into it.

I am able to open /proc/spoon but am not able to write into it. The
entry /proc/spoon does have write permissions and I am opening the
file in RDWR mode as well. Is there anything I need to do more to make
it work? Or else, is there anything related to the proc filesystem
that I am missing out on?


Thanks in advance :)
-Shri
--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


Re: [PLUG] [PROG]Writing to a /proc entry

2005-03-21 Thread Shrinand Javadekar
> Are you sure if anything can be written to /Proc? if yes, I thiink
> only root is able to write,.
> 

If no one can write to /proc how is it used for communication between
kernel mode and user mode?

And all the code that I am trying out is being executed as root. Yet
it does not work.
In fact I even tried to open the file /proc/spoon (as root )using vi.
It opens, but does not allow me to write to it.

-Shri
--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


Re: [PLUG] [PROG]Writing to a /proc entry

2005-03-21 Thread Shrinand Javadekar
> If you are accessing /proc/spoon with user program
> thats executed as root then theres no problem to write
> /proc entries. I already did that and able to write to
> /proc entry.
> 
> > If no one can write to /proc how is it used for
> > communication between
> > kernel mode and user mode?
> 
>  /proc is virtual filesystem that stores kernel
> internal states in various files under /proc dir.
>   You are confusing with /proc system. Kernel
> writes to /proc entries via
> typedef int (get_info_t)(char *, char **, off_t, int);
>  interface provided by proc_fs.h check
> /usr/src/linux-2.4/include/linux/proc_fs.h
> 
>  how user mode communicates kernel=> by using say
> cat /proc/net/route to print kernel IP routing table
> 
> > And all the code that I am trying out is being
> > executed as root. Yet
> > it does not work.
> > In fact I even tried to open the file /proc/spoon
> > (as root )using vi.
> > It opens, but does not allow me to write to it.
> >
> > -Shri
> Hope this helps you to understand /proc

Thanks a million linux_lover :) . Thats as comprehensive as one could
get. But i guess, I have a long way to go for understanding /proc.

This post is just to clarify some points.
In my case both the kernel mode routine (which creates the /proc
entry) and the user mode process (which has to read/write to the /proc
entry) are mine.

I had not registered the handlers for the read and write calls for the
/proc entry. Although I have not tried it practically yet, I guess
registering them would do the trick.
When a process gives a call to write to the /proc entry, the read
routine registered with the kernel is called. Similarly when a process
gives a call to read the /proc entry, the write routine regiestered
for that /proc entry is called. As these routines have not been
registered, the calls will definitely not go ahead.

Will definitely try that asap and will keep the group posted about the progress.

Thanks
-Shri
--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] openSolaris

2005-03-24 Thread Shrinand Javadekar
The Solaris operating system is going to be made open source. For more
details refer to the following site:

http://www.opensolaris.org/

When it does get open source, will be allowed to discuss about it here
on this group or will we  restrict ourselves to Linux?

Comments awaited :)
-Shri
--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] A request

2005-03-31 Thread Shrinand Javadekar
Can someone give a live demo of kernel debugging? (In the meeting on
this Sat or even otherwise)

In fact, if we show people how to write a small module and also show
them the use of the debugger, there will be many people who would get
hooked into kernel programming.

If such an activity has been carried out at PLUG recently, plz
recently ignore this mail :)

Thanks in advance
-Shri
--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] Just for pedantic purposes

2005-04-20 Thread Shrinand Javadekar
Hey all, 
Theres nothing gr8 in the question that i'm about to ask. Its just for
letting you put your thinking hats on :).

For the question, courtesy : kernelnewbies.org

If I have an executable say 'N', but I do not want it to be executed
(without modifyiing the .out file), how would I be able to do it?

Remember, you should think about the following scenarios:
linking (sym or hard)
copying the file
renaming the file
obtaining source code, changing it, recompiling as a different
executable (i think this is impossible to avoid:) )

-Shri

--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] Accessing the file table in the kernel

2005-05-24 Thread Shrinand Javadekar
Every process has its own file table where its stores apart from other
details the fds of the files it has opened and the current offset from
where the next read/write operation will begin.

How do I access this table in my kernel module? I want to change the
offset of a particular file to EOF.

-Shri

--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] Changing d_name from dirent in getdents64

2005-05-26 Thread Shrinand Javadekar
What I am trying to do is something like this:

For a file, say named 'config', I want to have 2 names for it ,say
'config' and 'donfig'. So when I do an 'ls' on that directory, I
should be able to see 2 files 'config' and 'donfig'

$ ls
config donfig
$

I DO NOT have the liberty of using symlinks. Other changes in the open
syscall to handle 'donfig' as a name will be done later. Rite now I
just want the above mentioned directory listing.

To achieve, I have hooked the getdents64 syscall. The algorithm for my
getdents64 routine is as follows:

1) Call the original getdents64
2) Make a copy the dirent entry of 'config' and in that replace the
name 'config' with 'donfig'; keeping other things the same.

But as you might have guessed correctly, this does not work :((

If I do not change the name to 'donfig', I do see 2 entries for
'config'. But if change any character of the name, the entry is not
seen in the output.
Is there any checksum or anything similar involved?

I am on Fedora Core 1, Kernel 2.4.22

-Shri

--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] Modifying the output of 'ls'

2005-05-27 Thread Shrinand Javadekar
What I am trying to do is something like this:

For a file, say named 'config', I want to have 2 names for it ,say
'config' and 'donfig'. So when I do an 'ls' on that directory, I
should be able to see 2 files 'config' and 'donfig'

$ ls
config donfig
$

I DO NOT have the liberty of using symlinks. Other changes in the open
syscall to handle 'donfig' as a name will be done later. Rite now I
just want the above mentioned directory listing.

To achieve, I have hooked the getdents64 syscall. The algorithm for my
getdents64 routine is as follows:

1) Call the original getdents64
2) Make a copy the dirent entry of 'config' and in that replace the
name 'config' with 'donfig'; keeping other things the same.

But as you might have guessed correctly, this does not work :((

If I do not change the name to 'donfig', I do see 2 entries for
'config'. But if change any character of the name, the entry is not
seen in the output.
Is there any checksum or anything similar involved?

I am on Fedora Core 1, Kernel 2.4.22

-Shri

--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] Re: Modifying the output of 'ls'

2005-05-30 Thread Shrinand Javadekar
>
> How about hard link?
> 

Ideally no links should be used. Neither symlink, nor hard link. If we
could get a solution without links then it would be gr8.

However, I would also like like to know how could we do this using links. 

Thanks in advance
-Shri

--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


[PLUG] System call interface

2005-07-06 Thread Shrinand Javadekar
If a function is written in a kernel module (and not hooked to any
syscall) and that kernel module is loaded in memory, can user-land
programs call that function?

Also, does making an entry in the syscall table mean writing an
interrupt handler?

Thanks in advance
-Shri

--
__
Pune GNU/Linux Users Group Mailing List:  (plug-mail@plug.org.in)
List Information:  http://plug.org.in/mailing-list/listinfo/plug-mail
Send 'help' to [EMAIL PROTECTED] for mailing instructions.


Re: [PLUG] vmware on 64 bit ubuntu

2009-05-13 Thread Shrinand Javadekar
On Tue, May 12, 2009 at 7:14 AM,  wrote:

> I'm trying to install vmware server 2.0 on ubuntu 8.10(64-bit) using
> installer (.bundle) package, It gives me error, Vmware cannot be installed
> on KVM enabled kernel. I'm using default kernel provided with Ubuntu 8.10.
> --
> Sharique
> ___
> Pune GNU/Linux Users Group Mailing List
>

The following link might be useful... It talks about VMware Workstation..
but I'm fairly certain that it would be applicable to Vmware Server too.
The short answer to your problem is to find out which KVM modules are
running (lsmod |grep kvm) and then rmmod those modules.

http://communities.vmware.com/thread/188359

-- Shri
___
Pune GNU/Linux Users Group Mailing List 


Re: [PLUG] Serial Communication Code

2009-06-21 Thread Shrinand Javadekar
On Thu, Jun 18, 2009 at 10:25 PM, Suraj Swami wrote:
> Hi,
>
> I trying to write a basic serial communication code in linux. I am well
> verse to serial communication but have never done so in Linux.
>
> I tried many forums but they had solution to complex issue. And I just want
> a basic code and  some basics of serial communication in Linux. I guess to I
> need to some drivers but I not fimiliar with it.
>
>
> Regards,
> Suraj Swami,
> suraj.g.sw...@gmail.com

What do you want to do exactly? If you want to communicate using a
"serial port", use /dev/ttyS*. Drivers should already be installed.

-Shri

___
Pune GNU/Linux Users Group Mailing List 

Re: [PLUG] Random number ( integer code )

2009-09-29 Thread Shrinand Javadekar
On Mon, Sep 28, 2009 at 12:14 PM, Suraj Swami  wrote:
> Hi,
>
> I was trying to generate random number integer in CPP ( gcc compiler ) using
> rand() function. But it is giving some error. I have tried a few things.
> Which did not work. As I am not at my home PC right now hence I am unable to
> tell the error I am facing.
>
> But can any one suggest a code to generate random numbers without using
> rand() function.
>
> Thanks in advance.
>
>
>
> Regards,
> Suraj Swami,
> ___
> Pune GNU/Linux Users Group Mailing List
>

This should help:
http://linux.die.net/man/3/rand

___
Pune GNU/Linux Users Group Mailing List 


Re: [PLUG] Tomcat default home page not accessible for Linux (CENTOS) host

2009-09-30 Thread Shrinand Javadekar
On Wed, Sep 30, 2009 at 10:01 AM, Rajendra Sakpal
 wrote:
> Hi Friends,
>
> I am accessing Tomcat homepage from a LINUX host deploying CENTOS 5.3.
> Tomcat is deployed on WINDOWS machine.  I could access the TOMCAT homepage
> from WINDOWS host.
>
> The WINDOWS host can be pinged from the CENTOS machine.  The firewalls on
> CENTOS host & WINDOWS host are disabled.
>
> Do let me know if you have any pointers on why the Tomcat home page is not
> accessible from the CENTOS machine.
>
> thanks & regards,
> Rajendra
> ___
> Pune GNU/Linux Users Group Mailing List
>

I'm no expert on this.. but here's what I think.
Have you made sure that TOMCAT is bound to all interfaces? What does
the netstat -a command give you? It should be something like:

% netstat -na | grep 8080
tcp46  0  0  *.8080 *.*LISTEN
% _

It might be that its only running on localhost:
% netstat -na | grep 8080
tcp4   0  0  127.0.0.1.8080 *.*LISTEN
% _

___
Pune GNU/Linux Users Group Mailing List 

[PLUG] Fwd: VMware pre-release with replay / reverse debugging for linux/gdb is available

2009-10-06 Thread Shrinand Javadekar
-- Forwarded message --
From: Michael Snyder
Date: Mon, Oct 5, 2009 at 3:29 PM
Subject: VMware pre-release with replay / reverse debugging for
linux/gdb  is available
To: g...@sourceware.org


Hello,

For those who are interested, VMware has made available a free
pre-release version of its Workstation 7.0 product, with support
for replay and reverse debugging of Linux guests using gdb from
the host.

This is a free download with a time-limited serial number,
and minimal intrusive requirements (registration with any
email address, and agreeing to a EULA).

Among the nifty things supported are fully deterministic
replay debugging of guest kernels, including all drivers and
modules, starting right from kernel start-up (and including
reverse debugging).  User-mode multi-thread reverse/replay
debugging is also supported.  This is full-system replay, if
you go backwards your windows will undraw themselves, files
will unwrite themselves, etc.  All processes on the system
will run backward in sync with each other.  Packets will
return to their senders, etc.

Download from here (I hope installation instructions are clear):
http://communities.vmware.com/community/beta/workstation

"Getting Started" user docs are here:
http://communities.vmware.com/docs/DOC-10714

Please let me know if you have any problems or comments.

Michael Snyder
(VMware, Inc.)

___
Pune GNU/Linux Users Group Mailing List