- 博客(33)
- 资源 (3)
- 收藏
- 关注
原创 signal 信号处理例子
#include <errno.h>#include <signal.h>#include <stdio.h>#include <string.h>#include <sys/time.h>#include <sys/types.h>#include <unistd.h>#include <time.h>#include <sys/types.h>#include <sys/s
2020-11-12 07:32:44
310
原创 CRC校验码
一 、CRC 16 modbus (推荐使用这种)unsigned short crc16_modbus(unsigned char* ptr, unsigned int len){ unsigned short crc = 0xFFFF; unsigned char i, j; for (j = 0; j < len; j ++) { crc = crc ^ *ptr++; ...
2020-06-10 18:46:17
617
原创 小白如何利用U盘启动盘给电脑或者嵌入式设备安装标准Ubuntu系统
1.制作U盘启动盘准备好U盘,和Ubuntu镜像文件以及下载好Universal USB Installer,请自行下载准备文件。Linux 可启动 U 盘制作工具 Universal USB Installer 1.9.8.3。Universal USB Installer 也是 UUI,它是一个 Live Linux 可启动 USB 创建器,允许您从选择的 Linux 发行版选择放在...
2019-12-14 10:55:32
643
原创 Ubuntu 忘记密码登录系统,然后修改密码
Ubuntu 11.04忘记用户密码的解决办法重启电脑安ESC键或者F2键进入GRUB引导模式如下图所示,选择第二行的recovery mode。有些电脑可能需要同时按住Shift+F2 键才是功能F2功能键的。需要自己注意。2. 按e进入recovery mode 编译kernel进行启动参数或者选择直接在后面加上一句 rw quiet splash in...
2019-11-15 11:13:35
625
原创 调试工具Strace
0. Strace是什么? 按照strace官网的描述, strace是一个可用于诊断、调试和教学的Linux用户空间跟踪器。我们用它来监控用户空间进程和内核的交互,比如系统调用、信号传递、进程状态变更等。 源码:https://github.com/strace/strace/releases1. 编译移植strace./configure --prefix...
2019-09-26 17:23:25
417
原创 Linux进程或线程绑定到CPU
为了让程序拥有更好的性能,有时候需要将进程或线程绑定到特定的CPU,这样可以减少调度的开销和保护关键进程或线程1. 进程绑定到CPULinux提供一个接口,可以将进程绑定到特定的CPU:#include <sched.h>int sched_setaffinity(pid_t pid, size_t cpusetsize, const cpu_set_t *mask);...
2019-09-25 14:24:29
1955
原创 字节对齐问题
gcc之__attribute__简介及对齐参数介绍GNU C的一大特色就是__attribute__机制。__attribute__机制可以设置函数属性(Function Attribute)、变量属性(Variable Attribute)和类型属性(Type Attribute)。 __attribute__语法格式为:__attribute__((attribute-list))...
2019-09-10 14:37:51
333
原创 struct ifreq 学习,现实ifconfig 功能
一、struct ifreq结构体这个结构定义在/usr/include/net/if.h,用来配置和获取ip地址,掩码,MTU等接口信息的。/* Interface request structure used for socket ioctl's. All interface ioctl's must have parameter definitions which begin ...
2018-12-04 19:27:42
1066
转载 linux 下获取当前网络连接状态的两种方法
#include &lt;linux/sockios.h&gt;#include &lt;sys/socket.h&gt;#include &lt;sys/ioctl.h&gt;#include &lt;linux/if.h&gt;#include &lt;string.h&gt;#in
2018-12-02 09:26:48
5252
转载 蓝牙协议规范(射频、基带链路控制、链路管理)
欢迎指正错误,共同学习、共同进步!!下载链接:Bluetooth PROFILE SPECIFICATIONS (基本涵盖所有蓝牙协议)、buletooth core 2.1-4.0 SPECIFICATION(三蓝牙版本的核心协议v2.1\v3.0\v4.0)、蓝牙核心技术与应用 马建仓 版(蓝牙协议相关初学者必读,开发者参考)蓝牙协议是蓝牙设备间交换信息所应该遵守的规则。与开放系统互联(OSI...
2018-05-19 15:54:22
486
转载 WIFI OTA 升级
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/htmledit_views-0a60691e80.css"> <div class="htmledit_views"> <...
2018-05-17 17:51:10
1875
原创 linux 文件系统的建立
1. 文件系统的制作Linux Core NANDUser’s Guide http://processors.wiki.ti.com/index.php/Linux_Core_NAND_User%27s_Guide#.23Building_UBI_File_system制作工具: mkfs.ubifs 和Ubinize 两个工具。1.1.通过sudo apt-get in
2017-10-12 20:12:43
1145
转载 AM335x U-boot d代码分析过程3
我们继续上一篇的代码,已经来到s_init()(位于arch\arm\cpu\armv7\am335x\board.c),其源代码如下:[cpp] view plain copy print?…defined(CONFIG_SPL_BUILD) gd = &gdata; preloader_console_init();//wlg: uart_init(), and print
2017-09-05 16:08:01
1004
1
原创 内核驱动 helloworld 内核模块
1 .c源码#include <linux/kernel.h>#include <linux/init.h> #include<linux/module.h> static int hello_init(void) { printk(KERN_INFO "[init] Can you feelmei? I ...
2017-09-02 09:36:50
1206
原创 搭建Ubuntu tftp 服务器和NFS
NFS和TFTP是利用网络传输数据的两种主要服务。接下来详细解释如何在ubuntu下安装这两种服务:1.搭建TFTP服务器: 首先要安装tftp服务端:sudo apt-get installtftpd-hpa //tftpd-hpa是服务器端sudo apt-get install tftp-hpa(如果不需要客户端可以不安装)安装好后配置服务器的设...
2017-08-19 09:19:46
346
转载 TI am335x U-boot
http://blog.chinaunix.NET/uid-28458801-id-3486399.html参考文件:1,AM335x ARM Cortex-A8 Microprocessors (MPUs) Technical Reference Manual.pdf;2,am3359.pdf;1,am335x的cpu上电后,会跳到哪个地址去执行?答:芯片到uboot启动流程 :ROM →
2017-08-08 22:30:58
420
原创 linux下进程、以及进程间的通信机制
2.1进程基本概念进程是Linux事务管理的基本单元,所有的进程均拥有自己独立的处理环境和系统资源。进程的环境由当前系统状态及其父进程信息决定和组成。系统的第一个进程init由内核产生,以后所有的进程都是通过fork函数/vfork()创建。系统在内核头文件中定义了进程控制块PCB结构体struct task_struct来管理每个进程的资源。进程资源由两部分组成:内核空间进程资源和用户空
2017-08-05 10:35:33
1086
原创 linux下多线程编程原以及互锁、条件变量、读写锁、信号等通信机制
一、多线程编程线程简单的说就是让多个函数同时执行,线程间通信是为了让他们有序的运行。1.1创建一个线程就是执行一个函数。 线程 进程创建 pthread_create() fork
2017-08-04 17:43:22
1598
原创 模拟捕获SIGPIPE信号 实现TCP服务器
server端代码:#include #include #include #include #include #include #include #include #include #include void handler (int sig) //信号处理函数{ printf("sig = %d\n", sig);}i
2017-07-26 15:31:48
712
Ubuntu忘记密码.docx
2019-11-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人