/*

*  该文件实现rs232 串行通信中断处理

*/

/*

*  linux/kernel/rs_io.s

*

*  (C) 1991  Linus Torvalds

*/

/*

*rs_io.s

*

* This module implements the rs232 io interrupts.

*/

.text

.globl _rs1_interrupt,_rs2_interrupt

/* 读写队列缓冲区的长度 */

size= 1024/* must be power of two !

and must match the value

in tty_io.c!!! */

/* these are the offsets into the read/write buffer structures */

/* 读写缓冲结构中的偏移量tty_queue */

rs_addr = 0

head = 4

tail = 8

proc_list = 12

buf = 16

/* 当写队列里还剩256 个字符空间(WAKEUP_CHARS)时,我们就可以写 */

startup= 256/* chars left in write queue when we restart it */

/*

* These are the actual interrupt routines. They look where

* the interrupt is coming from, and take appropriate action.

*/

.align 2

/* 串行端口1 中断处理程序入口点 */

_rs1_interrupt:

// tty 表中对应串口1 的读写缓冲指针的地址入栈

pushl $_table_list+8// table_list定义在文件tty_io.c文件中

jmp rs_int

/* 串行端口2 中断处理程序入口点 */

.align 2

_rs2_interrupt:

pushl $_table_list+16// 同上

rs_int:

pushl %edx

pushl %ecx

pushl %ebx

pushl %eax

push %es

push %ds/* as this is an interrupt, we cannot */

/* 让ds、es 指向内核数据段 */

pushl $0x10/* know that bs is ok. Load it */

pop %ds

pushl $0x10

pop %es

movl 24(%esp),%edx// 将缓冲队列指针地址存入edx 寄存器

movl (%edx),%edx// 取读队列指针(地址)

linux内核态串口读写程序,linux 0.11 内核学习 -- rs_io.s,串口汇编代码相关推荐

  1. Linux 0.11内核分析04:多进程视图

    目录 1 进程概念的引入 1.1 使用CPU的直观想法 1.2 直观用法的缺点 1.3 直观用法的改进 1.4 进程的概念 1.4.1 保存程序执行状态 1.4.2 进程与PCB 1.5 Linux ...

  2. Linux 0.11内核分析03:系统调用

    目录 1 概述 1.1 什么是系统调用 1.2 为什么需要系统调用 2 系统调用基础设施 2.1 安装系统门 2.1.1 中断描述符 2.1.2 中断描述符安装函数 2.1.3 安装0x80系统门 2 ...

  3. Linux 0.11内核分析02:系统启动

    目录 1. 内核镜像的构建 1.1 内核源码结构 1.1.1 boot 1.1.2 fs 1.1.3 include 1.1.4 init 1.1.5 kernel 1.1.6 lib 1.1.7 m ...

  4. Linux 0.11内核分析01:概述

    目录 1. 什么是操作系统 1.1 计算机硬件组成 1.2 操作系统基本结构 2. 操作系统核心视图 2.1 多进程视图 2.1.1 操作系统的相关演变 2.1.2 核心思想 2.2 文件视图 2.2 ...

  5. 0.11内核rd_load@ramdisk.c中memcpy函数好像有bug

    0.11内核rd_load@ramdisk.c中memcpy函数好像有bug,如: #define memcpy(dst,src,n) \     __asm__("cld;rep;movs ...

  6. linux 0.11 内核学习 -- rs_io.s,串口汇编代码

    /* *  该文件实现rs232 串行通信中断处理 */ /* *  linux/kernel/rs_io.s * *  (C) 1991  Linus Torvalds */ /* * rs_io. ...

  7. linux 用户态 内核态 通信,procfs(从0开始,内核态和用户态通信charpter2)

    这篇博文将针对linux内核态与用户态通信方式中的procfs进行详细的学习. /proc主要存放内核的一些控制信息,所以这些信息大部分的逻辑位置位于内核控制的内存,在/proc下使用ls -l你会发 ...

  8. Linux内核态之间进程通信,Linux 系统内核空间与用户空间通信的实现与分析[转载]...

    [https://www.ibm.com/developerworks/cn/linux/l-netlink/index.html] 多数的 Linux 内核态程序都需要和用户空间的进程交换数据,但 ...

  9. Linux 0.11 内核解析:中断相关(1)asm.s文件中断处理分析

    0 源代码 有两个版本的,一个是带中文注释,Intel格式的:一个是不带注释是AT&T格式的. Linux 0.11 中文注释版 Linux 0.11 源码,基于<Linux内核完全注释 ...

最新文章

  1. 深入卷积神经网络背后的数学原理 | 技术头条
  2. Spark 2.4重磅发布:优化深度学习框架集成,提供更灵活的流式接收器
  3. pipenv 虚拟环境新玩法
  4. ifconfig命令无法找到,提示bash: ifconfig: command not found
  5. 【linux】 -设备名称与文件目录
  6. PC-启动慢的解决好方法!
  7. 一些可视化Javascript插件
  8. SQL Server执行逻辑查询时,SQL被解析的步骤
  9. sql2005安装图解
  10. 用浏览器怎样监控网页内容变化
  11. 服务器装2t硬盘分区,2T移动硬盘分区办法
  12. 【论文泛读05】基于Conv-LSTM的短期交通流预测
  13. OneNote2013打开共享
  14. @Transactional注解解析
  15. IP欺骗攻击原理及如何修改IP
  16. 重复照片查找软件Duplicate Photos Sweeper Mac
  17. Excel制作水滴图和对称条形图
  18. 下列不属于计算机未来发展趋势的是,1-9 关于计算机的发展趋势,下面哪种不是未来发展趋势 ____________ 。_学小易找答案...
  19. 解决Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven
  20. [Swift]国际化

热门文章

  1. 什么是Java内存模型中的happens-before
  2. 怎么添加项目到SVN上面
  3. Python 之 风格规范(Google )
  4. Spring Sleuth和Zipkin跟踪微服务
  5. 运动框架实现思路(js)
  6. [C++] 为什么Linux需要itoa函数
  7. UA OPTI570 量子力学25 2-level System
  8. UA OPTI570 量子力学17 创生算符与湮灭算符
  9. 图解首次使用流光5.0
  10. 八个JS中你见过的类型。