Archive for the Works Category

Note : WDK Kernel Mode fundamental

Posted in Works on 2008 年 05 月 08 日 by Kun-Yi

Windows Driver Kit: Kernel-Mode Driver Architecture

Introduction to Standard Driver Routines

http://msdn.microsoft.com/en-us/library/ms794996.aspx

最基本的需要實做出來的函式

  • DriverEntry, Initializes the driver and its driver object. 初始化驅動程式與他的驅動物件
  • AddDevice, Initializes devices and creates device objects. 初始化裝置與建立裝置物件
  • Dispatch Routines, Receive and process IRPs. 接收與處理 IRPs (I/O Request Packet)
  • Unload, Release system resources acquired by the driver. 釋放這個驅動程式已經取得的系統資源

Dispatch Routines, 在 DriverEntry 裡面初始化 Driver Object 的相關function pointer,

Required Dispatch Routines

Most drivers must handle the following Dispatch routines:

DispatchPnP

DispatchPower

DispatchCreate

DispatchClose

DispatchRead

DispatchWrite

DispatchDeviceControl

DispatchInternalDeviceControl

DispatchSystemControl

Drivers handle IRPs set with some or all of the following major function codes:

IRP_MJ_CREATE

IRP_MJ_PNP

IRP_MJ_POWER

IRP_MJ_READ

IRP_MJ_WRITE

IRP_MJ_FLUSH_BUFFERS

IRP_MJ_QUERY_INFORMATION

IRP_MJ_SET_INFORMATION

IRP_MJ_DEVICE_CONTROL

IRP_MJ_INTERNAL_DEVICE_CONTROL

IRP_MJ_SYSTEM_CONTROL

IRP_MJ_CLEANUP

IRP_MJ_CLOSE

IRP_MJ_SHUTDOWN

廣告

A method to make a binary driver/BSP to your customer

Posted in WinCE, Works on 2008 年 01 月 24 日 by Kun-Yi

following show my source & makefile

SOURCE

!if 0
The file just dummy files
!endif

SKIPBUILD=1

TARGETNAME=dummy
RELEASETYPE=PLATFORM
SYNCHRONIZE_DRAIN=1
TARGETTYPE=DYNLINK
DLLENTRY=DllEntry
DEFFILE=

SOURCELIBS=

TARGETLIBS=

SOURCES=

Keypoint : SKIPBUILD=1, to skip compiler & sysgen stage.

you need know Compiler & Sysgen Phase in CE build process. SYSGEN is a linked stage.

MAKEFILE

!if 0
To copy all binary files
!endif

!INCLUDE $(_MAKEENVROOT)makefile.def

all:
copy /y ..lib$(_CPUINDPATH)*.* $(_TARGETPLATROOT)LIB$(_CPUINDPATH).
copy /y ..target$(_CPUINDPATH)*.* $(_TARGETPLATROOT)TARGET$(_CPUINDPATH).

!  IF “$(WINCEREL)" == “1″
copy /y .target$(_CPUINDPATH)*.* $(_FLATRELEASEDIR).
!  ENDIF

Keypoint:

the makefile to simulation “Release Copy Phase"

Bookmark: Centurion, South Africa

Posted in Works on 2008 年 01 月 15 日 by Kun-Yi

Google Maps, Centurion, Republic of South Africa

http://maps.google.com/maps?f=q&hl=zh-TW&geocode=&time=&date=&ttype=&q=Centurion+south+africa&sll=-26.074054,28.1147&sspn=0.262741,0.466919&ie=UTF8&ll=-25.805455,28.230743&spn=0.263341,0.466919&z=11&om=1

Tshwane == (Pretoria), 行政首都

Gauteng 地理位址上看起來應該比較靠 Pretoria, 但網路的介紹中,幾乎都都是跟 Johannesburg (約翰尼斯堡)產金的所在地,放在一起。不知道走在路上能不能踢到金子 XD, 看了一下衛星照片, 還真是地大人稀呀

 

看了這張圖,有點懂了為啥都會提到Johannesburg 應該是國際機場在 Johannesburg 的關係

希望過年前能回得來

Todo: Mainstream for the weekly work

Posted in Works on 2007 年 09 月 30 日 by Kun-Yi

1. check MSIPL to locking mechanism on H3 & G4 difference.

finish the item, added FAL_LockFlashRegion() & FAL_UnlockFlashRegion() to bootloader. Oct. 1 2007

what’s the issue not on TRUEFFS 6.xx? need check it.

2. update SDHC driver to BSP, finish update SDBus/SDMemory

SDHCD, need add CMD8(SEND MEMORY INTERFACE CONDITION) & Response7 process

   finish the item. Oct. 1 2007.

SD memory client driver to support greate than 4G SD Card,

   finish the item. Oct. 1 2007. maybe bootloader need change to support SDHC when update OS image.

Know issue:

   has a operation error code 31 (no funcitons)when operating a SD device to suspend & resume device.

   need to check power up & power down sequence of SDHCB/SD Memory

write a verification program to automation write/read SD card.

3. check LTK for WM6 others issues.

need to check Bulleye(WM 6.1) version req.

4. remap memory map on platform, use a OEMDRIVERHIGH package?

轉貼:MSDN:Windows Mobile – Provisioning Using a ROM Configuration XML File

Posted in Works on 2007 年 09 月 24 日 by Kun-Yi

Porting BSP 到WM6 上,卻發生Make CHT語系的OS Image 一直有問題,看來是Package/Configuration XML 有問題。需要好好重新規劃,不然 OS partition 一直建不出來,不論Space 調多大都無用,最近十分困擾。 Provision XML 是屬於OMA-DM 與上述問題無關 😛


http://msdn2.microsoft.com/en-us/library/bb737254.aspx

Your OEM can place your provisioning XML files in Image Update packages in ROM to be processed either during cold boot or during Image Update. During cold boot all files in all packages are processed. During Image Update only certain files, in packages that have been updated, will be processed.

An Image Update Package can contain two types of provisioning files:

  • Cold boot files that will be processed by Configuration Manager only when the device is cold booted. The provisioning file name must have one of the following formats:
    mxipcold_<package name>_<version>.provxml
    or
    mxip_<package name>_<version>.provxml
    where <package name> is the name of Image Update package.
    These files should contain settings that you intend to be applied only during cold boot.
  • Update files that will be processed by Configuration Manager both when the device is cold booted and, if their associated packages have been updated, during Image Update. The provisioning file name must have the following format:
    mxipupdate_<package name>_<version>.provxml
    All settings contained in these files will be re-applied whenever their associated packages are updated, regardless of whether they have or have not changed. Therefore, these files should only contain settings that you intend to be reapplied every time their packages are updated.

Microsoft recommends that you use a three-digit version number in the name of your .provxml files in ROM, such as mxip_opr_100, mxip_opr_200, mxip_opr_300, so that there is an adequate number of ordinals to identify successive versions of the file.

Note:

Mobile Operators should avoid using provxml files to override (shadow) entries in Microsoft-owned provxml files Mxip_<package name>_<version>.provxml is imported only at cold boot when the device is initially configured. In effect, mxip_<package name>_<version>.provxml and mxipcold_<package name>_<version>.provxml are handled the same. Mxipupdate_<package name>_<version>.provxml files are imported after cold boot and when the package containing them is updated.

Note: MDOC H3 get Uniquel ID using flGetUniquelID() and Reset Issues.

Posted in Works on 2007 年 08 月 13 日 by Kun-Yi

My work device use a Sandisk/M-System MDOC H3 chip with PXA270. The device has a mulit layer bootloader to support both Windows CE and Windows Mobile. Due to Windows Mobile need to implement Device UUID feature and MDOC has a hardware UUID funciton. you use “flGetUniqueID()" getting the MDOC UUID, the function in MDOC BDK library.The function on H3 device need more to more time.

if running flGetUniqueID(), can’t use GPIO reset signal to reboot the device.

workaround : Before call flGetUniqueID() to mask GPIO reset function register. after to re-enable the GPIO reset.

Note : Using Atmel AVR basic tips

Posted in Works on 2007 年 07 月 29 日 by Kun-Yi

1. Check using type default & how to selection configuration fuses. reading datesheet

like to following, infomation from ATMega48/88/168 datasheet

CKSEL3-0 : Clock Source Selector, default : "0010" (Calibrated Internal RC Oscillator), ref. section 7.2 of datasheet

CKDIV8  : default "0", so default CLKPR(Clock Prescale Register) is "0011", equ. divide 8.

SUT1-0 : Start up time, default "10", power on has 65ms+ 14 clock time to reset. ref. section 7.6 of datasheet.

so factory default setting of ATMega48 is operation at 1MHz, Internal RC Oscillator, slowly reset time

All fuse default setting has a table at section 26.2 of datasheet.

 

2. Programming tools

high voltage paraller programming

In Circuit System programming

3. WinAVR  is a complete GCC compiler solution for AVR.it is free and easy use.