跳到主要內容

發表文章

目前顯示的是 6月, 2008的文章

[WinCE] Driver Designe Course Note

BootLoader write process Connet Board by ICE install Banyan-UE-1.8.7b.exe Pass:5678088 execute Banyan-UE\DaemonU Unzip FlashWrite-V0.4.6b.zip execute FlashWrite-V0.4.6a.exe   >Initialize   >Detect   >Auto     Select "eboot.nb0"     Start Write Flash RAM Connet Board by COM Cable and Ethnet Cable(port cs8900) execute dnw.exe   Select com3 and 115200bps   [Serial Port]->[Connect]   and switch the Device power execute Platform Builder   open $MyOSDesign Workspace   [Target]->[Connectivity Options]->[Donwload]/[Setting]   [Target]->[Attach Device]       Build parameter setting set wincerel = 1 build 後自動複製 Driver *.reg write special [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\LED] "Dll"="leddrv.dll" /*Driver DLL檔名* "Prefix"="LED" /*Device名稱* "Index"=dword:1 /*設定driver共用編號* "Order"=dwo...

[WinCE] Driver-

ActivateDevice This function loads a device driver. HANDLE ActivateDevice( LPCWSTR lpszDevKey, DWORD dwClientInfo ); ActivateDeviceEx This function loads a driver and adds its registry values to the Active key in the registry. HANDLE ActivateDeviceEx( LPCWSTR lpszDevKey, LPCVOID lpRegEnts, DWORD cRegEnts, LPVOID lpvParam ); Loading Device Drivers Developing a Device Driver

[C,C++]typedef struct 用法

typedef 可以幫已知數據類型定義新名稱 也可以用來定義struct 如果要幫已知數據類型定義新名稱可用下列方法: '幫已知數據類型long起個新名字,叫byte_4 typedef long byte_4; 要用來定義struct的話 則用下列的方式 '設計一個struct tagMyStruct struct tagMyStruct { int iNum; long lLength; }; 下面是比較複雜的宣告方式 typedef struct tagMyStruct {  int iNum;  long lLength; } MyStruct; --這可以看成兩個部分 1. 設計一個struct 為tagMyStruct struct tagMyStruct { int iNum; long lLength; }; 2. 將 struct tagMyStruct 定名為MyStruct; typedef struct tagMyStruct MyStruct; 宣告更名後 直接給定變數的方式 typedef struct tagMyStruct {  int iNum;  long lLength; } MyStruct, *MyVariable; 可看成以下三行程式 struct tagMyStruct {  int iNum;  long lLength; }; typedef struct tagMyStruct MyStruct; MyStruct, *MyVariable;

[WinCE]WinCE Drivers--Stream Interface Drivers

Stream Interface is appropriate for any I/O device that produces or consumes streams of data. A good example: Serial port device, bad example: Display device Stream Driver is a DLL and has 12 standard Entry Points(函式/介面) (Init 、Deinit、I OControl、PowerDown、PowerUp、Open、 Read、 Write、 Seek、 Close..etc ) 怎麼判斷是否為Stream Driver ? ? public\common\oak\drivers下 的 def 檔,通常會使用 CreateFile("XXXN:", FILES_EXIST, ....) DeviceIoControl 操作的 Driver 都是 Stream Driver,即將 Driver 模擬成檔案來操作 Several ways to implement the stream driver: 1. With only Init and Deinit entry points and no device prefix. ==>You cannot access this driver using CreateFile. (e.g. %_WINCEROOT%\Public\Common\OAK\Drivers\RegEnum) 2.With device prefix in driver entry points. ==> DWORD DEM_ Init( LPCTSTR pContext, LPCVOID lpvBusContext) { OutputDebugString(L"DEM_DRIVER - DEM_Init - Context: "); OutputDebugString(pContext); OutputDebugString(L"\n"); OutputDebugString(L"DEM_DRIVER - Exit DEM_In...

[C,C++]CreateFile Function

CreateFile Function Creates or opens a file or I/O device. The most commonly used I/O devices are as follows: file, file stream, directory, physical disk, volume, console buffer, tape drive, communications resource, mailslot, and pipe. The function returns a handle that can be used to access the file or device for various types of I/O depending on the file or device and the flags and attributes specified. To perform this operation as a transacted operation, which results in a handle that can be used for transacted I/O, use the CreateFileTransacted function.

[C,C++]DataType

DWORD DWORD is not a standard C datatype. Typically it represents a double word. On a 16-bit machine a WORD would be 16 bits, on a 32-bit machine, it would be 32 bits. Having said that, it would imply that a double word on a 16 bit machine is 32 bits and on a 32 bit machine, it would be 64 bits. However, that is very vendor dependent. If you use the 32-bit Microsoft compilers, a WORD and DWORD are the same size!!! Since it deals with words, it is meant for low level use for instance bit patterns on an IO chip. If you want high level usage, use unsigned long. For windows (9x, ME, 2K & XP) registry a DWORD is a 32-bit unsigned long.

[WinCE] *.bib

BIB files ROMIMAGE uses Binary Image Builder (BIB) files to configure how it should configure the ROM. BIB files are just plain text files with keywords defining four different sections. The modules section is identified with the keyword MODULES on a line of its own. In the modules section, executable modules are listed for code that will execute in place (XIP). The files section (keyword FILES) lists other files to place in the image (bitmaps, data files, HTML pages, and so on). It can also specify executable modules not intended for XIP. Rarely used diagnostic applications are a good candidate for that. The items in the files section are compressed by default to reduce the size. modules and files The syntax is pretty straightforward for the entries of the modules and files sections: [target] [whitespace] [workstation][memory][flags][target] is the name of the file as it will appear in the ROM. is the path ROMIMAGE will use to find the actual file (normally based on $(_FLATRELEASEDIR...

[WinCE] Driver-

DllMain Callback Function ---Windows架構下呼叫dll的主程式結構 BOOL WINAPI DllMain( __in HINSTANCE hinstDLL , __in DWORD fdwReason , __in LPVOID lpvReserved ); XXX_IOControl (Device Manager) This function sends a command to a device. BOOL XXX_IOControl( DWORD hOpenContext, DWORD dwCode, PBYTE pBufIn, DWORD dwLenIn, PBYTE pBufOut, DWORD dwLenOut, PDWORD pdwActualOut ); Parameters hOpenContext [in] Handle to the open context of the device. The XXX_Open (Device Manager) function creates and returns this identifier. dwCode [in] I/O control operation to perform. These codes are device-specific and are usually exposed to developers through a header file. pBufIn [in] Pointer to the buffer containing data to transfer to the device. dwLenIn [in] Number of bytes of data in the buffer specified for pBufIn. pBufOut [out] Pointer to the buffer used to transfer the output data from the device. dwLenOut [in] Maximum number of bytes in the buffer specified by pBufOut. pdwActualOut [out] Pointer to the DWORD bu...

[WinCE] SOURCES文件詳解

SOURCES文件是WINCE底层开发中最重要的文件之一,主要的配置项如下: TARGETNAME,定义模块名称. TARGETTYPE,模块的种类,可以是DYNLINK, LIBRARY,EXE. 如果TARGETTYPE是DLL,则可以定义DLLENTRY,将Dll入口定义成别的不是DLLMain的函数,如果DLL的入口是DllMain,则不需要别的定义。 如果TARGETTYPE是EXE,则可以定义EXEENTRY,用于指定EXE的入口函数. 如果TARGETTYPE是LIBRARY,则不需要定义入口函数。 INCLUDES,如果一个模块需要使用非标准路径下的头文件时,需要定义INCLUDES,用于包含更多的头文件路径,用法如下: INCLUDES=$(INCLUDES);\new directory\...,注意定义新的INCLUDES时,需要包含INCLUDES原来的值,否则就需要包含所有可能的目录。 TARGETLIBS,SOURCELIBS用于定义该模块需要链接哪些库文件. TARGETLIBS,如果一个库以DLL的形式提供给调用者,就需要用TARGETLIBS,它只链接一个函数地址,系统执行时会将被链接的库加载。比如coredll.lib就是这样的库文件。即动态链接。 SOURCELIBS,将库中的函数实体链接进来。即静态链接,用到的函数会在我们的文件中形成一份拷贝。 注意,内核这个执行文件是没有TARGETLIBS的,GIISR.DLL也不能有TARGETLIBS。 WINCECOD,如果将其定义为1,则编译器会为每一个文件生成.cod文件,它是一个汇编文件,调试时查看汇编代码也是一种很好的办法。 SOURCES,定义该模块需要哪些源文件. 文章轉載自 WINCE Driver and BSP Develop Blog

[理財]合夥買賣房屋辦公室預告登記

先做預告登記 合夥投資保權益 商業辦公室買賣動輒數千萬元的交易,一般小投資人想介入門檻甚高。有投資人想到用合資的方式,將資金集合起來,一起購買,轉手賣出或出租,再按比例分享獲利,房仲業者表示,合夥人必須先到地政機關做好預告登記,來保障各自的權益。  信義房屋不動產企研室主任蘇啟榮表示,預告登記可以到地政機關申請,主要的好處就是避免房子的登記人,趁著其他的合夥人不注意,就私自將房子賣出,獲利全歸自己所有。 預告登記上可以註明,房屋的所有權人屬於哪幾個合夥人持有,一旦要出售,必須所有合夥人都同意,或者出示同意授權書,房子的登記人才有權利將房子出售,避免發生有人賣了房子後、捲款潛逃,剩下的合夥人被倒債狀況。 至於合資買的辦公室要登記誰的名字比較有利?永慶房屋協理黃增福說,有些人會登記在收入少的人名下,因為這樣來年要繳的稅比較少,不過,相對來說,跟銀行拿到的貸款額度也會比較低。 黃增福表示,登記在誰的名下,其實,沒有絕對的好壞,合夥人之間商量好即可,不過若是要拿到較高成數的銀行貸款,最好要登記在過去信用沒有瑕疵、所得比較高的人名下,能夠借到的錢最多。 住商不動產企研室主任徐佳馨表示,買賣房子一定是整個產權的過戶,也不可能將各自登記的比例,過戶給買方,合夥出資一定要在法律上保障到自己的權益,若是以為彼此感情好、只做口頭約定,沒有白紙黑字寫清楚,到最後都會出問題。 做了預告登記後,若不是出售而是出租,合夥人也不需要擔心登記人自己胡亂搞,出租給特種行業,或者是將持份的比例,亂租給來路不明的人,造成其他合夥人的困擾。 蘇啟榮表示,若是透過仲介公司做房屋租賃,房仲業者會到地政機關調出房子的謄本,包含持有人是誰、是否有做過預告登記等,房屋要順利出租,必須預告登記人都同意,才有辦法出租。 資料來源:【工商時報 許(清爭)文台北報導】 2008.6.15