linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Reg mkdir syscall
       [not found] <Pine.LNX.4.10.10106031716330.3971-100000@blrmail>
@ 2001-06-04 16:34 ` SATHISH.J
  2001-06-05  5:02   ` H. Peter Anvin
  2001-06-08  6:26 ` Reg compiling of source code SATHISH.J
  2001-06-11  4:59 ` exec format error SATHISH.J
  2 siblings, 1 reply; 32+ messages in thread
From: SATHISH.J @ 2001-06-04 16:34 UTC (permalink / raw)
  To: linux-kernel

Hi,
Sorry to disturb you.

Actually I had written a small file system(on 2.2.14 kernel) similar  to
RAMFS on 2.4 kernel. I am able to mount it but when I try to create
directory under it, it gives EEXIST error saying" file already exists" but
when I check the directory again that file gets created. But the link
count of the parent remains the same. I do not know how this directory
gets created but with an error message. Please also tell me what all
functions mkdir passes thro' while creating a directory. One more thing is
when I took an strace of mkdir command the syscall mkdir fails with
EEXIST error.
Please help me with your thoughts.

Thanks in advance,

Regards,
sathish.j





^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg mkdir syscall
  2001-06-04 16:34 ` Reg mkdir syscall SATHISH.J
@ 2001-06-05  5:02   ` H. Peter Anvin
  0 siblings, 0 replies; 32+ messages in thread
From: H. Peter Anvin @ 2001-06-05  5:02 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <Pine.LNX.4.10.10106042157410.10477-100000@blrmail>
By author:    "SATHISH.J" <sathish.j@tatainfotech.com>
In newsgroup: linux.dev.kernel
> 
> Actually I had written a small file system(on 2.2.14 kernel) similar  to
> RAMFS on 2.4 kernel. I am able to mount it but when I try to create
> directory under it, it gives EEXIST error saying" file already exists" but
> when I check the directory again that file gets created. But the link
> count of the parent remains the same. I do not know how this directory
> gets created but with an error message. Please also tell me what all
> functions mkdir passes thro' while creating a directory. One more thing is
> when I took an strace of mkdir command the syscall mkdir fails with
> EEXIST error.
> Please help me with your thoughts.
> 

Your code is broken.

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg compiling of source code
       [not found] <Pine.LNX.4.10.10106031716330.3971-100000@blrmail>
  2001-06-04 16:34 ` Reg mkdir syscall SATHISH.J
@ 2001-06-08  6:26 ` SATHISH.J
  2001-06-14  7:52   ` Reg-directory size SATHISH.J
  2001-06-11  4:59 ` exec format error SATHISH.J
  2 siblings, 1 reply; 32+ messages in thread
From: SATHISH.J @ 2001-06-08  6:26 UTC (permalink / raw)
  To: linux-kernel

Hi,
Sorry to disturb you.

I am in the process of writing a file system on 2.2.14 kernel similar to
ramfs on 2.4 kernel. I feel I should put some debug statements in the vfs
code and check the working. Please help me by trelling me how to compile
code in the vfs layer and add it to kernel. This info would be very
helpful for me and I am stuck up here.

Thanks in advance.

Regards,
sathish



^ permalink raw reply	[flat|nested] 32+ messages in thread

* exec format error
       [not found] <Pine.LNX.4.10.10106031716330.3971-100000@blrmail>
  2001-06-04 16:34 ` Reg mkdir syscall SATHISH.J
  2001-06-08  6:26 ` Reg compiling of source code SATHISH.J
@ 2001-06-11  4:59 ` SATHISH.J
  2001-06-11  6:08   ` David Woodhouse
  2 siblings, 1 reply; 32+ messages in thread
From: SATHISH.J @ 2001-06-11  4:59 UTC (permalink / raw)
  To: linux-kernel

Hi,
Sorry to disturb you.

I have written a file system in 2.2.14 kernel similar to ramfs on 2.5
kernel. I am able to register,mount and do file and directory operations.
I tried to write a C program and compile it. The compilation gave me the
object file. When i tried to run the object file it gave me an error 
" cannot execute binary file". I entered gdb and  I could get the error
"exec format error". What is exec format error and what is it because of?
Please help me out with this info.

Thanks in advance,

Regards,
sathish



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: exec format error
  2001-06-11  4:59 ` exec format error SATHISH.J
@ 2001-06-11  6:08   ` David Woodhouse
  0 siblings, 0 replies; 32+ messages in thread
From: David Woodhouse @ 2001-06-11  6:08 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 942 bytes --]


sathish.j@tatainfotech.com said:
> I have written a file system in 2.2.14 kernel similar to ramfs on 2.5
> kernel. I am able to register,mount and do file and directory
> operations. I tried to write a C program and compile it. The
> compilation gave me the object file. When i tried to run the object
> file it gave me an error  " cannot execute binary file". I entered gdb
> and  I could get the error "exec format error". What is exec format
> error and what is it because of? Please help me out with this info.

Assuming you did compile an executable, not just try to execute the .o file,
then your filesystem probably corrupted the executable. Building and linking
programs stresses parts of the filesystem that your other tests cannot
reach. In particular, it does lots of seeking and writing to places other
than the end of the file, which isn't trivial to do from a shell script. 

Try running the attached test program.


--
dwmw2


[-- Attachment #2: holey.c --]
[-- Type: text/plain , Size: 3076 bytes --]

#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>

/*  #define FILE_SIZE 50 * 4096 + 1 */
#define FILE_SIZE 106497
#define FILE_NAME "/mnt/jffs2/holey_file"
#define ITERATIONS 100000

#define SEED 123456789
#define min(x,y) ((x)<(y) ? (x):(y))
int randint (int low, int high)
{
  int normalized;

  normalized = (int) ( (float) rand() / ( (float) RAND_MAX / (float) (high - low + 1) ) );
  return (normalized + low);
}


int main (int argc, char *argv[])
{

  unsigned char holey_image[FILE_SIZE],
                holey_image_mem[FILE_SIZE], buf[FILE_SIZE];
  char *fname = malloc (strlen(FILE_NAME) + 8);
  char *errmsg = malloc (100);
  int holey_f;
  int start, size;
  int i, j;
  unsigned char c;
  int err;
  int written, newly_written, nwritten;

  srand (SEED);

  sprintf (fname, "%s%s%d", FILE_NAME, "-", getpid()); /* random file name to scribble on */

  if ((holey_f = open (fname, O_RDWR | O_CREAT | O_TRUNC, 
			S_IRUSR | S_IWUSR)) < 0) {
    perror ("Can't open holey file.");
    exit (-1);
  }

  c = (char) 0;
  /* initialize in memory check array, and buffer */
  for (i = 0; i < FILE_SIZE; i++) {
    holey_image[i] = holey_image_mem[i] = (char) 0;
    buf[i] = c++;
  }

 /* make a file with a big hole at the beginning */
  if (lseek (holey_f, FILE_SIZE-1, SEEK_SET) != FILE_SIZE-1) {
    perror ("Initial write of holey file failed");
    exit (-1);
  }

  c = '1';
  if (write (holey_f, &c, 1) != 1) {
    perror ("Write at and of hole failed");
    exit (-1);
  }
  holey_image[FILE_SIZE-1] = c;

  written = newly_written = 0;

  for (i = 0; i < ITERATIONS; i++) {

    size = randint (1, FILE_SIZE); /* how much to write */
    start = randint (0, (FILE_SIZE - size)); /* where to write it */
 /*     printf ("Start=%d, size=%d.\n", start, size); */

    lseek (holey_f, start, SEEK_SET);
    if ( (nwritten = write (holey_f, &buf, size)) != size) {
      sprintf (errmsg, "Could only write %d of %d bytes", nwritten, size); 
      perror (errmsg);
      exit (-1);
    }
    printf("%d bytes written to %d\n", size , start);

    written += size;
    newly_written += size;

    if (newly_written > 10000000) {
      printf ("%d bytes written.\n", written);
      newly_written = 0;
    }

    /* do the same copy in memory */
    memcpy (&holey_image[start], buf, size);
    memset(&holey_image_mem, 0x5a, FILE_SIZE);
    /* check to make certain that entire file looks like it's supposed to */
    lseek (holey_f, 0, SEEK_SET);
    if ( (read (holey_f, &holey_image_mem, FILE_SIZE)) != FILE_SIZE) {
      perror ("Rereading of file failed");
      exit (-1);
    }
   
    err = memcmp (&holey_image, &holey_image_mem, FILE_SIZE);
    if (err) {

      /* find the offset where they differ */
      j = 0;
      while (holey_image[j] == holey_image_mem[j]) 
	j++;

      printf ("File image is incorrect at offset %d. buf is %2.2X, file %2.2X\n", j, holey_image[j], holey_image_mem[j]);
      exit (-1);
    }

  } /* for (i... */

} /* main */
    
  

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg-directory size
  2001-06-08  6:26 ` Reg compiling of source code SATHISH.J
@ 2001-06-14  7:52   ` SATHISH.J
  2001-06-14  8:53     ` Daniel Phillips
  2001-06-14 10:23     ` RAM filesystem directory size SATHISH.J
  0 siblings, 2 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-14  7:52 UTC (permalink / raw)
  To: linux-kernel

Hi,
When we create lot of files and directories under a directory the size of
the directory changes after aparticular limit. I could find that if the
size of directory is 4096 it can create 341 files(size of qstr structure
for each file is 12 bytes,so 4096/12=341.xx) before it changes to 8192. 
Please tell me where in the code does this directory size changes. Is it
in VFS level or in  the file system level? Please tell me this which would
be of great use to me.

Thanks in advance,
With Regards,
Sathish.J 


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg-directory size
  2001-06-14  7:52   ` Reg-directory size SATHISH.J
@ 2001-06-14  8:53     ` Daniel Phillips
  2001-06-14 10:23     ` RAM filesystem directory size SATHISH.J
  1 sibling, 0 replies; 32+ messages in thread
From: Daniel Phillips @ 2001-06-14  8:53 UTC (permalink / raw)
  To: SATHISH.J, linux-kernel

On Thursday 14 June 2001 09:52, SATHISH.J wrote:
> Hi,
> When we create lot of files and directories under a directory the size of
> the directory changes after aparticular limit. I could find that if the
> size of directory is 4096 it can create 341 files(size of qstr structure
> for each file is 12 bytes,so 4096/12=341.xx) before it changes to 8192.
> Please tell me where in the code does this directory size changes. Is it
> in VFS level or in  the file system level? Please tell me this which would
> be of great use to me.

Filesystem.  Look in fs/ext2/dir.c and namei.c for typical examples.

--
Daniel

^ permalink raw reply	[flat|nested] 32+ messages in thread

* RAM filesystem directory size
  2001-06-14  7:52   ` Reg-directory size SATHISH.J
  2001-06-14  8:53     ` Daniel Phillips
@ 2001-06-14 10:23     ` SATHISH.J
  2001-06-15 10:22       ` Reg file system hash function SATHISH.J
  1 sibling, 1 reply; 32+ messages in thread
From: SATHISH.J @ 2001-06-14 10:23 UTC (permalink / raw)
  To: linux-kernel

Hi,

Sorry for disturbing you all.

On RAMFS on 2.4 kernel, What is the default directory size? Does the size
of directory(number of blocks) change with the increase in the number of
files or directories under it? If so, please tell me which part of RAMFS
code it is implemented. 

Thanks in advance,
With Regards,
Sathish.J


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg file system hash function
  2001-06-14 10:23     ` RAM filesystem directory size SATHISH.J
@ 2001-06-15 10:22       ` SATHISH.J
  2001-06-15 10:30         ` Russell King
  2001-06-17  8:06         ` Reg:dentry->d_mounts value SATHISH.J
  0 siblings, 2 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-15 10:22 UTC (permalink / raw)
  To: linux-kernel

Hi,

In the vfs layer when we see the lookup_dentry() function code we see that
a part of the code checks whether low level filesystem wants to use its
own hash. the part odf the code that calls the filesystem dependant
hashing is  "error = base->d_op->d_hash->(base,&this);". Why should it
callfilesystem dependant hashing. What is the main purpose of hashing
here.
Please help me with these details. 

Thanks in advance,
Regards,
sathish.j
 



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg file system hash function
  2001-06-15 10:22       ` Reg file system hash function SATHISH.J
@ 2001-06-15 10:30         ` Russell King
  2001-06-17  8:06         ` Reg:dentry->d_mounts value SATHISH.J
  1 sibling, 0 replies; 32+ messages in thread
From: Russell King @ 2001-06-15 10:30 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

On Fri, Jun 15, 2001 at 03:52:52PM +0530, SATHISH.J wrote:
> In the vfs layer when we see the lookup_dentry() function code we see that
> a part of the code checks whether low level filesystem wants to use its
> own hash. the part odf the code that calls the filesystem dependant
> hashing is  "error = base->d_op->d_hash->(base,&this);". Why should it
> callfilesystem dependant hashing. What is the main purpose of hashing
> here.
> Please help me with these details. 

It is used in two cases.  If a filesystem has:

1. case-insensitive filenames (its much better to have the names 'FOO' and
   'foo' refer to the same dentry, since they refer to the same file)

2. a limited filename length and your filesystem truncates names (on a
   non-vfat filesystem 'dosfilen.ame' and 'dosfilename.ame' would be the
   same file and the same dentry structure).

--
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg:dentry->d_mounts value
  2001-06-15 10:22       ` Reg file system hash function SATHISH.J
  2001-06-15 10:30         ` Russell King
@ 2001-06-17  8:06         ` SATHISH.J
  2001-06-17  8:14           ` Reg:magic number of the filesystem SATHISH.J
  1 sibling, 1 reply; 32+ messages in thread
From: SATHISH.J @ 2001-06-17  8:06 UTC (permalink / raw)
  To: linux-kernel

Hi,

Sorry to disturb you all.

In the d_alloc() function in the vfs layer of the filesystem(2.2.14
kernel) we can see the following: 

        dentry->d_mounts = dentry;
        dentry->d_covers = dentry;
        
Why should both the above be assigned the values of dentry. Wher elase is
this used. Please help me with this information. 

Thanks in advance,
Regards,
sathish.j


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg:magic number of the filesystem
  2001-06-17  8:06         ` Reg:dentry->d_mounts value SATHISH.J
@ 2001-06-17  8:14           ` SATHISH.J
  2001-06-17  8:21             ` Reg:use of file_system_type structure SATHISH.J
  2001-06-17  8:26             ` Reg:magic number of the filesystem Alexander Viro
  0 siblings, 2 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-17  8:14 UTC (permalink / raw)
  To: linux-kernel

Hi,

Every file system has a magic number. Can you please tell me what for this
magic number is used. When do we really use this unique magic number of
the file system and why?

Thanks in advance.

With Regards,
sathish



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg:use of file_system_type structure
  2001-06-17  8:14           ` Reg:magic number of the filesystem SATHISH.J
@ 2001-06-17  8:21             ` SATHISH.J
  2001-06-17  8:21               ` Alexander Viro
                                 ` (2 more replies)
  2001-06-17  8:26             ` Reg:magic number of the filesystem Alexander Viro
  1 sibling, 3 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-17  8:21 UTC (permalink / raw)
  To: linux-kernel

Hi,
Every file system has file_system_type structure defined. Where else this
structure is referred. Does register_filesystem() refer this structure.
Does sys_mount refer to this structure by any means?


Please help me with the info.

Thanks in advance,
Regards,
sathish.j



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg:use of file_system_type structure
  2001-06-17  8:21             ` Reg:use of file_system_type structure SATHISH.J
@ 2001-06-17  8:21               ` Alexander Viro
  2001-06-18  7:56               ` function of getname() function SATHISH.J
  2001-06-21 12:06               ` Reg:use of file_system_type structure Anuradha Ratnaweera
  2 siblings, 0 replies; 32+ messages in thread
From: Alexander Viro @ 2001-06-17  8:21 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel



On Sun, 17 Jun 2001, SATHISH.J wrote:

> Hi,
> Every file system has file_system_type structure defined. Where else this
> structure is referred. Does register_filesystem() refer this structure.
> Does sys_mount refer to this structure by any means?

Umm... No offense, but
	* all of these questions take a couple of minutes to answer.
	* if you know how to use grep you should be able to find the
answer faster than anybody could reply
	* if you know C the last two questions are non-issue (everyone who
doubts that is welcome to read the register_filesystem() source and see
what arguments do its callers pass to it)
	* it looks suspiciously similar to, pardon me, attempt to cheat on
a quiz.


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg:magic number of the filesystem
  2001-06-17  8:14           ` Reg:magic number of the filesystem SATHISH.J
  2001-06-17  8:21             ` Reg:use of file_system_type structure SATHISH.J
@ 2001-06-17  8:26             ` Alexander Viro
  1 sibling, 0 replies; 32+ messages in thread
From: Alexander Viro @ 2001-06-17  8:26 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel



On Sun, 17 Jun 2001, SATHISH.J wrote:

> Hi,
> 
> Every file system has a magic number. Can you please tell me what for this
> magic number is used. When do we really use this unique magic number of
> the file system and why?

find . -name *.[chS] >/tmp/list
xargs </tmp/list grep -nw s_magic
xargs </tmp/list grep -nw statfs
man 2 statfs
man 2 fstatfs
man 2 ustat


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: function of getname() function
  2001-06-18  7:56               ` function of getname() function SATHISH.J
@ 2001-06-18  7:42                 ` Alexander Viro
  2001-06-18  7:47                 ` Tigran Aivazian
                                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 32+ messages in thread
From: Alexander Viro @ 2001-06-18  7:42 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel



On Mon, 18 Jun 2001, SATHISH.J wrote:

> Hi,
> 
> Sorry if this question is too silly.
> 
> I could not understand what getname(filename) function in the sys_open()
> function is doing. I could not understand from the code what exactly it is
> doing. Please help me with the same.

It allocates a buffer and copies file name from user memory to that buffer.


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: function of getname() function
  2001-06-18  7:56               ` function of getname() function SATHISH.J
  2001-06-18  7:42                 ` Alexander Viro
@ 2001-06-18  7:47                 ` Tigran Aivazian
  2001-06-18  8:35                 ` Reg:current a pointer to task_struct SATHISH.J
  2001-06-20  9:41                 ` filldir() function SATHISH.J
  3 siblings, 0 replies; 32+ messages in thread
From: Tigran Aivazian @ 2001-06-18  7:47 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

Hi Sathish,

The function of getname() is to allocate some (kernel-space) memory for
the userspace-passed filename and copy it from user space to kernel space.

Regards,
Tigran

On Mon, 18 Jun 2001, SATHISH.J wrote:

> Hi,
> 
> Sorry if this question is too silly.
> 
> I could not understand what getname(filename) function in the sys_open()
> function is doing. I could not understand from the code what exactly it is
> doing. Please help me with the same.
> 
> Thanks in advance,
> 
> Regards,
> sathish
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


^ permalink raw reply	[flat|nested] 32+ messages in thread

* function of getname() function
  2001-06-17  8:21             ` Reg:use of file_system_type structure SATHISH.J
  2001-06-17  8:21               ` Alexander Viro
@ 2001-06-18  7:56               ` SATHISH.J
  2001-06-18  7:42                 ` Alexander Viro
                                   ` (3 more replies)
  2001-06-21 12:06               ` Reg:use of file_system_type structure Anuradha Ratnaweera
  2 siblings, 4 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-18  7:56 UTC (permalink / raw)
  To: linux-kernel

Hi,

Sorry if this question is too silly.

I could not understand what getname(filename) function in the sys_open()
function is doing. I could not understand from the code what exactly it is
doing. Please help me with the same.

Thanks in advance,

Regards,
sathish




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg:current a pointer to task_struct
  2001-06-18  7:56               ` function of getname() function SATHISH.J
  2001-06-18  7:42                 ` Alexander Viro
  2001-06-18  7:47                 ` Tigran Aivazian
@ 2001-06-18  8:35                 ` SATHISH.J
  2001-06-18  8:49                   ` Reg putname() function SATHISH.J
  2001-06-18  9:06                   ` Reg:current a pointer to task_struct george anzinger
  2001-06-20  9:41                 ` filldir() function SATHISH.J
  3 siblings, 2 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-18  8:35 UTC (permalink / raw)
  To: linux-kernel

Hi,

Please help me with the following:

I tried to go through get_current function which is in assembly.

static inline struct task_struct * get_current(void) {
        struct task_struct *current;
        __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
        return current;
 }


Please tell me what is done here. Does current refer to process onproc.


Thanks in advance,
Regards,
sathish



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg putname() function
  2001-06-18  8:35                 ` Reg:current a pointer to task_struct SATHISH.J
@ 2001-06-18  8:49                   ` SATHISH.J
  2001-06-18  9:06                   ` Reg:current a pointer to task_struct george anzinger
  1 sibling, 0 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-18  8:49 UTC (permalink / raw)
  To: linux-kernel

Hi,

Can anybody please tell me what the following assembly code means:
Tne function put_unused_fd() does FD_CLR() to clear the file descriptor
allocated in case file pointer could not be got. Before returning -1 as
file descriptor it goes to put_unused_fd() which calls FD_CLR() which is
as follows;

#define __FD_CLR(fd,fdsetp) \
                __asm__ __volatile__("btrl %1,%0": \
                        "=m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int)
(fd)))

This is in asm/posixtypes.h. Please decipher this for me.

Thanks in advance,
Regards,
sathish



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg:current a pointer to task_struct
  2001-06-18  8:35                 ` Reg:current a pointer to task_struct SATHISH.J
  2001-06-18  8:49                   ` Reg putname() function SATHISH.J
@ 2001-06-18  9:06                   ` george anzinger
  1 sibling, 0 replies; 32+ messages in thread
From: george anzinger @ 2001-06-18  9:06 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

"SATHISH.J" wrote:
> 
> Hi,
> 
> Please help me with the following:
> 
> I tried to go through get_current function which is in assembly.
> 
> static inline struct task_struct * get_current(void) {
>         struct task_struct *current;
>         __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
>         return current;
>  }
> 
> Please tell me what is done here. Does current refer to process onproc.

Actually the code returns the stack pointer (esp) anded with ~8191
(FFFE000).

The trick is that kernel task structures are allocated at the low end of
the kernel stack for each task.  The stack is a the high end of the
address range and works down.  (Kernel stack overflow will "eat" the
task structure.)

current is (struct tast_struct *) and points to the task_struc for the
current task (how could it be otherwise, given that it comes from the
tasks stack pointer).

George

^ permalink raw reply	[flat|nested] 32+ messages in thread

* filldir() function
  2001-06-18  7:56               ` function of getname() function SATHISH.J
                                   ` (2 preceding siblings ...)
  2001-06-18  8:35                 ` Reg:current a pointer to task_struct SATHISH.J
@ 2001-06-20  9:41                 ` SATHISH.J
  2001-06-20 22:26                   ` Jan Kara
  2001-06-25  7:11                   ` Reg Kernel Debugger kdb SATHISH.J
  3 siblings, 2 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-20  9:41 UTC (permalink / raw)
  To: linux-kernel

Hi,

Please someone tell me what is the function of filldir() function. I
could not understand it from the code. Just give me an outline of what it
will do.

Thanks in advance,
Regards,
sathish.j




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: filldir() function
  2001-06-20  9:41                 ` filldir() function SATHISH.J
@ 2001-06-20 22:26                   ` Jan Kara
  2001-06-25  7:11                   ` Reg Kernel Debugger kdb SATHISH.J
  1 sibling, 0 replies; 32+ messages in thread
From: Jan Kara @ 2001-06-20 22:26 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

  Hello,

> Please someone tell me what is the function of filldir() function. I
> could not understand it from the code. Just give me an outline of what it
> will do.
  This function is used in foo_readdir() (ie. ext2_readdir()). Purpose
of this function is to copy given data to buffer supplied by user.

								Honza
--
Jan Kara <jack@suse.cz>
SuSE Labs

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg:use of file_system_type structure
  2001-06-17  8:21             ` Reg:use of file_system_type structure SATHISH.J
  2001-06-17  8:21               ` Alexander Viro
  2001-06-18  7:56               ` function of getname() function SATHISH.J
@ 2001-06-21 12:06               ` Anuradha Ratnaweera
  2 siblings, 0 replies; 32+ messages in thread
From: Anuradha Ratnaweera @ 2001-06-21 12:06 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

On Sun, Jun 17, 2001 at 01:51:39PM +0530, SATHISH.J wrote:
>
> Every file system has file_system_type structure defined. Where else this
> structure is referred. Does register_filesystem() refer this structure.  Does
> sys_mount refer to this structure by any means?

For this and all your other questions, refer

www.kernelnewbies.org

-- 

Penguin : Linux 2.4.6-pre3 on an i586

When people say nothing, they don't necessarily mean nothing.


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg Kernel Debugger kdb
  2001-06-20  9:41                 ` filldir() function SATHISH.J
  2001-06-20 22:26                   ` Jan Kara
@ 2001-06-25  7:11                   ` SATHISH.J
  2001-06-25  7:33                     ` siva kumar
                                       ` (3 more replies)
  1 sibling, 4 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-25  7:11 UTC (permalink / raw)
  To: linux-kernel

Hi,
I would like to use a kernel debugger to set some breakpoints in some
of the kernel functions. In SVR4 and unixware we use kdb. What is its
equivalent in linux? Please tell me where the kernel debugger can be
downloaded for linux.

Thanks in advance,

With regards,
sathish.j




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg Kernel Debugger kdb
  2001-06-25  7:11                   ` Reg Kernel Debugger kdb SATHISH.J
@ 2001-06-25  7:33                     ` siva kumar
  2001-06-25  8:36                     ` Keith Owens
                                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 32+ messages in thread
From: siva kumar @ 2001-06-25  7:33 UTC (permalink / raw)
  To: SATHISH.J, linux-kernel

Hi,
You can download kernel debugger(kgdb) form the
following location:

http://kgdb.sourceforge.net/toc.html

Bye,
siva.s

--- "SATHISH.J" <sathish.j@tatainfotech.com> wrote:
> Hi,
> I would like to use a kernel debugger to set some
> breakpoints in some
> of the kernel functions. In SVR4 and unixware we use
> kdb. What is its
> equivalent in linux? Please tell me where the kernel
> debugger can be
> downloaded for linux.
> 
> Thanks in advance,
> 
> With regards,
> sathish.j
> 
> 
> 
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at 
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg Kernel Debugger kdb
  2001-06-25  7:11                   ` Reg Kernel Debugger kdb SATHISH.J
  2001-06-25  7:33                     ` siva kumar
@ 2001-06-25  8:36                     ` Keith Owens
  2001-06-26  4:54                     ` Reg Kernel Debugger kgdb SATHISH.J
  2001-06-26 16:17                     ` Reg Kernel Debugger kgdb Timur Tabi
  3 siblings, 0 replies; 32+ messages in thread
From: Keith Owens @ 2001-06-25  8:36 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

On Mon, 25 Jun 2001 12:41:53 +0530 (IST), 
"SATHISH.J" <sathish.j@tatainfotech.com> wrote:
>I would like to use a kernel debugger to set some breakpoints in some
>of the kernel functions. In SVR4 and unixware we use kdb. What is its
>equivalent in linux? Please tell me where the kernel debugger can be
>downloaded for linux.

ftp://oss.sgi.com/projects/kdb/download.  The man pages are in the
patch, in Documentation/kdb/...


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg Kernel Debugger kgdb
  2001-06-25  7:11                   ` Reg Kernel Debugger kdb SATHISH.J
  2001-06-25  7:33                     ` siva kumar
  2001-06-25  8:36                     ` Keith Owens
@ 2001-06-26  4:54                     ` SATHISH.J
  2001-06-26 10:01                       ` using gdb to debug kernel SATHISH.J
  2001-06-26 16:17                     ` Reg Kernel Debugger kgdb Timur Tabi
  3 siblings, 1 reply; 32+ messages in thread
From: SATHISH.J @ 2001-06-26  4:54 UTC (permalink / raw)
  To: linux-kernel

Hi,

I couls see http://kgdb.sourceforge.net/ the kgdb for 2.4.5 kernel
version. Can I use the same for 2.2.14 kernel which I am using? If so how
can I use gdb.bz2 downloaded file. I have this downloaded to my windows
machine and have ftp ed to my linux machine to my home directory. Please
tell me how I should go about it.

Thanks in advance,

Regards,
sathish.j




^ permalink raw reply	[flat|nested] 32+ messages in thread

* using gdb to debug kernel
  2001-06-26  4:54                     ` Reg Kernel Debugger kgdb SATHISH.J
@ 2001-06-26 10:01                       ` SATHISH.J
  2001-06-26 10:57                         ` Lars Marowsky-Bree
  2001-06-26 11:10                         ` Reg installing a patch on linux SATHISH.J
  0 siblings, 2 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-26 10:01 UTC (permalink / raw)
  To: linux-kernel

Hi,

I would like to know how I can use gdb to debug some function in the
kernel. Please help me out with this detail.

Thanks in advance,


Regs,
sathish



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: using gdb to debug kernel
  2001-06-26 10:01                       ` using gdb to debug kernel SATHISH.J
@ 2001-06-26 10:57                         ` Lars Marowsky-Bree
  2001-06-26 11:10                         ` Reg installing a patch on linux SATHISH.J
  1 sibling, 0 replies; 32+ messages in thread
From: Lars Marowsky-Bree @ 2001-06-26 10:57 UTC (permalink / raw)
  To: SATHISH.J; +Cc: linux-kernel

On 2001-06-26T15:31:04,
   "SATHISH.J" <sathish.j@tatainfotech.com> said:

> I would like to know how I can use gdb to debug some function in the
> kernel. Please help me out with this detail.

The easiest way would be user-mode-linux, hosted on sourceforge.net.

Sincerely,
    Lars Marowsky-Brée <lmb@suse.de>

-- 
Perfection is our goal, excellence will be tolerated. -- J. Yahl


^ permalink raw reply	[flat|nested] 32+ messages in thread

* Reg installing a patch on linux
  2001-06-26 10:01                       ` using gdb to debug kernel SATHISH.J
  2001-06-26 10:57                         ` Lars Marowsky-Bree
@ 2001-06-26 11:10                         ` SATHISH.J
  1 sibling, 0 replies; 32+ messages in thread
From: SATHISH.J @ 2001-06-26 11:10 UTC (permalink / raw)
  To: linux-kernel

Hi,
Please tell me how to install a patch on linux kernel. I have downloaded a
patch "kernel-patch-2_2_13-kdb_0_6-2.deb". How to install this patch? I am
using a 2.2.14-12 kernel. Can I install the above patch. 

The main idea of mine is to install kdb to debug the kernel. Please help
me out with this.

Thanks in advance,
sathish.j



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Reg Kernel Debugger kgdb
  2001-06-25  7:11                   ` Reg Kernel Debugger kdb SATHISH.J
                                       ` (2 preceding siblings ...)
  2001-06-26  4:54                     ` Reg Kernel Debugger kgdb SATHISH.J
@ 2001-06-26 16:17                     ` Timur Tabi
  3 siblings, 0 replies; 32+ messages in thread
From: Timur Tabi @ 2001-06-26 16:17 UTC (permalink / raw)
  To: linux-kernel

** Reply to message from "SATHISH.J" <sathish.j@tatainfotech.com> on Tue, 26
Jun 2001 10:24:02 +0530 (IST)


> I couls see http://kgdb.sourceforge.net/ the kgdb for 2.4.5 kernel
> version. Can I use the same for 2.2.14 kernel which I am using?

Definitely not.  Kernel patches are version-specific, especially ones of this
magnitude.


-- 
Timur Tabi - ttabi@interactivesi.com
Interactive Silicon - http://www.interactivesi.com


^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2001-06-26 16:18 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.10.10106031716330.3971-100000@blrmail>
2001-06-04 16:34 ` Reg mkdir syscall SATHISH.J
2001-06-05  5:02   ` H. Peter Anvin
2001-06-08  6:26 ` Reg compiling of source code SATHISH.J
2001-06-14  7:52   ` Reg-directory size SATHISH.J
2001-06-14  8:53     ` Daniel Phillips
2001-06-14 10:23     ` RAM filesystem directory size SATHISH.J
2001-06-15 10:22       ` Reg file system hash function SATHISH.J
2001-06-15 10:30         ` Russell King
2001-06-17  8:06         ` Reg:dentry->d_mounts value SATHISH.J
2001-06-17  8:14           ` Reg:magic number of the filesystem SATHISH.J
2001-06-17  8:21             ` Reg:use of file_system_type structure SATHISH.J
2001-06-17  8:21               ` Alexander Viro
2001-06-18  7:56               ` function of getname() function SATHISH.J
2001-06-18  7:42                 ` Alexander Viro
2001-06-18  7:47                 ` Tigran Aivazian
2001-06-18  8:35                 ` Reg:current a pointer to task_struct SATHISH.J
2001-06-18  8:49                   ` Reg putname() function SATHISH.J
2001-06-18  9:06                   ` Reg:current a pointer to task_struct george anzinger
2001-06-20  9:41                 ` filldir() function SATHISH.J
2001-06-20 22:26                   ` Jan Kara
2001-06-25  7:11                   ` Reg Kernel Debugger kdb SATHISH.J
2001-06-25  7:33                     ` siva kumar
2001-06-25  8:36                     ` Keith Owens
2001-06-26  4:54                     ` Reg Kernel Debugger kgdb SATHISH.J
2001-06-26 10:01                       ` using gdb to debug kernel SATHISH.J
2001-06-26 10:57                         ` Lars Marowsky-Bree
2001-06-26 11:10                         ` Reg installing a patch on linux SATHISH.J
2001-06-26 16:17                     ` Reg Kernel Debugger kgdb Timur Tabi
2001-06-21 12:06               ` Reg:use of file_system_type structure Anuradha Ratnaweera
2001-06-17  8:26             ` Reg:magic number of the filesystem Alexander Viro
2001-06-11  4:59 ` exec format error SATHISH.J
2001-06-11  6:08   ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).