EXT2 driver cannot find directory table

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.
Post Reply
SanderR
Member
Member
Posts: 70
Joined: Tue Aug 30, 2016 1:31 pm
Libera.chat IRC: SDR

EXT2 driver cannot find directory table

Post by SanderR »

Hello everyone,

I am trying to get the list of files of the root directory but it gives me a random file...
Can someone tell me what Im doing wrong?
https://github.com/AdeRegt/SanderOSUSB/ ... l/fs/ext.c
User avatar
iansjack
Member
Member
Posts: 4705
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: EXT2 driver cannot find directory table

Post by iansjack »

I notice that you haven't had any replies to this, which is a bit discouraging. I suspect the reason is that it's quite a chunk of code and it isn't particularly well-commented. I found it difficult to follow.

I'd suggest that what you want to do is to single-step this in a debugger to find where things deviate from what you expect. When developing my own ext2 driver I wrote it first of all as a normal Linux user program, using an image file. This makes the debugging much easier. It's then trivial to convert it to a driver for your OS. Apart from anything else this will be a good way of improving your debugging skills.

If you inspect the variables at each step, cross-referencing with a hex dump of the file system, it should become obvious where the error is.
Post Reply