Changes between Version 1 and Version 2 of jazz/jfbterm


Ignore:
Timestamp:
Nov 21, 2008, 1:39:48 PM (16 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • jazz/jfbterm

    v1 v2  
    3434Segmentation fault
    3535}}}
     36 * [備註] 如果沒有 modprobe uvesafb 的話,會缺少 /dev/fb0,因此當執行 jfbterm 時就會出現以下錯誤訊息
     37{{{
     38ENCODING: locale = UTF-8
     39FONT : (4) [iso10646.1]/pcf/U:///usr/share/fonts/X11/misc/unifont.pcf.gz/
     40encoding : UTF-8,iso10646.1
     41exec : ls open /dev/fb0: No such file or directory
     42}}}
    3643 * [備註] 如果沒有裝 v86d 的話,當執行 modprobe uvesafb 時會在 dmesg 看到以下資訊
    3744{{{
     
    5360[  269.938101] fb0: VESA VGA frame buffer device
    5461}}}
    55  * Ubuntu 8.10 Kernel 2.6.27-7-server 的 uvesafb 參數包括 scroll、vgapal、pmipal、mtrr、blank、nocrtc、noedid、vram_remap、vram_total、maxclk、maxhf、maxvf、mode_option、vbemode、v86d。
     62 * 編輯 GRUB 的 menu.lst 就可以不用每次都跑 modprobe
     63{{{
     64#!diff
     65--- menu.lst.org        2008-11-19 06:56:47.000000000 +0800
     66+++ menu.lst    2008-11-19 06:56:21.000000000 +0800
     67@@ -125,7 +125,7 @@
     68
     69 title          Ubuntu 8.10, kernel 2.6.27-7-server
     70 uuid           574912ac-8bd6-4cc7-90c6-8c5362033fec
     71-kernel         /boot/vmlinuz-2.6.27-7-server root=UUID=574912ac-8bd6-4cc7-90c6-8c5362033fec ro quiet splash
     72+kernel         /boot/vmlinuz-2.6.27-7-server root=UUID=574912ac-8bd6-4cc7-90c6-8c5362033fec ro quiet splash vga=0x305
     73 initrd         /boot/initrd.img-2.6.27-7-server
     74 quiet
     75}}}
     76 * 用 modinfo 觀看 Ubuntu 8.10 Kernel 2.6.27-7-server 的 uvesafb 模組參數,發現包括 scroll、vgapal、pmipal、mtrr、blank、nocrtc、noedid、vram_remap、vram_total、maxclk、maxhf、maxvf、mode_option、vbemode、v86d。並沒有 mode 這個參數。
    5677{{{
    5778root@intrepid:~# modinfo uvesafb
     
    110131leaves the console in the broken state.
    111132}}}
    112  * 尋找合理懷疑對象:
     133 * 尋找合理懷疑對象(1):
    113134{{{
    114135root@intrepid:~/jfbterm-0.4.7# grep "KD_GRAPHICS" *
     
    124145 * [wiki:jazz/08-11-16 08-11-16@GMT-6 原紀錄 BUGFIX: jfbterm (2)]
    125146
    126  * 尋找合理懷疑對象:
    127 {{{
    128 root@intrepid:~/jfbterm-0.4.7# grep "KD_GRAPHICS" *
    129 vterm.c:        ioctl(0, KDSETMODE, KD_GRAPHICS);
    130 
    131 root@intrepid:~/jfbterm-0.4.7# grep "KD_TEXT" *
    132 main.c:        if (mode == KD_TEXT) {
    133 vterm.c:        ioctl(0, KDSETMODE, KD_TEXT);
    134 
     147 * 尋找合理懷疑對象(2):
     148{{{
    135149root@intrepid:~/jfbterm-0.4.7# grep "cannot mmap" *
    136150fbcommon.c:             die("cannot mmap(smem)");
     
    146160}}}
    147161 * 縱使用 gdb 還是無法正常跳回文字模式,因此直接追原始碼。
     162   * [後記] uvesafb 作者的猜測確實合理,因為已經進入圖形模式,除非跳回文字模式,否則所有輸入輸出都不會正常顯示在畫面上。
    148163 * 根據錯誤訊息,應該是錯在 fbcommon.c 的第 572 行,往前追造成錯誤的原因是 566 行的 mmap(),歸屬在 tfbm_open() 函數
    149164{{{
     
    230245 * [wiki:jazz/08-11-17 08-11-17@GMT-6 原紀錄 BUGFIX: jfbterm (3)]
    231246
    232  * 編輯 GRUB 的 menu.lst 就可以不用每次都跑 modprobe
    233 {{{
    234 #!diff
    235 --- menu.lst.org        2008-11-19 06:56:47.000000000 +0800
    236 +++ menu.lst    2008-11-19 06:56:21.000000000 +0800
    237 @@ -125,7 +125,7 @@
    238 
    239  title          Ubuntu 8.10, kernel 2.6.27-7-server
    240  uuid           574912ac-8bd6-4cc7-90c6-8c5362033fec
    241 -kernel         /boot/vmlinuz-2.6.27-7-server root=UUID=574912ac-8bd6-4cc7-90c6-8c5362033fec ro quiet splash
    242 +kernel         /boot/vmlinuz-2.6.27-7-server root=UUID=574912ac-8bd6-4cc7-90c6-8c5362033fec ro quiet splash vga=0x305
    243  initrd         /boot/initrd.img-2.6.27-7-server
    244  quiet
    245 }}}
    246247 * mmap 的 offset 參數必須是 sysconf 中定義 _SC_PAGE_SIZE 的倍數。('''offset''' must be a __'''multiple of the page size'''__ as returned by sysconf(_SC_PAGE_SIZE).)
    247248 * 使用 gdb 設定中斷點在 fbcomm.c 第 566 行並觀察變數狀態,可以知道送到 mmap 函數的 offset 參數內容為 1572864 。