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
Accessing the folders in OS'es
Re: Accessing the folders in OS'es
There is seriously lack of detail in the question.
Check this out: How_To_Ask_Questions.
Check this out: How_To_Ask_Questions.
Re: Accessing the folders in OS'es
Get back to your cave! =)
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
http://github.com/Jezze/fudge/
Re: Accessing the folders in OS'es
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?
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
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
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/...?
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
I don't think he is, yashas always coded in c...turdus wrote: Are you by any chance Yashas/KernelX/...?