NTFS for Embedded Linux Systems

NTFS benchmarchs for embedded systems Tuxera vs NTFS-3G vs ext-3

Since now more and more HD videos are larger than 4GB they can not be stored into FAT32 file system, and require the use of other file systems, the most popular being ext2/ext3 or NTFS. However, since many users may want to access the mass storage devices (IDE / SATA harddisk, USB Harddisk, USB Thumbdrives…) in Windows as well as in their embedded systems (IP STV, Digital Signage..) NTFS seems to the best choice to share data between Windows systems and embedded systems using Linux. NTFS is available in the Linux kernel. However only read-only is fully supported and the performance is about 25% less than ext-2 or ext-3 for the platforms we tested (EM8623L and SMP8635), but this is still acceptable to play most of HD Videos. However, if the device also needs to download videos from a server or other P2P clients, having a read-only file system will […]

Finding and fixing memoy leaks in your software

Memory leak

Memory leaks will cause your device to crash after a period of time once it runs out of memory. A quick way to find out if your application has a memory leak(s) is to monitor it with top:

If you see the %MEM increase over time for no particular reason, then you’ve got a memory leak. However, it might be tricky to isolate where the issue occurs exactly. The first thing to do is the review your source code for the following: Malloced memory is always freed fopen is always followed by fclose, and open by close scandir calls are properly freed Threads are properly terminated with pthread_cancel & pthread_join or pthread_detach, etc… If after a code review you cannot find the reason for the memory leak, use the following piece of code:

  The memory usage is displayed in numbers of pages. Usually, one page is 4096 […]

Mounting a JFFS2 image in a Linux PC

We often use JFFS2 binary images for embedded system, generating them with mkfs.jffs2. In some instances, it could also be good to mount a jffs2 image into your PC to modify it directly. To do that,  type the following commands as root in a linux shell: modprobe mtdcore modprobe jffs2 modprobe mtdram modprobe mtdchar modprobe mtdblock dd if=image-jffs2 of=/dev/mtd0 mount /dev/mtdblock0 mnt If your image is larger than the default kernel size (4MB in my case), you can try to adjust the mtdram device size with the total_size parameters. when inserting the mtdram module, e.g.: modprobe mtdram total_size=8096 where total_size is expressed in KB Further details can be found @ http://www.handhelds.org/hypermail/familiar/62/6232.html Jean-Luc Aufranc (CNXSoft)Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011. www.cnx-software.com

Resizing an NTFS partition with Linux

If you have a computer where you already installed Windows and you wish to install Linux as well (dual boot), you may want to resize the NTFS partition to get more space for the Linux partitions. One way it to use Gparted (Gnome Partition Editor) – http://gparted.sourceforge.net/ with a boot CD. Here are the instructions: •  Boot from the CD •  Hit <ENTER> when you see the message “Boot:”. •  Select language, keyboard and screen resolution from the menus. •  The partitioner should start and the following steps are intuitive More details are available @ http://mlf.linux.rulez.org/mlf/ezaz/ntfsresize.html#example It is also possible to do it with a USB Thumdrive if you do not want to burn a CD and your bios can support booting from a USB device. http://gparted.sourceforge.net/liveusb.php Jean-Luc Aufranc (CNXSoft)Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting […]

EmbeddedTS embedded systems design