锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产91色综合久久免费,久久99中文字幕久久,男女久久久国产一区二区三区http://www.shnenglu.com/huyi/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ------ Keep life simple<br> GMail/GTalk/MSN:huyi.zg@gmail.comzh-cnWed, 07 May 2025 01:18:15 GMTWed, 07 May 2025 01:18:15 GMT60鍙戝竷涓涓棩璇眽瀛楀亣鍚嶈漿鎹㈣蔣浠剁粰澶уhttp://www.shnenglu.com/huyi/archive/2007/05/30/25110.htmlHuYiHuYiWed, 30 May 2007 03:03:00 GMThttp://www.shnenglu.com/huyi/archive/2007/05/30/25110.htmlhttp://www.shnenglu.com/huyi/comments/25110.htmlhttp://www.shnenglu.com/huyi/archive/2007/05/30/25110.html#Feedback18http://www.shnenglu.com/huyi/comments/commentRss/25110.htmlhttp://www.shnenglu.com/huyi/services/trackbacks/25110.htmlhttp://www.shnenglu.com/huyi/archive/2006/03/15/4207.html

涓嬭澆鍦板潃錛?br>http://www.shnenglu.com/Files/huyi/kanji.rar

浣跨敤鏂瑰紡錛?br>閫変腑涓嶇煡閬撹闊崇殑鏃ユ枃姹夊瓧錛堜腑鍥芥眽瀛楁棤鏁堬級錛岀劧鍚嶤trl+C鍗沖彲銆傚湪緋葷粺鎵樼洏鍥炬爣涓婄偣鍑誨乏閿紝鍙互鎵撳紑鍏抽棴鐩戣鍔熻兘銆?br>
杞歡鎴睆:



2007騫?鏈?1鏃?br>鏀懼嚭1.5鐗堬紝鏀瑰姩濡備笅錛?br>1.緹庡寲浜嗙晫闈紝鏀硅繘浜嗗墠涓鐗堟湰涓樉紺洪敊浣嶇殑闂銆?br>2.3縐掑悗鏌ヨ紿楀彛鑷姩灝忔椂銆?br>3.鍋氫簡閮ㄥ垎榪囨護錛岃兘榪囨護鎺夎澶氶潪鏃ユ枃姹夊瓧鐨勪笢瑗褲?br>4.宸﹂敭榛樿绔嬪嵆鍏抽棴紿楀彛錛屽彸閿畾浣忕獥鍙o紝浣夸箣涓嶄細鑷姩娑堝け銆?br>鏂扮殑鎴浘灝變笉鏀懼嚭浜嗭紝鎬諱箣婕備寒浜嗗緢澶氾紝甯屾湜澶у緇х畫鏀寔銆?br>

HuYi 2007-05-30 11:03 鍙戣〃璇勮
]]>
灝嗘垚鍛樺嚱鏁頒綔涓簊td::for_each鐨勭涓変釜鍙傛暟http://www.shnenglu.com/huyi/archive/2006/12/22/16736.htmlHuYiHuYiFri, 22 Dec 2006 07:10:00 GMThttp://www.shnenglu.com/huyi/archive/2006/12/22/16736.htmlhttp://www.shnenglu.com/huyi/comments/16736.htmlhttp://www.shnenglu.com/huyi/archive/2006/12/22/16736.html#Feedback3http://www.shnenglu.com/huyi/comments/commentRss/16736.htmlhttp://www.shnenglu.com/huyi/services/trackbacks/16736.htmlvoid CBookEditDlg::ForEachBookFunctor(Book book)
{
聽聽聽 ......
}
for_each(books.begin(), books.end(), std::bind1st(mem_fun(&CBookEditDlg::ForEachBookFunctor), this));

鍏抽敭鐐瑰湪浜巑em_fun鍜宐ind1st鐨勪嬌鐢ㄣ?br />
for_each鐨勫疄鐜頒腑鏈鏍稿績鐨勪竴涓皟鐢細functor(*iterater);
鐢變簬綾婚潪闈欐佹垚鍛樺嚱鏁幫紝蹇呴』鍦ㄥ疄渚嬩笂璋冪敤錛?instance->*pfn)(params);
鎵浠or_each鏃犳硶鐩存帴浣跨敤浼犺繃鍘葷殑鍑芥暟鍦板潃錛屽嚱鏁版寚閽堢殑絎竴涓弬鏁版槸綾葷殑涓涓疄渚嬫寚閽堬紙this鎸囬拡)錛屾墍浠ュ繀欏繪兂鍔炴硶鎶婅繖涓寚閽堜紶榪囧幓錛堜嬌鐢╯td::bind1st錛?br />
鍏充簬mem_fun鐨勪竴浜涜祫鏂欙紝璇峰弬鑰?br />http://www.stlchina.org/documents/EffectiveSTL/files/item_41.html

瀵逛簬甯︿袱涓互涓婂弬鏁扮殑鎴愬憳鍑芥暟錛岀敤stl鏄笉鑳借揪鍒扮洰鐨勭殑錛屽洜涓簃em_fun鍙兘鐢熸垚涓嶅甫鍙傛暟錛屾垨鑰呮槸浠呭甫涓涓弬鏁扮殑鍑芥暟瀵硅薄錛坒unctor)錛宐ind1st鍜宐ind2st涔熷彧鑳藉絎竴涓垨鑰呮槸絎簩涓弬鏁拌繘琛岀粦瀹氥?br />瑕佸疄鐜板浠繪剰鏁伴噺鍙傛暟鐨勬垚鍛樺嚱鏁扮敓鎴恌unctor錛屽繀欏誨stl榪涜鎵╁睍錛屾墍騫竍oost宸茬粡鍋氬埌浜嗚繖鐐癸紝boost::bind鍜宐oost::mem_fn灝辨槸鏇村姞娉涘寲鐨剆td::bind1st鍜宻td::mem_func

聽聽聽 void ForEachClassFunctor(Class c, CTreeItem treeItem)
聽聽聽 {
聽聽聽 聽聽聽 treeView.InsertItem(c.name.c_str(), treeItem, NULL);
聽聽聽 }

聽聽聽 void ForEachBookFunctor(Book book)
聽聽 聽{
聽聽 聽聽聽 聽CTreeItem treeItem = treeView.InsertItem(book.name.c_str(), NULL, NULL);
聽聽 聽聽聽 聽vector<Class> v;
聽聽 聽聽聽 聽v.push_back(Class(0,0,"nameClass1", "titleClass1"));
聽聽 聽聽聽 聽for_each(v.begin(), v.end(),
聽聽聽聽聽聽聽聽聽聽聽 boost::bind(boost::mem_fn(&CBookEditDlg::ForEachClassFunctor), this, _1, treeItem));
聽聽 聽}


HuYi 2006-12-22 15:10 鍙戣〃璇勮
]]>
UTF-8涓嶶nicode鐨勭浉浜掕漿鎹?/title><link>http://www.shnenglu.com/huyi/archive/2006/12/22/16734.html</link><dc:creator>HuYi</dc:creator><author>HuYi</author><pubDate>Fri, 22 Dec 2006 07:09:00 GMT</pubDate><guid>http://www.shnenglu.com/huyi/archive/2006/12/22/16734.html</guid><wfw:comment>http://www.shnenglu.com/huyi/comments/16734.html</wfw:comment><comments>http://www.shnenglu.com/huyi/archive/2006/12/22/16734.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/huyi/comments/commentRss/16734.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/huyi/services/trackbacks/16734.html</trackback:ping><description><![CDATA[浠婂ぉ鐢ㄥ埌浜哠qlite,鐢變簬瀹冨唴閮ㄦ槸浣跨敤UTF-8緙栫爜錛屾墍浠ュ湪Windows搴旂敤涓嚭鐜頒簡涔辯爜銆?br />綆鍗曠殑鎼滅儲浜嗕竴涓嬶紝鐩鎬簰杞崲鐨勬柟娉曞緢澶氾紝鎴戣寰楁瘮杈冨ソ鐨勶紝鏄?br /><a target="_blank">http://www.vckbase.com/document/viewdoc/?id=1444</a><br /><br />鎴戠◢寰敼榪涗簡涓涓?<br /><br />聽聽聽 static WCHAR* UTF82Unicode(WCHAR* pBuffer,char *pSource, int buff_size)<br />聽聽聽 {<br />聽聽聽 聽聽聽 int i, j, max;<br />聽聽聽 聽聽聽 char* uchar = (char *)pBuffer;<br />聽聽聽聽聽聽聽 max = buff_size - 2;<br />聽聽聽 聽聽聽 for(i = 0, j = 0; pSource[j] != '\0'; i += 2, j += 3)<br />聽聽聽 聽聽聽 {<br />聽聽聽聽聽聽聽聽聽聽聽 if (i > max) {<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 break;<br />聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽 聽聽聽 聽聽聽 uchar[i+1] = ((pSource[j] & 0x0F) << 4) + ((pSource[j+1] >> 2) & 0x0F);<br />聽聽聽 聽聽聽 聽聽聽 uchar[i] = ((pSource[j+1] & 0x03) << 6) + (pSource[j+2] & 0x3F);<br />聽聽聽 聽聽聽 }<br />聽聽聽聽聽聽聽 uchar[i] = '\0';<br />聽聽聽聽聽聽聽 uchar[i+1] = '\0';<br />聽聽聽聽聽聽聽 return pBuffer;<br />聽聽聽 }<br /><br />鍦╓indows涓殑璇濓紝榪樻湁鏇寸畝鍗曠殑鏂規硶瀹屾垚杞崲錛?br />姣斿浠嶶TF-8鍒癠nicode:<br />聽聽聽 WCHAR buff[255];<br />聽聽聽 <span style="FONT-WEIGHT: bold">MultiByteToWideChar</span>(CP_UTF8, 0, argv[i], -1, buff, sizeof(buff));<br />聽聽聽 item.name = W2A(buff);<br /><br />argv[i]鏄杞崲鐨勫瓧鑺傛暟緇?img src ="http://www.shnenglu.com/huyi/aggbug/16734.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/huyi/" target="_blank">HuYi</a> 2006-12-22 15:09 <a href="http://www.shnenglu.com/huyi/archive/2006/12/22/16734.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍏充簬鏂囦歡鎿嶄綔鐨勫皝瑁呭鐞?/title><link>http://www.shnenglu.com/huyi/archive/2006/10/14/13675.html</link><dc:creator>HuYi</dc:creator><author>HuYi</author><pubDate>Sat, 14 Oct 2006 08:45:00 GMT</pubDate><guid>http://www.shnenglu.com/huyi/archive/2006/10/14/13675.html</guid><wfw:comment>http://www.shnenglu.com/huyi/comments/13675.html</wfw:comment><comments>http://www.shnenglu.com/huyi/archive/2006/10/14/13675.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/huyi/comments/commentRss/13675.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/huyi/services/trackbacks/13675.html</trackback:ping><description><![CDATA[ <div class="mckwmem" id="inbdy">File綾繪湰韜茍涓嶆寔鏈夋枃浠跺彞鏌勶紝瀹冨彧鏄泦涓簡涓緋誨垪瀵規枃浠剁殑鎿嶄綔鏂規硶錛屽Create錛孫pen絳夌瓑銆傝繖浜涙柟娉曞叏閮ㄩ兘鏄潤鎬佺殑錛屼篃涓嶈繘琛屼換浣曠殑瀹夊叏媯嫻嬶紝浠呬粎<wbr>鏄洿鎺ヨ皟鐢╬spsdk鏉ュ畬鎴愪換鍔★紝濡傛灉鍑虹幇閿欒錛屽垯榪斿洖璐熷箋?<br />File鐨凮pen絳夋柟娉曞彲浠ュ垱寤洪拡瀵規寚瀹氭枃浠惰鍐欑殑嫻佸璞ileStream錛屽彞鏌勭敱FileStream鑷繁鍒涘緩鍜屾寔鏈夌鐞嗭紝File::Open鍙槸浼?wbr>杈捐礬寰勪俊鎭?<br />鍙互鎶奆ile鐪嬩綔鏄竴涓棬闈紝闆嗕腑浜嗗鏂囦歡鐨勬墍鏈夋搷浣滐紝騫朵笖涓嶉渶瑕佸垱寤篎ile瀵硅薄灝卞彲浠ョ洿鎺ユ墽琛岃繖浜涙搷浣溿傛墍浠ヨFile涓烘枃浠剁殑鍗曚竴鎿嶄綔鎻愪緵浜嗗揩鎹風畝渚跨殑<wbr>鏂瑰紡銆?<br />闄や簡鍑犱釜鍒涘緩FileStream嫻佺殑鎿嶄綔澶栵紝鍏朵粬鎿嶄綔閮戒笉浼氶暱鏈熷崰鐢ㄥ彞鏌勮祫婧愶紝閬靛驚"鍙ユ焺鍒涘緩-鎵ц鍏蜂綋鎿嶄綔-閲婃斁鍙ユ焺"鐨勬楠ゃ?<br /><p>濡傛灉闇瑕侀綣佺殑鎿嶄綔鏂囦歡錛屽垯闇瑕佷竴涓被鏉ラ暱鏈熸寔鏈夊彞鏌勶紝閬垮厤緇忓父鎬х殑鎵撳紑鍜屽叧闂枃浠訛紝鏁呮寮曞叆FileInfo綾匯侳ileInfo鎵цAppend絳夋搷浣滄椂錛?wbr>閮芥槸浣跨敤浜嬪厛鎵撳紑鐨勬枃浠跺彞鏌勩?<br />鍚屾椂錛孎ileInfo涔熷彲浠ュ垱寤篎ileStream瀹炰緥錛屼絾榪欎釜鏃跺欙紝鏂囦歡鐨勫彞鏌勭敓鍛藉懆鏈熷簲璇ョ敱FileInfo鏉ョ鐞嗭紝FileStream鍙互浣跨敤榪欎釜<wbr>鍙ユ焺錛屼絾涓嶈兘緇撴潫鍏剁敓鍛藉懆鏈燂紝FileStream::Close()鏂規硶浠呬粎浣胯繖涓祦澶勪簬鍏抽棴錛堜笉鍙鍐欙級鐘舵侊紝浣嗗茍涓嶅疄闄呭叧闂枃浠跺彞鏌勩?<br />榪欑鎯呭喌涓嬶紝FileInfo鎵鍒涘緩鐨凢ileStream::Close()鐨勮涓哄拰鍓嶉潰File鎵鍒涘緩鐨凢ileStream::Close()琛屼負鏈夊樊寮?wbr>銆傚洜涓篎ile騫朵笉鎸佹湁鍙ユ焺錛屾墍浠ュ畠鍒涘緩浜咶ileStream瀵硅薄鍚庯紝鍙ユ焺搴旇鐢盕ileStream鏉ョ鐞嗐備絾FileInfo鎵鍒涘緩鐨凢ileStrea<wbr>m鏄嬌鐢ㄧ殑FileInfo鎵鍒涘緩濂界殑鍙ユ焺錛屾墍浠ュ畠騫朵笉瀵規鍙ユ焺璐熻矗銆?<br /></wbr></wbr></wbr></wbr></p><p>瀹炵幇絳栫暐錛?<br />1.浣跨敤鍩轟簬緇ф壙鐨勫鎬佹垨鍩轟簬妯℃澘鐨勯潤澶氭併?<br />2.浣跨敤鍑芥暟鍥炶皟銆傛妸Close鍋氭垚璋冪敤鍑芥暟鎸囬拡錛岄氳繃涓嶅悓鐨凢ileStream鏋勯犲嚱鏁拌皟鐢紝鏉ヨ緗寚閽堟寚鍚戜笉鍚岀殑Close鍑芥暟瀹炵幇銆傦紙鍏抽棴鍙ユ焺鎴栦笉鍏抽棴<wbr>鍙ユ焺錛?<br />榪欎袱縐嶅仛娉曠殑浼樺姡鎬ф鍦ㄨ冭瘉涓紝璇鋒彁鍑烘剰瑙併?<br /><br /><br />琛ュ厖錛欶ile鍜孎ileInfo鐨勫叧緋誨湪dotnet涓篃鏈変綋鐜幫紝涓嶈繃浠栦滑涓昏鏄粠閿欒媯嫻嬫柟闈㈣冭檻銆?br />鏈緇堢殑鐩殑鏄涓哄鎴鋒彁渚涗竴涓粺涓鐨勭晫闈紝鎵浠ヤ笉鑳界敤澶鏉傜殑妯℃澘銆?br /><br />緇忚繃鎱庨噸鑰冭檻錛屾垜榪樻槸鍐沖畾鐢ㄨ櫄鍑芥暟錛屾斁寮冧簡妯℃澘銆?br /></wbr></p></wbr></wbr></wbr></div> <img src ="http://www.shnenglu.com/huyi/aggbug/13675.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/huyi/" target="_blank">HuYi</a> 2006-10-14 16:45 <a href="http://www.shnenglu.com/huyi/archive/2006/10/14/13675.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓轟粈涔堣鐢ㄢ?(鈥濆彇浠b?鈥?http://www.shnenglu.com/huyi/archive/2006/10/13/13637.htmlHuYiHuYiFri, 13 Oct 2006 05:50:00 GMThttp://www.shnenglu.com/huyi/archive/2006/10/13/13637.htmlhttp://www.shnenglu.com/huyi/comments/13637.htmlhttp://www.shnenglu.com/huyi/archive/2006/10/13/13637.html#Feedback1http://www.shnenglu.com/huyi/comments/commentRss/13637.htmlhttp://www.shnenglu.com/huyi/services/trackbacks/13637.html鍦ㄥ仛鏃ュ織鎺ュ彛鐨勬椂鍊欙紝鐪熷疄鐨勬帴鍙e嚱鏁板簲璇ユ槸濡備笅鏍峰紡鐨勶細
__static_logger__.log(int level,const char* fmt, ...);
榪欓噷浣跨敤浜唒rintf綾諱技鐨勬妧鏈細鍙彉鍙傛暟銆?br />榪欎釜鎶鏈彲浠ュ姩鎬佺殑鏇挎崲瀛楃涓瞗mt涓殑鍐呭銆?br />鍚屾椂錛岃繖涓柟娉曞彲鑳戒細琚噸杞斤紝鐢ㄤ簬涓嶉渶瑕佸彲鍙樺弬鏁扮殑鎯呭喌錛?br />__static_logger__.log(int level,const char* fmt);

閫氬父錛屾垜浠繕浼氬畾涔変竴浜涜緟鍔╃敤鐨勫畯錛?br />#define KLOG(X) \
聽聽聽 do { \
聽聽聽聽聽聽聽 KDBG::printf X; \
聽聽聽 } while (0)

浣跨敤鐨勬椂鍊欙紝蹇呴』鎸夌収涓嬮潰鐨勬牸寮忥細
KLOG((LM_ERROR, "%s\n", strerror(errno)));
娉ㄦ剰錛屼嬌鐢ㄤ簡鍙屽眰鐨勬嫭鍙封?(鈥?br />
涓轟粈涔堜笉鎶婂畯鏀規垚錛?br />#define KLOG(X,Y,...) \
聽聽聽 do { \
聽聽聽聽聽聽聽 KDBG::log(X,Y,__VA_ARGS__); \
聽聽聽 } while (0)s
浠庤屾寜濡備笅鐨勨滄爣鍑嗗艦寮忊濇潵浣跨敤LOG鍛紵
KLOG(LM_ERROR, "%s\n", strerror(errno));


絳旀鏄畯涓嶈兘鍍忓嚱鏁伴偅鏍烽噸杞斤紝KLOG瀹忓彧鑳芥湁涓涓紝灝辨槸鏈鍚庡畾涔夌殑閭d釜錛屼篃灝辨槸鑳芥帴鍙楃殑鍙傛暟涓暟鏄浐瀹氱殑銆?br />



HuYi 2006-10-13 13:50 鍙戣〃璇勮
]]>
浜岀幆鍗佷笁閮庝紶璇翠腑鐨勮澶?/title><link>http://www.shnenglu.com/huyi/archive/2006/07/31/10736.html</link><dc:creator>HuYi</dc:creator><author>HuYi</author><pubDate>Mon, 31 Jul 2006 10:26:00 GMT</pubDate><guid>http://www.shnenglu.com/huyi/archive/2006/07/31/10736.html</guid><wfw:comment>http://www.shnenglu.com/huyi/comments/10736.html</wfw:comment><comments>http://www.shnenglu.com/huyi/archive/2006/07/31/10736.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/huyi/comments/commentRss/10736.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/huyi/services/trackbacks/10736.html</trackback:ping><description><![CDATA[ <span id="ayeiqyg" class="content" id="lblContent"> <font style="FONT-SIZE: 12px; FONT-FAMILY: Verdana">1.8T鍙戝姩鏈烘繪垚聽55000鍏?br />澶т紬鍘熷巶MO250鍙橀熺聽20000<br />1.8T鍗婅醬聽3000<br />BMC榪涙苯聽2500<br />榪愬姩嬈懼疂鏉ュ嚫杞醬聽3000<br />榪愬姩嬈懼疂鏉ユ丁杞?800<br />SUPERSPRING鍏ㄦ鎺掓皵聽9800<br />灝劇墮聽7000<br />娉曢浄濂ョ鍚堝櫒聽3000<br />鍘熷巶180鍖圭數鑴戠▼搴徛?800<br />DENSO鐏姳濉灺?00<br />HKS娉勬皵闃聽2800<br />4鍏枻鍥炴補闃聽300<br /><br />SPAXJ鍑忛渿鍣?000<br />NEUSPEED鍓嶅悗闃插炬潌聽2000<br />鍘熷巶鍓?12mm鍚?56mm鍒硅濺鐩?000<br />浠縍S418瀵歌疆鍦埪?200<br />綾沖叾鏋桺S2杞儙聽10000<br /><br />鑷姞宸ュ墠鍚庡寘鍥綽?000<br />鑷埗鏈哄ご鐩柭?500<br />姘欐皵澶х伅聽1800<br />HKS娑¤疆鍘嬪姏琛?00<br />SPARCO鏂瑰悜鐩樎?800<br />4MOTION妗f妸聽1200</font> </span> <img src ="http://www.shnenglu.com/huyi/aggbug/10736.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/huyi/" target="_blank">HuYi</a> 2006-07-31 18:26 <a href="http://www.shnenglu.com/huyi/archive/2006/07/31/10736.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎬庝箞鎵嶈兘鎴愪竴鍚嶆灦鏋勫笀錛?/title><link>http://www.shnenglu.com/huyi/archive/2006/07/28/10617.html</link><dc:creator>HuYi</dc:creator><author>HuYi</author><pubDate>Thu, 27 Jul 2006 16:02:00 GMT</pubDate><guid>http://www.shnenglu.com/huyi/archive/2006/07/28/10617.html</guid><wfw:comment>http://www.shnenglu.com/huyi/comments/10617.html</wfw:comment><comments>http://www.shnenglu.com/huyi/archive/2006/07/28/10617.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/huyi/comments/commentRss/10617.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/huyi/services/trackbacks/10617.html</trackback:ping><description><![CDATA[ <p>榪欎釜棰樼洰澶т簡鐐癸紝涓嶉傚悎鎴戣繖縐嶅垰鍙傚姞宸ヤ綔涓嶄箙鐨勪漢鏉ュ洖絳斻?br /><br />Blog寰堜箙娌℃湁鏇存柊浜嗭紝絳斿簲浜嗘湅鍙嬪啓鐐硅繖鏂歸潰鐨勭湅娉曪紝灝卞湪榪欓噷琛ㄨ揪涓涓嬭嚜宸辯殑鎰忚錛屾姏鐮栧紩鐜夈?br /><br />鏋舵瀯甯堜篃鏈変笉鍚岀殑綾誨瀷銆傛垜涓昏鎯寵璁鴻蔣浠舵柟闈㈢殑鏋舵瀯甯堛?br /><br />涓鏄綋緋葷粨鏋勭駭鐨勶紝瑕佽礋璐d駭鍝佺殑閮ㄧ講錛岀‖浠訛紝緗戠粶絳夌瓑寰堝鏁翠綋涓婄殑涓滆タ錛岃繖涓綾諱笉浠呴渶瑕佹墡瀹炶屽箍娉涚殑鍩虹鐭ヨ瘑錛屾洿闇瑕佺粡楠岋紝鐗瑰埆鏄湪澶т紒涓氬伐浣滅殑緇忛獙銆傝繖涓鐐逛篃鏄湪鍗曚綅鐪嬩簡涓浜涙棩鏈漢鐨勮璁★紝鎵嶆參鎱綋浼氬埌銆?br /><br />浜屾槸杞歡鏈韓鐨勬灦鏋勶紝鏄垜鎯抽噸鐐硅璁虹殑銆?br />杞歡搴旂敤鐨勯鍩熶笉鍚岋紝鏋舵瀯涔熸湁寰堝ぇ鐨勫樊鍒紝宓屽叆寮忔湁宓屽叆寮忕殑鍋氭硶錛岀數淇¤蔣浠舵湁鐢典俊杞歡鐨勫仛娉曪紝浼佷笟搴旂敤鏈変紒涓氬簲鐢ㄧ殑鍋氭硶錛屾闈㈡湁妗岄潰鐨勫仛娉曘傚鏋滆鍏ㄩ儴璁ㄨ錛屾垜娌℃湁榪欎釜瀹炲姏錛屾墍浠ュ彧璇存渶甯歌鐨勪紒涓氬簲鐢ㄥ紑鍙戝拰妗岄潰杞歡寮鍙戙?br /><br />鏈閲嶈鐨勫熀紜錛屾垜瑙夊緱鏄疧O錛屼笉綆″疄闄呯紪紼嬭璁℃槸鍚︽槸OO鐨勶紝閮藉簲璇ヤ簡瑙o紝鍏峰OO鐨勬濇兂銆傚己璋冧竴涓嬶紝閲囩敤鏈鍚堥傜殑鎬濇兂鍜屾墜孌墊潵寮鍙戣蔣浠訛紝鑰屼笉涓瀹氶潪瑕佺敤OO錛屾垨鑰呮槸闈炰笉鐢∣O銆傛垜姣旇緝鍧氫俊鐨勪竴鐐規槸錛屽綋浠e強鏈潵鐨勭▼搴忓憳錛屾垨璁稿湪瀹為檯宸ヤ綔涓笉闇瑕佺敤鍒癘O錛屾瘮濡傝鎼炲祵鍏ュ紡寮鍙戯紝鎴栬匧inux搴曞眰鏂歸潰寮鍙戠殑錛堜簨瀹炰笂錛孡inux涓篃鐢ㄥ埌浜哋O錛屾瘮濡傛枃浠剁郴緇燂級錛屼絾蹇呴』鏄簡瑙O鐨勩?br /><br /><strong>涓錛屼竾涓堥珮妤間粠鍦拌搗錛屼竴鍔涙壙鎷呴潬鍦板熀<br /></strong><br />1銆傛晱鎹瘋蔣浠跺紑鍙?br /><br /><img src="http://www.china-pub.com/computers/ebook10000-15000/13569/cover.gif" /><br /><br />涓轟粈涔堟帹鑽愯繖鏈憿錛熷叾瀹炴槸鎺ㄨ崘榪欐湰涔︾殑鍓嶅崐閮ㄥ垎銆傚洜涓哄畠鐨勫墠涓鍗婁竴瀹氬彲浠ヨ浜鴻崇洰涓鏂幫紝璁╀漢鐭ラ亾OO闄や簡灝佽錛岀戶鎵匡紝澶氭佷互澶栵紝榪樻湁鏇村鐨勪笢瑗匡紝鑰屼笖榪欐湰涔﹀崄鍒嗗鏄撴噦銆?br /><br /><br />2銆傘奜OP鍚濆綍銆?br /><br /><img src="http://www.china-pub.com/computers/ebook15001-20000/16830/cover.gif" /><br />緇濆鐨勭粡鍏革紝涓嶈繃灝辨瘮杈冩灟鐕ヤ簡銆傚叏閮ㄦ槸鍏充簬OO鐨勭悊璁哄強璁捐鍑嗗垯銆傛墍浠ヨ櫧鐒墮潪甯稿熀紜錛屼絾騫舵病鏈変綔涓虹涓姝ユ帹鑽愮殑涔︺傜湅榪欎釜錛岄渶瑕佸OO鏈変簡涓瀹氱殑浜嗚В錛屾墠鑳藉潥鎸佷笅鍘匯?br /><br /><strong>浜岋紝欏鴻棨鎽哥摐錛屽鏍圭┒搴?br /></strong>鍒濆鐨勪漢甯歌錛孫O灝辨槸瀵硅薄錛屽氨鏄皝瑁呯戶鎵垮鎬併傚錛屾病閿欙紝浣嗚璦鏄庝箞鏀寔榪欎簺OO鐗規х殑鍛紵<br /><br />1銆傛繁搴︽帰绱++瀵硅薄妯″瀷<br /><br /><img src="http://www.china-pub.com/computers/ebook/3290/cover.gif" /><br /><br />鎴戜滑CPP綺変笣鏈夌浜嗭紝鏈功鎺㈢儲浜咰++瀵筄O鐨勬敮鎸侊紝搴曞眰瀵硅薄妯″瀷瀹炵幇絳夐潪甯告湁浠峰肩殑鍐呭銆傚悓鏍鋒槸鐩稿鏋嚗鐨勶紝鑰屼笖棰囧叿闅懼害錛屾墍浠ュ涔犱箣鍓嶆渶濂藉C++榪欓棬璇█鐔熸倝錛岃屼笖鏈夊叴瓚e幓浜嗚В瀹冪殑鏈川銆?br />瀵逛簬闈濩PP甯淳鎴愬憳錛岀湅榪欎釜鍙兘姣旇緝鍥伴毦錛屼絾鎴戜篃鎵句笉鍑哄叾浠栨浛浠g殑瀛︿範涔︾睄浜嗭紝鐭ラ亾鐨勬湅鍙嬭琛ュ厖銆?br /><br /><strong>絎笁錛岀粌鎷?/strong><br />鍐呭姛鍩虹鏈変簡錛屽氨璇ョ粌涔犲墤鎷涙嫵璋變簡銆?br /><br />杞歡璁捐鐨勫墤璋憋紝灝辨槸璁捐妯″紡錛屽氨鏄墠浜烘葷粨鍑烘潵鐨勫璺紝褰撶劧浣犱篃鍙互鑷垱銆備絾鑷垱涔嬪墠錛屼竴瀹氳澶氱湅澶氭兂錛屽厖鍒嗗惛鍙栧墠浜虹殑綺鵑珦銆?br /><br />1錛孞ava涓庢ā寮?br /><br /><img src="http://www.china-pub.com/computers/ebook/8182/cover.gif" /><br /><br />鍥戒漢鍐欑殑涓嶅緱涓嶆帹鑽愮殑涓鏈ソ涔︼紙涔熸湁寰堝浜鴻浠栧お鍟板棪錛夈傛垜鍒濆鐨勬椂鍊欙紝涓涓婃潵灝辨槸Gof鐨勪紶涓栫粡鍏革紝緇撴灉钖勮杽鐨勪竴鏈唽瀛愶紝鑺變簡鎴戞暣鏁翠竴騫寸殑鏃墮棿錛岃繕瑙夊緱鐞嗚В涓嶅銆傚綋鎴戠湅浜嗕竴閬岼ava涓庢ā寮忥紝璞佺劧寮鏈楋紝濡傛灉鍏堟湁浜嗚繖涓紝涓瀹氫笉浼氳寰楄璁℃ā寮忛偅涔堥毦銆?br /><br />2銆傝璁℃ā寮忥細鍙鐢ㄩ潰鍚戝璞¤蔣浠剁殑鍩虹<br /><img src="http://www.china-pub.com/computers/ebook/0684/cover.gif" /><br />鍓嶉潰鎵鎻愬埌鐨勨滀紶涓栦箣浣溾濓紝涓轟粈涔堥偅涔堢粡鍏革紵鍥犱負鍙ュ彞璇濋兘鏄粡鍏革紝鍙互璇存病鏈変竴鍙ュ簾璇濓紙銆妀ava涓庢ā寮忋嬪氨琚漢璇存垚搴熻瘽榪炵瘒錛夈?br />java涓庢ā寮忥紝鎴戠湅瀹屽悗灝遍佸コ鏈嬪弸浜嗭紝鑰岃繖鏈功錛屾垜鍗翠繚瀛樹簡璧鋒潵錛屼綔涓烘墜鍐屾煡錛岃繖灝辨槸鎴戠殑鐢ㄦ硶銆?br /><br /><br /><br /><br /><br />鏈畬寰呯畫銆傘傘?br /></p> <img src ="http://www.shnenglu.com/huyi/aggbug/10617.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/huyi/" target="_blank">HuYi</a> 2006-07-28 00:02 <a href="http://www.shnenglu.com/huyi/archive/2006/07/28/10617.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Linux鍚姩鍗忚Ver.2.04http://www.shnenglu.com/huyi/archive/2006/06/20/8745.htmlHuYiHuYiTue, 20 Jun 2006 06:46:00 GMThttp://www.shnenglu.com/huyi/archive/2006/06/20/8745.htmlhttp://www.shnenglu.com/huyi/comments/8745.htmlhttp://www.shnenglu.com/huyi/archive/2006/06/20/8745.html#Feedback0http://www.shnenglu.com/huyi/comments/commentRss/8745.htmlhttp://www.shnenglu.com/huyi/services/trackbacks/8745.html聽聽聽聽聽聽 THE LINUX/I386 BOOT PROTOCOL
聽聽聽聽聽聽 ----------------------------

聽聽聽聽聽 H. Peter Anvin <hpa@zytor.com>
聽聽聽Last update 2005-09-02

On the i386 platform, the Linux kernel uses a rather complicated boot
convention.聽 This has evolved partially due to historical aspects, as
well as the desire in the early days to have the kernel itself be a
bootable image, the complicated PC memory model and due to changed
expectations in the PC industry caused by the effective demise of
real-mode DOS as a mainstream operating system.

Currently, four versions of the Linux/i386 boot protocol exist.

Old kernels:聽zImage/Image support only.聽 Some very early kernels
聽聽may not even support a command line.

Protocol 2.00:聽(Kernel 1.3.73) Added bzImage and initrd support, as
聽聽well as a formalized way to communicate between the
聽聽boot loader and the kernel.聽 setup.S made relocatable,
聽聽although the traditional setup area still assumed
聽聽writable.

Protocol 2.01:聽(Kernel 1.3.76) Added a heap overrun warning.

Protocol 2.02:聽(Kernel 2.4.0-test3-pre3) New command line protocol.
聽聽Lower the conventional memory ceiling.聽No overwrite
聽聽of the traditional setup area, thus making booting
聽聽safe for systems which use the EBDA from SMM or 32-bit
聽聽BIOS entry points.聽 zImage deprecated but still
聽聽supported.

Protocol 2.03:聽(Kernel 2.4.18-pre1) Explicitly makes the highest possible
聽聽initrd address available to the bootloader.

Protocol 2.04:聽(Kernel 2.6.14) Extend the syssize field to four bytes.


**** MEMORY LAYOUT

The traditional memory map for the kernel loader, used for Image or
zImage kernels, typically looks like:

聽|聽聽聽 |
0A0000聽+------------------------+
聽|聽 Reserved for BIOS聽 |聽Do not use.聽 Reserved for BIOS EBDA.
09A000聽+------------------------+
聽|聽 Stack/heap/cmdline聽 |聽For use by the kernel real-mode code.
098000聽+------------------------+聽
聽|聽 Kernel setup聽聽 |聽The kernel real-mode code.
090200聽+------------------------+
聽|聽 Kernel boot sector聽 |聽The kernel legacy boot sector.
090000聽+------------------------+
聽|聽 Protected-mode kernel |聽The bulk of the kernel image.
010000聽+------------------------+
聽|聽 Boot loader聽聽 |聽<- Boot sector entry point 0000:7C00
001000聽+------------------------+
聽|聽 Reserved for MBR/BIOS |
000800聽+------------------------+
聽|聽 Typically used by MBR |
000600聽+------------------------+
聽|聽 BIOS use only聽 |
000000聽+------------------------+


When using bzImage, the protected-mode kernel was relocated to
0x100000 ("high memory"), and the kernel real-mode block (boot sector,
setup, and stack/heap) was made relocatable to any address between
0x10000 and end of low memory.聽Unfortunately, in protocols 2.00 and
2.01 the command line is still required to live in the 0x9XXXX memory
range, and that memory range is still overwritten by the early kernel.
The 2.02 protocol resolves that problem.

It is desirable to keep the "memory ceiling" -- the highest point in
low memory touched by the boot loader -- as low as possible, since
some newer BIOSes have begun to allocate some rather large amounts of
memory, called the Extended BIOS Data Area, near the top of low
memory.聽 The boot loader should use the "INT 12h" BIOS call to verify
how much low memory is available.

Unfortunately, if INT 12h reports that the amount of memory is too
low, there is usually nothing the boot loader can do but to report an
error to the user.聽 The boot loader should therefore be designed to
take up as little space in low memory as it reasonably can.聽 For
zImage or old bzImage kernels, which need data written into the
0x90000 segment, the boot loader should make sure not to use memory
above the 0x9A000 point; too many BIOSes will break above that point.


**** THE REAL-MODE KERNEL HEADER

In the following text, and anywhere in the kernel boot sequence, "a
sector" refers to 512 bytes.聽 It is independent of the actual sector
size of the underlying medium.

The first step in loading a Linux kernel should be to load the
real-mode code (boot sector and setup code) and then examine the
following header at offset 0x01f1.聽 The real-mode code can total up to
32K, although the boot loader may choose to load only the first two
sectors (1K) and then examine the bootup sector size.

The header looks like:

Offset聽Proto聽Name聽聽Meaning
/Size

01F1/1聽ALL(1聽setup_sects聽The size of the setup in sectors
01F2/2聽ALL聽root_flags聽If set, the root is mounted readonly
01F4/4聽2.04+(2聽syssize聽聽The size of the 32-bit code in 16-byte paras
01F8/2聽ALL聽ram_size聽DO NOT USE - for bootsect.S use only
01FA/2聽ALL聽vid_mode聽Video mode control
01FC/2聽ALL聽root_dev聽Default root device number
01FE/2聽ALL聽boot_flag聽0xAA55 magic number
0200/2聽2.00+聽jump聽聽Jump instruction
0202/4聽2.00+聽header聽聽Magic signature "HdrS"
0206/2聽2.00+聽version聽聽Boot protocol version supported
0208/4聽2.00+聽realmode_swtch聽Boot loader hook (see below)
020C/2聽2.00+聽start_sys聽The load-low segment (0x1000) (obsolete)
020E/2聽2.00+聽kernel_version聽Pointer to kernel version string
0210/1聽2.00+聽type_of_loader聽Boot loader identifier
0211/1聽2.00+聽loadflags聽Boot protocol option flags
0212/2聽2.00+聽setup_move_size聽Move to high memory size (used with hooks)
0214/4聽2.00+聽code32_start聽Boot loader hook (see below)
0218/4聽2.00+聽ramdisk_image聽initrd load address (set by boot loader)
021C/4聽2.00+聽ramdisk_size聽initrd size (set by boot loader)
0220/4聽2.00+聽bootsect_kludge聽DO NOT USE - for bootsect.S use only
0224/2聽2.01+聽heap_end_ptr聽Free memory after setup end
0226/2聽N/A聽pad1聽聽Unused
0228/4聽2.02+聽cmd_line_ptr聽32-bit pointer to the kernel command line
022C/4聽2.03+聽initrd_addr_max聽Highest legal initrd address

(1) For backwards compatibility, if the setup_sects field contains 0, the
聽聽聽 real value is 4.

(2) For boot protocol prior to 2.04, the upper two bytes of the syssize
聽聽聽 field are unusable, which means the size of a bzImage kernel
聽聽聽 cannot be determined.

If the "HdrS" (0x53726448) magic number is not found at offset 0x202,
the boot protocol version is "old".聽 Loading an old kernel, the
following parameters should be assumed:

聽Image type = zImage
聽initrd not supported
聽Real-mode kernel must be located at 0x90000.

Otherwise, the "version" field contains the protocol version,
e.g. protocol version 2.01 will contain 0x0201 in this field.聽 When
setting fields in the header, you must make sure only to set fields
supported by the protocol version in use.

The "kernel_version" field, if set to a nonzero value, contains a
pointer to a null-terminated human-readable kernel version number
string, less 0x200.聽 This can be used to display the kernel version to
the user.聽 This value should be less than (0x200*setup_sects).聽 For
example, if this value is set to 0x1c00, the kernel version number
string can be found at offset 0x1e00 in the kernel file.聽 This is a
valid value if and only if the "setup_sects" field contains the value
14 or higher.

Most boot loaders will simply load the kernel at its target address
directly.聽 Such boot loaders do not need to worry about filling in
most of the fields in the header.聽 The following fields should be
filled out, however:

聽 vid_mode:
聽Please see the section on SPECIAL COMMAND LINE OPTIONS.

聽 type_of_loader:
聽If your boot loader has an assigned id (see table below), enter
聽0xTV here, where T is an identifier for the boot loader and V is
聽a version number.聽 Otherwise, enter 0xFF here.

聽Assigned boot loader ids:
聽0聽 LILO
聽1聽 Loadlin
聽2聽 bootsect-loader
聽3聽 SYSLINUX
聽4聽 EtherBoot
聽5聽 ELILO
聽7聽 GRuB
聽8聽 U-BOOT

聽Please contact <hpa@zytor.com> if you need a bootloader ID
聽value assigned.

聽 loadflags, heap_end_ptr:
聽If the protocol version is 2.01 or higher, enter the
聽offset limit of the setup heap into heap_end_ptr and set the
聽0x80 bit (CAN_USE_HEAP) of loadflags.聽 heap_end_ptr appears to
聽be relative to the start of setup (offset 0x0200).

聽 setup_move_size:
聽When using protocol 2.00 or 2.01, if the real mode
聽kernel is not loaded at 0x90000, it gets moved there later in
聽the loading sequence.聽 Fill in this field if you want
聽additional data (such as the kernel command line) moved in
聽addition to the real-mode kernel itself.

聽 ramdisk_image, ramdisk_size:
聽If your boot loader has loaded an initial ramdisk (initrd),
聽set ramdisk_image to the 32-bit pointer to the ramdisk data
聽and the ramdisk_size to the size of the ramdisk data.

聽The initrd should typically be located as high in memory as
聽possible, as it may otherwise get overwritten by the early
聽kernel initialization sequence.聽 However, it must never be
聽located above the address specified in the initrd_addr_max
聽field.聽The initrd should be at least 4K page aligned.

聽 cmd_line_ptr:
聽If the protocol version is 2.02 or higher, this is a 32-bit
聽pointer to the kernel command line.聽 The kernel command line
聽can be located anywhere between the end of setup and 0xA0000.
聽Fill in this field even if your boot loader does not support a
聽command line, in which case you can point this to an empty
聽string (or better yet, to the string "auto".)聽 If this field
聽is left at zero, the kernel will assume that your boot loader
聽does not support the 2.02+ protocol.

聽 ramdisk_max:
聽The maximum address that may be occupied by the initrd
聽contents.聽 For boot protocols 2.02 or earlier, this field is
聽not present, and the maximum address is 0x37FFFFFF.聽 (This
聽address is defined as the address of the highest safe byte, so
聽if your ramdisk is exactly 131072 bytes long and this field is
聽0x37FFFFFF, you can start your ramdisk at 0x37FE0000.)


**** THE KERNEL COMMAND LINE

The kernel command line has become an important way for the boot
loader to communicate with the kernel.聽 Some of its options are also
relevant to the boot loader itself, see "special command line options"
below.

The kernel command line is a null-terminated string currently up to
255 characters long, plus the final null.聽 A string that is too long
will be automatically truncated by the kernel, a boot loader may allow
a longer command line to be passed to permit future kernels to extend
this limit.

If the boot protocol version is 2.02 or later, the address of the
kernel command line is given by the header field cmd_line_ptr (see
above.)聽 This address can be anywhere between the end of the setup
heap and 0xA0000.

If the protocol version is *not* 2.02 or higher, the kernel
command line is entered using the following protocol:

聽At offset 0x0020 (word), "cmd_line_magic", enter the magic
聽number 0xA33F.

聽At offset 0x0022 (word), "cmd_line_offset", enter the offset
聽of the kernel command line (relative to the start of the
聽real-mode kernel).

聽The kernel command line *must* be within the memory region
聽covered by setup_move_size, so you may need to adjust this
聽field.


**** SAMPLE BOOT CONFIGURATION

As a sample configuration, assume the following layout of the real
mode segment (this is a typical, and recommended layout):

聽0x0000-0x7FFF聽Real mode kernel
聽0x8000-0x8FFF聽Stack and heap
聽0x9000-0x90FF聽Kernel command line

Such a boot loader should enter the following fields in the header:

聽unsigned long base_ptr;聽/* base address for real-mode segment */

聽if ( setup_sects == 0 ) {
聽聽setup_sects = 4;
聽}

聽if ( protocol >= 0x0200 ) {
聽聽type_of_loader = <type code>;
聽聽if ( loading_initrd ) {
聽聽聽ramdisk_image = <initrd_address>;
聽聽聽ramdisk_size = <initrd_size>;
聽聽}
聽聽if ( protocol >= 0x0201 ) {
聽聽聽heap_end_ptr = 0x9000 - 0x200;
聽聽聽loadflags |= 0x80; /* CAN_USE_HEAP */
聽聽}
聽聽if ( protocol >= 0x0202 ) {
聽聽聽cmd_line_ptr = base_ptr + 0x9000;
聽聽} else {
聽聽聽cmd_line_magic聽= 0xA33F;
聽聽聽cmd_line_offset = 0x9000;
聽聽聽setup_move_size = 0x9100;
聽聽}
聽} else {
聽聽/* Very old kernel */

聽聽cmd_line_magic聽= 0xA33F;
聽聽cmd_line_offset = 0x9000;

聽聽/* A very old kernel MUST have its real-mode code
聽聽聽聽 loaded at 0x90000 */

聽聽if ( base_ptr != 0x90000 ) {
聽聽聽/* Copy the real-mode kernel */
聽聽聽memcpy(0x90000, base_ptr, (setup_sects+1)*512);
聽聽聽/* Copy the command line */
聽聽聽memcpy(0x99000, base_ptr+0x9000, 256);

聽聽聽base_ptr = 0x90000;聽聽 /* Relocated */
聽聽}

聽聽/* It is recommended to clear memory up to the 32K mark */
聽聽memset(0x90000 + (setup_sects+1)*512, 0,
聽聽聽聽聽聽聽聽 (64-(setup_sects+1))*512);
聽}


**** LOADING THE REST OF THE KERNEL

The 32-bit (non-real-mode) kernel starts at offset (setup_sects+1)*512
in the kernel file (again, if setup_sects == 0 the real value is 4.)
It should be loaded at address 0x10000 for Image/zImage kernels and
0x100000 for bzImage kernels.

The kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01
bit (LOAD_HIGH) in the loadflags field is set:

聽is_bzImage = (protocol >= 0x0200) && (loadflags & 0x01);
聽load_address = is_bzImage ? 0x100000 : 0x10000;

Note that Image/zImage kernels can be up to 512K in size, and thus use
the entire 0x10000-0x90000 range of memory.聽 This means it is pretty
much a requirement for these kernels to load the real-mode part at
0x90000.聽 bzImage kernels allow much more flexibility.


**** SPECIAL COMMAND LINE OPTIONS

If the command line provided by the boot loader is entered by the
user, the user may expect the following command line options to work.
They should normally not be deleted from the kernel command line even
though not all of them are actually meaningful to the kernel.聽 Boot
loader authors who need additional command line options for the boot
loader itself should get them registered in
Documentation/kernel-parameters.txt to make sure they will not
conflict with actual kernel options now or in the future.

聽 vga=<mode>
聽<mode> here is either an integer (in C notation, either
聽decimal, octal, or hexadecimal) or one of the strings
聽"normal" (meaning 0xFFFF), "ext" (meaning 0xFFFE) or "ask"
聽(meaning 0xFFFD).聽 This value should be entered into the
聽vid_mode field, as it is used by the kernel before the command
聽line is parsed.

聽 mem=<size>
聽<size> is an integer in C notation optionally followed by K, M
聽or G (meaning << 10, << 20 or << 30).聽 This specifies the end
聽of memory to the kernel. This affects the possible placement
聽of an initrd, since an initrd should be placed near end of
聽memory.聽 Note that this is an option to *both* the kernel and
聽the bootloader!

聽 initrd=<file>
聽An initrd should be loaded.聽 The meaning of <file> is
聽obviously bootloader-dependent, and some boot loaders
聽(e.g. LILO) do not have such a command.

In addition, some boot loaders add the following options to the
user-specified command line:

聽 BOOT_IMAGE=<file>
聽The boot image which was loaded.聽 Again, the meaning of <file>
聽is obviously bootloader-dependent.

聽 auto
聽The kernel was booted without explicit user intervention.

If these options are added by the boot loader, it is highly
recommended that they are located *first*, before the user-specified
or configuration-specified command line.聽 Otherwise, "init=/bin/sh"
gets confused by the "auto" option.


**** RUNNING THE KERNEL

The kernel is started by jumping to the kernel entry point, which is
located at *segment* offset 0x20 from the start of the real mode
kernel.聽 This means that if you loaded your real-mode kernel code at
0x90000, the kernel entry point is 9020:0000.

At entry, ds = es = ss should point to the start of the real-mode
kernel code (0x9000 if the code is loaded at 0x90000), sp should be
set up properly, normally pointing to the top of the heap, and
interrupts should be disabled.聽 Furthermore, to guard against bugs in
the kernel, it is recommended that the boot loader sets fs = gs = ds =
es = ss.

In our example from above, we would do:

聽/* Note: in the case of the "old" kernel protocol, base_ptr must
聽聽聽 be == 0x90000 at this point; see the previous sample code */

聽seg = base_ptr >> 4;

聽cli();聽/* Enter with interrupts disabled! */

聽/* Set up the real-mode kernel stack */
聽_SS = seg;
聽_SP = 0x9000;聽/* Load SP immediately after loading SS! */

聽_DS = _ES = _FS = _GS = seg;
聽jmp_far(seg+0x20, 0);聽/* Run the kernel */

If your boot sector accesses a floppy drive, it is recommended to
switch off the floppy motor before running the kernel, since the
kernel boot leaves interrupts off and thus the motor will not be
switched off, especially if the loaded kernel has the floppy driver as
a demand-loaded module!


**** ADVANCED BOOT TIME HOOKS

If the boot loader runs in a particularly hostile environment (such as
LOADLIN, which runs under DOS) it may be impossible to follow the
standard memory location requirements.聽 Such a boot loader may use the
following hooks that, if set, are invoked by the kernel at the
appropriate time.聽 The use of these hooks should probably be
considered an absolutely last resort!

IMPORTANT: All the hooks are required to preserve %esp, %ebp, %esi and
%edi across invocation.

聽 realmode_swtch:
聽A 16-bit real mode far subroutine invoked immediately before
聽entering protected mode.聽 The default routine disables NMI, so
聽your routine should probably do so, too.

聽 code32_start:
聽A 32-bit flat-mode routine *jumped* to immediately after the
聽transition to protected mode, but before the kernel is
聽uncompressed.聽 No segments, except CS, are set up; you should
聽set them up to KERNEL_DS (0x18) yourself.

聽After completing your hook, you should jump to the address
聽that was in this field before your boot loader overwrote it.



HuYi 2006-06-20 14:46 鍙戣〃璇勮
]]>
Google涓轟粈涔堜細琚皝閿?http://www.shnenglu.com/huyi/archive/2006/05/31/8002.htmlHuYiHuYiWed, 31 May 2006 15:28:00 GMThttp://www.shnenglu.com/huyi/archive/2006/05/31/8002.htmlhttp://www.shnenglu.com/huyi/comments/8002.htmlhttp://www.shnenglu.com/huyi/archive/2006/05/31/8002.html#Feedback13http://www.shnenglu.com/huyi/comments/commentRss/8002.htmlhttp://www.shnenglu.com/huyi/services/trackbacks/8002.html寰堟棭浠ュ墠灝卞惉璇磋繃Google琚皝閿佺殑娑堟伅,鍥犱負鑷繁娌℃湁閬囧埌榪?涔熶笉澶浉淇$湡浼氭湁榪欐牱鐨勪簨鎯?澶氬彲絎戝憖.

涓嶈繃鑷粠鎰熷彈鍒頒簡涓嬈ourceforge琚皝,灝辮寰楀湪涓浗,鎴栬鐪熶細鍙戠敓榪欐牱鐨勪簨鎯?

浠婂ぉ,google緇堜簬鎸備簡,gmail涔熸寕浜?鎴戜篃鏃犺浜?

鎵撳惉浜嗕竴涓?鍏ㄥ浗濂藉鍦版柟鐨勭綉鍙嬮兘璁塊棶涓嶄簡google浜?

涓氬唴鏈浠や漢閯欒鐨勬渚嬭帿榪囦簬寰蔣闈犳崋緇慖E鎼炶法浜嗙綉鏅?寰蔣鐨勮繖涓劸姘旇嚦浠婅繕鏄ぇ瀹墮剻瑙嗗畠鐨勪富鍥?浣嗘槸璇鋒敞鎰?寰蔣騫舵病鏈夌姝indows鐢ㄦ埛浣跨敤緗戞櫙鐨勬湇鍔?!!!

甯屾湜涓浗鐨刧oogle浜嬩歡涓嶈鎴愪負浠栧浗鐨勭瑧鏌?

http://post.baidu.com/f?kz=103530334

浠呬互姝よ創綰康Google GMail 聽GTalk




鏀寔Google鐨勬湅鍙嬭鍦ㄨ繖閲岀鍚嶅惂!

甯屾湜zf鏃╃偣鎶?font color="#0000ff">G
Mail鍜?font color="#0000ff">GTalk榪樼粰鎴戜滑!!



HuYi 2006-05-31 23:28 鍙戣〃璇勮
]]>
榪欏洖鐪嬭濂借創瀛愬氨鏈夎瘽璇翠簡^^http://www.shnenglu.com/huyi/archive/2006/05/26/7673.htmlHuYiHuYiFri, 26 May 2006 02:37:00 GMThttp://www.shnenglu.com/huyi/archive/2006/05/26/7673.htmlhttp://www.shnenglu.com/huyi/comments/7673.htmlhttp://www.shnenglu.com/huyi/archive/2006/05/26/7673.html#Feedback1http://www.shnenglu.com/huyi/comments/commentRss/7673.htmlhttp://www.shnenglu.com/huyi/services/trackbacks/7673.html闃呰鍏ㄦ枃

HuYi 2006-05-26 10:37 鍙戣〃璇勮
]]>
国産精品久久久久久久| 2021精品国产综合久久| 日日狠狠久久偷偷色综合0| 久久精品中文字幕大胸| 久久久久久亚洲精品成人| 国产成人精品久久综合| 尹人香蕉久久99天天拍| 久久免费小视频| 亚洲国产精品无码久久SM| 久久国产精品久久久| 久久人人爽人人爽人人片AV高清| 99精品久久久久中文字幕| 久久精品国产99国产精品亚洲| 久久er国产精品免费观看2| 久久九九兔免费精品6| 久久久久亚洲AV无码专区桃色| 久久99精品久久久久久久久久 | 91视频国产91久久久| 亚洲国产成人精品无码久久久久久综合 | 国产精品一区二区久久不卡| 久久婷婷色综合一区二区| 91麻精品国产91久久久久| 国产V亚洲V天堂无码久久久| 精品多毛少妇人妻AV免费久久| 欧美日韩精品久久免费| 国产日韩欧美久久| 2021精品国产综合久久| 久久久亚洲欧洲日产国码aⅴ| 久久亚洲精品成人无码网站| 香港aa三级久久三级老师2021国产三级精品三级在| 久久精品亚洲中文字幕无码麻豆 | 国内精品久久久久久久影视麻豆 | 久久99精品国产麻豆不卡| 国产精品久久亚洲不卡动漫| 久久99热这里只有精品66| 久久亚洲sm情趣捆绑调教| 日产精品久久久久久久| 欧美黑人激情性久久| 一本色道久久综合亚洲精品| 日日躁夜夜躁狠狠久久AV| 精品免费久久久久久久|