itop4412调试记录

【记录5】linux3.5内核移植报错,以下链接不存在:

CROSS_COMPILE ?=/home/cym/exynos4412/4.2/android4.2.2_JLB_PC4_CYIT/pre

builts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-

【发生时间】20200212

【解决思路】

因为编译linux-3.5 内核需要使用Android4.2.2 源码自带的交叉编译器,所以需要把Android4.2.2 的源码拷贝到Ubuntu 虚拟机。例如把Android4.2.2 的压缩包“android-4.2.2_r1_xxxxxxxx.tar.gz”(通过网盘下载得到,xxxxxxxx 是版本日期)拷贝到Ubuntu 虚拟机的“/home/topeet/android”目录下,使用命令“tar -xvf android-4.2.2_r1_ xxxxxxxx.tar.gz”解压Android4.2.2 源码,解压完成后得到“android-4.2.2_r1”文件夹。接下来把Android4.2.2 的内核压缩包“iTOP-4412_Kernel-3.5_xxxxxxxx.tar.gz”(通过网盘下载得到,xxxxxxxx 是内核的版本日期)拷贝到Ubuntu 系统中,使用“tar -xvfiTOP-4412_Kernel-3.5_ xxxxxxxx.tar.gz”解压这个压缩包,然后生成Linux 内核源码文件夹“linux-3.5”。然后使用“cd linux-3.5”命令进入Linux 内核源码文件夹,在“linux-3.5”目录下找到“Makefile”文件,使用“vi Makefile”命令打开这个文件,然后找到包含以下内容的行:

“CROSS_COMPILE ?=/home/cym/exynos4412/4.2/android4.2.2_JLB_PC4_CYIT/pre

builts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-”修改成前面Android4.2.2 所存放的目录:“CROSS_COMPILE ?=/home/topeet/android/android-4.2.2_r1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-”这里是指定下交叉编译器的路径,修改完成后退出并保存Makefile 文件。接下来开始编译Linux 内核,在“linux-3.5”目录执行下面命令开始编译内核:

make

参考链接:Android 开发环境搭建以及编译 - Self_made - 博客园
https://www.cnblogs.com/liming1593/p/5198842.html

 

【记录4】驱动教程——视频9 编写应用程序调用驱动 出现 Segmentation fault

【发生时间】2020.02.04

【解决思路】

驱动程序中.unlocked_ioctl赋值为1是错误的,需要改正为:.unlocked_ioctl =hello_ioctl

static struct file_operations hello_ops = {

.owner = THIS_MODULE,

.open = hello_open,

.release = hello_release,

.unlocked_ioctl =1,

};

改正后,编译结果如下:

 

 

 

【记录3】驱动教程——视频3 make menuconfig

【发生时间】2020.02.04

问题:make menuconfig 提示 Unable to find the ncurses

*** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 *** 
 *** Install ncurses (ncurses-devel) and try again.
 ***
make[1]: *** [scripts/kconfig/dochecklxdialog] 错误 1
make: *** [menuconfig] 错误 2

解决方法:

1. 使用make menuconfig时,提示 Unable to find the ncurses

使用命令:sudo apt-get install libncurses5-dev,还是解决不了。

2. 通过观当前用户为普通用户topeet,更换为root后,问题消失。


【记录2】第三章 helloworld,无法挂载usb

现象:使用命令mount /dev/sda1 /mnt/usb,提示

mount: mounting /dev/sdb on /mnt/usb failed: No such file or directory

解决办法:cd /    (mount命令必须在根目录下使用)

 

【记录1】第二章 最小 Linux 系统,system.img烧写通不过!

现象:

烧写步骤失败:fastboot.exe flash system system.img

即使烧写成功,系统也会提升:[   16.603855] init: cannot execve('/system/bin/sh'): No such file or directory

解决办法:更换电脑端USB下载端口。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

snaking616

你的鼓励是我最大的动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值