2015年3月9日 星期一

在ubuntu 14.04 編譯 linux kernel

首先下載想要的linux kernel
https://www.kernel.org/pub/linux/kernel/v3.x/
然後解壓縮

安裝必要的package:
sudo apt-get install fakeroot build-essential kernel-package libncurses5 libncurses5-dev
sudo dpkg -i kernel-package_13.003_all.deb
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock

接下來設定環境:
kerVer='3.15.7/linux-3.15.7'
KernelPath=$(sudo find /media/vli -name 'Kernel' | grep 'Test_tool')
cd ~/Desktop/
ln -s $KernelPath/$kerVer linux
cd ~/Desktop/linux
cp /boot/config-`uname -r` ./.config

編譯kernel:
sudo make menuconfig
sudo make-kpkg clean
sudo fakeroot make-kpkg --initrd kernel_image kernel_headers

安裝kernel:
sudo dpkg -i linux-image-3.15.8_3.15.8-10.00.Custom_amd64.deb
sudo dpkg -i linux-headers-3.15.8_3.15.8-10.00.Custom_amd64.deb

重新開機:
sudo reboot

編譯 linux MMC module

到linux source code的目錄下執行
 sudo make M=drivers/mmc modules

2015年3月4日 星期三

SQL使用範例說明

1.      WCT_trace:ER模型sahaema


共有5table當要使用SQL搜尋需要的資料時可以善加利用這個Schema
2.      幾個簡單SQL範例
(1)   選擇出Blk_Data所有的資料:
selectfrom Blk_Data

(2)選擇出WCT_Table所有的資料:
selectfrom WCT_Table

(3)選擇出Blk_Data當中的LFT_Key,Dat_Addr,count(Dat_Addr)資料當CH_No = 0 and CE_No =0 其中的 Dat_Addr是不重複的:
select LFT_Key,Dat_Addr,count(Dat_Addr)  from Blk_Data where CH_No = 0 and CE_No =0 group by Dat_Addr

       (4)選擇出Blk_Data當中的所有資料當CH_No = 0 and CE_No =0 其中根據 Dat_Addr做排序:
selectfrom Blk_Data where CH_No = 0 and CE_No =0 order by Dat_addr

       (5)選擇出Blk_Data當中的LFT_Key資料當 LFT_Table.TAT_Key = 1 AND             LFT_Table.LFT_Key = Blk_Data.LFT_Key其中Blk_Data.LFT_Key是不重複:


select Blk_Data.LFT_Key from LFT_Table, Blk_Data where LFT_Table.TAT_Key = 1 and LFT_Table.LFT_Key = Blk_Data.LFT_Key group by Blk_Data.LFT_Key