May 28, 2004

修正一下

seti@home还是有linux版的
只是奇怪怎么那么麻烦
先setiathome -graphics &
然后xsetiathome


6月1日,想明白了,很多人或很多机器
没有XWindow,或不在X下干活
SETI是希望他们也能帮上忙
:)

Posted by hufey at 12:07 AM | Comments (0)

May 26, 2004

4km wifi range w/ $5 diy


一个新西兰哥们用罩笠Chinese cookware scoops
可以收到5KM的Wifi信号
花了5$

-------------------------
一个罩笠有那么贵吗?

Posted by hufey at 10:32 AM | Comments (0)

May 25, 2004

《Linux Kernel Development》Note 2

A Beast of a Different Nature

  • The Kernel does not have access to the C library.

  • The kernel is coded in GNU C

  • The kernel lacks memory protection like user-space

  • The kernel cannot easily use floating point

  • The kernel has a small fixed-size stack

  • Because the kernel has asynchronous interrupts, is preemptive, and supports SMP, synchronization and concurrency are concerns within the kernel.

  • Portability is important.
  • No libc

    There are multiple reasons for this, including some chicken and the egg situations, but the primary reason is speed and size. The full C library -- or even a decent subset of if -- is too large and too inefficient for the kernel.

    GNU C

    Like any self-respecting Unix kernel, the Linux kernel is programmed in C. Perhaps surprising, the kernel is not programmed in strict ANSI C. Instead, where applicable, the kernel developers make use of various language extensions available in gcc.

    The kernel developers use both ISO C99 and GNU C extensions to the C language. These changes wed the Linux kernel to gcc , although recently compilers, such as the Intel C compiler, have sufficiently supported enough gcc features that they too an compile the Linux kernel. The ISO C99 extensions that the kernel uses are nothing special and, because C99 is an official revision of the C language, are slowly cropping up in a lot of other code. The more interesting, and perhaps unfamiliar, deviations from standrd ANSI C are those provided by GNU C. Let's look at some of the more interesting extensions that may show up in kernel code.

    Inline Function

    Inline Assembly

    Branch Annotation

    The kernel wraps the directive in very easy to use macros, likely() unlikely() .

    No Memory Protection
    When a user-space application attempts an illegal memory access, the kernel can trap the error and kill the process. If the kernel attempts an illegal memory access, the results are less controlled. Memory violations in the kernel result in an oops, which is a major kernel error. It should go without saying that you must not access illegal memory, dereference a NULL pointer, and so on -- but within the kernel, the stakes are much higher!

    Additionally, kernel memory is not pageable. Therefore, every byte of memory you consume is one less byte of available physical memory. Keep that in mind next time you have to add one more feature to the kernel!

    No (Easy) Use of Floating Point
    Unlike user-space, the kernel does not have the luxury of seamless support for floating point. Using floating point inside the kernel requires manually saving and restoring the floating point registers, among possible other chores. The short answer is: Don't do it; no floating point in the kernel.

    Small, fixed Size Stack
    The kernel stack is neither large nor dynamic; it is small and fixed in size. The kernel stack is fixed at 8KB on 32-bit architectures and 16KB on most 64-bit architectures.
    For more discussion on the kernel stack, see the section Statically Allocating on the Stack in Chaper 10, "Memory Management".

    Synchronization and Concurrency

    Portability Is Important

    Posted by hufey at 10:02 PM | Comments (0)

    《Linux Kernel Development》 note 1

    Linux Versus Classic Unix Kernels

  • Linux supports the dynamic loading of kernel module. Although the linux kernel is monolithic, it is capable of dynamically loading and unloading kernel code on demand.
  • Linux has symmetrical multiprocessor ( SMP ) support. Although many commercial variants of Unix now support SMP, most traditional Unix implementations did not.

  • The Linux kernel is preemptive. Unlike traditional Unix variants, the Linux kernel is capable of preempting a task if it is running in the kernel. Of the other commercial Unix implementations, Solaris and IRIX have preemptive kernels.

  • Linux takes an interesting approach to thread support: It does not differentiate between threads and normal processes. To the kernel, all processes are the same some just happen to share resources.

  • Linux ignores some common Unix features that are thought to be poorly implemented, such as STREAMS, or standards that are brain dead.

  • Linux is free in every sense of the word. The feature set Linux implements is the result of the freedom of Linux's open development model. If a feature is without merit or poorly thought out, the Linux developers are under no obligation to implement it. To the contrary, Linux has adopted an elitist attitude toward changes: Modifications must solve a specific real-world problem, have a sane design, and have a clean implementation. Consequently, features of some other modern Unix variants, such as pageable kernel memory, have received no consideration. Despite and differences, Linux remains an operating system with a strong Unix heritage.
  • Posted by hufey at 09:45 PM | Comments (0)

    May 23, 2004

    apt-get update: Dynamic MMap ran out of room的解决

    apt-get error

    若apt-setup出現"E:Dynamic MMap ran out of room"錯誤,在/etc/apt/apt.conf
    加入
    APT
    {
    Cache-Limit "141943904"
    }
    增加cache的可用空間。

    google来的,来自台湾龍潭國小drbl學習日誌 :)

    Posted by hufey at 02:13 PM | Comments (0)

    May 22, 2004

    一下子退回到原始社会

    装了debian 3.0的第一张盘,只有基本系统
    印象里安装过程没有问过我要不要设网卡IP什么的
    启动之后发现只有lo
    ifconfig -a后发现eth0设成了自动ip
    只好自己改interfaces的内容再ifup什么的

    问题:我现在家里用一台台式机ADSL上网,做Proxy Server
    IP地址是192.168.0.1,DNS,GATEWAY都是它
    笔记本固定IP地址设好后,能ping到192.168.0.1的机器
    ping 不通外边的名字或地址
    但是我用base-config,tasksel居然可以下载pkg!
    我虽然可以下载了,但是另一个console仍然不能ping通外边

    Posted by hufey at 08:42 PM | Comments (0)

    May 19, 2004

    手机上的三百万象素数码相机


    又是CASIO
    看来我快等到了

    Posted by hufey at 01:26 PM | Comments (0)

    May 17, 2004

    nfs /etc/exports 注意事项

    linux下跟Unix格式不同
    linux下是 *(rw,no_root_squash) 之类的
    Unix下是 -rw ,具体各个版本间Unix有什么区别还不知道

    另外export后remount成 rw 依然 有可能permission denied
    那是本身export出去的目录还不能写
    所以要想nfs export出去一个可写的目录,至少
    几个地方都要写对
    /etc/exports 要加 rw
    mount -t nfs -o remount,rw ...
    本身目录也是有 w

    Posted by hufey at 03:14 PM | Comments (0)

    May 16, 2004

    M$也开始叫patch了

    用MSBA查安全问题
    发现很多patch真的叫patch了
    嘿嘿

    Posted by hufey at 10:52 PM | Comments (0)

    May 12, 2004

    双64位CPU能干什么?

    俺们拿到一台双AMD Optron 64位CPU 1G PC733内存的机器
    居然想不起来该用她干点啥
    最后还是装了个SETI的client
    没事找找外星仁吧。。。。。。

    SETI居然没有Unix/Linux下的client

    Posted by hufey at 07:00 PM | Comments (0)

    May 11, 2004

    装了Ximian Desktop 2

    真漂亮
    装了CrossOver Office
    装了kernel 2.6.6

    Posted by hufey at 05:14 PM | Comments (0)

    May 10, 2004

    今天犯了个严重错误!

    发现/opt分区太小,windows留的分区太大
    用pqmagic挪鸭挪
    结果/boot是不能挪的,挪的linux不能启动了
    只好重装 :(

    Posted by hufey at 04:10 PM | Comments (0)

    May 09, 2004

    modutils 2.4.xx和mod-init-tools 0.9.xx不是一码事

    自己弄混了这么多年
    惭愧!

    Posted by hufey at 01:02 PM | Comments (0)

    May 08, 2004

    过了杆考

    好惨,今天she了好几个,昨天试考试车的时候还懵呢
    今天过得很顺利,一次通过
    后来听同时考试的一个兄弟说
    平时练的都是2.5x9,考试其实是2.55x9
    虽然只有5cm,但在后视镜里的差别还是蛮大的
    好几次都找不到杆儿

    Posted by hufey at 06:34 PM | Comments (0)

    May 01, 2004

    ddj中文版终于关张了

    看来订户还是太少啊
    俺没订全年的算是对了
    否则这会儿退钱什么的多麻烦

    本来不错的咚咚
    拿到国内还是超前了
    想当初jjhou还满怀妒意地说羡慕大陆有台湾没有聂
    大陆也就搞了8期嘛

    说什么刊号下不来,感情8期非法出版物啊?
    下一个撑不下去的就会是 www.china-pub.com

    服务越来越差了

    Posted by hufey at 07:46 PM | Comments (2)