Page 1 of 1
Accessing the folders in OS'es
Posted: Sat Feb 18, 2012 5:03 am
by MYOS
Hello guys..
I have a question about accessing the folders in OS'es, when I tell the kernel to open a file at the root folder of the OS, it will open it without any issue , but when I specify a path ("Apps\File.bin") it will not open , How can i tell the kernel to access that folder and open the file?
I am using Assembly & NASM
Re: Accessing the folders in OS'es
Posted: Sat Feb 18, 2012 5:37 am
by bluemoon
There is seriously lack of detail in the question.
Check this out:
How_To_Ask_Questions.
Re: Accessing the folders in OS'es
Posted: Sat Feb 18, 2012 6:16 am
by Jezze
Get back to your cave! =)
Re: Accessing the folders in OS'es
Posted: Sat Feb 18, 2012 7:33 am
by bubach
Why the big font? Anyway, I would presume that it's your filesystem driver that does the work, and not the kernel.. Your post lack all information needed to help you.
What filesystem are you using? What errors do you get? Have you actually implemented subdirectory support, and in that case can we have a look on the code that parses the path and is supposed to open the file? Have you checked the Wiki for FS info, and read the forum rules thread?
Re: Accessing the folders in OS'es
Posted: Sat Feb 18, 2012 12:05 pm
by brain
Is this in an os you are writing, or an existing os? Also what filesystem and are you accessing the fs in ring 0 or userland? Can you provide source? What happens instead of successfully opening the file?
Re: Accessing the folders in OS'es
Posted: Sat Feb 18, 2012 3:21 pm
by turdus
You start by searching path in the current directory, and if there's a match, you check the next char in path whether it’s directory separator. If not, file not found, if yes, you cut off the part from path (including separator), set the current directory to what's just found, and repeat the whole procedure until EOS in path found.
current dir 0 (inode, cluster, whatever), path ’Apps\file.bin’
1st entry App (1), match, next char in path ’s’, not separator, no match
2nd entry Apps (2), match, next char ’\’, directory separator, match
current dir 2, path ’file.bin’
1st entry some.bin (3), no match
2nd entry other.bin (4), no match
3rd entry file.bin (5), match, next char in path: end of string, file found 5 (inode, cluster etc.)
Are you by any chance Yashas/KernelX/...?
Re: Accessing the folders in OS'es
Posted: Sat Feb 18, 2012 4:16 pm
by brain
turdus wrote:
Are you by any chance Yashas/KernelX/...?
I don't think he is, yashas always coded in c...