Create a tiny file system
When you connect an mbed LPC11U24 with a computer, a disk named "MBED" will pop up. In the disk, there is a "MBED.HTM" file which will lead you to mbed.org.
I really like this feature. So when we design Arch, we use the Arch as a tiny disk to provide the feature. Implementing it takes three steps:
- Use USBMSD library to turn the Arch into a disk
- Create a tiny file system
- Put the file system into the Arch
Make a disk
It's quite easy to make a disk using USBMSD library. Here is a demo program. The content of the disk is in "DiskImage.c" file.
Create a custom file system
We can easily create a custom file system on linux.
git clone https://github.com/xiongyihui/dosfstools.git cd dosfstools make dd if=/dev/zero of=disk bs=1024 count=2 ./mkfs.fat -a -n "name" -s 1 -S 512 -f 1 -h 0 -F 12 -r 16 -R 1 disk mkdir mnt sudo mount disk mnt sudo echo "hello, mbed" > mnt/README.txt" sudo umount mnt python b2c.py disk DiskImage.c
The file system is in DiskImage.c. Use it in the above program, you will get the custom tiny disk.
Please log in to post comments.