title: How to get a file list from a directory inside the linux kernel?
body: <p>I just saw there is a ROOT<code>/</code>directory before any rootfs <em>(whether from initrd or form a disk)</em><br>
  I already know it do contains <code>/root</code>and<code>/dev</code>with a mounted devtmpfs <em>(if <code>CONFIG_DEVTMPFS_MOUNT</code>is selected)</em>.</p>
  
  <p>But I wasn’t able to find if there are other directories and which they are.</p>
  
  <p>So the point is to insert code at<code>init/do_mounts.c</code>before the line 403 for printk a list to the screen.<br>
  The problem is I don’t know how to use the struct direent for getting a directory list for the old<code>readdir()</code><em>(<code>int readdir(unsigned int fd, struct dirent *dirp, unsigned int count);</code>)</em></p>