ugh, either your MUA or your $EDITOR sucks... it broke your lines in a very unreadable way.. On Thu, Sep 25, 2003 at 06:41:29PM -0400, Pisupati, Ajay wrote: > 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. id do it on irc, i don't think the email address in the various malloc() files is valid anymore. > 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. well his http thing was entirely for testing, we won't be implementing http. tftp definitly, whether we try and wire it into open() itself im not sure yet. > 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). yes at the time we didn't really know what verify should do, on this list we decided it should indeed do superblock checks. if i have time ill write a ext2 superblock checker verify(). > 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? they are not. how chdir() and getpwd() work still needs to be defined. its tricky since both filesystem drivers, and the upper layers need to deal with them, since you can either be only within a OF device, or also within a filesystem directory. > 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/ yes EXT2_FILE and EXT2_FS are not macros, they need to be replaced with storage in one of these structs. i don't know where. > 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? EXT2_FILE is returned by ext2fs_open_file(), its type is ext2_file (as far as we are concerned consider it a void *) its a form of file descripter for a file on a ext2 filesystem. EXT2_FS is returned by ext2fs_open(), its type is ext2_fs (or so..) again as far as we are concerned its a void *. its a descripter to a filesystem itself. both are really just private data to the ext2 driver. EXT2_FILE is only relevant to a single file descripter, whereas EXT2_FS can be shared among several file descripters. > 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) ext2fs.h needs it, later releases of e2fsprogs might include it on thier own, im not sure. > /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 not my problem, your e2fsprogs-dev package sucks. > drivers/ext2.c: At top level: > drivers/ext2.c:55: warning: initialization makes integer from pointer > without a cast io_manager is undefined probably, this is because your e2fsprogs is broken. > 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.) EFSCORRUPTED is only in prom-libc, and IRIX, just #define it to some other errno for userspace testing. > 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' broken e2fsprogs. > drivers/ext2.c:323: `DEVICE_NODE' undeclared (first use in this function) > drivers/ext2.c:325: `EXT2_FS' undeclared (first use in this function) these need to be replaced with pointers to various members of the vfs structures, i don't know where, which is why i left these phony placeholders. they are not macros. DEVICE_NODE needs to be a pointer to something that holds the device being opened, eg if were trying to get hd:3,/etc/passwd DEVICE_NODE=hd:3 > drivers/ext2.c:330: `root' undeclared (first use in this function) > drivers/ext2.c:330: `cwd' undeclared (first use in this function) due to above e2fsprogs brokeness. > drivers/ext2.c:330: `EXT2_ROOT_INO' undeclared (first use in this function) e2fsprogs brokeness > drivers/ext2.c:333: `FILENAME' undeclared (first use in this function) another placeholder, this time FILENAME=/etc/passwd > drivers/ext2.c:333: `inode' undeclared (first use in this function) e2fsprogs brokeness > drivers/ext2.c:343: `EXT2_FILE' undeclared (first use in this function) see above > 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) see above > drivers/ext2.c:367: warning: passing arg 2 of `ext2fs_file_write' discards > qualifiers from pointer target type might be a bug, but i don't care, the write code is getting tossed as it doesn't work, and would be very very hard to make work. > 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) see above, placeholders. > 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 not sure on that one, looks like the ext2 struct is broken. -- Ethan Benson http://www.alaska.net/~erbenson/
Attachment:
pgp00006.pgp
Description: PGP signature