迷人的linux内核相关的操作
感谢Linus祖师爷赏口饭吃
今天6点半起床10点半睡觉和今天早晚运动
每天有限 多动脑 多运动 多实践
展开
-
linux c操作之offset_of和lower_32_bits和upper_32_bits的使用
linux原创 2022-12-13 15:35:21 · 245 阅读 · 0 评论 -
嵌入式Linux平台常用的工具之读取寄存器值
linux原创 2022-08-16 15:33:36 · 674 阅读 · 0 评论 -
linux ioctl的使用
ioctl iocl命令 和幻数 内核传参 功能号原创 2022-08-28 22:33:17 · 398 阅读 · 1 评论 -
linux应用层通过AXI总线读写寄存器值
dump register原创 2022-08-24 17:46:52 · 584 阅读 · 0 评论 -
linux字符设备之手动创建设备节点
手动创建设备节点原创 2022-08-28 09:21:40 · 141 阅读 · 0 评论 -
linux vmalloc分配虚拟连续的内存的使用
vmalloc分配内存原创 2022-08-20 14:30:31 · 379 阅读 · 0 评论 -
linux应用程序使用mmap将文件映射到内存中,然后读写操作
linux文件操作原创 2022-08-21 20:08:13 · 522 阅读 · 0 评论 -
linux应用层select和poll函数使用
watch 事件原创 2022-08-27 18:37:28 · 208 阅读 · 0 评论 -
linux 应用层使用posix 定时器
定时器操作原创 2022-08-26 10:12:44 · 235 阅读 · 0 评论 -
linux内核内存检测方法实践手记
内存原创 2022-08-19 14:23:49 · 519 阅读 · 0 评论 -
linux使用udev机制自动创建设备节点
设备号和设备设备节点原创 2022-08-27 22:16:15 · 301 阅读 · 0 评论 -
linux设备驱动之private_data的使用和创建多个字符子设备
linux private_data原创 2022-09-01 15:44:22 · 505 阅读 · 0 评论 -
linux内核分配物理页面alloc_pages
linux内核分配物理页空间原创 2022-08-20 17:07:53 · 170 阅读 · 0 评论 -
linux编写简单的驱动模块和向内核模块传递参数
linux开始驱动编写原创 2022-08-27 12:47:36 · 204 阅读 · 0 评论 -
linuxc库对内存操作的简单使用
linux c语言原创 2022-08-23 00:03:21 · 138 阅读 · 0 评论 -
linux将内核空间地址映射到用户空间操作
linux mmap函数原创 2022-08-22 16:59:15 · 952 阅读 · 0 评论 -
linux设备管理之平台驱动和平台总线和平台设备
linux设备管理 平台驱动和平台总线和平台设备原创 2022-09-05 00:28:41 · 250 阅读 · 0 评论 -
linux应用层对进程使用
linux fork 系统调用来访问内核进程技术的实现原创 2022-09-02 13:46:33 · 85 阅读 · 0 评论 -
linux用户层分配物理内存空间的使用
linux内存分配原创 2022-08-21 10:40:37 · 258 阅读 · 0 评论 -
linux内核空间向用户空间传递信息之输入子系统和内核定时器的使用
硬件空间 内核空间 用户空间原创 2022-09-08 21:52:39 · 142 阅读 · 0 评论 -
linux c操作之container_of的使用
linux原创 2022-12-13 19:52:27 · 863 阅读 · 1 评论 -
linuxslab分配小内存的测试例子
slab分配器 分配小内存原创 2022-08-20 11:28:08 · 142 阅读 · 0 评论 -
linux应用层和内核层通过字符设备读写进行双向通信
用户层通过系统调用双向和内核通信原创 2022-08-30 01:00:09 · 236 阅读 · 0 评论 -
linux用户空间向内核空间通信之使用proc接口和使用WARN_ON和BUG_ON调试内核代码
proc文件系统接口和WARN_ON接口原创 2022-09-11 17:04:27 · 394 阅读 · 0 评论 -
linux时间的应用之计算消耗时间
linux计算消耗时间 时间的测量原创 2022-09-10 11:58:37 · 329 阅读 · 0 评论 -
linux内核分配物理页__get_free_pages
分配物理页面原创 2022-08-20 17:31:26 · 193 阅读 · 0 评论 -
list_head在sound soc 中codec驱动中应用
#include <sound/soc.h>/* SoC Audio Codec device */struct snd_soc_codec { struct device *dev; const struct snd_soc_codec_driver *driver; struct list_head list; struct list_head card_list; /* runtime */ unsigned int cache_bypass:1; /* Suppre原创 2021-06-21 00:25:25 · 111 阅读 · 0 评论 -
数组指针在video_device使用
static struct video_device *video_device[VIDEO_NUM_DEVICES];数组元素赋值:/* Should not happen since we thought this minor was free */ WARN_ON(video_device[vdev->minor] != NULL); vdev->index = get_index(vdev); video_device[vdev->minor] = vdev;得到数原创 2021-07-25 19:20:41 · 154 阅读 · 0 评论 -
list_head 在gpio_lib驱动使用
struct gpio_chip { const char *label; struct device *parent; struct device *cdev; struct module *owner; void *data; struct list_head list; int (*request)(struct gpio_chip *chip, unsigned offset); void (*free)(struct gpio_chi原创 2021-06-21 00:43:20 · 142 阅读 · 0 评论 -
list_head在config functions使用
struct list_head functions;add: function->config = config; list_add_tail(&function->list, &config->functions);get: f = list_first_entry(&config->functions,struct usb_function, list); list_for_each_entry(uc, &cdev->原创 2021-07-17 13:24:02 · 135 阅读 · 0 评论 -
list_head在req使用
list_del(&req->list);add: for (i = 0; i < UVC_NUM_REQUESTS; ++i) { list_add_tail(&video->req[i]->list, &video->req_free); }empty: spin_lock_irqsave(&video->req_lock, flags); if (list_empty(&video->req_fr原创 2021-07-17 12:53:31 · 218 阅读 · 0 评论 -
linux内核定时器的编写实例
//timer编写: //嵌入到某个设备结构体里面去#include <linux/timer.h>struct timer_list { struct list_head entry; //定时器列表 unsigned long expires;//定时器到时时间 void (*function)(unsigned long); unsigned long data; // struct time_base_s*base;};#define VBUS_POLL_T原创 2021-09-18 15:31:45 · 143 阅读 · 0 评论 -
list_head在mtd_partition应用
/* Our partition linked list */static LIST_HEAD(mtd_partitions);/* Our partition node structure */struct mtd_part { struct mtd_info mtd; struct mtd_info *master; uint64_t offset; struct list_head list;};初始化:struct mtd_part *slave;/* allocate原创 2021-06-21 00:07:09 · 78 阅读 · 0 评论 -
list_head在内核得到系统分区信息的应用
static LIST_HEAD(part_parsers); // mtdpart.c /* * Functions dealing with the various ways of partitioning the space */struct mtd_part_parser { struct list_head list; struct module *owner; const char *name; int (*parse_fn)(struct mtd_info *, struc原创 2021-06-27 13:09:31 · 124 阅读 · 0 评论 -
list_head在v4l2_dev->subdevs中使用
INIT_LIST_HEAD(&v4l2_dev->subdevs);add:spin_lock(&v4l2_dev->lock);list_add_tail(&sd->list, &v4l2_dev->subdevs);spin_unlock(&v4l2_dev->lock);get: */ list_for_each_entry(sd, &v4l2_dev->subdevs, list) {原创 2021-07-25 19:27:12 · 185 阅读 · 0 评论 -
list_head在i2c设备驱动的应用
#include <linux/list.h>#include <linux/i2c.h>#include <linux/i2c-dev.h>struct i2c_dev { struct list_head list; struct i2c_adapter *adap; struct device *dev;};#define I2C_MINORS 256static LIST_HEAD(i2c_dev_list);第二步: 将i2c_dev原创 2021-06-20 10:02:06 · 102 阅读 · 0 评论 -
list_head在sound pcm驱动的应用
#include <sound/pcm.h>struct snd_pcm { struct snd_card *card; struct list_head list; int device; /* device number */ unsigned int info_flags; unsigned short dev_class; unsigned short dev_subclass; char id[64]; char name[80]; struct snd_pcm原创 2021-06-20 23:50:10 · 102 阅读 · 0 评论 -
list_head在 usb function的应用
static LIST_HEAD(func_list);add:usb_function_registerlist_add_tail(&newf->list, &func_list);out:del:usb_function_unregisterlist_del(&fd->list);改:usb_get_function_instance fi = try_get_usb_function_instance(name);static原创 2021-07-17 10:43:57 · 134 阅读 · 0 评论 -
list_head在spi驱动应用
struct spidev_data { dev_t devt; spinlock_t spi_lock; struct spi_device *spi; struct list_head device_entry; /* TX/RX buffers are NULL unless this device is open (users > 0) */ struct mutex buf_lock; unsigned users; u8 *tx_buffer; u8原创 2021-06-20 09:38:39 · 116 阅读 · 0 评论