编译我的hello.ko

一、环境:

1. PC: Fedora13:

[feng@~ #2]$uname -a
Linux Fedora13 2.6.34.8-68.fc13.i686.PAE #1 SMP Thu Feb 17 14:54:10 UTC 2011 i686 i686 i386 GNU/Linux
[feng@~ #3]$

2. 开发板

~ $ uname -a
Linux (none) 2.6.24-rt1-hi3515v100 #7 Thu Nov 10 18:42:18 CST 2011 armv5tejl unknown
~ $ 

二. 编译过程

1. 准备模块相关文件:源文件hello.c及Makefile

[root@c #72]#pwd
/mnt/mdisk5/program/c
[root@c #69]#ls -a
.  ..  hello.c  Makefile
[root@c #70]#cat hello.c 
#include <linux/init.h>
#include <linux/module.h>MODULE_LICENSE("GPL");static int hello_init(void)
{printk(KERN_ALERT "Hello, world\n");return 0;
}static void hello_exit(void)
{printk(KERN_ALERT "Goodbye, cruel world\n");
}module_init(hello_init);
module_exit(hello_exit);
[root@c #71]#cat Makefile 
ifneq ($(KERNELRELEASE), )obj-m := hello.o
else#KDIR ?= /mnt/mdisk5/kernel/linux-2.6.34.14KDIR ?= /mnt/mdisk5/kernel/linux-2.6.24PWD := $(shell pwd)default:$(MAKE) -C $(KDIR) M=$(PWD) modulescp hello.ko /tftpboot/DVR/clean:rm -f *.ko *.o *.mod.o *.mod.c Module.symvers modules.order .*.cmdrm -rf .tmp_versionsendif
[root@c #72]#

2. 准备内核源码及配置

[feng@~ #52]$cd /mnt/mdisk5/kernel/linux-2.6.24/
[feng@linux-2.6.24 #53]$ls -a
.   arch   COPYING  crypto         drivers  .gitignore   hi_patchset  init  Kbuild  lib                     .mailmap     Makefile  net     REPORTING-BUGS  scripts   sound
..  block  CREDITS  Documentation  fs       .hil_config  include      ipc   kernel  linux_kbuild_export.sh  MAINTAINERS  mm        README  samples         security  usr
[feng@linux-2.6.24 #54]$cp arch/arm/configs/hi3515v100_full_release_defconfig .config
[feng@linux-2.6.24 #55]$ls -a
.   arch   .config  CREDITS  Documentation  fs          .hil_config  include  ipc     kernel  linux_kbuild_export.sh  MAINTAINERS  mm   README          samples  security  usr
..  block  COPYING  crypto   drivers        .gitignore  hi_patchset  init     Kbuild  lib     .mailmap                Makefile     net  REPORTING-BUGS  scripts  sound
[feng@linux-2.6.24 #56]$head -n10 .config 
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.24
# Fri Nov 20 09:15:27 2009
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
# CONFIG_GENERIC_GPIO is not set
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
[feng@linux-2.6.24 #57]$head -n10 Makefile 
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 24
EXTRAVERSION =
NAME = Arr Matey! A Hairy Bilge Rat!HIL_CONFIG_FILE=.hil_config# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
[feng@linux-2.6.24 #58]$make prepareHOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c: 在函数‘traps’中:
scripts/basic/fixdep.c:377: 警告:提领类型双关的指针将破坏强重叠规则
scripts/basic/fixdep.c:379: 警告:提领类型双关的指针将破坏强重叠规则HOSTCC  scripts/basic/docprocHOSTCC  scripts/kconfig/conf.oHOSTCC  scripts/kconfig/kxgettext.oSHIPPED scripts/kconfig/zconf.tab.cSHIPPED scripts/kconfig/lex.zconf.cSHIPPED scripts/kconfig/zconf.hash.cHOSTCC  scripts/kconfig/zconf.tab.o
scripts/kconfig/lex.zconf.c:1639: 警告:‘input’定义后未使用HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/arm/Kconfig
arch/arm/Kconfig:11:warning: 'select' used by config symbol 'ARM' refers to undefined symbol 'HAVE_ARCH_KGDB'
.config:57:warning: trying to assign nonexistent symbol RADIX_TREE_CONCURRENT
.config:58:warning: trying to assign nonexistent symbol HAVE_IMMEDIATE
.config:86:warning: trying to assign nonexistent symbol LTT_TIMESTAMP
.config:87:warning: trying to assign nonexistent symbol HAVE_LTT_UNSTABLE_TSC
.config:88:warning: trying to assign nonexistent symbol HAVE_LTT_CLOCK
.config:89:warning: trying to assign nonexistent symbol HAVE_LTT_SYNTHETIC_TSC
.config:90:warning: trying to assign nonexistent symbol HAVE_LTT_DUMP_TABLES
.config:91:warning: trying to assign nonexistent symbol HAVE_OPROFILE
.config:92:warning: trying to assign nonexistent symbol HAVE_KPROBES
.config:218:warning: trying to assign nonexistent symbol PREEMPT_DESKTOP
.config:219:warning: trying to assign nonexistent symbol PREEMPT_RT
.config:220:warning: trying to assign nonexistent symbol PREEMPT_SOFTIRQS
.config:221:warning: trying to assign nonexistent symbol PREEMPT_HARDIRQS
.config:223:warning: trying to assign nonexistent symbol CLASSIC_RCU
.config:224:warning: trying to assign nonexistent symbol PREEMPT_RCU
.config:225:warning: trying to assign nonexistent symbol RCU_TRACE
.config:869:warning: trying to assign nonexistent symbol RMEM
.config:870:warning: trying to assign nonexistent symbol ALLOC_RTSJ_MEM
.config:1507:warning: trying to assign nonexistent symbol EVENT_TRACE
.config:1508:warning: trying to assign nonexistent symbol WAKEUP_TIMING
.config:1509:warning: trying to assign nonexistent symbol CRITICAL_IRQSOFF_TIMING
.config:1526:warning: trying to assign nonexistent symbol GCOV_PROFILE
.config:1527:warning: trying to assign nonexistent symbol KGDB
*
* Restart config...
*
*
* Kernel Features
*
Tickless System (Dynamic Ticks) (NO_HZ) [N/y/?] n
High Resolution Timer Support (HIGH_RES_TIMERS) [N/y/?] n
Preemption Model
> 1. No Forced Preemption (Server) (PREEMPT_NONE)2. Voluntary Kernel Preemption (Desktop) (PREEMPT_VOLUNTARY)3. Preemptible Kernel (Low-Latency Desktop) (PREEMPT) (NEW)
choice[1-3]: 
Use the ARM EABI to compile the kernel (AEABI) [N/y/?] n
Memory model
> 1. Flat Memory (FLATMEM_MANUAL)
choice[1]: 1
64 bit Memory and IO resources (EXPERIMENTAL) (RESOURCES_64BIT) [N/y/?] n
*
* USB support
*
USB support (USB_SUPPORT) [Y/n/?] ySupport for Host-side USB (USB) [Y/n/m/?] yUSB verbose debug messages (USB_DEBUG) [N/y/?] n** Miscellaneous USB options*USB device filesystem (USB_DEVICEFS) [Y/n/?] yUSB device class-devices (DEPRECATED) (USB_DEVICE_CLASS) [Y/n/?] yDynamic USB minor allocation (EXPERIMENTAL) (USB_DYNAMIC_MINORS) [N/y/?] n** USB Host Controller Drivers*EHCI HCD (USB 2.0) support (USB_EHCI_HCD) [Y/n/m/?] yFull speed ISO transactions (EXPERIMENTAL) (USB_EHCI_SPLIT_ISO) [N/y/?] nRoot Hub Transaction Translators (EXPERIMENTAL) (USB_EHCI_ROOT_HUB_TT) [N/y/?] nImproved Transaction Translator scheduling (EXPERIMENTAL) (USB_EHCI_TT_NEWSCHED) [N/y/?] nISP116X HCD support (USB_ISP116X_HCD) [N/m/y/?] nOHCI HCD support (USB_OHCI_HCD) [Y/n/m/?] ySL811HS HCD support (USB_SL811_HCD) [N/m/y/?] nR8A66597 HCD support (USB_R8A66597_HCD) [N/m/y/?] n** USB Device Class drivers*USB Modem (CDC ACM) support (USB_ACM) [M/n/y/?] mUSB Printer support (USB_PRINTER) [N/m/y/?] n** NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'*** may also be needed; see USB_STORAGE Help for more information*USB Mass Storage support (USB_STORAGE) [M/n/y/?] mUSB Mass Storage verbose debug (USB_STORAGE_DEBUG) [N/y/?] nDatafab Compact Flash Reader support (EXPERIMENTAL) (USB_STORAGE_DATAFAB) [Y/n/?] yFreecom USB/ATAPI Bridge support (USB_STORAGE_FREECOM) [Y/n/?] yISD-200 USB/ATA Bridge support (USB_STORAGE_ISD200) [Y/n/?] yMicrotech/ZiO! CompactFlash/SmartMedia support (USB_STORAGE_DPCM) [Y/n/?] yUSBAT/USBAT02-based storage support (EXPERIMENTAL) (USB_STORAGE_USBAT) [Y/n/?] ySanDisk SDDR-09 (and other SmartMedia) support (EXPERIMENTAL) (USB_STORAGE_SDDR09) [Y/n/?] ySanDisk SDDR-55 SmartMedia support (EXPERIMENTAL) (USB_STORAGE_SDDR55) [Y/n/?] yLexar Jumpshot Compact Flash Reader (EXPERIMENTAL) (USB_STORAGE_JUMPSHOT) [Y/n/?] yOlympus MAUSB-10/Fuji DPC-R1 support (EXPERIMENTAL) (USB_STORAGE_ALAUDA) [Y/n/?] ySupport OneTouch Button on Maxtor Hard Drives (EXPERIMENTAL) (USB_STORAGE_ONETOUCH) [N/y/?] nSupport for Rio Karma music player (USB_STORAGE_KARMA) [N/y/?] nThe shared table of common (or usual) storage devices (USB_LIBUSUAL) [N/y/?] n** USB Imaging devices*USB Mustek MDC800 Digital Camera support (EXPERIMENTAL) (USB_MDC800) [M/n/y/?] mMicrotek X6USB scanner support (USB_MICROTEK) [M/n/y/?] mUSB Monitor (USB_MON) [Y/n/?] y** USB port drivers*** USB Miscellaneous drivers*EMI 6|2m USB Audio interface support (USB_EMI62) [M/n/y/?] mEMI 2|6 USB Audio interface support (USB_EMI26) [M/n/y/?] mADU devices from Ontrak Control Systems (EXPERIMENTAL) (USB_ADUTUX) [N/m/y/?] nUSB Auerswald ISDN support (EXPERIMENTAL) (USB_AUERSWALD) [M/n/y/?] mUSB Diamond Rio500 support (EXPERIMENTAL) (USB_RIO500) [M/n/y/?] mUSB Lego Infrared Tower support (EXPERIMENTAL) (USB_LEGOTOWER) [M/n/y/?] mUSB LCD driver support (USB_LCD) [M/n/y/?] mUSB BlackBerry recharge support (USB_BERRY_CHARGE) [N/m/y/?] nUSB LED driver support (USB_LED) [M/n/y/?] mCypress CY7C63xxx USB driver support (USB_CYPRESS_CY7C63) [N/m/y/?] nCypress USB thermometer driver support (USB_CYTHERM) [N/m/y/?] nUSB Phidgets drivers (USB_PHIDGET) [N/m/y/?] nSiemens ID USB Mouse Fingerprint sensor support (USB_IDMOUSE) [M/n/y/?] mElan PCMCIA CardBus Adapter USB Client (USB_FTDI_ELAN) [N/m/y/?] nApple Cinema Display support (USB_APPLEDISPLAY) [M/n/y/?] mUSB 2.0 SVGA dongle support (Net2280/SiS315) (USB_SISUSBVGA) [N/m/y/?] (NEW) USB LD driver (USB_LD) [M/n/y/?] mPlayStation 2 Trance Vibrator driver support (USB_TRANCEVIBRATOR) [N/m/y/?] nIO Warrior driver support (USB_IOWARRIOR) [N/m/y/?] nUSB testing driver (DEVELOPMENT) (USB_TEST) [M/n/y/?] m
#
# configuration written to .config
#CHK     include/linux/version.hUPD     include/linux/version.hSYMLINK include/asm-arm/arch -> include/asm-arm/arch-hi3515v100Generating include/asm-arm/mach-types.hCHK     include/linux/utsrelease.hUPD     include/linux/utsrelease.hSYMLINK include/asm -> include/asm-armCC      arch/arm/kernel/asm-offsets.sGEN     include/asm-arm/asm-offsets.hCALL    scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
[feng@linux-2.6.24 #59]$
[feng@linux-2.6.24 #59]$make scriptsCC      scripts/mod/empty.oHOSTCC  scripts/mod/mk_elfconfigMKELF   scripts/mod/elfconfig.hHOSTCC  scripts/mod/file2alias.oHOSTCC  scripts/mod/modpost.oHOSTCC  scripts/mod/sumversion.oHOSTLD  scripts/mod/modpostHOSTCC  scripts/kallsymsHOSTCC  scripts/conmakehash

3. 编译模块,并将模块拷贝到目标目录(/tftpboot/DVR/)

[root@c #72]#pwd
/mnt/mdisk5/program/c
[root@c #73]#cd
[root@~ #74]#cd /mnt/mdisk5/program/c/
[root@c #75]#ls -a
.  ..  hello.c  Makefile
[root@c #76]#make
make -C /mnt/mdisk5/kernel/linux-2.6.24 M=/mnt/mdisk5/program/c modules
make[1]: Entering directory `/mnt/mdisk5/kernel/linux-2.6.24'WARNING: Symbol version dump /mnt/mdisk5/kernel/linux-2.6.24/Module.symversis missing; modules will have no dependencies and modversions.CC [M]  /mnt/mdisk5/program/c/hello.oBuilding modules, stage 2.MODPOST 1 modulesCC      /mnt/mdisk5/program/c/hello.mod.oLD [M]  /mnt/mdisk5/program/c/hello.ko
make[1]: Leaving directory `/mnt/mdisk5/kernel/linux-2.6.24'
cp hello.ko /tftpboot/DVR/
[root@c #77]#modinfo hello.ko
filename:       hello.ko
license:        GPL
depends:        
vermagic:       2.6.24-rt1-hi3515v100 mod_unload ARMv5 
[root@c #78]#ls -a
.  ..  hello.c  hello.ko  .hello.ko.cmd  hello.mod.c  hello.mod.o  .hello.mod.o.cmd  hello.o  .hello.o.cmd  Makefile  Module.symvers  .tmp_versions
[root@c #79]#

4. 在开发板上装载和卸载hello.ko

/mnt/nfs $ cd
~ $ pwd
/root
~ $ df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/mtdblock2           21020     21020         0 100% /
tmpfs                    22400         4     22396   0% /dev
tmpfs                    22400      7920     14480  35% /tmp
tmpfs                    22400         0     22400   0% /mnt
tmpfs                    22400         4     22396   0% /var
/dev/mtdblock1            2048       772      1276  38% /mnt/mtd
192.168.1.37:/tftpboot/DVR  19094240  13034976   5089312  72% /mnt/nfs
~ $ cd /mnt/nfs
/mnt/nfs $ ls
Wireless                  lvr_3515_pf_new           snap_20000101_000143.jpg
hello.ko                  lvrosd                    snap_20000101_000223.jpg
isp_config.ini            res                       snap_20000101_000657.jpg
lvftest                   screenshot_hisi           wiff
/mnt/nfs $ insmod hello.ko 
Hello, world
/mnt/nfs $ lsmod | grep hello    
hello                   1024  0 
/mnt/nfs $ rmmod hello    
Goodbye, cruel world
/mnt/nfs $ lsmod | grep hello
/mnt/nfs $ 

三、说明

1.  我的Fedora13的IP为:192.168.1.37,开发板将Fedora13下的/tftpboot/DVR/ 挂载到 /mnt/nfs/ 下

2.  我上面的运行结果是串口下进行的,所以能看到输出的结果。如果是通过telnet上去的话,可能看不到输出结果的,但是可以用cat /var/log/syslog 或 dmesg 查看

3.  我用的开发板是基于海思Hi3515平台的,所以用的.config来自于arch/arm/configs/hi3515v100_full_release_defconfig文件。

4.  若要对内核源代码进行清理,以便下次重新编译,可以执行"make clean"或"make distclean",这两个的区别可以看内核目录下的Makefile文件,说明很详细!

四、总结

1. 对内核源代码的相关操作:

a)  进入内核源代码目录

b) 生成.config文件,方法有很多,我是运行"cp arch/arm/configs/hi3515v100_full_release_defconfig .config",根据不同的目标环境,复制的源配置文件也不同。

c) 执行: make prepare

d) 执行: make scripts


2. 对自己编写的模块的操作

a) 写好hello.c及Makefile文件(文件名必须为”Makefile", 不能为“makefile")

b) 编译: make


3. 遇到错误,可参考: http://blog.csdn.net/joeblackzqq/article/details/8694431


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/405070.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

[react] 在React中你有遇到过安全问题吗?怎么解决?

[react] 在React中你有遇到过安全问题吗&#xff1f;怎么解决&#xff1f; dangerouslySetInnerHTML预防xss攻击 个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

SQL Server之索引

简单来说&#xff0c;索引就是一个指针&#xff0c;指向表里的数据。创建索引create indext index_name on table_name删除索引drop index index_name on table_name索引的类型单字段索引create indext index_name on table_name&#xff08;column_name&#xff09;如果某个字…

Qt多线程编程的主要线程类

1、描述 Qt提供QThread类处理多线程&#xff0c;继承自QObject。不受平台影响&#xff0c;实现跨平台功能。 2、主要的线程类 QAtomicInt&#xff1a;提供Interger与平台无关的Atomic运算&#xff0c;即提供了整数常用的原子操作&#xff0c;支持四种类型的操作。支持四种类…

安装kernel API的man手册

From: http://blog.163.com/yun_2527/blog/static/3527186120122242516589/ 参考&#xff1a;http://hi.baidu.com/handsoul/blog/item/eb2f59f11d55e8d90a46e0b2.html 系统环境&#xff1a;ubuntu-10.04.1-desktop-i386 1、下载一个内核源代码 2、安装make mandocs的两个依…

绝对不忽悠、暑期择机功能该咋选?

暑期已经过去一半了&#xff0c;但每年的择机高潮却正是个如火如荼&#xff0c;正值暑促阶段&#xff0c;很多手机厂商或商家都会适当的调整价格或者推出更具优惠的方案&#xff0c;吸引买家&#xff0c;其中不乏很多在手机功能上的大肆宣传&#xff0c;我们买手机看重的无外乎…

ASP.NET 5 Beta7发布

&#xff08;此文章同时发表在本人微信公众号“dotNET每日精华文章”&#xff0c;欢迎右边二维码来关注。) 前几天&#xff0c;ASP.NET 5如期发布了Beta 7&#xff0c;根据路线图 (https://github.com/aspnet/home/wiki/roadmap)&#xff0c;这次发布主要是实现跨平台的能力。之…

[react] 说说你对React的reconciliation(一致化算法)的理解

[react] 说说你对React的reconciliation&#xff08;一致化算法&#xff09;的理解 就是启发式Diff算法 &#xff0c;时间复杂度从N的三次方下降到N &#xff0c;通过博客途径了解到实现的策略是 tree diff , element diff , component diff 算法 。在diff算法中如果element 没…

CM3计算板装系统

1、CM3计算板简介 把树莓派搬到自己的产品中&#xff0c;一种和树莓派基础功能一模一样的板卡&#xff0c;并对相关管脚扩展&#xff0c;完成产品级的功能设计和硬件设计。板卡如下图所示&#xff0c;运行的是Linux操作系统。 2、下载镜像 CM3有多种内存搭配&#xff0c;常见…

线性表的各种基本操作

#include"stdio.h" #include<malloc.h> typedef char ElemType; typedef struct LNode{ElemType data;struct LNode *next; } LinkList; void CreatListF(LinkList *&L,ElemType a[],int n){ //头插法建表LinkList *s;int i;L(LinkList *)malloc(sizeof(L…

关于 CKEditor 3.6以后不兼容ie6的问题解决方案

2019独角兽企业重金招聘Python工程师标准>>> skins\模版名称\editor.css 在第一个.cke_skin_kama *,.cke_skin_kama a:hover,.cke_skin_kama a:link,.cke_skin_kama a:visited,.cke_skin_kama a:active{.....}里面添加 _overflow:hidden;即可. 转载于:https://my.os…

[react] 写例子说明React如何在JSX中实现for循环

[react] 写例子说明React如何在JSX中实现for循环 map方法 个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

USB/UART 串口转LoRa无线传输调试工具 评估套件

一、LoRa无线传输的特点 LoRa无线通信采用扩频调制通信方式&#xff0c;抗干扰强、灵敏度高&#xff0c;能够在较低功耗的情况下传输更远的距离。采用ISM免授权频段&#xff08;470MHZ-510MHZ&#xff09;&#xff0c;用于无线抄表、工业监控、农业管理、智慧园区、智慧楼宇等…

新手指导:51CTO微博小技巧

您是初次接触微博吗&#xff1f;您是不是不了解微博&#xff0c;不知道怎样才能玩转微博&#xff1f;没关系&#xff0c;小管家这就教您几招&#xff0c;让您通过140字轻松的将看到的、听到的、想到的事情随时随地分享给朋友。 一、怎样拥有微博二、新手快速使用微博攻略 2…

Linux给GCC编译的应用程序创建服务

一、创建服务文件 linux 服务文件的位置在&#xff1a; /etc/systemd/system &#xff0c;进入该目录。首先创建一个服务文件&#xff0c;名字可以按照xxx.service 的格式命名&#xff0c;例如我的噪声处理服务命名: noiserun.service。创建文件需要sudo权限&#xff1a;sudo …

[react] 怎样有条件地渲染组件?

[react] 怎样有条件地渲染组件&#xff1f; {condition && <Component />} or {condition ? <Component /> : <AnotherComponent />} 个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大…

13.bash shell中的if-then语句

文章目录 shell中的流控制if语句if语句if-then语句if-then-else 语句 test命令数值比较字符串比较文件比较case语句 欢迎访问个人网络日志&#x1f339;&#x1f339;知行空间&#x1f339;&#x1f339; shell中的流控制if语句 简单的脚本可以只包含顺序执行的命令&#xff0…

贪心算法问题

7.设有n 种物品&#xff0c;每种物品有一个重量及一个价值。但每种物品的数量是无限的&#xff0c;同时有一个背包&#xff0c; 最大载重量为M&#xff0c;今从n 种物品中选取若干件(同一种物品可以多次选取)&#xff0c;使其重量的和小于等于M&#xff0c; 而价值的和为最大。…

IOS贝塞尔曲线圆形进度条和加载动画

做项目让做一个加载动画,一个圈圈在转中间加一个图片,网上有好多demo,这里我也自己写了一个,中间的图片可加可不加。其中主要用到贝塞尔曲线。UIBezierPath是对CGContextRef的进一步封装,不多说直接上代码&#xff1a; #import <UIKit/UIKit.h>interface CircleLoader : …

CM3计算板EC20模组拨号上网

1、安装 ppp 安装ppp&#xff1a;sudo apt-get install ppp 2、配置路由 查看路由和网卡 ifconfig ; route -n增加路由设备&#xff1a; sudo route add default dev ppp0 3、执行拨号脚本 进入linux-ppp-scripts 文件下&#xff1a;sudo ./quectel-pppd.sh /dev/ttyUSB3 …

[react] 你是如何划分React组件的?

[react] 你是如何划分React组件的&#xff1f; 可复用的功能 可复用的页面 当你在多个地方写一样或类似的代码时&#xff0c;就该考虑封装组件 个人简介 我是歌谣&#xff0c;欢迎和大家一起交流前后端知识。放弃很容易&#xff0c; 但坚持一定很酷。欢迎大家一起讨论 主目录…