Forum Discussion
Altera_Forum
Honored Contributor
16 years agomounting SD Card on uClinux
Hi everyone, I'm trying to implement a fat file system on sd card I followed the instructions for Altera SPI Core on this page http://www.nioswiki.com/operatingsystems/uclinux/mmcsd didn't w...
Altera_Forum
Honored Contributor
13 years agoHi, all.
May be, it's too late to answer, but my message may help someone in the future and one question still left regarding this topic. --- Quote Start --- Please give me some suggestion to fix the problem --- Quote End --- Well, next step is definitely simple: Lets look at the devices, configured in the system:
/# cat /proc/devices
Character devices:
1 mem
2 pty
3 ttyp
4 ttyS
5 /dev/tty
5 /dev/console
5 /dev/ptmx
10 misc
128 ptm
136 pts
153 spi
204 ttyUL
Block devices:
1 ramdisk
259 blkext
179 mmc <--- Got it!
OK, our MMC card is configured as block device and had major number 179.
/# ls /sys/dev/block/ | grep 179
179:0
179:1
We see two devices with major = 179. The first one with minor number 0 is MMC (SD) card itself and the second with number 1 is the first (and last in my case) partition on the card. The problem is that "ls /dev/" command shows nothing about MMC, but we can make device node manually via mknod command:
/# mknod /dev/mmcblk0p1 b 179 1
/# mount /dev/mmcblk0p1 /mnt/
/# ls /mnt
simpleImage.xilinx.ub vmlinux
Thats it! Well, but I still do not know, how to make next step: say system to create /dev/mmcblk0p1 node automatically and have root partition on my SD card during boot. Thanks all for this topic, it was helpful. PS: Well, there was almost nothing magic. On BB: 1. Format your SD card in ext2 or ext3. 2. Copy busybox content into SD 3. (For paranoics like me :) ) Create static node /dev/mmcblk0p1 on SD using mknod with major:minor numbers 179:1 4. [MAGIC] Edit kernel boot parameters with "root=/dev/mmcblk0p1" and (this is important!) "rootdelay=3". The "rootdelay" parameter says kernel to wait until root partition initialization complete. Three seconds was enough in my case. [/MAGIC] Thats all, folks. :)