Saturday, May 02, 2009

How to Create/Modify an RAM disk Image

How to Create/Modify an RAM disk Image
Glomation GESBC-93XX series single board computers use RAM disk as the root file
system in it’s default configuration. Most likely one would want to create/change the
RAM disk to have user applications installed. This Document describes how to mount
and edit files in a RAM disk image, unmount the image and recompress it.
System Requirement
In order to mount a RAM disk image, your development system must have MTD support
compiled in, and have the Loopback Interface available. Most Linux distribution have
these configured in the kernel.
To check the availability of MTD and loopback interface, issue the following command
on the development system
# cat /proc/mtd
or
# ls -l /dev/mtd*
If any information is shown with /proc/mtd, and if you see any files named
mtdblock, mtd, etc that means the system has MTD support.
If not please rebuild the Linux kernel with MTD support. The follow instruction shows
the basic steps to do that.
Go to the kernel source tree directory on your development system and issue...
# make menuconfig
The following options must be enabled to use MTD.
Memory Technology Devices (MTD) --->
<*> Memory Technology Device (MTD) support
[*] Debugging
(0) Debugging verbosity (0 = quiet, 3 = noisy)
[*] MTD partitioning support
<*> Direct char device access to MTD devices
<*> Caching block device access to MTD devices
RAM/ROM/Flash chip drivers --->
<*> Detect flash chips by Common Flash Interface (CFI)
probe
<*> Support for Intel/Sharp flash chips
<*> Support for AMD/Fujitsu flash chips
Self-contained MTD device drivers --->
<*> MTD emulation using block device
GESBC-9315 User’s Manual
Version 0.2 Page 2 of 3 19-Apr-06
As well as....
Block devices --->
<*> RAM disk support
(32768) Default RAM disk size (kbytes)
[*] Initial RAM disk (initrd) support
After the kernel has been reconfigured, re-build the kernel, install the new kernel and
reboot your development system.
Once you have MTD and RAM disk support on your development system, you are ready
to create/modify the RAM disk image.
Create New RAM Disk Image
The Ext2 file system can be created and mounted onto an embedded device using the
concept of RAM disk.
mke2fs -vm0 /dev/ram 16384
mount -t ext2 /dev/ram /mnt
cd /mnt
cp /bin, /sbin, /etc, /dev ... files in mnt
cd ../
umount /mnt
dd if=/dev/ram bs=1k count=16384 of=ramdisk
gzip -9 ramdisk
mke2fs is the utility used to create an ext2 file system -- creating the super block, inodes,
inode table, and etc -- on any device.
In the above usage, /dev/ram is the device on which an ext2 file system of 16384 blocks
is built. Then the device (/dev/ram) is mounted on a temporary directory named /mnt and
all the necessary files are copied. Once these files are copied, the file system is
unmounted and the contents of the device (/dev/ram) is dumped into a file (ramdisk),
which is the required RAM disk (the Ext2 file system). The RAM disk file is then
compressed and ready to be loaded by Redboot.
The above sequence creates a RAM disk of 16 MB and fills it with the necessary file
utilities.
Some of the important directories to include in RAM disk are:
/bin -- Holds most of the binaries like init, busybox, shell, file management utilities, and
etc.
/dev -- Contains all the device nodes used in the device
GESBC-9315 User’s Manual
Version 0.2 Page 3 of 3 19-Apr-06
/etc -- Contains all the configuration files for the system
/lib -- Contains all the necessary libraries like libc, libdl, and so on
Modify Existing RAM Disk Image
1. First uncompress the ramdisk.gz file.
# gunzip ramdisk.gz
2. Make a directory to mount the ramdisk image.
# mkdir ramdisk_dir
3. Mount the ramdisk image as a loop back device
# mount -o loop ramdisk ramdisk_dir
You can then issue the command 'df' to see the new RAM disk partition on you
development system.
4. Edit Files
You can now edit files inside the RAM disk. Depending on how the original RAM disk
is created, you may or may not have enough space on the RAM disk to install your
application. Refer to Create New RAM Disk Image section on how to create a new RAM
disk with more storage space.
5. Unmount the ramdisk and compress it.
# umount ramdisk_dir
# gzip -9 ramdisk
You will then have a new compressed root file system that you can now load with
RedBoot

好屌的引擎模型!!

http://android.cool3c.com/article/7782

好屌的引擎模型!!

Date: 09-04-30 13:36 Author: kun

逛網路時看到,真的可以運轉,來源有影片

Porsche 911 Carrera 引擎 為世上首度配置並為人所熟知的水平對臥六缸引擎 1973 年 911 RS Carrera配置2,687c.c.全鋁合金引擎,最大動力輸出達210匹德制馬力,扭力峰值為26kgm/5100rpm,以當時來說,可說是顛峰之作 Marushin Co. 日本的精密機械廠,傳言應著公司老闆對911的狂愛, 而在生產線上製出了模型界傳頌的絕世精品 此引擎模型發表於1990年代初期,發表後引起模型界一陣震驚! 幾乎完全比照真車引擎縮小的組件,而且全部採用金屬鑄造,開模的精細度到了足堪比擬藝術品的境界,而且此具模型更採用壓縮空氣推動,可讓整具引擎比照實車運轉,在靜態展示之外,更增加了收藏的價值!

想看詳細的組裝過程可以引用來源:http://www.bluegtv.com/2008/05/porsche-911-carrera.html 好好看個仔細