1. How to Convert a Linux Boot ISO to USB
2011年7月19日 星期二
2011年7月13日 星期三
[Android] MIPS on Android - Application
1. Getting Started with Android
2. Android on MIPS Source Code
3. Build MIPS platform
$ export TARGET_PRODUCT=generic
$ export TARGET_ARCH=mips
$ export TARGET_ARCH_VARIANT=mips32-fp
$ source build/envsetup.sh
$ make -j4
2. Android on MIPS Source Code
3. Build MIPS platform
$ export TARGET_PRODUCT=generic
$ export TARGET_ARCH=mips
$ export TARGET_ARCH_VARIANT=mips32-fp
$ source build/envsetup.sh
$ make -j4
2011年7月1日 星期五
[Linux] callback function
Callback function
The program did "call" the function is initiative, but "callback" function is passive. For example, interrupt handler or event handler was called in some specific situations, they were "callback" functions.
The implementation for callback function is typically a function point in C.
The use of function point is like an abstraction layer. Every driver has to implement the same functions, just like r8169.c ethernet driver must implement the functions related to the pci_driver struct needed.
static struct pci_driver rtl8169_pci_driver = {
.name = MODULENAME,
.id_table = rtl8169_pci_tbl,
.probe = rtl8169_init_one,
.remove = __devexit_p(rtl8169_remove_one),
#ifdef CONFIG_PM
.suspend = rtl8169_suspend,
.resume = rtl8169_resume,
.shutdown = rtl_shutdown,
#endif
};
The program did "call" the function is initiative, but "callback" function is passive. For example, interrupt handler or event handler was called in some specific situations, they were "callback" functions.
The implementation for callback function is typically a function point in C.
The use of function point is like an abstraction layer. Every driver has to implement the same functions, just like r8169.c ethernet driver must implement the functions related to the pci_driver struct needed.
static struct pci_driver rtl8169_pci_driver = {
.name = MODULENAME,
.id_table = rtl8169_pci_tbl,
.probe = rtl8169_init_one,
.remove = __devexit_p(rtl8169_remove_one),
#ifdef CONFIG_PM
.suspend = rtl8169_suspend,
.resume = rtl8169_resume,
.shutdown = rtl_shutdown,
#endif
};
2011年6月28日 星期二
[Linux] script to exclude CVS directory
# find sbin/ -not -name "Entries" -not -name "Root" -not -name "Repository" -not -name "CVS" -not -name "." -exec install -m 755 {} $(INSTALL_DIR)/sbin \;
To delete svn files with "!":
To delete svn files with "!":
# svn st | grep ! | sed 's/!/svn --force del/g' > run.sh
edit run.sh and add "#!/bin/sh" in first line.
# ./run.sh
2011年6月27日 星期一
[Linux] Device/File system test script
#!/bin/ash
i=1
while true; do
FILENAME=/mnt/hd/test.tmp
BLOCKSIZE=1M
BLOCKCOUNT=100
echo "--- Write ($i) ---"
dd if=/dev/zero of=$FILENAME bs=$BLOCKSIZE count=$BLOCKCOUNT conv=sync
echo 3 > /proc/sys/vm/drop_caches
echo 0 > /proc/sys/vm/drop_caches
echo "--- Read ($i) ---"
dd if=$FILENAME of=/dev/zero bs=$BLOCKSIZE count=$BLOCKCOUNT
rm -f $FILENAME
i=$(($i+1))
done
i=1
while true; do
FILENAME=/mnt/hd/test.tmp
BLOCKSIZE=1M
BLOCKCOUNT=100
echo "--- Write ($i) ---"
dd if=/dev/zero of=$FILENAME bs=$BLOCKSIZE count=$BLOCKCOUNT conv=sync
echo 3 > /proc/sys/vm/drop_caches
echo 0 > /proc/sys/vm/drop_caches
echo "--- Read ($i) ---"
dd if=$FILENAME of=/dev/zero bs=$BLOCKSIZE count=$BLOCKCOUNT
rm -f $FILENAME
i=$(($i+1))
done
2011年6月9日 星期四
[Charset] UTF-8 support
File systems --->
DOS/FAT/NT Filesystems --->
(utf8) Default iocharset for FAT
-*- Native language support --->
(utf8) Default NLS Option
DOS/FAT/NT Filesystems --->
(utf8) Default iocharset for FAT
-*- Native language support --->
(utf8) Default NLS Option
訂閱:
文章 (Atom)