今早upgrade的時候,發現debian已建議轉換成 grub2,既然都這樣建議了,當然是把它換掉。
一開始安裝 grub2-pc後,會先相容舊的grub,開機的時候會出現:
When you have verified GRUB 2 works, you can use this command to
complete the upgrade: upgrade-from-grub-legacy
選擇linux-kernel的選項後,再執行 upgrade-from-grub-legacy,就能轉換成功。
設定檔由原本的 menu.lst 變成 /etc/grub.d/ 和 /etc/default/grub,設定完這兩個檔案內容後,執行 /usr/sbin/grub-mkconfig 就能產生 /boot/grub/grub.cfg,也就是開機時的選單了。
配合新版的grub2-splashimage,開機選單真是漂亮!而且,我覺得開機變快!
GRUB 2 has the following tasks:
* Create a compact core image. This will make Stage 1.5 unnecessary.
* Add support for dynamic loading to the core image, so that it can extend itself at the run time rather than at the build time.
* Add real memory management, to make GNU GRUB more extensible.
* Add a more object-oriented framework for file systems, files, devices, drives, terminals, commands, and OS loaders.
* Add support for internationalization. This includes support for non-ASCII character code, message catalogs like gettext, fonts, graphics console, and so on.
* Add an actual localization, based on the above internationalization support. We will target on Japanese as the first step.
* Segregate code specific to i386-pc from generic code, to make GNU GRUB portable.
* Add support for cross-platform installation.
* Develop additional software packages which will help our project and hopefully other projects.
2009年8月7日 星期五
2009年7月4日 星期六
體驗multi-thread decode的mplayer
先前閱讀了GeeXbox的 multi-thread decode 的功能,感到非常有興趣,因為我自已有收藏了許多1080p H264的影片,但我的Althon X2 3600+其實撥不太動。看到了Multi-thread decode的功能,當然要好好嘗試,讓我的 CPU 可以播放高清影片。
影片格式必須是 Mpeg1/2 H264才可以,大部份的高清片都以Mpeg2, H264為主,所以不用擔心。
先記錄一下做法。
1. 下載最新的 mplayer:
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
2. 下載 FFmpeg-mt:
git clone git://gitorious.org/~astrange/ffmpeg/ffmpeg-mt.git
3. 更新 mplayer 的libav*目錄
cd mplayer
rm -fr libav*
cp -a ../ffmpeg-mt/libavformat .
cp -a ../ffmpeg-mt/libavcodec .
cp -a ../ffmpeg-mt/libavutil .
4. 開始編譯和make
./configure
make
make install
編譯完成後,隨便拿一個測試影片(網路上也有提供高清的試看),執行下列指令來撥放:
mplayer -vc ffh264 -lavdopts threads=[N] movie.mp4 (N代表CPU的核心數)
撥放時用top來看,可以看到 mplayer 的 loading 會超過100%,而且畫面很順,真是開心極了。按照ffmpeg-mt的官方說法,目前除了Atom N330之外,其它雙核以上CPU都可以順暢。
這應該是C/P值最高的高清撥放功能了。
提外話,等我買了Nvidia8系列的顯示放後,再來測試 nvidia-libvdpau 的高清撥放功能。
影片格式必須是 Mpeg1/2 H264才可以,大部份的高清片都以Mpeg2, H264為主,所以不用擔心。
先記錄一下做法。
1. 下載最新的 mplayer:
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
2. 下載 FFmpeg-mt:
git clone git://gitorious.org/~astrange/ffmpeg/ffmpeg-mt.git
3. 更新 mplayer 的libav*目錄
cd mplayer
rm -fr libav*
cp -a ../ffmpeg-mt/libavformat .
cp -a ../ffmpeg-mt/libavcodec .
cp -a ../ffmpeg-mt/libavutil .
4. 開始編譯和make
./configure
make
make install
編譯完成後,隨便拿一個測試影片(網路上也有提供高清的試看),執行下列指令來撥放:
mplayer -vc ffh264 -lavdopts threads=[N] movie.mp4 (N代表CPU的核心數)
撥放時用top來看,可以看到 mplayer 的 loading 會超過100%,而且畫面很順,真是開心極了。按照ffmpeg-mt的官方說法,目前除了Atom N330之外,其它雙核以上CPU都可以順暢。
這應該是C/P值最高的高清撥放功能了。
提外話,等我買了Nvidia8系列的顯示放後,再來測試 nvidia-libvdpau 的高清撥放功能。
2009年6月28日 星期日
GeeXBox 1.2.2
Detailed Changelog (relative to 1.2.1 release):
- Multi-threaded video decoding for MPEG-1/2/4 and H.264 codecs.
- Support for newly discovered DVD MovieProtect encryption method.
- Extended DVD CSS descrambiling capabilities.
- Removal of GOOM audio visualization (was causing too much troubles).
- Automount daemon enhancements.
- Upgrade of MPlayer and its set of codecs.
我很好奇multi-threaded video decoding是怎麼做到的,mplayer有辦法達到multi-thread decode嗎?會不會是GeeXbox團隊自已實做出來的?
- Multi-threaded video decoding for MPEG-1/2/4 and H.264 codecs.
- Support for newly discovered DVD MovieProtect encryption method.
- Extended DVD CSS descrambiling capabilities.
- Removal of GOOM audio visualization (was causing too much troubles).
- Automount daemon enhancements.
- Upgrade of MPlayer and its set of codecs.
我很好奇multi-threaded video decoding是怎麼做到的,mplayer有辦法達到multi-thread decode嗎?會不會是GeeXbox團隊自已實做出來的?
2009年1月6日 星期二
宇瞻 Apacer AH321 紅寶石16G隨身碟入手
最近不小心摔到了用了近兩年的NEXS 4G的隨身碟,資料都不見了...><,該隨身碟的讀取有15MB,寫入了7MB以上。而且不貴。
由於隨身碟壞掉的關係,於是就上網物色了一下便宜又大碗的隨身碟。市面上標榜快速讀寫的牌子有OCZ, patriot,但16G的價格破千,甚至到1.5k,實在是買不起,最後在討論區看到了這一隻隨身碟。16G的價格在大同3C才$799,實在是滿心動的。
於是下班後就買了跑去大同買了該碟,回家用hdparm -t測試,讀取竟然有30MB!!!!,寫入也有15MB,實在是太嚇人了。幾乎跟OCZ, Patriot的牌子一樣快。
買到了物美價廉的好物,真是開心 :D
由於隨身碟壞掉的關係,於是就上網物色了一下便宜又大碗的隨身碟。市面上標榜快速讀寫的牌子有OCZ, patriot,但16G的價格破千,甚至到1.5k,實在是買不起,最後在討論區看到了這一隻隨身碟。16G的價格在大同3C才$799,實在是滿心動的。
於是下班後就買了跑去大同買了該碟,回家用hdparm -t測試,讀取竟然有30MB!!!!,寫入也有15MB,實在是太嚇人了。幾乎跟OCZ, Patriot的牌子一樣快。
買到了物美價廉的好物,真是開心 :D
2008年8月2日 星期六
iconv的初體驗
最近因為公司任務的關係,我要負責弄DVB-T的東西。DVB-T對我是一個全新的挑戰,也滿有趣的。第一個遇到的問題就是EPG的亂碼。想到亂碼的解決,就是澆冷水...囧rz.....恕我開個玩笑。:-P
咳咳...在Linux的環境下,一想到轉碼,就會想到iconv!
對iconv,小弟都只聞其名、未深入體驗,這次剛好有個機會來嘗試。試著寫個簡單的小範例來轉換字串成UTF-8或是Big5。
PS:因為blogger不知道要怎麼顯示 <> 這樣的符號(會被辨試成delimiter),所以改用 "" 表示。
#include "iconv.h"
#include "string.h"
#include "stdlib.h"
#include "errno.h"
int main( int argc, char **argv )
{
iconv_t cd;
size_t in_s, out_s;
/* UTF-8 轉 Big5 */
cd = iconv_open("BIG-5", "UTF8");
char *ibuf = "我是阿信", *in_ptr;
char *obuf = NULL, *out_ptr;
in_s = strlen(ibuf);
in_ptr = ibuf;
obuf = malloc( in_s * 3 );
out_s = in_s * 3;
out_ptr = obuf;
if( cd == (iconv_t )-1 ){
fprintf( stderr, "error opening iconv \n" );
exit(1);
}
if( iconv( cd, &in_ptr, &in_s, &out_ptr, &out_s) == -1 ){
printf("errno: %s\n", strerror(errno));
}
*out_ptr = '\0';
printf("%s, %s\n",ibuf, obuf);
iconv_close( cd );
free( obuf );
return 0;
}
接下來就 gcc -Wall a.c -o a.out,開一個Big5的terminal,執行一下這個新生的a.out,就能看到轉換後的字串了。
試用過了iconv之後,花了一點時間修改dvb-apps的scan程式,利用下scan指令後,會得到正確的節目表的名稱在新產生的channel.conf檔案內了。
咳咳...在Linux的環境下,一想到轉碼,就會想到iconv!
對iconv,小弟都只聞其名、未深入體驗,這次剛好有個機會來嘗試。試著寫個簡單的小範例來轉換字串成UTF-8或是Big5。
PS:因為blogger不知道要怎麼顯示 <> 這樣的符號(會被辨試成delimiter),所以改用 "" 表示。
#include "iconv.h"
#include "string.h"
#include "stdlib.h"
#include "errno.h"
int main( int argc, char **argv )
{
iconv_t cd;
size_t in_s, out_s;
/* UTF-8 轉 Big5 */
cd = iconv_open("BIG-5", "UTF8");
char *ibuf = "我是阿信", *in_ptr;
char *obuf = NULL, *out_ptr;
in_s = strlen(ibuf);
in_ptr = ibuf;
obuf = malloc( in_s * 3 );
out_s = in_s * 3;
out_ptr = obuf;
if( cd == (iconv_t )-1 ){
fprintf( stderr, "error opening iconv \n" );
exit(1);
}
if( iconv( cd, &in_ptr, &in_s, &out_ptr, &out_s) == -1 ){
printf("errno: %s\n", strerror(errno));
}
*out_ptr = '\0';
printf("%s, %s\n",ibuf, obuf);
iconv_close( cd );
free( obuf );
return 0;
}
接下來就 gcc -Wall a.c -o a.out,開一個Big5的terminal,執行一下這個新生的a.out,就能看到轉換後的字串了。
試用過了iconv之後,花了一點時間修改dvb-apps的scan程式,利用下scan指令後,會得到正確的節目表的名稱在新產生的channel.conf檔案內了。
2008年6月21日 星期六
節約,省電的好幫手:Cpufrequtils
最近常聽到節約,省電的口號,加上七月份電費要開始上漲,省電變成每台電腦的基本功能。
今天要介紹的就是要讓您的CPU降速、降溫度的好工具:cpufrequtils。
在kernel-2.6中,已經實作了動態調整CPU clock的kernel module:cpufreq,它支援Intel/AMD的CPU,小弟的CPU是Althon Dual Core 3600+,支援CnQ,在待機時可以降下速度,溫度也會降低。
首先,先安裝適當的module,以AMD的CPU而言,採用的是powernow-k8:
modprobe powernow-k8
modprobe cpufreq_ondemand
以及相關的cpufreq module,小弟採用的是ondemand模式,接下來,請安裝cpufrequitls,修改
/etc/default/cpufrequtils
加入
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED=1900M
MIN_SPEED=1000M
或者直接修改/etc/init.d/cpufrequtils,內容如上。重新啟動cpufrequtils
/etc/init.d/cpufrequtils restart
執行cpufreq-info
analyzing CPU 0:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 1.90 GHz
available frequency steps: 1.90 GHz, 1.80 GHz, 1000 MHz
available cpufreq governors: powersave, conservative, userspace, ondemand, performance
current policy: frequency should be within 1000 MHz and 1.90 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1000 MHz.
出現上述字樣就表示cpufreq已經設定成功,檢查/proc/cpuinfo,您就會發現CPU的頻率會在1G~1.9G跳動,剩下的,就是好好享受cpufreq帶給你的便利性了. :-D
PS: cpufreq支援多種policy:
performance: 全速
powersave: 以最省電的方式調整CPU clock,大部份都在最低的頻率
ondemand: 依照CPU loading的程度動態調整,撥SD/HD的影片時,會跳動的最明顯。
PS2: 還有另一套cpufreqd,它是以daemon的方式運作,設定的內容更細,還能依照ACPI來監控電池容量改變CPU頻率,由於弟只有桌上型PC,所以cpufrequtils簡單的設定方法已經符合弟的需求了。
今天要介紹的就是要讓您的CPU降速、降溫度的好工具:cpufrequtils。
在kernel-2.6中,已經實作了動態調整CPU clock的kernel module:cpufreq,它支援Intel/AMD的CPU,小弟的CPU是Althon Dual Core 3600+,支援CnQ,在待機時可以降下速度,溫度也會降低。
首先,先安裝適當的module,以AMD的CPU而言,採用的是powernow-k8:
modprobe powernow-k8
modprobe cpufreq_ondemand
以及相關的cpufreq module,小弟採用的是ondemand模式,接下來,請安裝cpufrequitls,修改
/etc/default/cpufrequtils
加入
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED=1900M
MIN_SPEED=1000M
或者直接修改/etc/init.d/cpufrequtils,內容如上。重新啟動cpufrequtils
/etc/init.d/cpufrequtils restart
執行cpufreq-info
analyzing CPU 0:
driver: powernow-k8
CPUs which need to switch frequency at the same time: 0 1
hardware limits: 1000 MHz - 1.90 GHz
available frequency steps: 1.90 GHz, 1.80 GHz, 1000 MHz
available cpufreq governors: powersave, conservative, userspace, ondemand, performance
current policy: frequency should be within 1000 MHz and 1.90 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1000 MHz.
出現上述字樣就表示cpufreq已經設定成功,檢查/proc/cpuinfo,您就會發現CPU的頻率會在1G~1.9G跳動,剩下的,就是好好享受cpufreq帶給你的便利性了. :-D
PS: cpufreq支援多種policy:
performance: 全速
powersave: 以最省電的方式調整CPU clock,大部份都在最低的頻率
ondemand: 依照CPU loading的程度動態調整,撥SD/HD的影片時,會跳動的最明顯。
PS2: 還有另一套cpufreqd,它是以daemon的方式運作,設定的內容更細,還能依照ACPI來監控電池容量改變CPU頻率,由於弟只有桌上型PC,所以cpufrequtils簡單的設定方法已經符合弟的需求了。
2008年6月18日 星期三
mhddfs: join several real filesystems together to form a single larger one
FYI
http://debaday.debian.net/2008/05/25/mhddfs-join-several-real-filesystems-together-to-form-a-single-larger-one/
該軟體的是利用FUSE(User space filesystem)這個module將多顆硬碟串成一個virtual device,而非像已往的Raid,LVM的方式,
他寫入的機制很簡單,假設有三顆硬碟:A,B,C。當寫入資料時,若資料大於A硬碟所餘的大小,就會換到第二顆。同理,第三顆硬碟的操作也是如此。
另外,當它寫入第一顆時,發現還有空間太小必須換另一顆硬碟時,會搬移剛剛寫入的資料到接續有足夠大小的硬碟。
雖然機制上沒有Raid, LVM那麼有效率和安全,但不失為一個單機版合拼硬碟的方法。
目前Debian testing/unstable已經有,Ubuntu尚未納入,參考看看
http://debaday.debian.net/2008/05/25/mhddfs-join-several-real-filesystems-together-to-form-a-single-larger-one/
該軟體的是利用FUSE(User space filesystem)這個module將多顆硬碟串成一個virtual device,而非像已往的Raid,LVM的方式,
他寫入的機制很簡單,假設有三顆硬碟:A,B,C。當寫入資料時,若資料大於A硬碟所餘的大小,就會換到第二顆。同理,第三顆硬碟的操作也是如此。
另外,當它寫入第一顆時,發現還有空間太小必須換另一顆硬碟時,會搬移剛剛寫入的資料到接續有足夠大小的硬碟。
雖然機制上沒有Raid, LVM那麼有效率和安全,但不失為一個單機版合拼硬碟的方法。
目前Debian testing/unstable已經有,Ubuntu尚未納入,參考看看
訂閱:
文章 (Atom)