Tuesday, January 29, 2008

无法规避, 巨大的孤寂.

我一个人.我一个人.我一个人.

树欲静而风不止,子欲养而亲不待.

Saturday, January 12, 2008

Everything on Solaris 10 with a user account

If getting used to GNU/Linux, using pure unix is suffering. To make things worse, I only have a regular user acount. Hands are really tight. Not until now do I appreciate GNU tools, very smart and powerful.


1. make pdflatex.fmt
pdftex -ini -fmt=pdflatex.fmt latex.ltx


2. install AucTeX for emacs
./configure --prefix=/home/cps536-n1.07/elisp # install package
--with-lispdir=/home/cps536-n1.07/elisp # install auctex.el
--with-texmf-dir=/home/cps536-n1.07/texmf-local/ # put config in texmf

make; make install


note: if pdflatex is not working, to compile auctex, just open $auctex-install-dir/preview/latex/Makefile.in, and delete lines that test pdflatex.

3. make TAGS of linux kernel with i386 platform, under emacs
cd $Linux-kernel-dir;
find include/linux/ fs/ init/ ipc/ kernel/ lib/ mm/ net/ arch/i386/ -type f -iregex .*\.[csh] -exec etags -a '{}' -o kernel-TAGS \;
Useful hot keys:
M-. tag
Find first definition of tag (find-tag).
C-u M-.
Find next alternate definition of last tag specified.
C-u - M-.
Go back to previous tag found.
C-M-. pattern
Find a tag whose name matches pattern (find-tag-regexp).
C-u C-M-.
Find the next tag whose name matches the last pattern used.
C-x 4 . tag
Find first definition of tag, but display it in another window
(find-tag-other-window).
C-x 5 . tag
Find first definition of tag, and create a new frame to select the
buffer (find-tag-other-frame).
M-*
Pop back to where you previously invoked M-. and friends.
4. The purpose of __init:

__init tells GCC to put the function in a special section. These functions are
only used during booting, and are removed from memory after boot (see the
"Freeing unused kernel memory: 200k freed" or similar boot message.

5. Funny. If adding "exec bash" in .cshrc, I cannot login to OpenWindows, while change it to "bash", everything is OK. Still wonder when it executes .cshrc.

6. read entire file using c:
  fseek(input, 0L, SEEK_END);  /* Position to end of file */
lFileLen = ftell(input); /* Get file length */
rewind(input); /* Back to start of file */
fread(str, lFileLen, 1, input);