三日实验遇到问题简记

来源:互联网 发布:淘宝卖家介入公益 编辑:程序博客网 时间:2024/05/06 08:51

内核编译

使用2.6.34.4编译不行
最终使用和系统安装上的2.6.33.3,可行
但是不能安装nvidia显卡驱动,最好使用nouveau开源驱动
出现一次无法启动后,将/etc/X11/xorg.conf删除掉即可
编译时须将文件系统支持尽量的编译进去,防止以后无法识别一些文件系统
  
  时间测量
测试设备初始化时间
do_gettimeofday 读取的时间tv_usec总是0
  
在内核中添加代码,测试一些设备的初始化时间
但是do_gettimeofday函数读取的时间,tv_usec部分总是0
比如:对init/main.c中的start_kernel()函数中的console_init()部分测量,这次是两处,曾经在4处进行测量,结果四处的时间都是一样,当然秒一样可以理解,但tv_usec部分全是0
  
注:start 和 end都是struct timeval类型,内核版本2.6.33.3,cpu是core 2,内核编译时把HPET Timer support编入了内核,其它部分不清楚哪些和这个问题有关,暂时没列出
  
do_gettimeofday(&start);
console_init();
do_gettimeofday(&end);
printk(KERN_DEBUG "whoisyourdaddy: The time used for console init is %ld, start time is %ld s %ld us, end time is %ld s %ld us/n", (start.tv_sec - end.tv_sec) * 1000000 + start.tv_usec - end.tv_usec, start.tv_sec, start.tv_usec, end.tv_sec, end.tv_usec);
  
从dmesg中读取的结果是
whoisyourdaddy: The time used for console init is 0, start time is 1282062076 s 0 us, end time is 1282062076 s 0 us 
  
不是每次都是0,在函数了设置了10多个打印点,结果有些不是0,不过是199,699,13999之类的
有可能是console_init太快了,没有到1微秒,或者do_gettimeofday的问题,999和0结尾比较多
  
  开机信息隐藏
老师提供的方法不可以用
采用方式是在/boot/grub/grub.conf的kernel行启动参数的结尾加上,
quiet
  
  启动画面修改方法,iso中的参考资料太老,
需要自己往屏幕上输出数据,制造图画,现在有先进方法
  
plymouth的启动主题选择,
将/usr/share/plymouth/themes/solar中的背景图片,换成想要更改的图片,大小调成800*600、
当然可以对其它的主题采取同样的修改方案
  
例如,要使用solar主题:
#cd /usr/lib/plymouth/ 
#plymouth-set-default-theme solar
#/usr/libexec/plymouth/plymouth-update-initrd

 

 

skyeye安装

参考给的版本太老,gtk-config早已被gtk 2.0抛弃
到官网下载最新版本,我们使用的是1.3.0
http://sourceforge.net/projects/skyeye/files/
skyeye 1.3.0 编译过程中
./configure && make lib && make 
一定要make lib,readme里没有写
  
 
进入解压后的目录,依次执行以下命令:
  
./configure
make lib
make
make install
make install_lib
  
其中,在make的时候,在编译uart_console.c时,会报告stropts.h找不到,需要去网上下载三个头文件放到
/usr/include目录下的 sys和bits目录下,三个文件分别是sys/stropts.h,  bits/stropts.h,  bits/xtitypes.h,可从
http://www.koders.com/info.aspx?c=ProjectInfo&piacd=AVWB885MV5PEZNQF3XEYQ49P8A
  
出现类似下面这种问题的解决办法
utils/uart_console/uart_console.c:58: 错误:expected identifier or ‘(’ before numeric constant
utils/uart_console/uart_console.c:59: 错误:expected identifier or ‘(’ before numeric constant
utils/uart_console/uart_console.c:62: 错误:expected identifier or ‘(’ before numeric constant
utils/uart_console/uart_console.c:63: 错误:expected identifier or ‘(’ before numeric constant
  
错误:expected identifier or ‘(’ before numeric constant
是因为在其它头文件中已将POLLRDNORM那些定义,此处是已被define
解决方法,将58到63行注释
//const uint32_t POLLRDNORM = 0x040;
//const uint32_t POLLRDBAND = 0x080;
//const uint32_t POLLPRI = 0x002;
//const uint32_t POLLOUT = 0x004;
//const uint32_t POLLWRNORM = 0x100;
//const uint32_t POLLWRBAND = 0x200;


因为在/usr/include/bits/poll.h中已经define,第32到35行
/* These values are defined in XPG4.2.  */
# define POLLRDNORM     0x040           /* Normal data may be read.  */
# define POLLRDBAND     0x080           /* Priority data may be read.  */
# define POLLWRNORM     0x100           /* Writing now will not block.  */
# define POLLWRBAND     0x200           /* Priority data may be written.  */

 

原文发表于2010年08月19日 01:03 

原创粉丝点击