多檔案組成的程式 by Hsian Studio
http://hsian-studio.blogspot.com/2008/09/blog-post_126.html
2011年1月8日 星期六
在 Linux 上建立 helloDriver.ko for Android
參考:http://telesky.pixnet.net/blog/post/6969608
1. 先準備 helloDriver.c and Makefile
====================================================================================
helloDriver.c
Makefile
2. 在 /home/____/_____/982_Android/kernel/ 裡修改 Makefile
====================================================================================
$ make mrproper
$ make oldconfig
全部enter
$ make modules_prepare
3. 回到 helloDriver.c 所在的目錄
====================================================================================
$ make
這樣就會得到 helloDriver.ko
$ file helloDriver.ko
1. 先準備 helloDriver.c and Makefile
====================================================================================
helloDriver.c
#include
#include
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk(KERN_INFO "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_INFO "Goodbye, cruel world\n");
}
module_init(hello_init);
module_exit(hello_exit);
Makefile
KERNELDIR := /home/____/_____/982_Android/kernel/
PWD :=$(shell pwd)
ARCH=arm
CROSS_COMPILE=/home/____/_____/991_Android/other/vanilla/tools/arm-eabi-4.2.1/bin/arm-eabi-
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
obj-m := hello.o
modules:
$(MAKE) -C $(KERNELDIR) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) M=$(PWD) modules
clean:
rm *.o *.ko *.mod.c *.markers *.order *.symvers
2. 在 /home/____/_____/982_Android/kernel/ 裡修改 Makefile
====================================================================================
ARCH := arm
CROSS_COMPILE := /home/____/_____/991_Android/other/vanilla/tools/arm-eabi-4.2.1/bin/arm-eabi-
$ make mrproper
$ make oldconfig
全部enter
$ make modules_prepare
3. 回到 helloDriver.c 所在的目錄
====================================================================================
$ make
這樣就會得到 helloDriver.ko
$ file helloDriver.ko
2009年5月28日 星期四
2008年11月17日 星期一
2008年11月14日 星期五
完整備份Ubuntu已安裝的應用程式清單
這裡有教你如何完整備份Ubuntu已安裝的應用程式清單,
以及重灌後的還原:
http://hehe2.net/linuxhowto/howto-fresh-ubuntu-install-without-losing-your-current-settings/
1. 備份/home/user (如果/home是獨立分割區可以省略這步)
2. 備份應用軟體清單:
3. 重灌好後還原應用軟體:
以及重灌後的還原:
http://hehe2.net/linuxhowto/howto-fresh-ubuntu-install-without-losing-your-current-settings/
1. 備份/home/user (如果/home是獨立分割區可以省略這步)
2. 備份應用軟體清單:
sudo dpkg --get-selections > /home/user/package.selections
3. 重灌好後還原應用軟體:
sudo dpkg --set-selections /home/package.selections && apt-get dselect-upgrade
2008年11月10日 星期一
回覆: 壓縮檔內出現中文亂碼
先新增zh_TW.Big5的locale...
加入:
接著再執行...
最後...
sudo gedit /var/lib/locales/supported.d/zh
加入:
zh_TW.Big5 Big5
接著再執行...
sudo locale-gen
最後...
LANG=zh_TW.Big5 file-roller
訂閱:
意見 (Atom)