mkdir and rtems_mkdir
Chan Kim
ckim at etri.re.kr
Thu Jul 9 07:03:39 UTC 2015
Hi,
I am trying to mount an SD card and I found this link below useful.
https://github.com/SayCV/rtems-example-sparc-leon/blob/master/rtems-spi-sdcard.c
I've read master boot record successfully. According to the C source, logical partition seems to have been created.
Now it tries to mount the device.(disk and parition separtately, a question at the end)
This program first uses int mkdir( const char *pathname, mode_t mode) to make directory
and then calls rtems_fsmount( const rtems_fstab_entry *fstab_ptr, size_t fstab_count, size_t *fail_idx) to mount the disk.
But inside rtems_fsmount, it creates mount point again using rtems_mkdir(const char *path, mode_t mode).
I will follow the rtems_fsmount function, but why does it make "/mnt" twice? Shouldn't I remove first mkdir(..) call?
and I don't know why the mount point is the same "/mnt" for mounting two devices. (sd-card-card-a1 and sd-card-a).
Am I supposed to see the first partition under /mnt? and why does it mount disk? (in linux, I understand we mount only partition, not disk).
By the way, I'm using rtems4.10.99.
Thanks in advance.
Chan
More information about the users
mailing list