搜尋此網誌

2011年6月28日 星期二

How to check system BIOS memory usage?

  • [0040h:0013h] - Base Memory Size In KBytes(Word)  System BIOS remaining memory.
  • [0040h:000Eh] - Segment Of Extended BIOS Data Segment(Word)  →  [System BIOS current memory segment]:[0000h] → offset 00h - Length Of EBDA In kilobytes(Byte)  Has been used memory.

2011年6月15日 星期三

Int 13H不常用的中斷向量,當開發BIOS這些要怎麼回應?

下列列出的中斷向量是在Int 13H中,較為不常用。當BIOS遇到這些中斷食,該怎麼回應:
當AH = 0x00 /*Reset Disk System*/
           = 0x05 /*Format Track*/
           = 0x09 /*Initialize Controller with Drive Parameters*/
           = 0x0C /*Seek to Cylinder*/
           = 0x0D /*Reset Hard Disk*/
           = 0x11 /*Recalibrate  Hard Disk(硬碟重新校正)*/
           = 0x14 /*Controller Internal Diagnostic*/
           = 0x18 /*Set media type for Format*/
           = 0x44 /*Verify Sectors*/
           = 0x4C /*Bootable CD-ROM Initiate Disk Emulation and Boot*/
           = 0x4D /*Bootable CD-ROM Return Boot Catalog*/
     以上這些中斷向量必須回傳AX = 0x0000, Flag Register CF = 0

當AH = 0x06 /*Format Track and Set BAD Sector Flags*/
           = 0x07 /*Format Driver Starting at Given Track*/
           = 0x0A /*Read Long Sectors*/
           = 0x0B /*Write Long Sectors*/
           = 0x0E /*Read Sector Buffer*/
           = 0x0F /*Write Sector Buffer*/
           = 0x12 /*Controller RAM Diagnostic*/
           = 0x13 /*Drive Diagnostic*/
           = 0x45 /*Lock/Unlock Drive*/
           = 0x46 /*Eject Media*/
           = 0x49 /*Extended Media Change*/
     以上這些中斷向量必須回傳AH = 0x01, Flag Register CF = 1


2011年6月14日 星期二

PnP OptionROM Header

[PnP OptionROM Header]
Offset  Size       Value     Description
0x00     Byte        0x55       Signature byte 1.
0x01     Byte        0xAA      Signature byte 2.
0x02     Byte        Varies    Option ROM length in 512byte Blocks.
0x03     4Bytes    Varies    Initialization entry point(BIOS進入點).
0x07     17Bytes  Varies   Reserved(保留).
0x18     2Bytes    Varies   Offset to PCI data structure.
0x1A    2Bytes     Varies   Offset to expansion header structure.

[PCI Data Structure]
Offset  Size       Value     Description
0x00     Byte        ?             Signature byte 1.
0x01     Byte        ?             Signature byte 2.
0x02     Byte        ?             Signature byte 3.
0x03     Byte        ?             Signature byte 4.
0x04     2Bytes    Varies     Vendor Identification(廠商識別碼).
0x06     2Bytes    Varies     Device Identification(裝置識別碼).
0x08     2Bytes    Varies     Pointer to Vital Product Data().
0x0A    2Bytes    Varies     PCI Data Structure Length(PCI資料結構長度)..
0x0C    Bytec      Varies     PCI Data Structure Revision(PCI資料結構修訂版).
0x0D    3Bytes    Varies     Class Code(分類碼).
0x10     2Bytes    Varies     Image Length(影像長度).
0x12     2Bytes    Varies     Revision Level of Code/Data(程式碼/資料的修訂層級).
0x14     Byte       Varies     Code Class程式碼的型態.
0x15     Byte       Varies     Indicator(指標).
0x16     2Bytes                  Reserved(保留).          



[Code Type]  The Code Type field is a one-byte field that identifies the type of  code contained in this section of the ROM.  The code may be executable binary for a specific processor and system architecture or interpretive code.  The following code types are assigned:
Type     Description
0   Intel x86, PC-AT compatible
1   Open Firmware standard for PCI 7
2   Hewlett-Packard PA RISC
3   Extensible Firmware Interface (EFI)
4-FF       Reserved


[Last Image Indicator]  Bit 7 in this field tells whether or not this is the last image in the ROM.  A value of 1 indicates “last image;” a value of 0 indicates that another image follows.  Bits 0-6 are reserved.




[PnP Expansion Header]
Offset  Size       Value     Description
0x00     Byte        ?             Signature byte 1.
0x01     Byte        ?             Signature byte 2.
0x02     Byte        ?             Signature byte 3.
0x03     Byte        ?             Signature byte 4.
0x04     Byte        0x01       Structure revision(結構修訂版).
0x05     Byte        Varies     Length(in 16 byte increment)(以16Byte為單位基準值).
0x06     2Bytes     Varies     Offset of next header(下一個標頭偏移植).
0x08     Byte        Varies     Offset of next header(下一個標頭偏移植).
0x09     Byte        Varies     Check sum(檢查碼)
0x0A    4Bytes     Varies     Device identifier(裝置識別).
0x0E    2Bytes     Varies     Point to manufacturer string(Optional)(廠商字串指標).
0x10    2Bytes     Varies     Point to product name string(Optional)(產品名稱字串指標).
0x12    3Bytes     Varies     Device type code(裝置型態碼).
0x15    Byte         Varies     Device indicators(裝置表指標)
0x16     2Bytes     Varies     Boot Connection Vector(BCV), 0x0000 if none(開機鏈結向量, 0x0000:無). 
0x18     2Bytes     Varies     Disconnection Vector(DV), 0x0000 if none(分離向量, 0x0000:無).
0x1A    2Bytes     Varies   Bootstrap Entry Vector(BEV), 0x0000 if none(啟動程式登入向量, 0x0000:無 )
0x1C    2Bytes     0x0000   Reserved(保留).
0x1E    2Bytes     Varies     Static resource information vector(靜態資源資訊向量).

         

2011年6月11日 星期六

什麼是Android?

Android是在以Linux為核心的一種開放式的移動設備的作業系統。目前也有很多廠商參與並開發相關的硬體產品,如Acer、Asus、HTC...等。Android提供各式各樣的函式庫,與一個完整的應用程式框架,並採用較符合商用限制的[Apache]授權協議,也提供免費的Eclipse整合開發(IDE)環境。
詳細開發資訊可上http://developer.android.com/index.html取得。
SDK下載http://developer.android.com/sdk/eclipse-adt.html

Enjoy it!!

如何偵測ATA裝置

1. 使用Device control register(ATA),然後對裝置下SRST(先寫1再寫0)。在狀態回傳的同時一組Signature

7
6
5
4
3
2
1
0
RSVD
RSVD
RSVD
RSVD
RSVD
SRST
nIEN
0
SRST: Host Software Reset bit(裝置重置:它針對後端裝置的重置).

Digital Signature:  

  • [Cyl High(31:24) | Cyl Low(23:17) | Sec Number(16:8) | Sec Count(7:0)]
  • [LBA High(31:24) | LBA Mid(23:17) | LBA Low(16:8) | Sec Count(7:0)]

0xEB140101 == ATAPI (CDROM, DVD, Tape)
0x00000101 == HDD
0x96690110 == Port Multiplier

2. 使用另外一個方法,等到Busy Bit等於0時,先下 ATA Identify command(0XEC),成功的話此裝置為HDD。若不成功,再下另一個ATA Identify Packet Command(0xA1),成功的話為ATAPI裝置。此方法不適用於Port Multiplier裝置。

財經詞彙(中英對照)---Z

Zero-Coupon Bond(零息債劵)

財經詞彙(中英對照)---Y

Yield(殖利率)
Yield Curve(殖利率曲線)
Yield to Maturity(YTM)(到期殖利率)

財經詞彙(中英對照)---X

財經詞彙(中英對照)---W

Warrant(認證權證)
Weighted Average(加權平均值)
Weighted Average Market Capitalization(市值加權指數)
Windfall Profit Tax(暴利稅)
Working Capital(營運資金)

財經詞彙(中英對照)---V

Value Investing(價值投資法)
Value Proposition(價值主張)
Value Stock(價值股)
Variable Cost(變動成本)
Venture Capital(創業投資)
VIX(CBOE Volatility Index)(VIX指數)
Volatility(波動性)
Volume(成交量)
Volume Weighted Average Price(VWAP)(成交量加權平均價格)

財經詞彙(中英對照)---U

Underwriting(承銷)(核保)
U.S.Treasury(美國財政部)
Unemployment Rate(失業率)
Unlevered Beta(去槓桿貝他係數)
Unrealized Gain(未實現盈利)
Unsystematic Risk(非系統風險)
Uptick(高於前成交價)
Uptrend(上升趨勢)

2011年6月10日 星期五

財經詞彙(中英對照)---T

Takeover(收購)
Tangible Asset(有形資產)
Tangible Net Worth(有形資產淨值)
Tax Deferred(延後課稅)
Technical Analysis(技術分析)
Ted Spread(泰德利差)
Terminal Value(TV)(終值)
Tick(跳動點)
Tier 1 Capital(一級資本)
Time Value of Money(資金的時間價值)
Times Interest Earned(TIE)(利息保障倍數)
Total Enterprise Value(TEV)(總企業價值)
Total Return(總報酬率)
Tracking Error(追蹤誤差)
Traditional IRA(傳統個人退休帳戶)
Tranches(份類)
Treasury Bill(T-Bill)(美國國庫劵)
Treasury Bond(T-Bond)(美國長期公債)
Treasury Inflation Protected Securities(TIPS)(抗通膨美國公債)
Treasury Note(美國中期公債)
Trend Analysis(趨勢分析)
Triple Witching(三巫日)
Turnover(週轉率)
Turnover Ratio(基金週轉率)

2011年6月9日 星期四

財經詞彙(中英對照)---S

Secondary Market(次級市場)
Secondary Offering(二次發行)
Securities and Exchange Commission(SEC)(美國證劵交易委員會)
Securitization(證劵化)
Security(證劵)
Security Market Line(SML)(證劵市場線)
Series 63(系列六十三執照)
Series 7(系列七執照)
Settlement Date(結算日)
Shareholders' Equity(股東權益)
Sharpe Ratio(夏普值)
Short(or Short Position)(空頭)
Short Covering(空頭回補)
Short Interest(空單餘額)
Short Interest Ratio(空單餘額比率)
Short Sale(賣空)
Short Squeeze(軋空)
Simple Moving Average(SMA)(簡單移動平均線)
Singapore Interbank Offered Rate(新加坡同業銀行拆款利率)
Small Cap(小型股)
Solvency Ratio(償債能力比率)
Spiders(SPDR)(標準普爾存託憑證)
Spinoff(分割)
Spread(價差)
Stagflation(滯脹)
Standard & Poor's 500 Index(S&P 500)(標準普爾五百指數)
Standard Deviation(標準差)
Stochastic Oscillator(隨機指標)
Stock(股票)
Stock Market(股票市場)
Stock Option(股票選擇權)
Stock Split(股票分割)
Stop Order(停止單)
Stop-Limit Order(限價停損單)
Stop-Loss Order(停損單)
Straddle(跨式選擇權組合)
Strangle(勒式選擇權組合)
Strike Price(履約價)
Style(投資風格)
Style Drift(投資風格移轉)
Subordinated Debt(次順位債)
Subprime Loan(次級貸款)
Subprime Meltdown(次貸崩盤)
Support(支撐點)
Swap(交換交易)
Syndicate(銀行團)(承銷團)
Systematic Risk(系統風險)

2011年6月8日 星期三

財經詞彙(中英對照)---R

Real Estate Investment Trust(REIT)(不動產投資信託)
Real Gross Domestic Product(實質國內生產毛額)
Real Rate of Return(實質報酬率)
Receivable Turnover Ratio(應收帳款週轉率)
Recession(經濟衰退)
Record Date(股權登記日)
Regulation T(Reg T)(T規定)
Relative Strength Index(RSI)(相對強弱指數)
Repurchase Agreement(Repo)(附買回協議)
Required Minimum Distribution(RMD)(最低要求提取額)
Required Rate of Return(要求報酬率)
Residual Income(剩餘所得)
Resistance(阻力位)
Retained Earnings(保留盈餘)
Return on Assets(ROA)(資產報酬率)
Return on Equity(ROE)(股東權益報酬率)
Return on Investment(ROI)(投資報酬率)
Return on Net Assets(RONA)(淨資產報酬率)
Return on Sales(銷售報酬率)
Revenue(營業收入)
Reverse Stock Split(股票合併)
Rights Offering(Issue)(原股東現金增資)
Risk(風險)
Risk-Free Rate of Return(無風險報酬率)
Risk-Return Trade-Off(風險與報酬的取捨)
Risk-Weighted Assets(風險性資產)
Roth IRA(羅斯個人退休帳戶)
R-Squared(R平方值)
Run Rate(運行速度)

財經詞彙(中英對照)---Q

Qualified Retirement Plan(合資格退休金計畫)
Quantitative Analysis(量化分析)
Quick Ratio(速動比率)
Quote(報價)

2011年6月7日 星期二

財經詞彙(中英對照)---P

Paid-Up Capital(實收資本額)
Par Value(債劵面值)(股票面額)
Pari-Passu(權利相同)
Parity(平價)
Passive Investing(被動型投資)
Payback Period(還本期)
Penny Stock(水餃股)
Pink Sheets(粉紅單市場)
Pip(跳動點)
Pivot Point(軸點)
Plain Vanilla(陽春型)
Plus Tick(高於前成交價)
Poison Pill(毒丸策略)
Portfolio(投資組合)
Preferred Stock(優先股)
Premium(選擇權權利金)(溢價)(保費)
Present Value(PV)(現值)
Present Value Interest Factor(PVIF)(現值利率因子)
Price to Tangible Book Value(PTBV)(股價有形資產比)
Price-Weighted Index(價格加權指數)
Price/Earnings to Growth Ratio(PEG Ratio)(PEG值)
Price-Earnings Ratio(P/E Ratio)(本益比)
Price-to-Book Ratio(P/B Ratio)(股價淨值比)
Price-to-Cash-Flow Ratio(股價現金流量比)
Price-to-Sales Ratio(Price/Sales)(股價營收比)
Prime Rate(基本放款利率)
Private Equity(私募股權)
Private Placement(私下募集)
Pro Forma(擬制)(試算)(備考)
Profit and Loss Statement(損益表)
Profit Margin(淨利率)
Profitability Ratio(獲利能力比率)
Prospectus(公開說明書)
Put(賣權)
Put Option(賣權)
Put-Call Ratio(賣權買權比)

2011年6月6日 星期一

財經詞彙(中英對照)---O

October Effect(10月效應)
Off-Balance-Sheet Financing(帳外融資)
Oligopoly(寡頭壟斷)
Open Interest(未平倉量)
Open-End Fund(開放型基金)
Operating Cash Flow(OCF)(營業現金流)
Operating Cash Flow(OCF) Ratio(營業現金流對流動負債比)
Operating Expense(營業費用)
Operating Income(營業利潤)
Operating Leverage(營業槓桿)
Operating Margin(營業利潤率)
Operating Profit(營業利潤)
Opportunity Cost(機會成本)
Optimization(優化)
Option(選擇權)
Out of the Money(OTM)(價外)
Outstanding Shares(發行在外股份)
Overbought(超買)
Overnight Index Swap(隔夜拆款交換)
Oversold(超賣)
Over the Counter(OTC)(場外交易)
Over-the-Counter Bulletin Board(OTCBB)(那斯達克場外交易系統)

2011年6月1日 星期三

How To Build EDK II(EFI Developer Kit II) on Windows

HOW TO BUILD (WINDOWS SYSTEM)
Windows System Configuration: Microsoft Windows XP  Professional Version 2002 Service Pack 3 *
I.  Setup Build Environment
  1. Install Microsoft Visual Studio 2008* SP1 in the build machine and make sure that AMD64 complier was selected when installing.
  2. Download "iasl-win-20070508.zip" from http://www.acpica.org/downloads/Version_20070508.php" and extract file "iasl.exe" to C:\ASL
  3. Donwload WinDDK.3790.1830 from:
  4. http://download.microsoft.com/download/9/0/f/90f019ac-8243-48d3-91cf-81fc4093ecfd/1830_usa_ddk.iso and install WINDDK 3790.1830* at : C:\WINDDK\3790.1830 NOTE: Be certain to obtain version 3790.1830 of the WinDDK and none other
  • NOTE: In the following steps substitue the name of the directory in which the UDK2010 build will be performed for the "C:\MyWorkspace." For example, if the build was to be performed in the directory "C:\UDK2010_UP3" then when directed to perform a step in directory "C:\MyWorkspace" substitue "C:\UDK2010_UP4" for "C:\MyWorkspace."
------------------  
II.  Extract Common Source Code
[UDK2010.UP4]
  1. Create a working space directory in the build machine, for example, C:\MyWorkspace
  2. Extract files in [UDK2010.UP4] the working space directory. In this case, it is C:\MyWorkspace. There are two BaseTools package one is for Windows system and another is for UNIX-Like system. Please make sure BaseTools(Windows).zip is used here.
  3. Extract files in [P.UDK2010.UP4.Network] one by one to the working space directory. Copy NetworkPkg to C:\MyWorkspace.
  4. Extract files in [P.UDK2010.UP4.SourceDebugging] one by one to the working space directory. Copy SourceDebuggingPkg to C:\MyWorkspace.
[UDK2010.SR1]
  1. Extract files in [UDK2010.SR1.MyWorkSpace.zip] to the working space directory (e.g C:). Note the Directory "MyWorkSpace" will be created as a result. In this case, it is C:\MyWorkspace.
  2. There are two BaseTools package one is for Windows system and another is for UNIX-Like system. Please make sure BaseTools(Windows)_UDK2010.SR1.zip is used here. Expand the appropriate BaseTools to C:\MyWorkSpace
------------------  
III.  Generate OpenSSL* Crypto Library
  1. Open file "C:\MyWorkspace\CryptoPkg\Library\OpensslLib\Patch-HOWTO.txt" and follow the instruction to install OpenSSL* for UEFI building.
      HOW to Install Openssl for UEFI Building
  • Download OpenSSL 0.9.8l from official website: http://www.openssl.org/source/openssl-0.9.8l.tar.gz NOTE: Some web browsers may rename the downloaded TAR file to openssl-0.9.8l.tar.tar. When you do the download, rename the "openssl-0.9.8l.tar.tar" to "openssl-0.9.8l.tar.gz" or rename the local downloaded file with ".tar.tar" extension to ".tar.gz".
  • Extract TAR into CryptoPkg/Library/OpenSslLib/openssl-0.9.8l NOTE: If you use WinZip to unpack the openssl source in Windows, please uncheck the WinZip smart CR/LF conversion option (WINZIP: Options --> Configuration --> Miscellaneous --> "TAR file smart CR/LF conversion").
  • Apply this patch: EDKII_openssl-0.9.8l.patch, and make installation
    For Windows Environment:
  1. Make sure the patch utility (patch.exe) has been installed in your machine at the following location: $(WORKSPACE)\CryptoPkg\Library\OpensslLib\openssl-0.9.8l Either install Cygwin or get the patch utility binary (patch.exe) from the following location: http://gnuwin32.sourceforge.net/packages/patch.htm
  2. Open a command prompt and enter the following commands in the exact order given - allowing each command to complete before entring the next command: 
  • NOTE: Win32, i.e. MS-Windows 95/98/ME/NT/2000/XP/2003/Vista with msvcrt.dll and msvcp60.dll. If msvcrt.dll or msvcp60.dll is not in your Windows/System folder, get them from Microsoft, or (msvcrt.dll only) by installing Internet Explorer 4.0 or higher.
------------------------------------
        cd $(WORKSPACE)\CryptoPkg\Library\OpensslLib\openssl-0.9.8l
          patch -p0 -i ..\EDKII_openssl-0.9.8l.patch
          cd ..
          install.cmd
------------------------------------
IV.  Build Steps
  1. Open a "Visual Studio 2008 Command Prompt", type command "cd C:\MyWorkspace" to enter the workspace directory, and then type command "edksetup" to initialize the working environment.
  2.  Type below commands to build platforms "build -a IA32 -p Nt32Pkg\Nt32Pkg.dsc"
  3.  Type below commands to build DUET IA32 platforms "build -a IA32 -p DuetPkg\DuetPkgIa32.dsc"
There are two methods to select the tool chain (Use Microsoft Visual Studio 2008* as sample):
  1. Update TOOL_CHAIN_TAG in file Conf/target.txt: TOOL_CHAIN_TAG = VS2008
  2. Add -t build option in command line: "build -t VS2008 ... "
For 32-bit VS2008 on 64-bit WINDOWS OS, VS2008x86 should be selected instead of VS2008.
Please refer to tools_def.txt for all supported tool chains and detailed descriptions. (tools_def.txt will be generated at Conf directory after running "edksetup".)

財經詞彙(中英對照)---N

Naked Shorting(無劵放空)
Nasdaq(那斯達克)
National Association of Securities Dealers(NASD)(全美證劵交易商協會)
Net Asset Value(NAV)(資產淨值)
Net Income(NI)(淨值)(所得淨值)
Net Long(淨多頭部位)
Net Operating Income(NOI)(營利淨利)
Net Operating Profit After Tax(NOPAT)(稅後營業淨利)
Net Present Value(NPV)(淨現值)
Net Sales(淨銷售額)
Net Tangible Assets(有形資產淨值)
Net Worth(淨值)
New York Stock Exchange(NYSE)(紐約證交所)
No-Load Fund(免收銷售費的基金)
Nominal GDP(名目國內生產毛額)
Nonmarginable Securities(不可融資買進的證劵)
Notional Value(名義值)