Changes between Version 1 and Version 2 of jazz/jfbterm
- Timestamp:
- Nov 21, 2008, 1:39:48 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TabularUnified jazz/jfbterm
v1 v2 34 34 Segmentation fault 35 35 }}} 36 * [備註] 如果沒有 modprobe uvesafb 的話,會缺少 /dev/fb0,因此當執行 jfbterm 時就會出現以下錯誤訊息 37 {{{ 38 ENCODING: locale = UTF-8 39 FONT : (4) [iso10646.1]/pcf/U:///usr/share/fonts/X11/misc/unifont.pcf.gz/ 40 encoding : UTF-8,iso10646.1 41 exec : ls open /dev/fb0: No such file or directory 42 }}} 36 43 * [備註] 如果沒有裝 v86d 的話,當執行 modprobe uvesafb 時會在 dmesg 看到以下資訊 37 44 {{{ … … 53 60 [ 269.938101] fb0: VESA VGA frame buffer device 54 61 }}} 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 這個參數。 56 77 {{{ 57 78 root@intrepid:~# modinfo uvesafb … … 110 131 leaves the console in the broken state. 111 132 }}} 112 * 尋找合理懷疑對象 :133 * 尋找合理懷疑對象(1): 113 134 {{{ 114 135 root@intrepid:~/jfbterm-0.4.7# grep "KD_GRAPHICS" * … … 124 145 * [wiki:jazz/08-11-16 08-11-16@GMT-6 原紀錄 BUGFIX: jfbterm (2)] 125 146 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 {{{ 135 149 root@intrepid:~/jfbterm-0.4.7# grep "cannot mmap" * 136 150 fbcommon.c: die("cannot mmap(smem)"); … … 146 160 }}} 147 161 * 縱使用 gdb 還是無法正常跳回文字模式,因此直接追原始碼。 162 * [後記] uvesafb 作者的猜測確實合理,因為已經進入圖形模式,除非跳回文字模式,否則所有輸入輸出都不會正常顯示在畫面上。 148 163 * 根據錯誤訊息,應該是錯在 fbcommon.c 的第 572 行,往前追造成錯誤的原因是 566 行的 mmap(),歸屬在 tfbm_open() 函數 149 164 {{{ … … 230 245 * [wiki:jazz/08-11-17 08-11-17@GMT-6 原紀錄 BUGFIX: jfbterm (3)] 231 246 232 * 編輯 GRUB 的 menu.lst 就可以不用每次都跑 modprobe233 {{{234 #!diff235 --- menu.lst.org 2008-11-19 06:56:47.000000000 +0800236 +++ menu.lst 2008-11-19 06:56:21.000000000 +0800237 @@ -125,7 +125,7 @@238 239 title Ubuntu 8.10, kernel 2.6.27-7-server240 uuid 574912ac-8bd6-4cc7-90c6-8c5362033fec241 -kernel /boot/vmlinuz-2.6.27-7-server root=UUID=574912ac-8bd6-4cc7-90c6-8c5362033fec ro quiet splash242 +kernel /boot/vmlinuz-2.6.27-7-server root=UUID=574912ac-8bd6-4cc7-90c6-8c5362033fec ro quiet splash vga=0x305243 initrd /boot/initrd.img-2.6.27-7-server244 quiet245 }}}246 247 * mmap 的 offset 參數必須是 sysconf 中定義 _SC_PAGE_SIZE 的倍數。('''offset''' must be a __'''multiple of the page size'''__ as returned by sysconf(_SC_PAGE_SIZE).) 247 248 * 使用 gdb 設定中斷點在 fbcomm.c 第 566 行並觀察變數狀態,可以知道送到 mmap 函數的 offset 參數內容為 1572864 。