[ANNOUNCE] Native Linux KVM tool

Date: Thu, 31 Mar 2011 20:30:56 +0300
From: Pekka Enberg 
To: linux-kernel@vger.kernel.org
Cc: aarcange@redhat.com, avi@redhat.com, mtosatti@redhat.com,
        kvm@vger.kernel.org, joro@8bytes.org, penberg@cs.helsinki.fi,
        asias.hejun@gmail.com, gorcunov@gmail.com, mingo@elte.hu
Subject: [ANNOUNCE] Native Linux KVM tool

Hi all,

We’re proud to announce the native Linux KVM tool!

The goal of this tool is to provide a clean, from-scratch, lightweight
KVM host tool implementation that can boot Linux guest images (just a
hobby, won't be big and professional like QEMU) with no BIOS
dependencies and with only the minimal amount of legacy device
emulation.

Note that this is a development prototype for the time being: there's no
networking support and no graphics support, amongst other missing
essentials.

It's great as a learning tool if you want to get your feet wet in
virtualization land: it's only 5 KLOC of clean C code that can already
boot a guest Linux image.

Right now it can boot a Linux image and provide you output via a serial
console, over the host terminal, i.e. you can use it to boot a guest
Linux image in a terminal or over ssh and log into the guest without
much guest or host side setup work needed.

1. To try out the tool, clone the git repository:

  git clone git://github.com/penberg/linux-kvm.git

or alternatively, if you already have a kernel source tree:

  git checkout -b kvm/tool
  git pull git://github.com/penberg/linux-kvm.git

2. Compile the tool:

  cd tools/kvm && make

3. Download a raw userspace image:

  wget http://wiki.qemu.org/download/linux-0.2.img.bz2 && bunzip2
linux-0.2.img.bz2

4. Build a kernel with CONFIG_VIRTIO_BLK=y and
CONFIG_SERIAL_8250_CONSOLE=y configuration options. Note: also make sure
you have CONFIG_EXT2_FS or CONFIG_EXT4_FS if you use the above image.

5. And finally, launch the hypervisor:

  ./kvm --image=linux-0.2.img --kernel=../../arch/x86/boot/bzImage

The tool has been written by Pekka Enberg, Cyrill Gorcunov, and Asias
He. Special thanks to Avi Kivity for his help on KVM internals and Ingo
Molnar for all-around support and encouragement!

See the following thread for original discussion for motivation of this
project:

http://thread.gmane.org/gmane.linux.kernel/962051/focus=962620

			Pekka

关于 Erlang

erlang 是一门内建支持并发的编程语言,起初是为开发通讯系统设计的,1998年开放源码,适合于构建分布式、实时软并行计算系统。erlang的分布式机制是透明的,程序并不知道
自己是分布式运行,所以编写分布式应用更简单些。
有人称erlang是OS中的OS,并且是自举的,少量核心代码是C实现的。
erlang运行是启动许多轻量级进程,进程间通过消息机制进行通信,不共享内存/变量,所以不存在同步问题。erlang进程可被映射到主机进程或线程,甚至是多台几期的多个进程/>线程。erlang调度不同机器上的进程是在传输层之上,考虑到安全问题,需要对通信进行加密(如ssl)。这里的网络也是依靠OTP(Open Telecom Platform)提供,所以损耗系统资源较小。OPT是一个基于erlang的高并发开发环境。
在云计算中,每个虚拟机就是一个具备执行能力的结点,可以利用erlang的并发机制,将执行任务分布到不同的虚拟机上,使用消息机制进行通信。
erlang语法很怪异,不管是变量赋值、循环实现、函数执行流程等。
-- hello.erl ----------------------------
-module(hello).
-export([hello/0]).

hello() ->
    io:fwrite("Hello, World!∼n", []).
-- compile, execute  --------------------
ekmac:~ ek$ erl
1> c("hello.erl").
{ok,hello}
2> hello:hello().
Hello, World!
ok
3> init:stop().
ok
4> ekmac:~ ek$

推荐基本书、链接:

erlang.org
erlang-china.org
docs.huihoo.com/erlang/
Thinking in erlang
Programming erlang (详读)
erlang程序学习笔记

20110404 玉渊潭.赏樱花

昨天和磊子、阿龙,骑自行车向北跑了五十多里,阳光、风儿都不错,只是路上骑车尾气、尘土让人难受。中午去吃了顿烧烤火锅自助,早早回家休息。
今天又和阿龙、小刘、闫姣,一起去了趟玉渊谭赏樱花。这活动是中科院读研的吴玉龙组织的,除了老校友,还有很多他的同学朋友,有在中科院读研的,有刚刚从上海上学毕业的,还有几个在北京工作了的。今天主要活动就是玩两种杀人游戏,虽说是打着赏樱花的旗号,但樱花没看几眼,甚至连公园都没转一圈。
刚开始,游戏规则不清楚,大家也生疏,感觉没啥意思。一两局后,大家都放开了,各种论战激烈展开。我的战绩很不错,当杀手一个人战斗到底了两三局,最终获胜!晚上接着腐败,吃火锅,接着玩到十点多。
明天还没安排,可能看看书,睡个懒觉,也有可能骑车出去逛逛。

Photo: http://photo.renren.com/photo/sp/hesr84EYwGq

正则表达式【from javaeye.com/iteye.com】

From : http://www.iteye.com/wiki/Regular-Expression/910-%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E5%AD%A6%E4%B9%A0

正则表达式是个好东西,就是有些复杂.在验证输入,字符串查找,处理上确实很方便.

30分钟教程http://www.unibetter.com/deerchao/zhengzhe-biaodashi-jiaocheng-se.htm

D可使用的表达式:http://www.digitalmars.com/ctg/regular.html

常用的元字符
. 匹配除换行符以外的任意字符
w 匹配字母或数字或下划线或汉字
s 匹配任意的空白符
d 匹配数字
b 匹配单词的开始或结束
^ 匹配字符串的开始
$ 匹配字符串的结

Continue reading “正则表达式【from javaeye.com/iteye.com】”