Notice: We have migrated to GitLab launching 2024-05-01 see here:

#2190 closed defect (invalid)

an external fat16 image does not work properly, getcwd() fails

Reported by: Marco Owned by: Chris Johns
Priority: low Milestone: Indefinite
Component: fs/fat Version:
Severity: normal Keywords:
Cc: sebastian.huber@… Blocked By:

Description (last modified by Sebastian Huber)

getcwd() syscall fails when browsing deeper in the mounted filesystem.
A wrong path is returned (also in rtems4.10 which is our target platform)

Discussion was on mailing list:

Test case:
an external fat16 image is created with a default content using the following tools:

the mkfs generated image is converted to a C data array and compiled to an object file.
This object file is then linked into the rtems application.

Steps to compile the test case:
The above tools need to be installed on a Linx build machine (debian wheezy used here)

The top level Makefile in the src folder expects the sparc rtems 4.11 toolchain in the $(project_root_dir)/build/toolchain/

Toolchain is not attached as it is very big. But if desired I can provide a link to download it.

The top level Makefile calls the fatfs image generation Makefile and then the application Makefile.

The test case app sets up two ramdisks.
One under /sdram -> this one id formated using rtems dosfs functions
and one under /mram -> this should contain the default content

then a dummy thread and the rtems shell is started.

We suppose it is getcwd() as we had this behaviour in our final application using this system call.

If something is missing or so please contact me.

Attachments (1)

testcase.tar.gz (11.7 KB) - added by Marco on 10/17/14 at 07:59:01.
test project

Download all attachments as: .zip

Change History (7)

Changed on 10/17/14 at 07:59:01 by Marco

Attachment: testcase.tar.gz added

test project

comment:1 Changed on 10/24/14 at 05:46:45 by Sebastian Huber

Cc: Sebastian Huber added

comment:2 Changed on 10/28/14 at 12:40:42 by Marco

I will create one in addition to the attached test case. It will be a Makefile approach and also a native linux app demonstrating that the fatfs image is ok.
It will take me a week or two.

comment:3 Changed on 12/18/14 at 12:39:14 by Sebastian Huber

Description: modified (diff)
Milestone: 4.115.0
Priority: normallow

comment:4 Changed on 08/14/17 at 00:43:19 by Chris Johns

Milestone: 5.0Indefinite
Version: 4.11

comment:5 Changed on 08/24/17 at 10:00:58 by Sebastian Huber

Resolution: invalid
Status: newclosed

We fixed a couple of FAT bugs. Maybe it works now.

comment:6 Changed on 10/10/17 at 06:50:58 by Sebastian Huber

Component: fsfs/fat
Note: See TracTickets for help on using tickets.