易截截图软件、单文件、免安装、纯绿色、仅160KB

linux 0.11 内核学习 console.c,控制台


参考《linux内核完全注释》和网上相关文章
/*
 * 控制台显示操作
 */
/*
 *  linux/kernel/console.c
 *
 *  (C) 1991  Linus Torvalds
 */
/*
 * console.c
 *
 * This module implements the console io functions
 * 'void con_init(void)'
 * 'void con_write(struct tty_queue * queue)'
 * Hopefully this will be a rather complete VT102 implementation.
 *
 * Beeping thanks to John T Kohl.
 */
/**********************
 * con_init con_write *
 **********************/
/*
 *  NOTE!!! We sometimes disable and enable interrupts for a short while
 * (to put a word in video IO), but this will work even for keyboard
 * interrupts. We know interrupts aren't enabled when getting a keyboard
 * interrupt, as we use trap-gates. Hopefully all is well.
 */
/*
 * Code to check for different video-cards mostly by Galen Hunt,
 * <g-hunt@ee.utah.edu>
 */
#include <linux/sched.h>
#include <linux/tty.h> // 定义tty_struct结构,串行通信方面的参数和常量
#include <asm/io.h> // 硬件对应的汇编io指令
#include <asm/system.h>
/*
 * These are set up by the setup-routine at boot-time:
 */
#define ORIG_X (*(unsigned char *)0x90000) // 光标列号
#define ORIG_Y (*(unsigned char *)0x90001) // 光标行号
#define ORIG_VIDEO_PAGE (*(unsigned short *)0x90004) // 显示页面
#define ORIG_VIDEO_MODE ((*(unsigned short *)0x90006) & 0xff) // 显示模式
#define ORIG_VIDEO_COLS (((*(unsigned short *)0x90006) & 0xff00) >> 8) // 字符列数
#define ORIG_VIDEO_LINES (25) // 字符行数
#define ORIG_VIDEO_EGA_AX (*(unsigned short *)0x90008) // ??
#define ORIG_VIDEO_EGA_BX (*(unsigned short *)0x9000a) // 显示内存大小和色彩模式
#define ORIG_VIDEO_EGA_CX (*(unsigned short *)0x9000c) // 显示卡特性参数
#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display,单色文本 */
#define VIDEO_TYPE_CGA 0x11


相关文档:

实战Linux Bluetooth编程 (七) SDP协议

Service Discovery Protocol(SDP)提供一种能力,让应用程序有方法发现哪种服务可用以及这种服务的特性。
服务发现协议(SDP或Bluetooth SDP)在蓝牙协议栈中对蓝牙环境中的应用程序有特殊的含意,发现哪个服务是可用的和确定这些可用服务的特征。SDP定义了bluetooth client发现可用bluetooth server服务和它们的特征的方法。 ......

Linux设备模型之input子系统详解

一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......

使用Secure CRT、UltraEdit连接虚拟机中的Linux系统

  过去的一两年中,一直喜欢捣腾Linux系统,虽然没有搞出什么实际的成效出来,但是有乐此不疲,哈哈!前一段时间,有跟它抗上了,总是觉得那种在命令行下敲击字符的感觉甚是爽快,有中莫名的优越感,于是就在VMware中安装了Oracle Enterprise Oracle,至于系统的安装倒是没有很困难,直接按照默认的提示选择就行,要改 ......

linux内存管理

内核进行物理内存管理和虚拟内存管理
使用磁盘上的空间,称为交换区。
内核是将虚拟内存中的内容来来回回的和内存的内容进行交换的
这样可以让os感觉到其实可用的内存比物理内存空间更大。
内存的分配是成组的分成块的,称为页面。
内核有一张表,用来定位页面是在内存里面还是在磁盘里面。以决定哪些页面要交换。 ......

***********Linux学习笔记汇总***********

linux目录架构
/       根目录
/bin         常用的命令   binary   file   的目錄
/boot       存放系统启动时必须读取的档案,包括核心   (kernel)   在内
          /boot/grub/menu.lst   &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号