[[PageOutline]] = 2008-11-16 = == Event: SC'08 == * SC'08 * 13:00-13:30: Cloud Computing and Grid Computing 360-Degree Compared - GCE08 @ Room 11AB. * [http://www.cels.anl.gov/events/conferences/SC08/schedule/index.php Argonne Booth(#558) Schedule] * [http://dev.globus.org/wiki/Outreach/SC2008 Globus Related Presentation Schedule] == BUGFIX: jfbterm (2) == * (續 [wiki:jazz/08-11-15 08-11-15@GMT-6])尋找合理懷疑對象: {{{ root@intrepid:~/jfbterm-0.4.7# grep "KD_GRAPHICS" * vterm.c: ioctl(0, KDSETMODE, KD_GRAPHICS); root@intrepid:~/jfbterm-0.4.7# grep "KD_TEXT" * main.c: if (mode == KD_TEXT) { vterm.c: ioctl(0, KDSETMODE, KD_TEXT); root@intrepid:~/jfbterm-0.4.7# grep "cannot mmap" * fbcommon.c: die("cannot mmap(smem)"); fbcommon.c: die("cannot mmap(mmio)"); fbcommon.c: print_message("cannot mmap(mmio) : %s\n", strerror(errno)); }}} * 啟用 DEBUG 旗標,編譯 jfbterm,使用 gdb 追蹤 {{{ root@intrepid:~/jfbterm-0.4.7# ./configure --enable-debug root@intrepid:~/jfbterm-0.4.7# make root@intrepid:~/jfbterm-0.4.7# gdb ./jfbterm (gdb) run }}} * 縱使用 gdb 還是無法正常跳回文字模式,因此直接追原始碼。 * 根據錯誤訊息,應該是錯在 fbcommon.c 的第 572 行,往前追造成錯誤的原因是 566 行的 mmap(),歸屬在 tfbm_open() 函數 {{{ < fbcommon.c > 482 void tfbm_open(TFrameBufferMemory* p) 566 p->mmio = (u_char*)mmap(NULL, p->mlen, PROT_READ|PROT_WRITE, 567 MAP_SHARED, p->fh, p->slen); 568 if ((long)p->mmio == -1) { 569 #ifdef JFB_MMIO_CHECK 570 die("cannot mmap(mmio)"); 571 #else 572 print_message("cannot mmap(mmio) : %s\n", strerror(errno)); 573 #endif }}} {{{ < main.c > 368 int main(int argc, char *argv[]) 431 tfbm_open(&gFramebuffer); }}} * 安裝 manpages-dev 套件,查 mmap 、 strerror 跟 errno 的 manpage。從 cannot mmap(mmio) : Invalid argument 這個錯誤訊息可以判斷 errno 等於 EINVAL。而 mmap 發生 EINVAL 的情形有三種,最可能的原因是第一個:We don't like addr, length, or '''offset''' (e.g., they are too large, or __'''not aligned on a page boundary'''__). * 這裡注意到 mmap 的 offset 參數必須是 sysconf 中定義 _SC_PAGE_SIZE 的倍數。('''offset''' must be a __'''multiple of the page size'''__ as returned by sysconf(_SC_PAGE_SIZE).) {{{ root@intrepid:~/jfbterm-0.4.7# apt-get install manpages-dev }}} {{{ root@intrepid:~/jfbterm-0.4.7# man errno EINVAL Invalid argument (POSIX.1) }}} {{{ void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); offset must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). ERRORS EINVAL We don't like addr, length, or offset (e.g., they are too large, or not aligned on a page boundary). EINVAL (since Linux 2.6.12) length was 0. EINVAL flags contained neither MAP_PRIVATE or MAP_SHARED, or contained both of these values. }}} * 使用 gdb 設定中斷點在 fbcomm.c 第 566 行並觀察變數狀態 {{{ root@intrepid:~/jfbterm-0.4.7# gdb (gdb) file jfbterm Reading symbols from /root/jfbterm-0.4.7/jfbterm...done. (gdb) set args -e ls (gdb) show args Argument list to give program being debugged when it is started is "-e ls". (gdb) break fbcommon.c:566 Breakpoint 1 at 0x4034ba: file fbcommon.c, line 566. (gdb) run ... 略 ... Breakpoint 1, tfbm_open (p=0x6146e0) at fbcommon.c:566 566 p->mmio = (u_char*)mmap(NULL, p->mlen, PROT_READ|PROT_WRITE, (gdb) l 561 } 562 p->smem = (char *)p->smem + p->soff; 563 564 p->moff = (u_long)(fb_fix.mmio_start) & (~PAGE_MASK); 565 p->mlen = (fb_fix.mmio_len + p->moff + ~PAGE_MASK) & PAGE_MASK; 566 p->mmio = (u_char*)mmap(NULL, p->mlen, PROT_READ|PROT_WRITE, 567 MAP_SHARED, p->fh, p->slen); 568 if ((long)p->mmio == -1) { 569 #ifdef JFB_MMIO_CHECK 570 die("cannot mmap(mmio)"); (gdb) p fb_fix.mmio_len $1 = 0 (gdb) p p->moff $2 = 0 (gdb) p p->mlen $3 = 0 (gdb) p p->fh $4 = 6 (gdb) p p->slen $5 = 1572864 (gdb) p fb_fix.smem_len $6 = 1572864 }}} == UCIMF - jfbterm patch (中文輸入) == * S 大說: 等解完 jfbterm 的 BUG 之後,可以考慮看一下 jfbterm 的中文輸入 * [http://groups.google.com/group/ucimf/ UCIMF] - Unicode Console Input Method Framework * http://ucimf.sourceforge.net/ - 在 Unicode Console 環境下, 提供外掛輸入法支援的函式庫架構. * [http://moto.debian.org.tw/viewtopic.php?p=54330&highlight=#54330 <問題> 如何編譯ucimf] * [http://blog.xuite.net/porpoise/blog/19454958 使用 FrameBuffer 更高解析度的開機參數]: {{{ vga=0x303 (for 800 x 600) or vga=771 vga=0x305 (for 1024 x 768) or vga=773 vga=0x307 (for 1280 x 1024) or vga=775 }}} * [http://wiki.ubuntu-tw.org/index.php?title=UbuntuL10n#jfbterm UbuntuL10n - jfbterm] * [http://wiki.debian.org.hk/w/Make_Debian_support_Chinese_and_other_language 令 Debian 支援中文其他語言] == Debian == * [http://lists.debian.org/debian-devel-announce/2008/11/msg00002.html Debian Installer lenny release candidate 1] * [http://cdimage.debian.org/cdimage/lenny_di_rc1/ Debian 5.0 RC1 光碟下載] * 原來 Lenny 是這隻雙筒望眼鏡呀?! [[BR]][[BR]][[Image(http://www.linuxdevices.com/files/misc/pixar_toy_story_lenny_cap.jpg)]] * [http://blog.seety.org/everydaywork/2007/4/25/669/ screenrc 範例] * [備註] 拿掉時鐘的部份,以免造成往上捲動會不斷被拉回的困擾。 {{{ $ cat > .screenrc <