This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fileio w/o kernel


On Fri, Nov 12, 2004 at 05:10:13PM +0200, Jani Monoses wrote:
> Hello
> 
> this patch makes fileio (more exactly devfs ) compile without the kernel. 
> It did not have an actual dependency on it but some kernel headers were 
> included nonetheless. Also make the fileio tests build w/o kernel.

Committed.

> Was there a reason for using a thread in fat/tests/fileio instead of 
> regular main startup?

Not that i can see. It works OK your way, which is the same as for
romfs, ramfs & jffs2. However, main() is only called by the kernel. If
you don't have a kernel you need to use cyg_start() or
cyg_user_start(). Since you are trying to make this work without the
kernel it makes sense to change this to cyg_start() not main. You
might want to change the tests in fat, ram, rom & jffs2 as well.

> With the other tests in fileio which need the kernel (socket and testfs) I 
> am not sure which patch to take: make their building conditional in the CDL 
> or put ifdefs in them so they build but print NOT_AVALAIBLE at runtime. 
> Which is the preferred method?

Well it looks like testfs just needs cyg_current_time() for setting
the time in the file inodes. I did a quick test of using 0 if there is
no kernel which seems to work OK. Given how fast these tests run, its
unlikely cyg_current_time() is returning anything other than 0 anyway!

For socket its best to make use of CYG_TEST_NA().

        Andrew

Attachment: fileio.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]