Android 1.6 NDK, Release 1 | Android Developers
http://developer.android.com/sdk/ndk/1.6_r1/index.html
anroid ndk文档翻译之一:android ndk一览 – Android专区 – 搜狐开发者公社 – iPhone,Android,Symbian手机开发者交流专区
http://mi.it.sohu.com/forums/redirect.php?tid=116&goto=lastpost
用YLMF提供的Wubi-hd.exe进Ylmf-linux-Y1.15.iso的LiveCD模式成功|Ylmf OS 学习园地 – 雨林木风交流论坛[WwW.YlmF.Net] – 专业的电脑技术精英培养基地!
http://www.ylmf.net/read.php?tid=1372183
关于linux下APACHE+SVN_筱子未央_百度空间
http://hi.baidu.com/xclist/blog/item/5ef7caf4154d2c64dcc474eb.html
Linux下apache和svn的整合 – - JavaEye技术网站
http://silencon.javaeye.com/blog/455690
安装了apache后,接下来可以和svn整合在一起了
1.先下载svn的tar.gz包
2.解压 tar zxf svbversion.1.4.0.tar.gz
3.配置 ./configure –with-apxs=/opt/apache/bin/apxs –prefix=/opt/subversion –with-apr=/opt/apr –with-apr-util=/opt/apr-util
4.make(当时make出错)
错误是cannot find lexpat
解决办法是:安装 sudo apt-get install expat
之后做两个连接:ln -sf /usr/lib/libexpat
ln -sf /usr/lib/libexpat.so.1 /usr/lib/libexpat.so
5.再一次编译 make
6.makestall
7.成功之后查看,在apache/modules 里面是否多了2个跟svn相关的.so 文件
还有就是在apache/conf/httpd.conf 文件的最后是否多了两行Loadmodule 跟是svn的内容
8.到/opt/svbversion1.4.0/bin
执行 sudo ./svnadmin create /home/svnroot/test1 //创建svn库
9.httpd.conf下添加如下内容
<Location /svn>
DAV svn
SVNPath /home/svnroot/test1
<Location>
10启动apache
Linux系统RedHat9.0 上配置SVN+APACHE服务参考 – Tech – JavaEye论坛
http://www.javaeye.com/topic/470516
svn 代码库创建 简单手册 – 项目管理 – develop – JavaEye论坛
http://www.javaeye.com/topic/290278
为何父文件夹不能看到版本库? – Windows下Subversion安装使用 – SVN中文论坛 – Powered by Discuz!
http://www.iusesvn.com/bbs/thread-72-1-1.html
解决了svn的问题:”Could not open the requested SVN filesystem”_游戏角色空间_百度空间
http://hi.baidu.com/gamerole/blog/item/562ccaef7b244236acafd5ca.html
svn again Could not open the requested SVN filesystem error after recovery — Windows Live
http://dulltechman.spaces.live.com/Blog/cns!E4697FC9DEE0B7B1!134.entry
–解决了svn的问题:”Could not open the requested SVN filesystem”
http://www.w3china.org/blog/more.asp?name=lhwork&id=32236
TortoiseSVN访问VisualSVN Server:Could not open the requested SVN filesystem。解决方法!! – sahusoft的专栏 – CSDN博客
http://blog.csdn.net/sahusoft/archive/2009/07/26/4381278.aspx
Linux下apache+svn的安装与配置 – itkan的专栏—在路上 – CSDN博客
http://blog.csdn.net/itkan/archive/2008/06/12/2539372.aspx
修改apache配置文件,该文件位于/usr/local/apache/conf/httpd.conf
//找到下列语句,如果没有则自行添加
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
//在后面添加
<Location /svn>
DAV svn
SVNParentPath /home/svnroot/repository/ //svn父目录
AuthzSVNAccessFile /home/svnroot/repository/authz.conf //权限配置文件,本文件需要自己建立
AuthType Basic //连接类型设置
AuthName “Subversion.zoneyump” //连接框提示
AuthUserFile /home/svnroot/repository/passwd //用户配置文件,通过htpasswd命令添加
Require valid-user //采用何种认证
</Location>
7、 权限管理
(1)增加用户
# htpasswd -c /home/svnroot/repository/authfile 用户名
//第一次设置用户时使用-c表示新建一个用户文件。回车后输入用户密码,完成对用户的增加
# htpasswd /home/svnroot/repository/authfile 用户名(加入新的用户,就不用-c了)
(2)权限分配
# vi /home/svnroot/repository/authz.conf
[groups]
admin=useradmin
devteamcs = useradmin,user1,user2//这里定义了一个用户组
[/]//对所有的项目,所有的用户都有读权限,admin用户有读写权限
@admin = rw
* = r
[test:/]//对test项目,
@devteamcs = rw
8、 修改/usr/local/apache/conf/httpd.conf文件,找到以下两行:
User daemon
Group daemon
// 将daemon改为svnroot,组也做相应更改,让apache进程以svnroot的身份运行
//改完后是这个样子
User svnroot
Group svn
9、 启动apache命令
# /usr/local/apache/bin/apachectl start(restart,stop)
访问http://localhost/svn/test ,现在需要身份验证,且通过验证后应该可以看到信息
标签:Android, apache, linux, svn
Linux下如何测试及使用USB转串口线_我的天涯
http://hi.baidu.com/freedom_asic/blog/item/dcb145181192750234fa4131.html
Linux下如何测试及使用USB转串口线
2008-06-10 10:38
1、将设备u口插入pc
2、输入#lsmod 先看看能否检测到这个设备,就看有没有pl2303字眼可以了。如果有,则不需要再装驱动。另外如果有的话最好再用dmesg | grep usb查找如果看到:
“drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic”
就说明设备已被识别,然后往下看
drivers/usb/serial/usb-serial.c: USB Serial support registered for PL-2303
usb 2-2: PL-2303 converter now attached to ttyUSB0 (or usb/tts/0 for devfs)如果没有则需要驱动程序,一般硬件厂商都会提供,如果真的没有的话就只有到网上下载了,一般2.6内核以上的都支持。
安装完毕后再输入这个命令瞧瞧,是否安装成功。说明我的usb转串口芯片是PL-2303,对应系统设备是 dev/usb/ttUSB0,最后只需在minicom配置文件里将端口改成/dev/usb/ttyUSB0就可以使用了:)
3、检测步骤,检测步骤如下,只是需要主意的是设置串口设备的时候可能不是ttyS2了,有可能是ttyUSB0或者ttyUSB1等之类的,我这里就是ttyUSB0(我用的是Fedora Core 8)。 因此,最好请您先看一下/dev下面的文件。
USB转串口安装 型号PL2303h
1、插入USB转串口到主机,
2、启动 Linux,打开终端,检查是否存在设备/dev/ttyUSB0,如果没有就建立一个:
mknod /dev/ttyUSB0 c 188 0
如果有多个USB口,可以类推,建立/dev/ttyUSB[1-n],注意从设备号要累加,
如:mknod /dev/ttyUSB[1-n] c 188 [1-n]
3、输入命令:#setserial /dev/ttyS0 -aP (COM-1)
显示内容:/dev/ttyS0, Line 0, UART: 16550A, Port: 0×3f8, irq: 4
Baud_base: 115200, clos_delay: 50, divisor: 0
closing_wait: 3000, closing_wait2: infinite
Flags: spd_normal skip_test
4、输入命令:#setserial /dev/ttyS2 -a (COM-3)
显示内容:/dev/ttyS2, Line 2, UART: unknown, Port: 0×3e8, irq: 4
Baud_base: 115200, clos_delay: 50, divisor: 0
closing_wait: 3000, closing_wait2: infinite
Flags: spd_normal skip_test
第3、4步操作的目的主要是对主机自带串口及PCI扩展串口的区别。区别在于4显示的内容中UART:未知unknow。不过若您检测这一步的时候 UART为16550A而不是unknow,证明你的系统已经认识了扩展的串口,不需要进一步设置,直接跳入第8步测试就可以了。
5、设置好了后是不是需要测试一下是否能够通讯呢?最好的办法是两台pc相连。如果pc为windows操作系统就用超级终端,是linux呢就用minicom吧
6、装有linux的机器,首先需要设置一下监听的串口参数,输入命令
#minicom -s
进入界面后有个框弹出来,如果你学过英文的话,就会知道选择哪个的。应该是第三个吧,串口参数设置。
将第一行更改为 /dev/ttyUSB0
波特率也更改您所需要的。
更改完后保存,保存的那个菜单应该是 save … df1
最后 exit
7.重启minicom, 复位目标板,看是否有打印信息?如果没有请确认:a)USB/串口线没问题,b)确认你使用的USB口是第一个(一个个的试吧,一般电脑不会标示出来)
在另外一台机器发送数据,这台机器minicom界面就能够收到信息了。另外不要把两个COM顺序弄翻了,如果弄错了哪个是COM3 COM4测试可就不灵便咯。
Linux下如何测试及使用USB转串口线_我的天涯
http://hi.baidu.com/freedom_asic/blog/item/dcb145181192750234fa4131.html
C# USB转串口突然拔出检测解决方案 – 秋的专栏 – CSDN博客
http://blog.csdn.net/wuqiubin/archive/2008/01/18/2052182.aspx
VMware Image – Mono
http://mono-project.com/VMware_Image
resizable and movable controls的开源代码 – 源码搜搜
http://search.codesoso.com/Search?q=resizable+and+movable+controls&start=61
bash: ifconfig: command not found – 东方欲晓 --让智慧的花朵开满2009 – JavaEye技术网站
http://gnn.javaeye.com/blog/515800
ImageComponent.NET | Create a movable usercontrol in WPF part II
http://blog.imagecomponent.net/post/Create-a-movable-usercontrol-in-WPF-part-II.aspx
CodeProject: Create a movable usercontrol in WPF part I . Free source code and programming help
http://www.codeproject.com/KB/WPF/BaseAnimationControl.aspx
CodeProject: Create a movable usercontrol in WPF part II. Free source code and programming help
http://www.codeproject.com/KB/WPF/MovingTargets.aspx
ResizingAdorner Sample
http://msdn.microsoft.com/en-us/library/ms771714.aspx
CodeProject: Dragging Elements in a Canvas. Free source code and programming help
http://www.codeproject.com/KB/WPF/DraggingElementsInCanvas.aspx?df=100&forumid=335963&exp=0&select=2324355
我的FC9中怎么连fdisk, shutdown这些基本命令用不了? – LinuxSir.Org
http://www.linuxsir.org/bbs/thread334166.html
老头_列表_Linux博客/红联Linux博客 – powered by X-Space
http://www.linuxdiyf.com/blog/?63516/action_spacelist_type_blog.html
Debian: ‘bash: id: command not found’ beim Login – Privates Blog von Karsten Gresch
http://blog.gresch.de/index.php?/archives/262-Debian-bash-id-command-not-found-beim-Login.html
bash出错:-bash: id: command not found – UNIX Resources Network
http://www.unixresources.net/linux/clf/vrml/archive/00/00/45/93/459310.html
CentOS 5.2 下用Yum安装Apache+PHP+MySQL环境 – 石灰呤的日志 – 网易博客
http://wqbboy.blog.163.com/blog/static/129500658200996113045849/
RHEL5/CentOS5 轻松安装 Subversion+apache+mysql+ssl – 红联Linux门户 – 中国领先的Linux技术网站 – 网站导航 – Linux企业应用 – Linux服务器应用
http://www.linuxdiyf.com/viewarticle.php?id=67267
The WPF Resizing Adorner for Canvas — Windows Live
http://dvuyka.spaces.live.com/Blog/cns!305B02907E9BE19A!124.entry
Linux 命令及可执行程序路径的设置 | LinuxSir.Org
http://www.linuxsir.org/main/?q=node/26
Linux—设定命令的搜索路径-Linux认证考试-考试大
http://www.examda.com/linux/fudao/20080723/140908461.html
solution no listening sockets available, shutting down
http://www.davtheultimate.com/solution-no-listening-sockets-available-shutting-down
suse 的 YaST_muskycn
http://hi.baidu.com/muskycn/blog/item/baa040239d2a4543ac34de13.html
yast命令_思考之屋
http://hi.baidu.com/%CE%DE%B7%A8%CE%DE%D5%C5/blog/item/1f93847b7c5c65f20ad18705.html
YaST (Yet Another Setup Tool) – waterye – BlogJava
http://www.blogjava.net/waterye/archive/2005/11/12/19434.html
YaST 本地更新 – openSUSE
http://cn.opensuse.org/YaST_%E6%9C%AC%E5%9C%B0%E6%9B%B4%E6%96%B0
yast是什么意思_百度知道
http://zhidao.baidu.com/question/101161685.html
SUSE FAQ 系列 — 配置网关和路由_speiwak的空间
http://hi.baidu.com/speiwak/blog/item/03f47eee425328e5cf1b3ee3.html
VMWare workstation 6下SuSE 10安装VMTools步骤(转)_╰☆蓝色的雨
http://hi.baidu.com/ap3255/blog/item/9f137d352899a1315bb5f523.html
20080307 windows c socket soap
http://www.yippeesoft.com
arm-elf-gcc -nostartfiles -Wl, -elf2flt -o sockaspx socketaspx.c -I/home/sf/sfsf/uClinux-IST/uClibc/include -L/home/sf/sfsf/uClinux-IST/uClibc/lib -fpermissive /home/sf/sfsf/uClinux-IST/lib/uClibc/lib/crt0.o -lc -lpthread -lm
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#define PORT 5566 /* the port client will be connecting to */
#define MAXDATASIZE 1500 /* max number of bytes we can get at once */
int main(int argc, char *argv[])
&leftsign;
int sockfd, numbytes;
char buf[MAXDATASIZE] ;
char* req="POST /test/websrvtest/s.asmx HTTP/1.1\\r\\n"
"Host: www.yippeesoft.com:5566\\r\\n"
"User-Agent: gSOAP/2.7\\r\\n"
"Content-Type: text/xml; charset=utf-8\\r\\n"
"Content-Length: 481\\r\\n"
"Connection: close\\r\\n"
"SOAPAction: \\"http://tempuri.org/HelloWorld\\"\\r\\n\\r\\n"
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>\\n"
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=\\"http://schemas.xmlsoap.org/soap/envelope/\\" xmlns:SOAP-ENC=\\"http://schemas.xmlsoap.org/soap/encoding/\\" xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns:xsd=\\"http://www.w3.org/2001/XMLSchema\\" xmlns:ns2=\\"http://tempuri.org/Service1Soap\\" xmlns:ns1=\\"http://tempuri.org/\\" xmlns:ns3=\\"
struct hostent *he;
struct sockaddr_in their_addr; /* connector\’s address information */
if(argc != 2)
&leftsign;
fprintf(stderr,"usage: client hostname\\n");
exit(1);
&rightsign;
printf("1\\r\\n");
if((he=gethostbyname(argv[1])) == NULL)
&leftsign;
/* get the host info */
herror("get host by name" ) ;
exit(1);
&rightsign;
printf("2\\r\\n");
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
&leftsign;
perror("socket");
exit(1) ;
&rightsign;
printf("3\\r\\n");
their_addr.sin_family = AF_INET; /* host byte order */
their_addr.sin_port = htons(PORT); /* short, network byte order */
their_addr.sin_addr = *((struct in_addr *)he->h_addr);
bzero(&(their_addr.sin_zero), 8); /* zero the rest of the struct */
printf("4\\r\\n");
if (connect(sockfd, (struct sockaddr *)&their_addr, sizeof(struct sockaddr)) == -1)
&leftsign;
perror("connect") ;
exit( 1 ) ;
&rightsign;
printf("5\\r\\n");
if (send(sockfd,req, strlen(req), 0) == -1)
&leftsign;
perror("send error");
close(sockfd);
exit(0);
&rightsign;
printf("6\\r\\n");
numbytes=1;
while(numbytes>0)
&leftsign;
numbytes=recv(sockfd,buf,MAXDATASIZE,0);
if(numbytes>0)
buf[numbytes]=0;
else
buf[0]=0;
printf("\\nReceived bytes:%d\\n",numbytes);
printf("Result:\\n%s",buf);
&rightsign;
printf("7\\r\\n");
buf[numbytes] = \’\\0\’;
printf("Received: %s",buf);
close(sockfd);
printf("8\\r\\n");
return 0;
&rightsign;
20071122 linux minigui
http://www.yippeesoft.com
主要参照:
http://blog.chinahr.com/blog/jiaxiao/post/32132
丝路花语 放飞理想,友谊长存!
编译:
make menuconfig
去掉了JPG什么得。。。。
没有安装到默认,自行指定,搞的比较麻烦,因为考虑原来得交叉编译
编译应用
gcc -o helloworld helloworld.c -I/home/sf/kvm/miniguiinstall/include/ -L/home/sf/kvm/miniguiinstall/lib/ -lminigui -lmgext -lm -lpng -lpthread -ljpeg -lttf -static
修改
仔细看一下你的配置文件MiniGUI.cfg与实际字体或其它资源文件路径是否一致,以及该路径下对应文件是否存在或名称是否是否正确
静态库的连接用法的确是 gcc -L libpath -llibname。
比如你的静态库放在 $HOME/lib目录下,静态库的名称是 libmylib.a,你的程序是 myproc.c 则gcc的用法是 gcc -L$HOME/lib -lmylib myprog.c -o myproc。
但是看你提问中又有dlopen函数,那么如果按以上的连接,肯定会找不到dlopen这个函数,因为这个函数是专门用于调用动态函数库 .so 的。所以你连接时必须要用 gcc -shared -L$(HOME)/lib -lmylib myproc.c -o myproc,其中-shared表示是调用动态连接库。这样gcc就不会报告dlopen找不到的错误了。但是这样的动态函数库后缀名应该是 .so的。
在调用动态连接库时,静态的库也是可以调用的。要注意的一点,如果你的$(HOME)目录下同时有 mylib.a 和 mylib.so,那么编译器会调用 mylib.so
你可以在编译配置文件时查找头文件和库文件,并按非标准的附加形式让C的预处理器和连接器通过。如下所示: CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure 如你使用csh及相容的Shell脚本作为你登录的脚本,则应该设为: env CPPFLAGS=-I/path/to/include LDFLAGS=-L/path/to/library ./configure
NEWGAL: Video mode smaller than requested.
NEWGAL: Set video mode failure.
GDI: Can not initialize graphics engine!
GDI: Error in loading raw bitmap fonts!
GDI: Can not initialize raw bitmap fonts!
DESKTOP: Initialization of GDI failure!
InitGUI failure when using /home/sf/kvm/mg-samples-1.6.9/src/MiniGUI.cfg as cfg file.
仔细看一下你的配置文件MiniGUI.cfg与实际字体或其它资源文件路径是否一致,以及该路径下对应文件是否存在或名称是否是否正确
偶然机会,认识了Minigui,就有忍不住想一探深浅的冲动。于是,在搜索了一些相关资料后就蠢蠢欲动了。首先就在自己的LINUX操作系统下建立 MiniGUI环境,几天摸索下来,竟然也成功了。还知道了MiniGUI的资源网站(http://www.minigui.org/重要)。下面就将自己的建立步骤写下,其中,我将自己所有下载的压缩文件都存放在/root/study/目录下,没有特别说明就不再重复了:
1.从http://www.minigui.org/res.shtml网站上下载相应的软件压缩包:
libminigui-1.3.3.tar.gz
minigui-res-1.3.tar.gz
mg-samples-1.3.0.tar.gz
mde-1.3.0.tar.gz
还要从相应的网站上下载qvfb-1.0.tar.gz压缩文件。
2.我在/root/software/下建立了minigui目录
cd /root/software/
mkdir minigui
3.解压qvfb-1.0.tar.gz压缩文件,并编译该工具包。
tar zxvf /root/study/qvfb-1.0.tar.gz (解压后生成qvfb-1.0文件夹)
cd qvfb-1.0
./configure
make
make install
qvfb& (出现一qvfb应用程序,则编译成功)
4.安装资源文件,进入minigui目录下,解压minigui-res-1.3.tar.gz
tar zxvf /root/study/minigui-res-1.3.tar.gz
cd minigui-res-1.3.3
make install
5.配置安装MiniGUI,进入minigui目录下,解压libminigui-1.3.3.tar.gz
tar zxvf /root/study/libminigui-1.3.3.tar.gz
cd libminigui-1.3.3
make menuconfig (配置相应的设置)
出现一配置工具,配置完退出后选种“Yes”退出。
make
make install
当系统停止输出后,该步骤将MiniGUI库安装到默认目录/usr/local/lib/目录下。此时查看/etc/ld.so.conf,如果内容中没有/usr/local/lib这一行,则在该文件的最后填加该行。
填加该行完成后,必须运行
ldconfig (不运行该命令,到后来做samples会出现问题)
6.编译运行演示程序,解压mg-samples-1.3.0.tar.gz压缩文件
cd /root/software/minigui
tar zxvf /root/study/mg-samples-1.3.0.tar.gz
cd mg-samples-1.3.0
./configure
make
之后,在/usr/local/etc/目录下找到MiniGUI配置文件MiniGUI.cfg,按照下面的配置改写:
[system]
gal_engine=fbcon改为gal_engine=qvfb
ial_engine=console改为ial_engine=qvfb
[qvfb]
defaultmode=640×480-16bpp
改完后保存退出即可。
cd /root/software/minigui/mg-samples-1.3.0/src
qvfb&
设置一下qvfb,选择File/configure,选择640×480,16bit。按Ctrl-c键退出,不要关闭qvfb运行程序。
./helloworle
好了,你可以看到运行在qvfb内的MiniGUI程序了。
假如运行成功,那么恭喜你了,你已经在linux操作系统下建立了MiniGUI环境了。
20071122 grub linux
http://www.yippeesoft.com
真是古怪,LINUX服务器重启后就是不能自行进入系统,只是停留在启动菜单
我装了Linux,win98,win2000三个系统,开机时是win2000的启动界面(就是只能选进入98还是2000),要是进Linux就得用Linux的启动盘,这样时间长了,软盘难免会出问题,到时候进不去Linux怎么办?
我想应该有方法在起机的时候的启动菜单可以有三个选择:Linux,win98,win2k.
进入linux后,打开/etc/lilo.conf文件,将其中加入类似于下面的行:
other=/dev/hdan //其中n使用你的win2000的安装分区号,一般是1。
label=win2000
然后保存。
再在命令提示符下,运行lilo -v命令,如没有错即行了。
如果你有将LILO装在boot分区的第一扇区,你可试度下面的方法:
1)用软盘启动linux,
2)在命令模式下输入:
dd if=/dev/hda6 of=/bootsect.lnx bs=512 count=1
其中hda6是指你装linux时选的boot分区,你应适当修改!
如果成功,会在根目录(/)下生成一个文件:bootsect.lnx,是512B
3)copy /bootsect.lnx a:
4)重启进win2000
5)copy a:\\bootsect.lnx c:
6)找到boot.ini
7)在最后一行加入:C:\\bootsect.lnx="Linux"
8)重启,选Linux试试。
当然,如果没有装LILO,你只能先装再说,装lilo并不会破坏你的98和2000!
无论是先装windows2k再装linux,还是先装linux装windows2k,都可以!
区别只在于你要用哪个程序作为缺省的多系统引导程序而已。
1)先装win2k再装linux:
可以缺省使用linux的lilo或grub做多系统引导,涉及到的配置文件:
lilo:/etc/lilo.conf
grub: /boot/menu.lst
2)先装linux再装win2k:
缺省用win2k的ntloader来引导多系统,涉及到的配置文件:
boot.ini以及linux的引导映像文件。
而且这两种引导方式也是从您“缺省”使用的角度讲的,您完全可以
不管安装的先后顺序,选择一种你熟悉的引导程序来引导您的多系统。
不过从学习linux和配置的简便角度讲,还是使用的linux的lilo或
grub比较好。毕竟让一个对linux系统并不熟悉的人去使用dd这样的
命令在经过若干操作后得到一个多系统引导的结果,比直接修改文本
的配置文件要复杂多了。
安装Fedora Core 5(以下简称为FC5)和Windows双系统时,如果按照默认安装方式,不会出现选择启动顺序的选项,默认为FC5优先启动的。对于不经常使用Linux的朋友,就需要在启动时选择启动的操作系统。如果一时忘了那么就得等待Linux漫长的启动过程后,重启再次选择,可以说是非常不便的。
那么怎样改变默认的启动顺序呢,与改变Windows 98和Windows 2000双系统的启动顺序相比也不复杂。只需要以root身份登陆,修改/boot/grub.conf文件即可。以下是默认安装的grub.conf文件内容:
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,7)/grub/splash.xpm.gz
hiddenmenu
title Fedora Core (2.6.15-1.2054_FC5)
root (hd0,7)
kernel /vmlinuz-2.6.15-1.2054_FC5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.15-1.2054_FC5.img
title Other
rootnoverify (hd0,0)
chainloader +1
将default=0改为default=1,即默认启动第二项,Other操作系统。tilte Other这里tilte后的内容就是启动菜单里显示内容,我们也可以将Other改为其它标记,如改为Windows XP,保存退出就完成了配置操作,是不是有点象改boot.ini的感觉,还比较容易吧。重启后试试看是不是已经生效了。这里还可以启动菜单停留的时间,将timeout=5后的数字改为你所需的时间就行了
用linux引导盘,引导你的linux系统,进去后:
1、导出boot区的前512字节,命令如下(xxx代表你的boot区)
dd if=/dev/xxx of=/bootsect.lnx bs=512 count=1
2、把bootsect.lnx copy到win2k的c:\\下
3、修改c:\\boot.int加入一行:
c:\\bootsect.lnx="RedHat 8.0 linux"
进入你的Linux(记住要用root),到\\boot\\grub下寻找看有没有menu.lst,打开它后,你会看到一大串英文的东西,有一个default x选项,x代表启动的顺序。如果98在启动菜单的第2行,那么X=1!这样设置就行了!
GRUB是一款非常优秀的系统引导器,它的功能非常强大,今天就为大家介绍一下快速配置GRUB的五个参数。GRUB是利用其配置文件方式来工作的,要对GRUB进行配置,只需要修改/boot/grub/grub.conf或者/etc/grub.conf(/etc/grub.conf是/boot/grub/grub.conf的符号链接)就可以了。GRUB的配置文件其实可以分为两个部分,在开头有“#”的均为注释行,可以不必理会;另外一部分则是起作用的参数部分,下面就为大家一一介绍。
default
这个参数决定了GRUB引导时光标默认停留的引导标签。如default=0,则GRUB引导时,光标停留在第一个引导标签上。如果将0改成1,则GRUB引导时,光标默认停留在第二个引导标签上。
timeout
这个参数设置的是GRUB的等待时间。当计算机启动至引导页面的时候,GRUB会有一段默认是10秒的等待时间,如果在默认时间内用户不作任何选择,则GRUB将根据default参数的设置,自动引导系统。
用户也可以根据自身的需要来设置timeout参数。如timeout=30,则将GRUB默认等待时间设置为30秒,而如果将timeout参数删除或者将等于号后的数字改为负数,将会使此参数失效,GRUB将一直停留在引导页面等待用户选择。
splashimage
当进入GRUB引导界面的时候,可以看见一副背景图片,而参数提供的就是这个功能。为了使GRUB引导更加个性化,大家也可以自己准备一张XPM图片,然后将图片压缩成gz格式,最后修改splashimage参数中的文件路径即可。但是,如果将splashimage删除,GRUB的引导菜单将会和NT Loader一样,变成最普通的黑底白字,非常难看。
title
其实title就是一个引导标签,我们可以对title后的文字部分进行修改,使它更加复合我们的使用习惯。如将title Red Hat Enterprise Linux AS改为title Red Hat Linux,再次进入GRUB引导界面的时候,引导菜单就会变为Red Hat Linux,是不是一目了然呢?(笔者提示:title以下部分是系统引导所需的信息,切勿修改!)
password
众所周知,通过编辑GRUB启动参数可以轻松的进入单用户模式从而修改root密码,这对于一台多用户的计算机或服务器来说,无疑增加了安全隐患。大家一定很像为自己的GRUB加一把锁吧,大家可以通过GRUB的password参数对GRUB设置密码。
GRUB的密码设置可分为全局密码和菜单密码。
为了防止他人通过GRUB修改root密码大家需要设置一个全局密码。vi /boot/grub/grub.conf在splashimage这个参数的下一行可以加上password=密码,保存后重新启动计算机,再次登录到GRUB菜单页面的时候就会发现,这时已经不能直接使用e命令编辑启动标签了,须先使用p命令,输入正确的密码后才能够对启动标签进行编辑。如下图:
虽然我们设置了全局密码,但是如果他人得到了全局密码后仍然可以修改GRUB启动标签从而修改root密码;这样我们就可以设置菜单密码,设置菜单密码也非常简单,我们只需要在title的下一行加上password=密码,然后保存退出。这样即使有了全局密码也必需输入菜单密码才能够引导系统。
此外,如果直接对GRUB进行明文加密也是非常不安全的,所以就要使用MD5对其进行加密。在终端中输入grub-md5-crypt回车,这时系统会要求输入两次相同的密码,之后系统便会输出MD5码。大家只需要将生成的MD5密文复制下来,然后在按照password –md5 MD5密文这个格式设置全局或者菜单密码,保存退出,重启计算机即可。
按e键进入编辑模式后,密码已经加密:
好了,快速配置GRUB的五个参数给大家详细介绍了一下,会用这几个参数,就可以快速配置GRUB了,大家加油啊!
英特科技
20071121 midp linux 成功
http://www.yippeesoft.com
这几天都准时回家,终于把这玩意编译通过了
还弄了UBUNTU,结果还是在REDHAT 9上面
undefined reference to `Java_com_sun_cldc_io_GeneralBase_iowait\’
obj/events.o(.text+0×186): In function `InterpreterHandleEvent\’:
: undefined reference to `SLEEP_FOR\’
obj/midpEvents.o(.text+0×1ed): In function `Java_com_sun_midp_lcdui_Events_open\’:
: undefined reference to `Java_com_sun_cldc_io_j2me_events_PrivateInputStream_open\’
obj/midpEvents.o(.text+0×1f9): In function `Java_com_sun_midp_lcdui_Events_readInt\’:
: undefined reference to `Java_com_sun_cldc_io_j2me_events_PrivateInputStream_readInt\’
obj/midpEvents.o(.text+0×205): In function `Java_com_sun_midp_lcdui_Events_readUTF\’:
: undefined reference to `Java_com_sun_cldc_io_j2me_events_PrivateInputStream_readUTF\’
obj/midpServices.o(.text+0×5): In function `midp_exitVM\’:
: undefined reference to `ERROR_THROW\’
obj/ROMjavaUnix.o(.rodata+0×3b1b4): undefined reference to `Java_com_sun_cldc_io_ResourceInputStream_open\’
obj/ROMjavaUnix.o(.rodata+0×3b1d4): undefined reference to `Java_com_sun_cldc_io_ResourceInputStream_close\’
obj/ROMjavaUnix.o(.rodata+0×3b1f4): undefined reference to `Java_com_sun_cldc_io_ResourceInputStream_size\’
obj/ROMjavaUnix.o(.rodata+0×3b214): undefined reference to `Java_com_sun_cldc_io_ResourceInputStream_read\’
obj/ROMjavaUnix.o(.rodata+0×3b234): undefined reference to `Java_com_sun_cldc_io_ResourceInputStream_readBytes\’
obj/ROMjavaUnix.o(.rodata+0×3c7d0): undefined reference to `Java_java_lang_Float_floatToIntBits\’
obj/ROMjavaUnix.o(.rodata+0×3c7f0): undefined reference to `Java_java_lang_Float_intBitsToFloat\’
obj/ROMjavaUnix.o(.rodata+0×3d2ac): undefined reference to `Java_java_lang_Math_sin\’
obj/ROMjavaUnix.o(.rodata+0×3d2cc): undefined reference to `Java_java_lang_Math_cos\’
obj/ROMjavaUnix.o(.rodata+0×3d2ec): undefined reference to `Java_java_lang_Math_tan\’
obj/ROMjavaUnix.o(.rodata+0×3d34c): undefined reference to `Java_java_lang_Math_sqrt\’
obj/ROMjavaUnix.o(.rodata+0×3d36c): undefined reference to `Java_java_lang_Math_ceil\’
obj/ROMjavaUnix.o(.rodata+0×3d38c): undefined reference to `Java_java_lang_Math_floor\’
obj/ROMjavaUnix.o(.rodata+0×40854): undefined reference to `Java_java_lang_Double_doubleToLongBits\’
obj/ROMjavaUnix.o(.rodata+0×40874): undefined reference to `Java_java_lang_Double_longBitsToDouble\’
obj/ROMjavaUnix.o(.rodata+0×4a2f8): undefined reference to `Java_com_sun_cldc_io_GeneralBase_iowait\’
collect2: ld returned 1 exit status
kvm是针对嵌入式设备所设计的小型虚拟机,如果再配套一个外接的类库就会很不方便,希望类库也能集成在可执行文件中。但Java是一种动态装载的语言,要把类库放到可执行文件中,就要首先反类库“静态化”。在静态化的过程中,首先就要载入类,并保证字节码的安全性,所以也要有验证,这里生成的preverifier就是用来验证类文件的。与虚拟中的验证器不同的是,preverifier的输入是类文件,输出也是类文件,只不过输出的类文件已经是被验证过的了,使用时不需要再进行验证,preverifier相当于class文件在使用之前就进行了一次验证,所以这个验证器被称为“预验证器”。
2、api/Makefile – 在api目录下存放有cldc1.1的所有Java源文件,这个Makefile的作用首先是把Java源文件编译成.class文件,当然这要调用本机的javac,要确保PC上安装有JDK;编译完成后,调用上面生成的preverifier进行预验证,经过预验证的class已经是安全的;接下来把class文件打包成classes.zip。
3、tools/jcc/Makefile – 这就是把类库“静态化”的地方,在其中会调用java命令把classes.zip里的class文件转化成C源文件。
4、kvm/vmunix/src/Makefile – 这是最后的一步,所把有虚拟机的源文件和第3步所生成的类库的源文件编译并连接成可执行文件kvm。
http://blog.csdn.net/cwmbecoming/archive/2006/08/26/1123400.aspx
交叉编译要注意的问题:
如果是要在嵌入式设备上使用kvm,就会需要使用arm-linux-gcc来编译。由以上的编译过程可知,前三个步骤都是只能在PC上完成的,只有最后一个步骤是面向目标平台的。所以只要修改kvm/vmunix/src/Makefile中的CC为arm-linux-gcc就可以编出可以在嵌入式设备上运行的kvm啦。
一、编译环境:
ubuntu6.06+jdk1.4.2+gcc 2.95.4
二、编译内容:
CLDC1.1+MIDP2.0 linux版
//JDK_HOME表示你的JDK的安装目录,如 /usr/
//编译命令为:make ALT_BOOTDIR=JDK_HOME KVM_DIR=../../../../j2me_cldc/
三、编译步骤:(根据错误一步步修改,每改一步最好重新make一下)
1、GeneralBase.ioWait()到Waiter.waitForIO()的映射
com.sun.cldc.io.GeneralBase.ioWait()是CLDC1.04里面的,在CLDC1.1里面对应的是com.sun.cldc.io.Waiter.waitForIO(),按照错误提示一个个改吧。
2、将CLDC1.04的com.sun.cldc.io.GeneralBase类copy到1.1相应的目录里,再从1.1里面的 java.io.DateInputStream和java.io.DateOutputStream两个类里面将方法 writeFloat、writeDouble、readFloat、readDouble四个方法copy到 com.sun.cldc.io.GeneralBase里面,并将GeneralBase的 ioWait()这个native方法删除
3、midp2.0fcs/src/solaris/native/machine_md.h里 添加 #include <setjmp.h> ,解决不识别global.h里的“jmp_buf”标识符的问题
4、安装Xpm、X11、Xwindow相关的开发库:libX11_dev、libXpm_dev、xlibs_dev,解决找不到 X11/Shell.h 等头文件的问题
5、midp2.0fcs/src/share/native/kvm/midpServices.c的宏 ERROR_THROW 改成 THROW
6、midp2.0fcs/src/share/native/kvm/midpEvents.c:
void Java_com_sun_midp_lcdui_Events_open(void) &leftsign;
Java_com_sun_cldc_io_j2me_events_PrivateInputStream_open();
&rightsign;
void Java_com_sun_midp_lcdui_Events_readInt(void) &leftsign;
Java_com_sun_cldc_io_j2me_events_PrivateInputStream_readInt();
&rightsign;
void Java_com_sun_midp_lcdui_Events_readUTF(void) &leftsign;
Java_com_sun_cldc_io_j2me_events_PrivateInputStream_readUTF();
&rightsign;
改成:
void Java_com_sun_midp_lcdui_Events_open(void) &leftsign;
//Java_com_sun_cldc_io_j2me_events_PrivateInputStream_open();
&rightsign;
void Java_com_sun_midp_lcdui_Events_readInt(void) &leftsign;
//Java_com_sun_cldc_io_j2me_events_PrivateInputStream_readInt();
JVM_EventsReadInt();
&rightsign;
void Java_com_sun_midp_lcdui_Events_readUTF(void) &leftsign;
//Java_com_sun_cldc_io_j2me_events_PrivateInputStream_readUTF();
JVM_EventsReadUTF();
&rightsign;
7、midp2.0fcs/src/solaris/native/machine_md.h的宏 SLEEP_UNTIL 改成 SLEEP_FOR
8、midp2.0fcs/build/share/makefiles/kvm/VM.gmk修改:
vpath %.c $(KVM_DIR)/kvm/VmCommon/src
vpath %.c $(KVM_DIR)/kvm/VmExtra/src
改为:
vpath %.c $(KVM_DIR)/kvm/VmCommon/src
vpath %.c $(KVM_DIR)/kvm/VmExtra/src
vpath %.c $(KVM_DIR)/kvm/VmExtra/src/fp
9、midp2.0fcs/build/share/makefiles/kvm/Defs.gmk修改:
KVM_DEF_SRC += cache.c class.c fields.c frame.c garbage.c global.c \\
interpret.c loader.c native.c pool.c thread.c \\
nativeCore.c loaderFile.c runtime_md.c events.c \\
hashtable.c profiling.c StartJVM.c \\
verifier.c verifierUtil.c log.c stackmap.c execute.c \\
inflate.c jar.c kni.c
改为:(在后面添加,要注意每行前面的空白不是空格是/t)
KVM_DEF_SRC += cache.c class.c fields.c frame.c garbage.c global.c \\
interpret.c loader.c native.c pool.c thread.c \\
nativeCore.c loaderFile.c runtime_md.c events.c \\
hashtable.c profiling.c StartJVM.c \\
verifier.c verifierUtil.c log.c stackmap.c execute.c \\
inflate.c jar.c kni.c \\
e_rem_pio2.c e_sqrt.c fp_bytecodes.c k_cos.c k_rem_pio2.c k_sin.c k_tan.c \\
s_ceil.c s_copysign.c s_cos.c s_fabs.c s_floor.c s_scalbn.c s_sin.c s_tan.c \\
w_sqrt.c resource.c fp_math.c
注:有人碰到检验时发生段错误,我没碰到,不知什么原因。
http://blog.csdn.net/cwmbecoming/archive/2006/08/26/1123400.aspx
http://xgui.yculblog.com/post.240208.html
midp
Jaty @ 2004-10-20 11:22
export PATH=/opt/ar2001/bin/:$PATH
export ALT_BOOTDIR=/home/wang/j2sdk
export ALT_BOOTDIR=/home/wang/j2sdk1.4.2_04/
export KVM_DIR=/usr/src/ar2001/j2me/j2me_cldc-1_0_4
export LANG=en_US.ISO8859_1
[root@new-server kvm]# pwd
/usr/src/ar2001/j2me/midp2.0fcs/build/uclinux/kvm
make midp
make midp GUIIN=/home/jaty/xgui/inc
make midp GUIIN=/usr/src/ar2001/j2me/midp2.0fcs/src/solaris/native/inc
[root@new-server kvm]# cd bin
[root@new-server bin]# cp ../../../linux/kvm/bin/preverify ./
[root@new-server bin]# cp ../../../linux/kvm/bin/extractOffsets ./
[root@new-server kvm]#mkdir bin
[root@new-server bin]# cp ../../linux/kvm/bin/preverify ./bin
[root@new-server bin]# cp ../../linux/kvm/bin/extractOffsets ./bin
20071116 linux 定时器
http://www.yippeesoft.com
minigui的定时器似乎极其不准~~~~~~
在Linux实现一个定时器,不像Win32下那样直观。在Win32调用SetTimer就行了,在Linux下则没有相应函数可以直接调用。定时器作为一个常用的功能,在Linux当然也有相应实现。下面我们看看几种常用的方法。
要实现定时器功能,最土的办法实现莫过于用sleep/usleep来实现了。当然,它会阻塞当前线程,除了处理定时功能外,什么活也干不了。当然要解决这个问题不难,创建一个单独的线程来负责定时器,其它线程负责正常的任务就行了。
要实现定时器功能,最简单的办法就是ALARM信号。这种方法简单,也相应的缺陷:用信号实现效率较低; 最小精度为1秒,无法实现高精度的定义器。简单示例:
#include <stdio.h>
#include <signal.h>
static void timer(int sig)
&leftsign;
if(sig == SIGALRM)
&leftsign;
printf("timer\\n");
&rightsign;
return;
&rightsign;
int main(int argc, char* argv[])
&leftsign;
signal(SIGALRM, timer);
alarm(1);
getchar();
return 0;
&rightsign;
(setitimer和alarm有类似的功能,也是通过信号来实现)
最优雅的方法是使用RTC机制。利用select函数,你可以用单线程实现定时器,同时还可以处理其它任务。简单示例:
#include <stdio.h>
#include <linux/rtc.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
int main(int argc, char* argv[])
&leftsign;
unsigned long i = 0;
unsigned long data = 0;
int retval = 0;
int fd = open ("/dev/rtc", O_RDONLY);
if(fd < 0)
&leftsign;
perror("open");
exit(errno);
&rightsign;
/*Set the freq as 4Hz*/
if(ioctl(fd, RTC_IRQP_SET, 4) < 0)
&leftsign;
perror("ioctl(RTC_IRQP_SET)");
close(fd);
exit(errno);
&rightsign;
/*Set the freq as 4Hz*/
if(ioctl(fd, RTC_IRQP_SET, 4) < 0)
&leftsign;
perror("ioctl(RTC_IRQP_SET)");
close(fd);
exit(errno);
&rightsign;
/* Enable periodic interrupts */
if(ioctl(fd, RTC_PIE_ON, 0) < 0)
&leftsign;
perror("ioctl(RTC_PIE_ON)");
close(fd);
exit(errno);
&rightsign;
for(i = 0; i < 100; i++)
&leftsign;
if(read(fd, &data, sizeof(unsigned long)) < 0)
&leftsign;
perror("read");
close(fd);
exit(errno);
&rightsign;
printf("timer\\n");
&rightsign;
/* Disable periodic interrupts */
ioctl(fd, RTC_PIE_OFF, 0);
close(fd);
return 0;
&rightsign;
**********************************************************************************
调用setitimer安装定时器:
它有三个参数第一个设ITIMER_REAL,第二和三个参数是新的时钟间隔和之前设置的时钟间隔。
struct itimerval &leftsign;
struct timeval it_interval; //设为时钟间隔
struct timeval it_value; //设为第一次触发的时钟间隔,其实只被执行一次,以后按照it_interval的值
&rightsign;
下面是一个具体的例子
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#include <stdlib.h>
#include <signal.h>
int count = 0;
void set_timer()
&leftsign;
struct itimerval itv, oldtv;
itv.it_interval.tv_sec = 1;
itv.it_interval.tv_usec = 0;
itv.it_value.tv_sec = 5;
itv.it_value.tv_usec = 0;
setitimer(ITIMER_REAL, &itv, &oldtv);
&rightsign;
void sigalrm_handler(int sig)
&leftsign;
count++;
printf("timer signal.. %d\\n", count);
&rightsign;
int main()
&leftsign;
signal(SIGALRM, sigalrm_handler);
set_timer();
while (count < 30)
&leftsign;&rightsign;
exit(0);
&rightsign;
20071102 midp linux
http://www.yippeesoft.com
便宜没好货。。。。。。。。。。编译问题都。。。
用的是Borland Together Architect 1.0
居然发生运行Sample都不行,例如CashSales,总是产生这个错误:
error: error reading source file: sun.io.MalformedInputException
但是在同事的机子上运行却没有问题,查API DOC,
Checked exception thrown when an input byte sequence is not legal for given charset, or an input character sequence is not a legal sixteen-bit Unicode sequence.
是不是机子的字符集设置有问题?望高手指点,THX
1. 檢查一下你檔案的編碼
2. 檢查一下 OS 的 Locale 的設定
這問題是編譯時, javac 無法讀取你的 .java 檔案
所以編碼注意一下, 不要使用太奇怪的編碼就可以
找到一个 御姐 的~~
KDE源码构建FAQ
奴家认为,一个二进制的软件发布是很难满足一个人的真正需要的,前提是他真的知道自己想要的是什么,而且知道不同选择能提供给自己的有什么不同。
Q:在编译kdebindings中的kdejava时,出现这样的错误怎么办:error: error reading source file: sun.io.MalformedInputException
A:在编译这个组件时您的locale必须是en_US,所以可以这样解决:LANG=en_US make -C kdejava,注意确保qtjava应先被构建完成。
LINUX下的LOCALE可以通过 LANG=zh_CN; LC_ALL=zh_CN.GBK; export LANG LC_ALL 设置。locale 命令可以显示系统当前的环境设置
Windows的LOCALE可以通过 控制面板==>区域设置 设置实现
../../../src/share/classes/com/sun/midp/io/j2me/datagram/DatagramObject.java:15: cannot resolve symbol
symbol : class GeneralBase
location: package io
import com.sun.cldc.io.GeneralBase
import com.sun.cldc.io.ConnectionBaseInterface;
import com.sun.cldc.io.GeneralBase;
… searching updated .java files
… compiling 264 .java files
../../../src/share/classes/com/sun/midp/io/j2me/datagram/DatagramObject.java:20: class GeneralBase is public, should be declared in a file named GeneralBase.java
../../../src/share/classes/com/sun/midp/io/j2me/datagram/DatagramObject.java:23: com.sun.midp.io.j2me.datagram.DatagramObject is not abstract and does not override abstract method readDouble() in java.io.DataInput
midp2.0 是和cldc1.0搭配的. midp2.0用到了一些cldc1.0.x里的类.
midp2.0和cldc1.1一起编译是会有问题的.
问题之一是midp2.0用到了GeneralBase这个类.可以将cldc1.0.x里的GeneralBase类放到cldc1.1中,当然需要修改.
还有就是浮点数支持的问题.这需要更改makefile相关文件.
ROMjavaUnix.c:125765:14: macro "INSTANCE_INFO" passed 13 arguments, but takes just 12
ROMjavaUnix.c:125755: `INSTANCE_INFO\’ undeclared here (not in a function)
ROMjavaUnix.c:125755: initializer element is not constant
ROMjavaUnix.c:125755: (near initialization for `AllClassblocks.com_sun_midp_security_PermissionProperties\’)
我使用sun提供的j2me_cldc-1_0_4-src-winunix以及midp-2_0-src-linux-i686,在redhat linux下編譯,環境為j2sdk1.4.1,kvm可以成功地make出來,但是make midp的時候,出現了錯誤,其中一段信息為:
ROMjavaUnix.c:126831:14: macro "INSTANCE_INFO" passed 13 arguments, but takes just 12
ROMjavaUnix.c:126821: `INSTANCE_INFO\’ undeclared here (not in a function)
ROMjavaUnix.c文件是機器自己生成的,我看不懂,也不知道出錯的原因是什麽,有哪位可以幫幫我?先謝過了!
This error occurs when building MIDP2.0 with CLDC1.1,there is no errors when using CLDC1.0.4.
midp
Jaty @ 2004-10-20 11:22
export PATH=/opt/ar2001/bin/:$PATH
export ALT_BOOTDIR=/home/wang/j2sdk
export ALT_BOOTDIR=/home/wang/j2sdk1.4.2_04/
export KVM_DIR=/usr/src/ar2001/j2me/j2me_cldc-1_0_4
export LANG=en_US.ISO8859_1
[root@new-server kvm]# pwd
/usr/src/ar2001/j2me/midp2.0fcs/build/uclinux/kvm
make midp
make midp GUIIN=/home/jaty/xgui/inc
make midp GUIIN=/usr/src/ar2001/j2me/midp2.0fcs/src/solaris/native/inc
[root@new-server kvm]# cd bin
[root@new-server bin]# cp ../../../linux/kvm/bin/preverify ./
[root@new-server bin]# cp ../../../linux/kvm/bin/extractOffsets ./
[root@new-server kvm]#mkdir bin
[root@new-server bin]# cp ../../linux/kvm/bin/preverify ./bin
[root@new-server bin]# cp ../../linux/kvm/bin/extractOffsets ./bin
Install MIDP On Linux(x86)
这其实是一篇翻译了,SUN的midp文档里面有说明的,我只是照着做了一次。有兴趣的可以看看:
编译环境:OS: RHAS3 、GCC:3.2.3、 MIDP2.0、CLDC1.03、JDK1.4.2
建立编译路径:
建立文件夹midp,将midp、cldc的zip文件src放入。
解压CLDC1.03 ,得到J2ME_CLDC文件夹,从命名为kvm。
解压MIDP2.0,得到midp2.0fcs;进入该文件夹的build/linux/kvm/makefiles路径下。修改Defs-pre.gmk文件,修改下面的_BOOTDIR为你的jdk路径。
回到/build/linux/kvm路径,make midp即可完成。
20071029 linux setjmp
http://www.yippeesoft.com
C语言的setjmp:异常处理与构建协作式多任务系统
int setjmp(jmp_buf envbuf)
宏函数setjmp()在缓冲区envbuf中保存系统堆栈里的内容,供longjmp()以后使用,setjmp()必须使用头文件setjmp.h。
调用setjmp()宏时,返回值为0,然而longjmp()把一个变原传递给setjmp(),该值(恒不为0)就是调用longjmp()后出现的setjmp()的值。
setjmp 函数用于保存程序的运行时的堆栈环境,接下来的其它地方,你可以通过调用longjmp函数来恢复先前被保存的程序堆栈环境。当setjmp和 longjmp组合一起使用时,它们能提供一种在程序中实现“非本地局部跳转”("non-local goto")的机制。并且这种机制常常被用于来实现,把程序的控制流传递到错误处理模块之中;或者程序中不采用正常的返回(return)语句,或函数的正常调用等方法,而使程序能被恢复到先前的一个调用例程(也即函数)中。
对setjmp函数的调用时,会保存程序当前的堆栈环境到env参数中;接下来调用longjmp时,会根据这个曾经保存的变量来恢复先前的环境,并且当前的程序控制流,会因此而返回到先前调用setjmp时的程序执行点。此时,在接下来的控制流的例程中,所能访问的所有的变量(除寄存器类型的变量以外),包含了longjmp函数调用时,所拥有的变量。
如何实现异常处理
首先设置一个跳转点(setjmp() 函数可以实现这一功能),然后在其后的代码中任意地方调用 longjmp() 跳转回这个跳转点上,以此来实现当发生异常时,转到处理异常的程序上,在其后的介绍中将介绍如何实现。 setjmp() 为跳转返回保存现场并为异常提供处理程序,longjmp() 则进行跳转(抛出异常),setjmp() 与 longjmp() 可以在函数间进行跳转,这就像一个全局的 goto 语句,可以跨函数跳转。
jmp_buf 异常结构
使用 setjmp() 及 longjmp() 函数前,需要先认识一下 jmp_buf 异常结构。jmp_buf 将使用在 setjmp() 函数中,用于保存当前程序现场(保存当前需要用到的寄存器的值),jmp_buf 结构在 setjmp.h 文件内声明:
typedef struct
&leftsign;
unsigned j_sp; // 堆栈指针寄存器
unsigned j_ss; // 堆栈段
unsigned j_flag; // 标志寄存器
unsigned j_cs; // 代码段
unsigned j_ip; // 指令指针寄存器
unsigned j_bp; // 基址指针
unsigned j_di; // 目的指针
unsigned j_es; // 附加段
unsigned j_si; // 源变址
unsigned j_ds; // 数据段
&rightsign; jmp_buf;
jmp_buf 结构存放了程序当前寄存器的值,以确保使用 longjmp() 后可以跳回到该执行点上继续执行。
setjmp() 与 longjmp() 函数都使用了 jmp_buf 结构作为形参,它们的调用关系是这样的:
首先调用 setjmp() 函数来初始化 jmp_buf 结构变量 jmpb,将当前CPU中的大部分影响到程序执行的积存器存入 jmpb,为 longjmp() 函数提供跳转,setjmp() 函数是一个有趣的函数,它能返回两次,它应该是所有库函数中唯一一个能返回两次的函数,第一次是初始化时,返回零,第二次遇到 longjmp() 函数调用后,longjmp() 函数使 setjmp() 函数发生第二次返回,返回值由 longjmp() 的第二个参数给出(整型,这时不应该再返回零)。
在使用 setjmp() 初始化 jmpb 后,可以其后的程序中任意地方使用 longjmp() 函数跳转会 setjmp() 函数的位置,longjmp() 的第一个参数便是 setjmp() 初始化的 jmpb,若想跳转回刚才设置的 setjmp() 处,则 longjmp() 函数的第一个参数是 setjmp() 所初始化的 jmpb 这个异常,这也说明一件事,即 jmpb 这个异常,一般需要定义为全局变量,否则,若是局部变量,当跨函数调用时就几乎无法使用(除非每次遇到函数调用都将 jmpb 以参数传递,然而明显地,是不值得这样做的);longjmp() 函数的第二个参数是传给 setjmp() 的第二次返回值
http://www.upsdn.net/html/2004-11/47.html
标签:linux20071029 java cldc uclinux
http://www.yippeesoft.com
移植KVM到arm-linux(1)
http://jayya.com/?p=109
KVM在嵌入式Linux上的移植
http://blog.csdn.net/zht_sir/archive/2007/06/03/1636342.aspx
http://dev.csdn.net/author/fyzhao/3ee7494bceb94997bf418b42a8bd009a.html
KVM本身只带有cldc1.1的类库,功能十分简单,不能满足用户的需求,本篇介绍如何对KVM进行扩展。
对KVM进行扩展,在Java层十分简单,只要向在编译Java代码时多加一个文件就可以,没什么要说的,麻烦的是如果在加入的Java类中有本地操作该怎么办?本地的C语言代码放在哪里编译才能够供KVM调用?
答案是KNI。下面就以KNI为主要内容介绍如何对KVM加以扩展,在最后附加一个具体的实现例子。
1. KNI的特点:
KNI(K Native Interface)是SUN的KVM(K Virtual Machine)所使用的本地方法调用机制。
JNI(Java Native Interface)是已经为我们所熟悉的Java本地方法调用机制,JNI一般使用在J2SE或J2EE平台上,本地方法被编进动态链接库,在运行时由Java虚拟机载入。
KVM中也需要本地调用,但JNI是“重量级”的本地调用方式,在使用时消耗的资源较多,所以针对KVM设计出了KNI,KNI被称为是JNI的一个简化版,是“轻量级”的本地调用方式。KVM不能加载动态链接库,所以在KNI机制下,本地方法不是写在库中,而是编入虚拟机内部。
以下是KNI与JNI最重要的一些区别:
KNI是“实现层”的API,即它是虚拟机实现的一部分,修改KNI的API就要重新编译虚拟机,这些API的细节对于Java程序员来说是不可见的;而JNI的API是在运行时动态加载进来的,它的修改与虚拟机无关,JNI的API对于Java程序员来说是可见的。
KNI的函数建在虚拟机内部,只能为此虚拟机所独享;而JNI的函数放在动态链接库中,可以为多个虚拟机共用。
由于在虚拟机内部,KNI的很多操作方式与虚拟机有关,在传递参数和控制对象的时候都要先经过一些特别的处理;JNI的调用方式比较直接,但可能会增加安全隐患。
KNI是JNI的简化版,功能也会弱一些,它不能创建对象,也不能调用Java层的方法。
总之,“在虚拟机内部”是KNI所有特点的根源,记得这一点,KNI的所有内容都非常容易理解。
KVM Porting 指南
4。KVM源码概览
4.1目录结构概览
解压KVM包后,在你的目录下生成如下子目录。(假定父目录为j2me_cldc1.0.3)
目录j2me_cldc1.0.3:
■api-Java类库源码
■bin-可执行文件,编译的类库
■build-编译用的makefile
■docs-说明文件
■jam-JAM(Java Application Manager)源码
■kvm-KVM源码
■samples-试例程序源码
■tools-辅助工具的源码(如JavaCodeCompact, preverifier,kdp,palm tool等)
目录j2me_cldc1.0.3kvm:
■VmCommon-所有公用的,平台无关的KVM源码都在该目录下
■VmExtra-公用的,可选的组件的源码
■VmUnix-针对Unix
■VmWin-针对Windows
目录j2me_cldc1.0.3kvmVmCommon:(所有公用的,平台无关的KVM源码)
■h-include文件
■src-源码
注:当你要port时,可以把你自己平台相关的源码置于kvm目录之中。例如我要port到W
inCE我可以这样安排我的源码(kvmVmWinCEsrc-我的源码,kvmVmWinCEh-我的头
文件,kvmVmWinCEuild-我的makefile)。
4.2 KVM源码功能简述
在j2me_cldc1.0.3kvmVmCommonsrc和j2me_cldc1.0.3kvmVmCommonh中包含了K
VM所有公用的,平台无关的源码和头文件,如下表所示:
------------------------------------
File Description
------------------------------------
StartJVM.c VM的启动和命令行的读取
bytecodes.c Java bytecodes的定义,自KVM1.0.2后,bytecode解释器被从新设
计,这部分从interpret.c分离出来。你可以定制VM,使用这里定义的bytecode的子集或
超集。
cache.h 内联缓存(inlinecaching)的支持,用以加快方法检索(
cache.c method lookup)的速度,并支持"fast" bytecodes.(注:关于m
ethodlookup请参考JLS15.12.4)
class.h 运行时java类的内部数据结构和操作
class.c
events.h 实现事件处理系统
events.c
execute.h 解释器的执行宏和操作
execute.c
fields.h 用以存储不同类型的域(field)的运行时内部结构。当一个
fields.c 新类被载入VM时,就会生成一张由这些域组成的表。
frame.h 定义栈帧(stack frame)和异常处理(exceptionhandling )的
操作。
frame.c
garbage.h 垃圾处理器和内存管理。
garbage.c
collector.c
collectorDebug.c
global.h 大量全局变量的定义
global.c
hashtable.h 实现VM内部使用的哈希表
hashtable.c
interpret.h bytecode解释器。
interpret.c
loader.h 类载入器。
loader.c
log.h 记录并输出运行时VM的诊断信息
log.c
long.h 处理64bit运算的特殊的宏
main.h 编译的选项及系统的预制设定。
messages.h 错误与警告信息
native.h JVM所需的native函数和核心native库,注意,KVM是不使用
native.c JNI(Java Native Interface)的,JNI对小设备来说开销太大了。
nativeCore.c
pool.h 常量池(Constant pool)的管理。
pool.c
profiling.h 用以描述VM的执行的数据声明与操作
profiling.c
property.h 取得Java系统特性的操作。
property.c
rom.h ROMizer(JavaCodeCompact tool) 所需的宏.
runtime.h 平台特有的操作的函数原型定义,注意这里定义的函数通过一个r
untime_md.c来实现。这也就是说runtime_md.c是建立在你想要port的平台特性之上的。
stackmap.c Stackmap操作用于支持额外的垃圾收集。
thread.h 多线程的支持与java的线程管理。
thread.c
verifier.h 类文件审核器
verifier.c
增加KVM中的系统调用API
http://kaober.spaces.live.com/
在Palm开发JAVA程式的心得
http://bbs.ustc.edu.cn/cgi-bin/bbsanc?path=/groups/GROUP_4/Java/D900879D8/D7BE53F98/M.1933.A
KVM Porting 指南⑵
http://www.zixi.net/article/show.asp?id=37082&Page=2
20071027 linux 延时 2
http://www.yippeesoft.com
【gettimeofday/settimeofday系统调用】
功能描述:
gettimeofday获取当前时间和时区信息。settimeofday设置当前时间和时区信息。只有超级用户可以调用settimeofday,如果存在为NULL的参数,表示不改变某一项信息。
用法:
#include <sys/time.h>
#include <time.h>
int gettimeofday(struct timeval *tv, struct timezone *tz);
int settimeofday(const struct timeval *tv , const struct timezone *tz);
参数:
tv:对于gettimeofday,指向存放返回的时间信息的缓冲区;对于settimeofday,指向需要设置的时间信息缓冲区。原型如下
struct timeval &leftsign;
time_t tv_sec; /* 秒 */
suseconds_t tv_usec; /* 微妙 */
&rightsign;;
main()
&leftsign;
struct timeval tpstart,tpend;
float timeuse;
unsigned int i;
gettimeofday(&tpstart,NULL);
for(i=0;i<1000;i++)
pid_t fork();
gettimeofday(&tpend,NULL);
timeuse=1000000*(tpend.tv_sec-tpstart.tv_sec)+tpend.tv_usec-tpstart.tv_usec;
timeuse/=1000000;
printf("Used Time:%f\\n",timeuse);
exit(0);
&rightsign;
我们的平台支持返回服务器当前时间的功能,但是原来的实现只能是time_t mytime形式的,经过简单的localtime(mytime)和ctime(&mytime)处理.精度是不够的,为了返回高精度的时间,我使用了gettimeofday函数。这里一个简单的小例子说明了他的简单用法。记下来,希望以后用起来能够顺手些。
首先是申请struct timeval的变量,这个结构体包含两个子变量,tv_sec返回的是秒数,tv_usec返回的是微秒数。
#include <sys/time.h>
#include <stdio.h>
main()
&leftsign;
struct tpstart;
float micro;
char timeBuf[64];
char buf[64];
gettimeofday(&tpstart,NULL);
micro=tpstart.tv_usec;
snprintf(timeBuf, sizeof(timeBuf),"%f", micro);
strncat(buf, timeBuf,6);
printf("\\n%s",timeBuf);
printf("\\n%s\\n",buf);
exit(0);
&rightsign;
gettimeofday:获得是自00:00:00 UTC, January 1, 1970开始到现在的时间,单位微秒
GetTickCount:获得的是自系统开始运行时到现在的时间,单位毫秒
#include <sys/select.h>
#include <stdio.h>
#include <stdlib.h>
void Timer(int sec, long usec)
&leftsign;
struct timeval tvSelect;
tvSelect.tv_sec = sec;
tvSelect.tv_usec = usec;
select(FD_SETSIZE, NULL, NULL, NULL, &tvSelect);
&rightsign;;
20071027 linux 延时 1
http://www.yippeesoft.com
版主说的大于10毫秒的定时我没有试过,我想这个可能是与linux的滴嗒节拍有关系,我记得linux0.11版的do_timer是在100HZ的时钟中断门里面做的.那照想以10ms的整倍数定时应该可以做的到.
由于这个ARM芯片的片内资源有些不够用,有几路波形我想用软件来做,所有就引出了这个问题,在试过linux的实时时间定时器之后,我尝试另外开一个线程来不断地查询gettimeofday(), 然后比较判断来实现从pin脚输出波形,这个方法到是可以精确到us级的时间,但是很快我就发现这个方法也不行,当只有这单个进程单个线程参与调度时,可以看到很漂亮的很稳的连续的波形(hi 5.5ms, lo 5.5ms),如是再开多一个线程来实现另一频率的波形输出,呵,这时就不好了,它们实际上是交替输出了(当A路输出fA频率的波形时,B路的输出就停了;反之亦然),这个"交替"的时间间隔从几十毫秒到几百毫秒(我想这个应该是linux时间片轮转调度的结果),显然这个方法不实用,除非只单独开这个进程且只有这个线程,或者其它的都进入睡觉,这个没什么实用性.
后来又想了想,还是想加速一下linux的"心跳",专到kernel里转悠了大半天,当正在kernel源码里漫游时,偶然想到这个功能如果放到驱动层里面去做可能更灵活,更容易实现 所以,还是让linux保持了原有的"心跳速率"(当然,为了下面的实现,还是改了几级分频和装载值了).所以现在是在驱动层做了,另外开一个硬定时器,它的时间颗粒度可以设的比较小,我现在设的是100us,这样就可以实现了
C语言的时间函数
http://hi.baidu.com/tjkvvv/blog/item/e86255094de50bce3ac76352.html
windows和linux下的时间函数是有点差别的,在这些资料中都没有区别开,这里分开讨论。
通用的:clock_t和clock()
clock_t和clock()在两个平台下都能用,使用它们可以计算程序使用的cpu时间,不过windows和linux返回的时间单位不一样,一个是毫秒,一个是微秒。使用他们需要包含<time.h>
示例程序如下:
#i nclude <time.h>
#i nclude <stdio.h>
#i nclude <iostream>
using namespace std;
int main()
&leftsign;
clock_t t;
double beginning_time, finish_time;
int i, j, k;
double sum=0,avg=0,times=10;
for(int a=0;a<times;a++)
&leftsign;
t = clock();
if ((clock_t)-1 == t)
return -1; /* 调用失败,退出 */
beginning_time = (double)t /1000; /* 转换成秒 */
for (i = 0; i < 500; i++)
for (j = 0; j < 500; j++)
for (k = 0; k < 500; k++)
; /* 什么也不做 */
t = clock();
if ((clock_t)-1 == t)
return -1; /* 调用失败,退出 */
finish_time = (double)t /1000; /* 转换成秒 */
sum=sum + finish_time – beginning_time;
printf("loop spends %g seconds\\n", finish_time – beginning_time);
&rightsign;
avg=sum/times;
cout<<avg<<endl;
return 0;
&rightsign;
要特别注意的是udelay是个忙等待函数,在延迟的时间段内无法运行其他的任务。源码见头文件<asm/delay.h>。
目前内核不支持大于1微秒而小于1个时钟滴答的延迟,但这不是个问题,因为延迟是给硬件或者人去识别的。百分之一秒的时间间隔对人来说延迟精度足够了,而1毫秒对硬件来说延迟时间也足够长。如果你真的需要其间的延迟间隔,你只要建立一个连续执行udelay(1000)函数的循环。
linux内核延时函数代码示例:
1、#include <linux/time.h>
void do_gettimeofday(struct timeval *tv)
&leftsign;
unsigned long flags;
unsigned long usec, sec;
read_lock_irqsave(&xtime_lock, flags);
sec = xtime.tv_sec;
usec = xtime.tv_usec + do_gettimeoffset();
read_unlock_irqrestore(&xtime_lock, flags);
while (usec >= 1000000) &leftsign;
usec -= 1000000;
sec++;
&rightsign;
tv->tv_sec = sec;
tv->tv_usec = usec;
&rightsign;
void MyDelay(unsigned long delay)
&leftsign;
struct timeval tv;
do_gettimeofday(&tv)
unsigned long start = tv.tv_usec;//unsigned long start = tv.tv_sec;
while(tv.tv_usec – start <delay)
do_gettimeofday(&tv)
&rightsign;
2、如果驱动程序使用等待队列等待某个事件,而你又想确保在一段时间后运行该驱动程序时
extern inline long sleep_on_timeout(wait_queue_head_t *q, signed long timeout)
&leftsign;
signed long early = 0;
current->timeout = jiffies + timeout;
sleep_on (q);
if (current->timeout > 0) &leftsign;
early = current->timeout – jiffies;
current->timeout = 0;
&rightsign;
return early;
&rightsign;
extern inline long interruptible_sleep_on_timeout(wait_queue_head_t *q,
signed long timeout)
&leftsign;
signed long early = 0;
current->timeout = jiffies + timeout;
interruptible_sleep_on (q);
if (current->timeout > 0) &leftsign;
early = current->timeout – jiffies;
current->timeout = 0;
&rightsign;
return early;
&rightsign;
3.无需等待其他事件,则可直接延时等待
extern inline void schedule_timeout(int timeout)
&leftsign;
current->timeout = jiffies + timeout;
current->state = TASK_INTERRUPTIBLE;
schedule();
current->timeout = 0;
&rightsign;
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(jit_delay*HZ);
4 非常短的延时与硬件同步 udelay推荐最大1000us
#include<linux/delay.h>
void __delay(int loops)
&leftsign;
long long dummy;
__asm__ __volatile__("gettr " __t0 ", %1\\n\\t"
"_pta 4, " __t0 "\\n\\t"
"addi %0, -1, %0\\n\\t"
"bne %0, r63, " __t0 "\\n\\t"
"ptabs %1, " __t0 "\\n\\t":"=r"(loops),
"=r"(dummy)
:"0"(loops));
&rightsign;
void __udelay(unsigned long long usecs, unsigned long lpj)
&leftsign;
usecs *= (((unsigned long long) HZ << 32) / 1000000) * lpj;
__delay((long long) usecs >> 32);
&rightsign;
#ifdef notdef
#define mdelay(n) (\\
&leftsign;unsigned long msec=(n); while (msec–) udelay(1000);&rightsign;)
#else
#define mdelay(n) (\\
(__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) : \\
(&leftsign;unsigned long msec=(n); while (msec–) udelay(1000);&rightsign;))
#endif
20071024 uclinux java jikes kaffe
http://www.yippeesoft.com
据说KAFFE可以运行在UCLINUX,可是。。。。。
说要JIKES。。。
然后要 zlib。。。。。。
我想,这样还能到UCLINUX。。。。。。。
We have successully ported Kaffe JVM (www.kaffe.org) to our
ARM7TDMI/uClinux platform (B2).
Kaffe was initially developed for x86/Linux platform but it\’s enough
flexible to fit an embedded system too!
I have not tryied to port CDC due the fact that it\’s not an opensource project.
Unfortunately I have never worked with OSGi Framework so I don\’t really
know if it\’s needs some special
feature of the JVM (is it pure Java code or has some native code too?).
Maybe you can ask to Kaffe mailing list too
set JAVA_HOME=/home/sf/j2sdk1.4.2_04
export JAVA_HOME=/home/sf/j2sdk1.4.2_04
set PATH=$JAVA_HOME/bin:$PATH
export PATH
set CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export CLASSPATH =.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
-bootclasspath bootclasspath
Cross-compile against the specified set of boot classes. As with the user class path, boot class path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives.
-extdirs directories
Cross-compile against the specified extension directories. Directories is a colon-separated list of directories. Each JAR archive in the specified directories is searched for class files.
As you can see, Jikes has moved again. We\’re now hosted at SourceForge®. This move was a result of IBM\’s decision to pull out of the project hosting space. Since there was a great amount of similarity between sf.net and dw/oss, the change will be mostly cosmetic.
SourceForge.net Logo
What is Jikes?
JikesTM is a compiler that translates JavaTM source files as defined in The Java Language Specification into the bytecoded instruction set and binary format defined in The Java Virtual Machine Specification.
You may wonder why the world needs another Java compiler, considering that Sun provides javac free with its SDK. Jikes has five advantages that make it a valuable contribution to the Java community: [OSI Certified Logo]
* Open source. Jikes is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative.
* Strictly Java compatible. Jikes strives to adhere to both The Java Language Specification and The Java Virtual Machine Specification as tightly as possible, and does not support subsets, supersets, or other variations of the language. The FAQ describes some of the side effects of this strict language conformance.
* High performance. Jikes is a high performance compiler, making it ideal for use with larger projects.
* Dependency analysis. Jikes performs a dependency analysis on your code that provides two very useful features: Incremental builds and makefile generation.
* Constructive Assistance. Jikes strives to help the programmer write better code in two key ways. Jikes has always strived to provide clear error and warning text to assist the programmer in understanding problems, and now with release 1.19 Jikes helps point out common programming mistakes as documented in Effective Java.
The Config
CC=m68k-elf-gcc NM=m68k-elf-nm AR=m68k-elf-ar \\
CFLAGS="-Wall -g -m5307 -Wl,-elf2flt -Os -lc " \\
LDFLAGS="-g -m5307 -Wl,-elf2flt" \\
KAFFEH=/root/workspace/kaffe/kaffe/kaffeh \\
/root/workspace/kaffe/configure \\
–host=m68k-linux \\
–build=i686-linux \\
–with-engine=intrp \\
–enable-pure-java-math \\
–with-threads=unix-jthreads \\
–disable-direct-threading \\
–prefix=/uclinux/jvm/ \\
–disable-fastjar \\
–disable-sound \\
–disable-alsa \\
–without-alsa \\
–without-esd \\
–disable-gtk-peer \\
–disable-alsatest \\
–disable-esdtest \\
–without-x \\
–disable-xmltest \\
–disable-xslttest \\
–disable-debug \\
–disable-native-awt \\
–disable-feedback \\
–without-profiling \\
–without-stats \\
–disable-gcj \\
–disable-xawt-xi18n \\
–disable-fastjar \\
–disable-shared \\
–with-staticlib \\
–with-staticbin \\
–with-staticvm \\
–without-gmp \\
–disable-rpath \\
–disable-libtool-lock \\
–with-jikes=/opt/jikes/bin/jikes
~
Error Code: 258
MSI (s) (40!CC) [19:00:16:625]: 产品: Microsoft SQL Server 2005 — 错误 29515。SQL Server 安装程序无法连接到数据库服务进行服务器配置。 错误为: [Microsoft][SQL Native Client]共享内存提供程序: 超时错误 [258]. 有关详细信息,请参阅服务器错误日志和安装日志。有关如何查看安装日志的详细信息,请参阅 SQL Server 联机丛书中的“如何查看安装日志文件”。
错误 29515。SQL Server 安装程序无法连接到数据库服务进行服务器配置。 错误为: [Microsoft][SQL Native Client]共享内存提供程序: 超时错误 [258].
同事点个重试就OK了。。。。。。
Compiling Kaffe
—————
- Configure-ing:
1. You must decide if you will use a static or a dynamically linked VM.
In most cases a shared VM is the preferable scenario – it\’s smaller but you
need to be sure that you have all the libraries needed on the target device.
In this case specify the following options to the configure script:
In the case when only java based applications will run on the device and they
will be started directly after the kernel boots (for example instead of init)
it is a good idea to use a static VM and no libraries on the target board.
Pass these options to configure:
2. Choose the engine.
My experience shows that on systems with slower CPUs the intrp engine is
faster than jit.
You might try both of them to see what fits your needs/device best.
The factor here is the speed because the difference between the storage used with jit and
the one used with intrp is not considerable. If your target platform supports jit3 you
may consider testing that too.
3. Remove the profiling and debugging (at least for the final sollution):
–disable-debug
–disable-xprofiling
–disable-xdebugging
–disable-feedback
–without-profiling
–without-stats
To be sure that these are applied (for example) check the gcc otptions used during the compilation
for "-g".
4. If you don\’t enable the use of pthreads you will save some storage space from the
libpthreads.so but if other applications will use it on the target device you might
enable it.
5. Disable the gcj support:
–disable-gcj
20071024 uclinux java
http://www.yippeesoft.com
嵌入式Linux与Java
Java 2 Micro Edition(J2ME官方站点)
http://www.javasoft.com/j2me/
waba为小设备提供一个编程平台。它被定义为一种语言,一个虚拟机,一个类文件格式以及功能类的设置。
http://wabasoft.com/products.shtml
Kaffe is a clean room implementation of the Java virtual machine, plus the associated class libraries needed to provide a Java runtime environment. The Kaffe virtual machine is free software, licensed under the terms of the GNU General Public License.
Kaffe is a great choice as a base for virtual machine education and/or research, or if you need a virtual machine as an integral component of an open source or free software Java distribution.
http://www.kaffe.org
Wonka(一个java虚拟机,超小)
http://www.acunia.com/wonka
-msoft-float
Generate output containing library calls for floating point. Warning: there
is no GNU floating-point library for SPARC. Normally the facilities of the
machine\’s usual C compiler are used, but this cannot be done directly in
cross-compilation. You must make your own arrangements to provide suitable
library functions for cross-compilation.
-msoft-float changes the calling convention in the output file; therefore,
it is only useful if you compile all of a program with this option.
关于怎样查出一个库函数到底在哪个库文件中,我想到一个变通的办法,以查找fcntl函数在哪个库文件中为例吧:
1、找到一个使用fcntl的可执行文件,如test_fcntl。实在不行,自己编一个只有fcntl函数的c文件,然后编译一下得了。
2、使用“ldd test_fcntl”命令,可以追踪出该可执行文件到底使用了哪些库文件。通常可能有几个到几十个。
3、根据要查找的函数的作用和上一步所得到的各库文件的名字大致推测一下,该函数可能会在哪个或哪些库中。
4、最后使用"nm test_fcntl"命令,依次查找一下第三步所得到的库文件,通常就可以最后确定fcntl函数到底在哪个库中。
比如,我用上面的方法查出fcntl函数在“/lib/tls/libc.so.6”库中。
sun公司的虚拟机现在只有java卡虚拟机原码不开放,其他的都已经开放了,只不过对中国大陆地区有点儿限制。大家努力一下,下载到应该不难。
在网上已经有其他公司虚拟机的产品,比较有名的是kaffe虚拟机,他们针对不同的平台都开发了相应的java虚拟机,大家有兴趣可以到 www.kaffe.org网站上去看看,网站上提供了移植的文档。现在在消费类电子产品上运行java程序已经是一种趋势(java 语言产生的原始动力就在于此:)),java虚拟机也应该会成为各个嵌入式产品厂商研究的热点,如果看到java程序在自己虚拟机上运行流畅,会很有成就感的:)
4.2 KVM源码功能简述
在j2me_cldc1.0.3\\kvm\\VmCommon\\src和j2me_cldc1.0.3\\kvm\\VmCommon\\h中包含
了KVM所有公用的,平台无关的源码和头文件,如下表所示:
------------------------------------
File Description
------------------------------------
StartJVM.c VM的启动和命令行的读取
bytecodes.c Java bytecodes的定义,自KVM1.0.2后,bytecode解释器被
从新设计,这部分从interpret.c分离出来。你可以定制VM,
使用这里定义的bytecode的子集或超集。
cache.h 内联缓存(inlinecaching)的支持,用以加快方法检索(
cache.c method lookup)的速度,并支持“fast” bytecodes.(注:
关于methodlookup请参考JLS15.12.4)
class.h 运行时java类的内部数据结构和操作
class.c
events.h 实现事件处理系统
events.c
execute.h 解释器的执行宏和操作
execute.c
fields.h 用以存储不同类型的域(field)的运行时内部结构。当一个
fields.c
新类被载入VM时,就会生成一张由这些域组成的表。
frame.h 定义栈帧(stack frame)和异常处理(exceptionhandling
frame.c
)的操作。
garbage.h 垃圾处理器和内存管理。
garbage.c
collector.c
collectorDebug.c
global.h 大量全局变量的定义
global.c
hashtable.h 实现VM内部使用的哈希表
hashtable.c
interpret.h bytecode解释器。
interpret.c
loader.h 类载入器。
loader.c
log.h 记录并输出运行时VM的诊断信息
log.c
long.h 处理64bit运算的特殊的宏
main.h 编译的选项及系统的预制设定。
messages.h 错误与警告信息
native.h JVM所需的native函数和核心native库,注意,KVM是不使用
native.c JNI(Java Native Interface)的,JNI对小设备来说开销太大
nativeCore.c 了。
pool.h 常量池(Constant pool)的管理。
pool.c
profiling.h 用以描述VM的执行的数据声明与操作
profiling.c
property.h 取得Java系统特性的操作。
property.c
rom.h ROMizer(JavaCodeCompact tool) 所需的宏.
runtime.h 平台特有的操作的函数原型定义,注意这里定义的函数通过
一个runtime_md.c来实现。这也就是说runtime_md.c是建立
在你想要port的平台特性之上的。
stackmap.c Stackmap操作用于支持额外的垃圾收集。
thread.h 多线程的支持与java的线程管理。
thread.c
verifier.h 类文件审核器
verifier.c
------------------------------------
在j2me_cldc1.0.3\\kvm\\VmExtra\\src和j2me_cldc1.0.3\\kvm\\VmExtra\\h中包含
了KVM所有外加的公用平台无关的源码和头文件,其中主要包括windows、Unix下最
常见的网络协议的实现;把类载入目标平台的文件接口(该目标平台拥有一个常规
的文件系统);检视,解压缩JAR文件的工具;还有Jave级的debugger和KDWP(
KVM Debug Wire Protocol)接口的实现。除了上述之外,还包括一些用来处理异步
事件的额外的宏,并定义了VM的一些在非嵌入式,基于命令行的系统(如windows和
Solaris)上运行所需要的启动操作。
\\VmExtra中的文件如下表所示:
———————-+————————————————–+
文件 描述
———————-+————————————————–+
async.h 支持异步I/O的宏。
loaderFile.c 从文件系统中载入Java类文件的操作。
main.c 缺省的main程序,用于具备文件系统并支持VM从命令行启
动的平台。
jar.h 阅读、解压Jar文件的相关操作。
inflate.h
inflateint.h
inflatetables.h
jar.c
inflate.c
commProtocol.h windows、Unix下常见的网络协议的实现,如串行端口通
commProtocol.c 讯,套接字(socket),数据报(datagram)等。
socketProtocol.h
socketProtocol.c
datagramProtocol.h
datagramProtocol.c
resource.c 读取外部资源的流式(stream-based)协议的实现。
debugger.h Java级debugger和KDWP接口的实现。
debugger.c
debuggerCommands.h
debuggerStreams.h
debuggerInputStream.c
debuggerOutputStream.c
debuggerSocketIO.c
fakeStaticMemory.c 内存管理的定义,可以使KVM在Windows/Unix下模拟特
殊的USESTATIC模式(也称"simonizing"),以便调试。
这种模式最初是为Spotless/KVM系统开发的,用以克服
一些Palm独有的内存限制。
nativeSpotlet.h 定义事件处理的底层操作和对宿主操作系统的事件的截
nativeSpotlet.c
取例程,以及为事件调用已注册的handler方法。