Hi, On Sun, Apr 18, 2010 at 10:51:55AM +0530, shivpratap chauhan wrote: > I run JariOS with ext2fs debuging on..I did not find log entries in serial > log for ext2_read, ext2_opendir..etc.. It's very strange ... I saw the sources and I find ext2_debug entries ... > there is only entry for ext2_lookup calls and no more method calls from > ext2.c file. yep, it will always calls. > > I am wondering how fs layer read files on ext2 fs without making calls for > ext2_read, ext2_opendir? how did cat command prints content of file without > making concrete ext2 fs calls for ext2_read? Pls explain. It may happen while file you're reading cached node, hmmm, try to do the following: - write some text file - try to `cat' it I think u will see the debug output. Anyway, please send your full log in attachment please, I will try to expect it.
Thanks. > > > On Wed, Apr 14, 2010 at 11:24 AM, Alfeiks <[email protected]> wrote: > > > hi, please write to maillist too, it's a good practice, > > because many other people may read messages and make a sense > > on many stuff ;) > > On Tue, Apr 13, 2010 at 10:14:14PM +0530, shivpratap chauhan wrote: > > > On Tue, Apr 13, 2010 at 5:13 PM, Alfeiks <[email protected]> wrote: > > > > > > > On Sun, Apr 11, 2010 at 01:05:44PM +0530, shivpratap chauhan wrote: > > > > > Hi All, > > > > Hi, > > > > and hi all, i've back! > > > > > > > > > > I have few qeries and observations: > > > > > > > > > > #1: > > > > > > > > > > I am trying to understand ext2 fs and how it interact with vfs. I am > > not > > > > > able to see any log in serial output for ext2 though i enabled > > debugging > > > > for > > > > > it also i manually tried these changes: > > > > it should works without any modifications. > > > > you just need to compile kernel with serial debug option. > > > > > > > Its working now I just forgot to make a new initrd and initially mukernel > > > uses ext2 from initrd only. Thanks. > > mukernel using stuff that loaded by GNU Grub, other things loaded by > > the bootstrapper (that works within user space). > > Initrd is a varios thing, because while you haven't all the services > > to mount real root filesystem you may use initfilesystem that is simple > > and doesn't require some additional services/drivers that may depends > > on hardware you are running on. > > > > > > > > > > > > --- a/filesystems/regular/ext2/log.h > > > > > +++ b/filesystems/regular/ext2/log.h > > > > > @@ -7,16 +7,17 @@ > > > > > #define EXT2FS_DEBUG > > > > > #endif > > > > > > > > > > -#ifdef EXT2FS_DEBUG > > > > > +#define EXT2FS_DEBUG > > > > > +//#ifdef EXT2FS_DEBUG > > > > > #define ext2_debug(f, a...) > > > > \ > > > > > do { > > > > \ > > > > > klog("EXT2-fs DEBUG (%s, %d): %s:", > > > > \ > > > > > __FILE__, __LINE__, __func__); > > > > \ > > > > > klog(f"\n", ## a); > > > > \ > > > > > } while (0) > > > > > -#else > > > > > -#define ext2_debug(f, a...) do {} while(0) > > > > > -#endif > > > > > +//#else > > > > > +//#define ext2_debug(f, a...) do {} while(0) > > > > > +//#endif > > > > > > > > > > > > > > > > > > > > > > > > > #2 > > > > > > > > > > when I did mkdir in root directory jariOS crashes pls see log below: > > > > Actually jari OS didn't crashed, it's a pf in the ext2. > > > > > > > > > > [v2] {pp_lookup} point->point-> (0x1096a98)<<END > > > > > [EXT2] (creating dir): mkdir error: 2133571369 > > > > It's a debug output of the ext2, it works. > > > > ext2 doesn't support write support now and it will fails > > > > on write access always. > > > > > > > OK > > yep, now u may take this file system and finish it with write support, > > it's a good task to start, btw it's just an example of existing tasks. > > > > > > > > ================[USER-SPACE PAGE FAULT #14]================ > > > > > [CPU #0] Task: ext2.fs (PID=24, TID=0) > > > > > Error code: 0x6 > > > > > Invalid address: 0x545, RIP: 0x10024e3 > > > > > [=== General purpose registers dump ===] > > > > > |RAX: 0x0000000000000545 | RBP: 0x0000000000000000 | RSI: > > > > > 0x0000000000000000| > > > > > |RDI: 0x000000ffffffd9c0 | RDX: 0x0000000000000000 | RCX: > > > > > 0x000000ffffffd748| > > > > > |RBX: 0x0000000001002420 | R15: 0x0000000000000000 | R14: > > > > > 0x0000000000000000| > > > > > |R13: 0x0000000001185018 | R12: 0x0000000001185010 | R11: > > > > > 0x0000000000000206| > > > > > |R10: 0x0000000000000000 | R9: 0x0000000000000000 | R8: > > > > > 0x0000000000000000| > > > > > [=== Interrupt stack frame ===] > > > > > > RIP: 0x00000000010024e3, CS: 0x000000000000001b > > > > > > RSP: 0x000000ffffffdab0, SS: 0x000000000000001b > > > > > > RFLAGS: 0x0000000000000202 > > > > > [=== USER STACK DUMP ===] > > > > > [0x000000ffffffdaf0] [0x0000000000000000] [0x0000000000000000] > > > > > [0x0000000000000000] [0x00000001000001ed] > > > > > > > > > > > > > > > > > > > > #3 > > > > > > > > > > There is a minor issue with makefile for core_servers > > > > > > > > > > diff --git a/Makefile b/Makefile > > > > > index d2e1f4a..2e10461 100644 > > > > > --- a/Makefile > > > > > +++ b/Makefile > > > > > @@ -183,7 +183,7 @@ help: > > > > > $(Q)$(MAKE) -f sconfig/Makefile help > > > > > $(Q)echo '' > > > > > $(Q)echo 'Targets:' > > > > > - $(Q)echo ' all [default] - make all but five services > > > > shared" > > > > > + $(Q)echo ' all [default] - make all but five services > > > > shared' > > > > > $(Q)echo ' static - make everything as static > > > > modules' > > > > > $(Q)echo ' shared - make everything as shared > > > > modules' > > > > > $(Q)echo '' > > > > > > > > > > > > > > > PS: Can anybody tell me relation in vfs (vfs also tun in usersapce? ) > > and > > > > > kernel how they interact > > > > VFS layer (vfs/fses/file resources) all is works in user space. > > > > u need to know that you have a major components: > > > > - vfsv2 service (that keeps all the information about > > > > filedescriptors, mounted filesystems and mount tree itself). > > > > - libv2 is a library that linked to the filesystem and it works with > > > > vfsv2 proto and libc, also it provide the major filesystem > > > > abstractions (vnode for example) > > > > > > > so vfsv2 and concrete fs communicate using libc and libc uses libv2's low > > > level funcitons or something else is happening? > > not at all, vfsv2 and fs uses microkernel IPC and protocol that > > implemented in libv2 and vfsv2 - intercommunication between vfsv2 and > > libv2 is not a part of libc, in case of it specifics. > > > > > > - libc part (low level and proto part of the fs<->application operation) > > Here I mean that low level implementation of POSIX calls such as > > open(), close(), read(), write() etc ... > > Libc contains client side of proto implementation. > > > > Also, there are need to keep in mind that actually you have two > > > > generic types of the user<->vfs layer interaction: > > > > - indirect > > > > - direct > > > > For example, when you need to resolve file name, create file or > > > > directory - it will be always indirect operation and it will goes > > > > throw vfsv2, vfsv2 will determine which of the mounted fses may keeps > > this > > > > file and redirect that to the concrete fs. > > > > Otherwise, while you have filedescriptor (you are connected to the fs > > > > resource already) and you need to read or write - that will be a > > > > direct call to the filesystem that keep that resource. > > > > > > > So, writing and reading form disk is part of concrete fs and in turn it > > uses > > > libv2 for disk specific operation? > > > please clarify. > > Well, in Jari OS like in other UNIX-like OSes everything is a file, > > and disk might be accessed via /dev file system. > > u may use generic POSIX read/write to iteract with block device, > > or u may use libv2 specific API intended to be useful for the > > disk i/o operations, for those calls checkout the following: > > libs/services/include/vfs/super.h > > There are some functions like: > > /* > > * initialize block device related data and structure > > * return 0 if ok, -1 and errno on fail. > > */ > > int super_bdev_init(super_block_t *sb); > > > > /* > > * write block blk to block device assigned to super block > > * return 0 if ok, -1 and errno on fail. > > */ > > int super_bdev_write(super_block_t *sb,ulong_t blk,void *sect); > > > > /* > > * reads block blk to block device assigned to super block > > * return 0 if ok, -1 and errno on fail. > > */ > > int super_bdev_read(super_block_t *sb,ulong_t blk,void **sect); > > > > /* > > * read blocks or data (depends on size in bytes given) from > > * block device assigned to the super block > > * return 0 if ok, -1 and errno on fail. > > */ > > int super_bdev_read_blks(super_block_t *sb,ulong_t blk_start, > > size_t bytes_read,void **data); > > > > /* > > * write blocks or data(depends on size in bytes given) to > > * block device assigned to the super block > > * return 0 if ok, -1 and errno on fail. > > */ > > int super_bdev_write_blks(super_block_t *sb,ulong_t blk_start, > > size_t bytes_read,void *data); > > > > But, there API will be changed, and u need to write filesystem in the > > API independed way (via some useful wrappers). > > Currently I'm working on the fs layer redesign. > > > > Thanks, > > > > > > > > > > In your case you're trying to create directory - that means that first > > > > you are going to the vfsv2 service, that determine the concrete > > > > filesystem, and redirect it to the ext2 (that going to the PF, because > > > > many things was not implemented/ported in ext2 specific code). > > > > > Thanks, > > > > > Shiv > > > > Thanks, > > > > have a nice day. > > > > > _______________________________________________ > > > > > Jarios-dev mailing list > > > > > [email protected] > > > > > http://lists.jarios.org/cgi-bin/mailman/listinfo/jarios-dev > > > > > > > > _______________________________________________ > > > > Jarios-dev mailing list > > > > [email protected] > > > > http://lists.jarios.org/cgi-bin/mailman/listinfo/jarios-dev > > > > > > _______________________________________________ > > Jarios-dev mailing list > > [email protected] > > http://lists.jarios.org/cgi-bin/mailman/listinfo/jarios-dev > > _______________________________________________ Jarios-dev mailing list [email protected] http://lists.jarios.org/cgi-bin/mailman/listinfo/jarios-dev
