Hi Genode Community,

I'm working on the implementation of SD card driver in ODROID-X2 (exynos4412) platform. I decided to reuse the implementation of SDHCI controller implemented by Norman Feske and Christian Helmuth. Essentially I only updated the memory map. I ran the sd_card and sd_card_bench tests, which ran successfully after making some arrangements in the corresponding .run files.

I'm interested in trying this driver using the FAT32 file system, but running the libc_ffat example, an error occurs. Apparently the test attempts to create a directory and then open it, but fails when trying to open it.
The serial output is as follows:

L4 Bootstrapper
  Build: #32 Tue Sep  1 15:31:27 CDT 2015, 4.9.2
  Scanning up to 2047 MB RAM
  Memory size is 2047MB (40000000 - bfefffff)
  RAM: 0000000040000000 - 00000000bfefffff: 2096128kB
  Total RAM: 2047MB
  mod11: 4130c000-413434c4: genode/platform_drv
  mod10: 412ce000-4130b640: genode/sd_card_drv
  mod09: 412b8000-412cd4b4: genode/libc_ffat.lib.so
  mod08: 412ab000-412b76f4: genode/test-libc_ffat
  mod07: 411ea000-412aa358: genode/libc.lib.so
  mod06: 4117b000-411e9068: genode/ld.lib.so
  mod05: 4113f000-4117aca8: genode/timer
  mod04: 410fd000-4113ec40: genode/init
  mod03: 410fc000-410fc4b6: genode/config
  mod02: 41097000-410fbe90: genode/core
  mod01: 41085000-41096368: sigma0
  mod00: 41015000-4108431c: /home/humberto/SO/Genode/Repo_genode/GenodeOS/build/foc_odroid_x2/kernel/fiasco.oc/fiasco
  Moving up to 12 modules behind 41100000
  moving module 00 { 41015000-4108431b } -> { 4142f000-4149e31b } [455452]
  moving module 01 { 41085000-41096367 } -> { 4149f000-414b0367 } [70504]
  moving module 02 { 41097000-410fbe8f } -> { 414b1000-41515e8f } [413328]
  moving module 03 { 410fc000-410fc4b5 } -> { 41344000-413444b5 } [1206]
  moving module 04 { 410fd000-4113ec3f } -> { 41345000-41386c3f } [269376]
  moving module 05 { 4113f000-4117aca7 } -> { 41100000-4113bca7 } [244904]
  moving module 06 { 4117b000-411e9067 } -> { 4113c000-411aa067 } [450664]
  moving module 07 { 411ea000-412aa357 } -> { 411ab000-4126b357 } [787288]
  moving module 08 { 412ab000-412b76f3 } -> { 4126c000-412786f3 } [50932]
  moving module 09 { 412b8000-412cd4b3 } -> { 41279000-4128e4b3 } [87220]
  moving module 10 { 412ce000-4130b63f } -> { 4128f000-412cc63f } [251456]
  moving module 11 { 4130c000-413434c3 } -> { 412cd000-413044c3 } [226500]
  moving module 03 { 41344000-413444b5 } -> { 41305000-413054b5 } [1206]
  moving module 04 { 41345000-41386c3f } -> { 41306000-41347c3f } [269376]
  Scanning /home/humberto/SO/Genode/Repo_genode/GenodeOS/build/foc_odroid_x2/kernel/fiasco.oc/fiasco -serial_esc
  Scanning sigma0
  Scanning genode/core
  Relocated mbi to [0x4100e000-0x4100e232]
  Loading ode/GenodeOS/build/foc_odroid_x2/kernel/fiasco.oc/fiasco
  Loading sigma0
  Loading genode/core
  find kernel info page...
  found kernel info page at 0x40002000
Regions of list 'regions'
    [ 40001000,  40001a3f] {      a40} Kern   ode/GenodeOS/build/foc_odroid_x2/kernel/fiasco.oc/fiasco
    [ 40002000,  4007efff] {    7d000} Kern   ode/GenodeOS/build/foc_odroid_x2/kernel/fiasco.oc/fiasco
    [ 400a0000,  400a5fdf] {     5fe0} Sigma0 sigma0
    [ 400b0000,  400b617b] {     617c} Sigma0 sigma0
    [ 41000000,  410143f7] {    143f8} Boot   bootstrap
    [ 4100e000,  4100e32f] {      330} Root   Multiboot info
    [ 41100000,  41347c3f] {   247c40} Root   Module
    [ 80100000,  80246663] {   146664} Root   genode/core
  API Version: (87) experimental
  Sigma0 config    ip:400a0100 sp:41013de4
  Roottask config  ip:80100000 sp:00000000
  Starting kernel ode/GenodeOS/build/foc_odroid_x2/kernel/fiasco.oc/fiasco at 40001208
Hello from Startup::stage2
Per_cpu_data_alloc: (orig: 0xf006c0d8-0xf006cb28)
Number of IRQs available at this GIC: 160
Cache config: ON
ID_PFR[01]:  00001231 00000011 ID_[DA]FR0: 00010444 00000000
ID_MMFR[04]: 00100103 20000000 01230000 00102111
FPU0: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p: dbl/sngl
L2: ID=4100c4c8 Type=1a340340 Aux=7e470001 WMask=ffff S=0
L2: Type L2C-310 Size = 1024kB
Watchdog initialized
SERIAL ESC: allocated IRQ 85 for serial uart
Not using serial hack in slow timer handler.
Welcome to Fiasco.OC (arm)!
L4/Fiasco.OC arm microkernel (C) 1998-2013 TU Dresden
Rev: b6fac81 compiled with gcc 4.9.2 for Samsung Exynos    []
Build: #31 Tue Sep  1 15:31:24 CDT 2015

Per_cpu_data_alloc: (orig: 0xf006c0d8-0xf006cb28)
Allocate 2640 bytes (3KB) for CPU[4] local storage (offset=1179f28, 0xf11e6000-0xf11e6a50)
Timer for CPU0 is at IRQ 28
Number of CPUs: 4
Calibrating timer loop... Per_cpu_data_alloc: (orig: 0xf006c0d8-0xf006cb28)
done.
Allocate 2640 bytes (3KB) for CPU[1] local storage (offset=117af28, 0xf11e7000-0xf11e7a50)
SCache config: ON
IID_PFR[01]:  00001231 00000011G ID_[DA]FR0: 00010444 00000000
MID_MMFR[04]: 00100103 20000000 01230000 00102111
AFPU1: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p: dbl/sngl
0Timer for CPU1 is at IRQ 28
:CPU[1]: goes to idle loop
 Per_cpu_data_alloc: (orig: 0xf006c0d8-0xf006cb28)
HAllocate 2640 bytes (3KB) for CPU[2] local storage (offset=1161f28, 0xf11ce000-0xf11cea50)
eCache config: ON
lID_PFR[01]:  00001231 00000011l ID_[DA]FR0: 00010444 00000000
oID_MMFR[04]: 00100103 20000000 01230000 00102111
!FPU2: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p: dbl/sngl

Timer for CPU2 is at IRQ 28
 CPU[2]: goes to idle loop
 Per_cpu_data_alloc: (orig: 0xf006c0d8-0xf006cb28)
KAllocate 2640 bytes (3KB) for CPU[3] local storage (offset=1164f28, 0xf11d1000-0xf11d1a50)
ICache config: ON
PID_PFR[01]:  00001231 00000011  ID_[DA]FR0: 00010444 00000000
@ID_MMFR[04]: 00100103 20000000 01230000 00102111
 FPU3: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p: dbl/sngl
4Timer for CPU3 is at IRQ 28
0CPU[3]: goes to idle loop
002000
  allocated 4KB for maintenance structures
SIGMA0: Dump of all resource maps
RAM:------------------------
[0:40000000;40000fff]
[0:4007f000;4009ffff]
[0:400a6000;400affff]
[0:400b7000;4100dfff]
[4:4100e000;4100efff]
[0:4100f000;410fffff]
[4:41100000;41347fff]
[0:41348000;800fffff]
[4:80100000;80246fff]
[0:80247000;beefffff]
IOMEM:----------------------
[0:0;3fffffff]
[0:bff00000;ffffffff]

KIP @ 40002000
    magic: 4be6344c
  version: 87024444
         sigma0  esp: 41013de4  eip: 400a0100
         sigma1  esp: 00000000  eip: 00000000
           root  esp: 00000000  eip: 80100000
MBI @ 4100e000
 mod[3] [41305000,413054b6) config
 mod[4] [41306000,41347c40) init
 mod[5] [41100000,4113bca8) timer
 mod[6] [4113c000,411aa068) ld.lib.so
 mod[7] [411ab000,4126b358) libc.lib.so
 mod[8] [4126c000,412786f4) test-libc_ffat
 mod[9] [41279000,4128e4b4) libc_ffat.lib.so
 mod[10] [4128f000,412cc640) sd_card_drv
 mod[11] [412cd000,413044c4) platform_drv
:ram_alloc: Allocator 80235f68 dump:
 Block: [40000000,40001000) size=00001000 avail=00001000 max_avail=00001000
 Block: [4007f000,400a0000) size=00021000 avail=00021000 max_avail=00021000
 Block: [400a6000,400a601c) size=0000001c avail=00000000 max_avail=00021000
 Block: [400a601c,400a6038) size=0000001c avail=00000000 max_avail=00000000
 Block: [400a6038,400a6054) size=0000001c avail=00000000 max_avail=00000000
 Block: [400a6054,400a6070) size=0000001c avail=00000000 max_avail=00000000
 Block: [400a6070,400a608c) size=0000001c avail=00000000 max_avail=00021000
 Block: [400a608c,400a60a8) size=0000001c avail=00000000 max_avail=00000000
 Block: [400a60a8,400a60c4) size=0000001c avail=00000000 max_avail=00009f04
 Block: [400a60c4,400a60e0) size=0000001c avail=00000000 max_avail=00000000
 Block: [400a60e0,400a60fc) size=0000001c avail=00000000 max_avail=00009f04
 Block: [400a60fc,400b0000) size=00009f04 avail=00009f04 max_avail=00009f04
 Block: [400b7000,400b701c) size=0000001c avail=00000000 max_avail=3edb8000
 Block: [400b701c,4100e000) size=00f56fe4 avail=00f56fe4 max_avail=00f56fe4
 Block: [4100f000,41100000) size=000f1000 avail=000f1000 max_avail=3edb8000
 Block: [41348000,80100000) size=3edb8000 avail=3edb8000 max_avail=3edb8000
 Block: [80247000,bef00000) size=3ecb9000 avail=3ecb9000 max_avail=3ecb9000
 => mem_size=2125352960 (2026 MB) / mem_avail=2125352680 (2026 MB)
:region_alloc: Allocator 802370d8 dump:
 Block: [00001000,20000000) size=1ffff000 avail=1ffff000 max_avail=1ffff000
 Block: [30000000,40000000) size=10000000 avail=10000000 max_avail=1ffff000
 Block: [40001000,40002000) size=00001000 avail=00001000 max_avail=1ffff000
 Block: [40003000,4007f000) size=0007c000 avail=0007c000 max_avail=0007c000
 Block: [400a0000,400a6000) size=00006000 avail=00006000 max_avail=1ffff000
 Block: [400b0000,400b7000) size=00007000 avail=00007000 max_avail=010f0000
 Block: [bef00000,bfff0000) size=010f0000 avail=010f0000 max_avail=010f0000
 => mem_size=823627776 (785 MB) / mem_avail=823627776 (785 MB)
:io_mem: Allocator 802363c4 dump:
 Block: [00000000,40000000) size=40000000 avail=40000000 max_avail=40000000
 Block: [40001000,40002000) size=00001000 avail=00001000 max_avail=40000000
 Block: [40003000,4007f000) size=0007c000 avail=0007c000 max_avail=0007c000
 Block: [400a0000,400a6000) size=00006000 avail=00006000 max_avail=0007c000
 Block: [400b0000,400b7000) size=00007000 avail=00007000 max_avail=410fffff
 Block: [bef00000,ffffffff) size=410fffff avail=410fffff max_avail=410fffff
 => mem_size=2165874687 (2065 MB) / mem_avail=2165874687 (2065 MB)
:io_port: Allocator 80236820 dump:
:irq: Allocator 80236c7c dump:
 Block: [00000000,00000260) size=00000260 avail=00000260 max_avail=00000260
 => mem_size=608 (0 MB) / mem_avail=608 (0 MB)
:rom_fs: Rom_fs 8023798c dump:
 Rom: [4113c000,411aa068) ld.lib.so
 Rom: [41306000,41347c40) init
 Rom: [41305000,413054b6) config
 Rom: [40002000,40003000) l4v2_kip
 Rom: [40002000,40003000) kip
 Rom: [4128f000,412cc640) sd_card_drv
 Rom: [41279000,4128e4b4) libc_ffat.lib.so
 Rom: [411ab000,4126b358) libc.lib.so
 Rom: [412cd000,413044c4) platform_drv
 Rom: [4126c000,412786f4) test-libc_ffat
 Rom: [41100000,4113bca8) timer
:core ranges: Allocator 8023a260 dump:
 Block: [40000000,40001000) size=00001000 avail=00001000 max_avail=00001000
 Block: [4007f000,400a0000) size=00021000 avail=00021000 max_avail=00021000
 Block: [400a6000,400b0000) size=0000a000 avail=0000a000 max_avail=7def1000
 Block: [400b7000,4100e000) size=00f57000 avail=00f57000 max_avail=7def1000
 Block: [4100f000,bef00000) size=7def1000 avail=7def1000 max_avail=7def1000
 => mem_size=2129084416 (2030 MB) / mem_avail=2129084416 (2030 MB)
Genode 15.05-173-gb6fac81 <local changes>
int main(): --- create local services ---
int main(): --- start init ---
int main(): transferred 2026 MB to init
int main(): --- init created, waiting for exit condition ---
[init] parent provides
[init]   service "ROM"
[init]   service "RAM"
[init]   service "IRQ"
[init]   service "IO_MEM"
[init]   service "IO_PORT"
[init]   service "CAP"
[init]   service "PD"
[init]   service "RM"
[init]   service "CPU"
[init]   service "LOG"
[init]   service "SIGNAL"
[init] child "timer"
[init]   RAM quota:  876544
[init]   ELF binary: timer
[init]   priority:   0
[init]   provides service Timer
[init] child "test-libc_ffat"
[init]   RAM quota:  8216576
[init]   ELF binary: test-libc_ffat
[init]   priority:   0
[init] child "platform_drv"
[init]   RAM quota:  2973696
[init]   ELF binary: platform_drv
[init]   priority:   0
[init]   provides service Platform
[init]   provides service Regulator
[init] child "sd_card_drv"
[init]   RAM quota:  876544
[init]   ELF binary: sd_card_drv
[init]   priority:   0
[init]   provides service Block
[init -> platform_drv] --- Odroid-x2 platform driver ---
[init -> platform_drv] Dentro del constructor CMU
[init -> platform_drv] Changing CPU frequency to 1400000000
[init -> platform_drv] End of Changing CPU frequency to 1400000000
[init -> platform_drv] Saliendo del constructor CMU
[init] child "timer" announces service "Timer"
[init -> platform_drv] Entrando del constructor PMU
[init -> platform_drv] Saliendo del constructor PMU
[init] child "platform_drv" announces service "Regulator"
[init -> sd_card_drv] --- SD card driver ---
[init] child "sd_card_drv" announces service "Block"
[init -> platform_drv] --- Odroid-x2 platform driver. Done ---
[init -> test-libc_ffat] void init_libc_ffat(): using the libc_ffat plugin
[init -> test-libc_ffat] calling mkdir(dir_name, 0777) dir_name=testdir
[init -> sd_card_drv] CID: 0x744a4553 0x44432020 0x1033005b 0x8700e100
[init -> sd_card_drv] RCA: 0xb368
[init -> sd_card_drv] SD card detected
[init -> sd_card_drv] capacity: 7695 MiB
[init -> test-libc_ffat] get_fattime() called - not yet implemented.
[init -> test-libc_ffat] disk_ioctl(drv=0, ctrl=0, buff=0) called - not yet implemented.
[init -> test-libc_ffat] mkdir(dir_name, 0777) succeeded
[init -> test-libc_ffat] calling chdir(dir_name) dir_name=testdir
[init -> test-libc_ffat] chdir(dir_name) failed, ret=-1, errno=20
[init] virtual void Genode::Child_policy::exit(int): child "test-libc_ffat" exited with exit value -1


Anyone have any idea what might be happening?