Chinaunix首页 | 论坛 | 博客
  • 博客访问: 65007
  • 博文数量: 38
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 138
  • 用 户 组: 普通用户
  • 注册时间: 2014-02-26 16:24
文章分类

全部博文(38)

文章存档

2014年(38)

我的朋友

分类: LINUX

2014-05-26 09:14:01

我按照上面的方法在mini2440上安装了emdebian,不过我使用的文件系统是上面的
可以启动,我也对遇到的问题进行了些改进,比如:

一、编译环节,完全可以不使用上面提到的
arm-2008q3-72-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
来编译u-boot和kernel,为了与友善之臂提供的程序兼容,可以直接使用友善现在的交叉编译器arm-linux-gcc-4.4.3.tgz 来编译它们,这样后面移植图形环境,就可以直接拷贝rootfs_qtopia_qt4-20100816.tar.gz 之中的qtopia部分来使用了,而不用重新编译这样麻烦了, 其中的文件系统我使用的是 之中的
emdebian-grip-090306-armel-lenny-installed.tar.bz2
也有squeeze的更新的稳定版本,可以参考 使用
  1. sudo debootstrap --arch=armel --foreign squeeze grip/ http://www.emdebian.org/grip/
这样的方法下载文件系统(最好是先执行 sudo -s , 再运行上述命令,因为文件系统中有些文件需要完整的root用户权限来生成), 但是我使用上述方法下载的文件系统,etc文件夹中没有inittab这个文件,这样我就不好使用变换 runlevel 的方法,来进行更换图形界面的操作。

二、u-boot 和 kernel 都移植好后,rootfs 也写进SD卡了,然而在开发板系统启动过程中遇到以下错误,
  1. mmc0: error -110 whilst initialising SD card
  2. s3c-sdi s3c2440-sdi: powered down.
  3. usb 1-1.1: new low speed USB device using s3c2410-ohci and address 3
  4. usb 1-1.1: configuration #1 chosen from 1 choice
  5. input: USB Optical Mouse as /devices/platform/s3c2410-ohci/usb1/1-1/1-1.1/1-1.1:
  6. 1.0/input/input2
  7. generic-usb 0003:192F:0416.0001: input,hidraw0: USB HID v1.11 Mouse [USB Optical
  8.  Mouse] on usb-s3c24xx-1.1/input0
  9. usb 1-1.2: new full speed USB device using s3c2410-ohci and address 4
  10. usb 1-1.2: configuration #1 chosen from 1 choice
  11. Root-NFS: No NFS server available, giving up.
  12. VFS: Unable to mount root fs via NFS, trying floppy.
  13. VFS: Cannot open root device "mmcblk0p1" or unknown-block(2,0)
  14. Please append a correct "root=" boot option; here are the available partitions:
  15. 1f00 256 mtdblock0 (driver?)
  16. 1f01 128 mtdblock1 (driver?)
  17. 1f02 5120 mtdblock2 (driver?)
  18. 1f03 256640 mtdblock3 (driver?)
  19. Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
  20. [<c002e954>] (unwind_backtrace+0x0/0xd8) from [<c02d56fc>] (panic+0x40/0x118)
  21. [<c02d56fc>] (panic+0x40/0x118) from [<c0008e74>] (mount_block_root+0x1c8/0x208)
  22. [<c0008e74>] (mount_block_root+0x1c8/0x208) from [<c0009108>] (prepare_namespace
  23. +0x160/0x1b8)
  24. [<c0009108>] (prepare_namespace+0x160/0x1b8) from [<c0008434>] (kernel_init+0xd8
  25. /0x10c)
  26. [<c0008434>] (kernel_init+0xd8/0x10c) from [<c002a868>] (kernel_thread_exit+0x0/
  27. 0x8)
不要慌张,再重新启动一遍,可能就容易进系统了,我的情况就是这样的,如果还是不行,那么就可能是SD卡没有放好,或是SD卡中的文件系统出问题了。重新做一遍文件系统吧!

三、登录问题,我将文件系统中的/etc/inittab修改为了
  1. 4 # The default runlevel.
  2. 5 id:S:initdefault:
这样,登录的时候,按下回车键,就进入了系统:
simone:/# 

或者,console的问题也可以通过直接修改sd卡上的文件来解决。

  1. # echo ttySAC0 >>etc/securetty
  2. # printf "T0:123:respawn:/sbin/getty 115200 ttySAC0\n" >>etc/inittab

然后,对于自动登录,可以参照如下方法:
for auto login
edit /etc/inittab and change
  1. 1:2345:respawn:/sbin/getty 38400 tty1
to make it look like
  1. #1:2345:respawn:/sbin/getty 38400 tty1
  2. 1:2345:respawn:/bin/login -f root tty1 </dev/tty1 >/dev/tty1 2>&1
对于,minicom之类的串口终端没有自动登录的问题,则可以在将最后面的
  1. T0:123:respawn:/sbin/getty 115200 ttySAC0
改为:
  1. #T0:12345:respawn:/sbin/rungetty ttySAC0 --autologin root
  2. T0:12345:respawn:/bin/login -f root 115200 ttySAC0 </dev/ttySAC0 >/dev/ttySAC0 2>&1
这样,开发板LCD屏幕上与串口终端两边都可以自动登录了。

四、在插入U盘的时候,出现了
  1. modprobe: FATAL: Could not open 'kernel/drivers/usb/storage/usb-storage.ko'
这个问题,于是我运行了一遍
  1. depmod -a
就好了。

五、上网问题,由于我是在学校里面,IP是动态获取的,运行 dhclient eth0 使之自动分配IP,如果还不可以直接上网,那么可以发挥教育网的优势,先使用DevilProxy,自己去搜索网上的教育网代理吧,找到可以使用的免费代理,比如我的就是将/etc/bash.bashrc后面加上以下语句:
  1. http_proxy=202.112.117.202:3128
  2. export http_proxy
而对于etc/apt/sources.list , 我找到的可以连接的软件源如下:
  1. #中科大
  2. deb ftp://debian.ustc.edu.cn/debian lenny main non-free contrib
  3. deb-src ftp://debian.ustc.edu.cn/debian lenny main non-free contrib
再运行 apt-get update 后,即可上网.

六、移植图形界面,直接将友善
rootfs_qtopia_qt4-20100816.tar.gz
之中的 opt 文件夹 和 usr/local/ 文件夹全部按照同样的路径拷贝到SD卡下面去,然后在root文件夹下添加一个文件 .bash_profile ,内容如下:
  1. if [ -f ~/.bashrc ] ; then
  2. . ~/.bashrc
  3. fi

  4. /bin/qtopia &
  5. echo " " > /dev/tty1
  6. echo "Starting Qtopia, please waiting..." > /dev/tty1
 重新开机,即可看到qtopia2.2的画面了。但是其中还是有些问题(比如"Start Qt4.6.3"图标失去作用),需要在后续研究中解决。

七、 T35统宝3.5寸LCD中,图形界面偏移问题
我查看资料过程中,发现在arch/arm/mach-s3c2440/mach-mini2440.c 这个文件中有以下代码:

  1. static struct s3c2410fb_display mini2440_lcd_cfg[] __initdata = {
  2.     [0] = {    /* mini2440 + 3.5" TFT + touchscreen - old model "N35" */
  3.         _LCD_DECLARE(
  4.             7,            /* The 3.5 is quite fast */
  5.             240, 21, 38, 6,     /* x timing */
  6.             320, 4, 4, 2,        /* y timing */
  7.             60),            /* refresh rate */
  8.         .lcdcon5    = (S3C2410_LCDCON5_FRM565 |
  9.                  S3C2410_LCDCON5_INVVLINE |
  10.                  S3C2410_LCDCON5_INVVFRAME |
  11.                  S3C2410_LCDCON5_INVVDEN |
  12.                  S3C2410_LCDCON5_PWREN),
  13.     },
  14. ........
  15.     [3] = {    /* mini2440 + 3.5" TFT + TS -- New model as Nov 2009 "T35" */
  16.         _LCD_DECLARE(
  17.             7,            /* The 3.5 is quite fast */
  18.             240, 21, 25, 6,     /* x timing */
  19.             320, 2, 4, 2,        /* y timing */
  20.             40),            /* refresh rate */
  21.         .lcdcon5    = (S3C2410_LCDCON5_FRM565 |
  22.                  S3C2410_LCDCON5_INVVLINE |
  23.                  S3C2410_LCDCON5_INVVFRAME |
  24.                  S3C2410_LCDCON5_INVVDEN |
  25.                  S3C2410_LCDCON5_PWREN),
  26.     },
而且在Documentation/kernel-parameters.txt  中,也有以下说明:
  1. mini2440=    [ARM,HW,KNL]
  2.             Format:[0..2][b][c][t]
  3.             Default: "0tb"
  4.             MINI2440 configuration specification:
  5.             0 - The attached screen is the 3.5" TFT
  6.             1 - The attached screen is the 7" TFT
  7.             2 - The VGA Shield is attached (1024x768)
  8.             Leaving out the screen size parameter will not load
  9.             the TFT driver, and the framebuffer will be left
  10.             unconfigured.
  11.             b - Enable backlight. The TFT backlight pin will be
  12.             linked to the kernel VESA blanking code and a GPIO
  13.             LED. This parameter is not necessary when using the
  14.             VGA shield.
  15.             c - Enable the s3c camera interface.
  16.             t - Reserved for enabling touchscreen support. The
  17.             touchscreen support is not enabled in the mainstream
  18.             kernel as of 2.6.30, a preliminary port can be found
  19.             in the "bleeding edge" mini2440 support kernel at
  20.             http://repo.or.cz/w/linux-2.6/mini2440.git
这样,后来,经过测试,直接在u-boot的设置环境中,输入以下语句。
  1. setenv bootargs 'noinitrd rootdelay=4 mini2440=3tb root=/dev/mmcblk0p1 console=ttySAC0,115200'
  2. saveenv
然后输入 reset 重启 ,即可得到没有偏移的图形界面。

八、安装xorg icewm 的过程中遇到的问题:
首先,安装 icewm 使用以下命令:
  1. apt-get install xorg icewm arora
  2. apt-get install xserver-xorg-input-evtouch
  3. apt-get install xserver-xorg-input-tslib
  4. apt-get install xserver-xorg-video-fbdev
如果还不行的话,再试试下面的命令:
apt-get install xserver-xorg-input-evtouch xorg xserver-xorg-video-fbdev xfonts-base xinit xfonts-75dpi xserver-xorg-input-mouse xserver-xorg-input-kbd udev locales

在使用startx 后出现以下错误:
  1. (EE) FBDEV(0): FBIOPUT_VSCREENINFO: Invalid argument
  2. (EE) FBDEV(0): mode initialization failed
解决这个问题的过程中发现这样一段话:
  1. also fighting with the error and found a sulotion on a japanisch site,
  2. thx google translate :-)
  3. you need to ad one line to the fb driver im kernel.
  4. edit this in your kernel ../linux/drivers/video/fbmem.c
  5. Rewriting point (fbmem.c, near line 1050)
  6. case FBIOPUT_VSCREENINFO:
  7. return 0; #### INSERT THIS LINE ####
  8. if(copy_from_user(&var...))
  9. return -EFAULT;
  10. recompile your kernel(uImage) and be happy.
按照上面所说的方法修改代码并重新编译后,就可以 startx 重新启动 icewm/x11 图形界面了。

(注:此图为之中的图片,我的屏幕上方有T35的标志)

九、图形界面的触摸屏校正方法,在qtopia2之中,直接使用tslib即可。不过要将 bin/qtopia 之中的
  1. export TSLIB_TSDEVICE=/dev/input/event0
 修改为
  1. export TSLIB_TSDEVICE=/dev/input/event1
可以先把/etc/pointercal 这个文件删除,然后再开机测试,这样可以更好的校正触摸屏。

而对于 icewm/x11 图形界面,它的既可以使用 tslib, 也可以使用 evtouch.
不过两者对于 /etc/X11/xorg.conf 这个文件的内容,都不一样. 这两者,我都没有测试成功。
对于tslib ,我参考的两篇文章网址如下:

对于 evtouch ,我参考的文章网址如下:

我直接使用的是鼠标。
其中,icewm 图形界面中的字体太大了,可以将xorg.conf 之中的  
  1. Section "Monitor"
  2. Identifier "Monitor0"
  3. ModelName "Monitor Model"
  4. DisplaySize 240 320
  5. EndSection
240 与 320 修改为 100 与 150 ,即可正常显示。

十、使用runlevel 来更换图形界面:
首先,在etc/init.d/ 文件夹下面生成两个文件,分别为 qtopia2.sh 内容为:
  1. # enable bash completion in interactive shells
  2. if [ -f /etc/profile ]; then
  3.     . /etc/profile
  4. fi

  5. /bin/qtopia &
  6. echo " " > /dev/tty1
  7. echo "Starting Qtopia, please waiting..." > /dev/tty1
startx.sh 内容为:
  1. # enable bash completion in interactive shells
  2. if [ -f /etc/profile ]; then
  3.     . /etc/profile
  4. fi

  5. if [ -f /etc/pointercal ]; then
  6.         startx &
  7.     else
  8.         /usr/local/bin/ts_calibrate
  9.         startx &
  10. fi
而 etc/profile 的内容为:
 
  1. # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
  2. # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

  3. export TSLIB_TSDEVICE=/dev/input/event1
  4. export TSLIB_ROOT=/usr/local/tslib
  5. export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
  6. export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
  7. export TSLIB_CALIBFILE=/etc/pointercal
  8. export TSLIB_CONSOLEDEVICE=none
  9. export TSLIB_FBDEVICE=/dev/fb0
  10. export LD_LIBRARY_PATH=$TSLIB_ROOT/lib:$LD_LIBRARY_PATH

  11. if [ "`id -u`" -eq 0 ]; then
  12.   PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  13. else
  14.   PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
  15. fi

  16. if [ "$PS1" ]; then
  17.   if [ "$BASH" ]; then
  18.     PS1='\u@\h:\w\$ '
  19.     if [ -f /etc/bash.bashrc ]; then
  20.     . /etc/bash.bashrc
  21.     fi
  22.   else
  23.     if [ "`id -u`" -eq 0 ]; then
  24.       PS1='# '
  25.     else
  26.       PS1='$ '
  27.     fi
  28.   fi
  29. fi

  30. export PATH

  31. umask 022
再使用以下命令将这些图形界面与权限挂钩:
  1. cd etc/
  2. chmod a+x etc/init.d/qtopia2.sh
  3. chmod a+x etc/init.d/startx.sh
  4. ln init.d/qtopia2.sh rc2.d/S99qtopia2
  5. ln init.d/startx.sh rc5.d/S99startx
如此之后,只需要修改 etc/inittab之中的id后面的数字, 换成自己想要的图形界面的权限号即可。

  1. # The default runlevel.
  2. id:2:initdefault:

但如果想要在qtopia2.2 与 icewm 的图形界面之间切换,还得先在命令行中修改/etc/inittab中的ID,然后重启系统才能产生效果,所以如果能够有种方法像,新版mini2440-qtopia2.2中的“Start Qt4.6.3”图标启动qt4的方法来启动icewm,那样就更好了,但是由于友善没有提供qt4-starter的源码,所以也就没有办法做研究了!
阅读(918) | 评论(0) | 转发(0) |
0

上一篇:tslib-1.4的安装与移植

下一篇:学习篇

给主人留下些什么吧!~~