Accessing the folders in OS'es

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Locked
MYOS
Posts: 1
Joined: Fri Feb 17, 2012 11:02 pm

Accessing the folders in OS'es

Post 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
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Accessing the folders in OS'es

Post by bluemoon »

There is seriously lack of detail in the question.
Check this out: How_To_Ask_Questions.
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Re: Accessing the folders in OS'es

Post by Jezze »

Get back to your cave! =)
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: Accessing the folders in OS'es

Post 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?
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Accessing the folders in OS'es

Post 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?
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Accessing the folders in OS'es

Post 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/...?
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Accessing the folders in OS'es

Post by brain »

turdus wrote: Are you by any chance Yashas/KernelX/...?
I don't think he is, yashas always coded in c...
Locked