OSDev.org
https://forum.osdev.org/

What does linux put in inode 2 of ext2 filesystem?
https://forum.osdev.org/viewtopic.php?f=11&t=29213
Page 1 of 1

Author:  glauxosdev [ Sun Apr 05, 2015 5:51 am ]
Post subject:  What does linux put in inode 2 of ext2 filesystem?

https://www.imageupload.co.uk/image/Zc88
What is this in red supposed to mean? Does not look like a file/directory/etc entry. File length 0BBh, file type 0CEh... Odd...
Could someone enlighten me?

Regards,
glauxosdev

Author:  iansjack [ Sun Apr 05, 2015 9:32 am ]
Post subject:  Re: What does linux put in inode 2 of ext2 filesystem?

It's an unused part of the block. I've no idea how it got there in your particular instance as it doesn't look like a deleted entry. Whatever, it's doing no harm.

Author:  glauxosdev [ Sun Apr 05, 2015 12:20 pm ]
Post subject:  Re: What does linux put in inode 2 of ext2 filesystem?

And how should my code know how to skip it?

Quote:
I've no idea how it got there in your particular instance
I formatted my flash drive as ext2, I created a folder "sys" and I copied "docs", "programs", "source" and "system".

Edit: sometimes the length of this unused block is specified in place of file name length.

Author:  iansjack [ Sun Apr 05, 2015 1:23 pm ]
Post subject:  Re: What does linux put in inode 2 of ext2 filesystem?

Quote:
And how should my code know how to skip it?
I've said it before, but it looks like I have to say it again.

Before you can work with ext2fs at a low level you have to understand the filesystem, its structures, and how they are used. And you have to at the very least read that document that I linked to describing the ext2 filesystem. It is evident that you have not yet reached that stage. I suggested before a way that you could work towards that level of enlightenment; you rejected my suggestion then, so there seems to be little point in repeating it now.

There is no easy path to OS development, and asking someone else to help you every time you hit something that you don't understand is not the magical path.

But, to answer your question: your code knows how to skip it because it reads the directory from the disk in the way it was designed to be read.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/