[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ext2 driver



Hi Ethan,
	Too bad about Andrew Over ;).  Here's another update. *Warning* long
email!

1. I will write to the original author about my questions and hope for the
best.  
   for now, I just commented out     those lines in __fsdriver.h/c and it
seems 
   to work just fine.  I figure once we have this sucker working on a
disk, then 
   we can worry about http/ftp, you name it.

2. with some messing around, I was able to "open" a file (thanks to the
simplistic implementation of kim s.,
  I was able to fool the code) using your rawio.c routine (replace __open w/
regular/*nix open()) 
   get a fd.  so situation 1 is sorta ready.  I am now looking to implement
2 & 3.

3. the next situation is where the client specifies both the device and the
file.  this requries that I do
   the following
	A. check the appropriate FS driver using FS->verify() routine
		The problem w/ this is that right now the ext2 verify
doesn't really do much except verify that
		the passed __fd * type is set to FD_DEVICE.  I don't think
this is what it is supposed to do right?
 		I was expecting it to check the superblock or something that
tells it whether or not it is the
		right FS (sorry, I don't really know much about how FS
work).
	B. once that's done, I can code to open the device calling open()
again
	C. check if the path specified is abosolute (begins w/ a "/") or not
(foo/bar) ->
		chdir(foo)
		open(bar) etc.
	   Questions: 
		What implements chdir() & getpwd()?  is it stdio or the FS
itself?
		are they already implemented for promLibC?

4. and this is the biggie.
	I tried compiling your ext2.c w/ the code I have so far and it is
spitting out numerous errors.
	I figured since you wrote it, you could help w/ them.  what follows
below is the listing from the 
	compiler.  I took out all the warnings.  I remember you telling me
before that 
	EXT2_FILE and EXT2_FS are just place holders for pointers because
you hadn't decided what to do w/
	them.  I think the time has come to atleast do something w/ them as
a first pass (seems to me that 
	we have to rewrite most of the other code anyway).  can you explain
what purpose they serve exactly?
	I haven't had a chance to look through the whole code yet and even
if I did, it would take me a while to
	figure it out.  so i would really appreciate your help.
	note that I had to comment out #include <ext2fs/ext2_fs.h> because I
couldn't find it on my machine (RHAT 7.1 x86)

/usr/include/ext2fs/ext2fs.h: In function `ext2fs_group_of_blk':
/usr/include/ext2fs/ext2fs.h:1008: dereferencing pointer to incomplete type
/usr/include/ext2fs/ext2fs.h:1009: dereferencing pointer to incomplete type
/usr/include/ext2fs/ext2fs.h: In function `ext2fs_group_of_ino':
/usr/include/ext2fs/ext2fs.h:1017: dereferencing pointer to incomplete type
drivers/ext2.c: At top level:
drivers/ext2.c:55: warning: initialization makes integer from pointer
without a cast
drivers/ext2.c: In function `cerrtoerrno':
drivers/ext2.c:253: `EFSCORRUPTED' undeclared (first use in this function)
drivers/ext2.c:253: (Each undeclared identifier is reported only once
drivers/ext2.c:253: for each function it appears in.)
drivers/ext2.c: In function `ext2_open':
drivers/ext2.c:303: `ext2_ino_t' undeclared (first use in this function)
drivers/ext2.c:303: parse error before `root'
drivers/ext2.c:323: `DEVICE_NODE' undeclared (first use in this function)
drivers/ext2.c:325: `EXT2_FS' undeclared (first use in this function)
drivers/ext2.c:330: `root' undeclared (first use in this function)
drivers/ext2.c:330: `cwd' undeclared (first use in this function)
drivers/ext2.c:330: `EXT2_ROOT_INO' undeclared (first use in this function)
drivers/ext2.c:333: `FILENAME' undeclared (first use in this function)
drivers/ext2.c:333: `inode' undeclared (first use in this function)
drivers/ext2.c:343: `EXT2_FILE' undeclared (first use in this function)
drivers/ext2.c: In function `ext2_read':
drivers/ext2.c:355: `EXT2_FILE' undeclared (first use in this function)
drivers/ext2.c: In function `ext2_write':
drivers/ext2.c:367: `EXT2_FILE' undeclared (first use in this function)
drivers/ext2.c:367: warning: passing arg 2 of `ext2fs_file_write' discards
qualifiers from pointer target type
drivers/ext2.c: In function `ext2_seek':
drivers/ext2.c:379: `EXT2_FILE' undeclared (first use in this function)
drivers/ext2.c: In function `ext2_close':
drivers/ext2.c:391: `EXT2_FILE' undeclared (first use in this function)
drivers/ext2.c:396: `EXT2_FS' undeclared (first use in this function)
drivers/ext2.c: In function `ext2_init':
drivers/ext2.c:413: warning: assignment from incompatible pointer type
drivers/ext2.c:414: warning: assignment from incompatible pointer type
make: *** [drivers/ext2.o] Error 1

ajay