Qemu patches (1)
之前的 blog [
quilt - 強大的 patch 管理工具] 提到我最近花了些時間修改 [
QEMU],這裡先放出一些 patches,並作為 quilt 的示範。
首先,這些修改放在 [
qemu::patches],注意到該目錄下有個名為 "series" 的檔案,此為 patches 被 applied 的順序。目前的列表如下: (隨時可能更動,僅供參考)
- configure.patch
- qemu-sdl-cursor.patch
- arm_nptl.patch (NPTL for target-arm)
- pl110_rgb-r0.patch
- compiler.patch
- qemu-usb-wacom.patch (Wacom Tablet device)
- qemu-usb-wacom-pressure.patch
- qemu-usb-wacom-buttons.patch
- nodoc.patch
- qemu-x-no-sdl.patch (X11 output)
- qemu-arm-pxa255.patch (Intel Xscale/PXA255 emulation)
- qemu-hw-pxa255-peripherals.patch (PXA255 peripherals)
- smc91c111-softirq.patch
- qemu-hw-pflash-cfi.patch (CFI parallel flash with Intel command set)
- qemu-machine-gumstix.patch (PXA255-based Gumstix machine)
這些 patches 是提供給 qemu-0.8.2+cvs20061121,checkout 後,將上述 patches/ 目錄置放於 qemu root 後,執行:
quilt setup patches/series
接著我們就可以將上述 patch 逐一 push & applied,操作如下:
quilt push patches/configure.patch
quilt push patches/qemu-sdl-cursor.patch
...
當然也有對應的反向操作,也就是 pop,在上述動作執行後,執行:
quilt pop
即可返回上次更動狀態,若要查詢目前已被 applied 的 patch,可執行:
quilt top
當然我們也可以對這些 patch 作修改。如果現在 "quilt top" 顯示 "qemu-arm-pxa255.patch",而我們想以此為基礎,對 cp14 (system processor) instruction 作修改,那麼可以執行:
quilt edit target-arm/translate.c
這會呼叫 vi 或者 $EDITOR 所定義的文書編輯器來修改 target-arm/translate.c 的內容,注意到這個時候,會一併建立副本,以便後續作 diff 所用。當我們的修改完畢後,確定要更新該 patch 時,可執行:
quilt refresh
這樣一來,patches/qemu-arm-pxa255.patch 的內容也因此會更新,詳情可參考 quilt 文件,這對維護大量的 patch 非常方便。
感謝德國的朋友 Thorsten Zitterell 提供許多建議,現在已經展開 Intel/Marwell PXA27x emulation for Qemu 的開發工作,而我也規劃 emulated machine 也會以 Intel Mainstone DevKit 為基礎。在今年年初,我展開 PXAemu 的個人計畫,目前已經略有成果,[
QEMU] 的架構設計非常優越,效能更讓人激賞,希望在一面研究 Qemu 的 "portable JIT" 同時,我也能慢慢移轉 emulation 過去。
由 jserv 發表於 November 22, 2006 01:12 PM