Friday, April 8, 2011

Digital Photo Frame based on TinyCore

  • Long time requirement to have a DPF of my own.
  • Requirement:
    • Reasonably big in size 14 inch or beyond, not like the bad resolution DPFs for lesser cost or the higher resolution ones where one has to sell his/her soul.
    • Try and reuse older hardware that I can get as freebie or throw away.
  • Got an Emcore i511 board, pentium class SBC (single board computer) with 256 MB CF, 64MB RAM and VGA with 1024x768 resolution. Also got a 14 inch complimentary frame. The SBC runs on 5V DC and consumes about 5-10Watts.
  • Wanted to run LFS, but compilation and trials would take too much time.
  • Found Tinycore. Runs of very low resource machines, including a 486 and Xwindows. 
  • Used unetbootin to write the tinycore.iso to the Compact Flash
  • Basically uses a new kernel and a ramdisk to run the whole OS. Everything is run from RAM. Harddisk installs are also supported.
  • After booting followed the howto from the Tinycore site and created a few native Linux partitions on the same CF and copied the kernel and the tinycore ramdisk. Installed grub by making the required changes. Grub boots the machine.
  • Applications can be chosen via the applications manager. Using qiv as an image viewer because of the low resource requirements.
  • Installed dropbear via a similar method.
  • Tried to auto mount my USB stick that contained all the pics by various methods.
    • Making entries in tc-config. But this is not useful for programs that have to wait for X.
    • Made changes in /home/tc/.X.d and added scripts to run the qiv imageviewer and to point dropbear to a well-known place for the keys. These scripts are run after X starts.
    • The Backup option has to be selected via the X menu for reboot/shutdown else the changes to the default user's home directory /home/tc will not be visible on the next boot.
  • Changes can be made in the default initramdisk by extracting the original one by cpio -i -H newc < inputfile.cpio and after extracting make the needed changes and run find directory | cpio -o -H newc > outputfile.cpio. Gzip it and point this to the kernel's initrd.
  • Until a better image is found, this is how the DPF looks.

Thursday, April 7, 2011

Linux kernel 2.6.37.2 on a UTU2440-S

  • S3C2440 clone board from youtiyou. Basically made by YC corporation. Low cost board around 120$ (without LCD) and comes with standard Linux 2.6.2x . Specification available here S3C2440 Board.
  • The good part is this board comes with both a USB host and a slave. Requirement was to investigate some USB client devices ie USB HID devices like Keyboard, mouse,etc.
  • Linux kernel 2.6.37.2  has updated USB GHID drivers and more stable stuff.
  • Porting is usually a big exercise, sometimes involves a couple of months for all drivers, etc.
  • Downloaded gcc from CodeSourcery version 4.5.1 (gcc version 4.5.1  Sourcery G++ Lite 2010.09-50) 
  • Downloaded the latest 37 kernel and tried a make s3c2410_defconfig
  • Setup a tftp server and downloaded the uImage that was generated. The kernel failed to boot saying unknown machine type. Basically the machine type is reported by the bootloader, in this case uboot.
  • In /include/generated/mach-types.h, changed MACH_TYPE_SMDK2410 from 193 to 5244, the type UTU is as defined in the uboot.
  • Recompiled and copied a few of the init code snippets into linux/arch/arm/mach-s3c2410
    • file mach-smdk2410.c: stuff like flash partition information, nand configuration, usb device config, registering the USB gadget platform code (as specified in the USB gadget readme in linux/doc). 
    • Had to comment out smdk_machine_init which tries to configure flash in an smdk standard way
    • Did not put in the ethernet or the lcd parts, as there was no interest in it. 
  • Used tftp to download the image thus: tftp 30000000 uImage and followed by a bootm.
  • And  Linux 2.6.37  booted and finally gave up cos it did not find the yaffs2 filesystem support that the utu board has as default. Root is yaffs2 based.
  • Used git to clone yaffs2. yaffs2 isnt part of the standard kernel. Used a script called "patch-ker.sh" from the yaffs2 git code to patch the  kernel and enabled yaffs2 in the kernel filesystem.
  • Recompiled and Linux kernel 2.6.37.2 with rootfs booted and was able to login to the machine and use it for my needs.
  • A teeny bit of happiness in under 30 minutes !