linux 0.11 内核学习 floppy.c,驱动你的软盘
/*
* linux/kernel/floppy.c
*
* (C) 1991 Linus Torvalds
*/
/*
* 02.12.91 - Changed to static variables to indicate need for reset
* and recalibrate. This makes some things easier (output_byte reset
* checking etc), and means less interrupt jumping in case of errors,
* so the code is hopefully easier to understand.
*/
/*
* This file is certainly a mess. I've tried my best to get it working,
* but I don't like programming floppies, and I have only one anyway.
* Urgel. I should check for more errors, and do more graceful error
* recovery. Seems there are problems with several drives. I've tried to
* correct them. No promises.
*/
/*
* As with hd.c, all routines within this file can (and will) be called
* by interrupts, so extreme caution is needed. A hardware interrupt
* handler may not sleep, or a kernel panic will happen. Thus I cannot
* call "floppy-on" directly, but have to set a special timer interrupt
* etc.
*
* Also, I'm not certain this works on more than 1 floppy. Bugs may
* abund.
*/
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/fdreg.h> // 软驱头文件,其中包含软驱的常用函数的定义
#include <asm/system.h>
#include <asm/io.h>
#include <asm/segment.h>
#define MAJOR_NR 2 // 软驱主设备号
#include "blk.h"
/* 全局标志变量 */
static int recalibrate = 0; // 需要重新校正
static int reset = 0; // 需要重新置位
static int seek = 0; // 寻道
extern unsigned char current_DOR; // 在文件sched.c中定义
#define immoutb_p(val,port) \ // 字节val直接输出到port
__asm__("outb %0,%1\n\tjmp 1f\n1:\tjmp 1f\n1:"::"a" ((char) (val)),"i" (port))
#define TYPE(x) ((x)>>2) // 软驱类型,2--1.2MB,7--1.44MB
#define DRIVE(x) ((x)&0x03) // 软驱序列号0-3对应A-D
/*
* Note that MAX_ERRORS=8
相关文档:
1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI) 就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......
例一:发送Signaling Packet:
Signaling Command是2个Bluetooth实体之间的L2CAP层命令传输。所以得Signaling Command使用CID 0x0001.
多个Command可以在一个C-frame(control frame)中发送。
如果要直接发送Signaling Command.需要建立SOCK_RAW类型的L2CAP连接Socket。这样才有机会自己填充Command Code,Identi ......
在Windows宿主机中添加共享文件夹
1.选择 虚拟机 〉设置
2.选择 选项
3.点选 共享文件夹
4.点击Add按钮 打开共享文件夹向导 并点下一步
5.输入共享文件夹名字和位置 并点下一步
Name —— 这个名字将出现在虚拟机内
Host folder —— 在宿主机中你想共享的文件夹路 ......
作者: 羽飞 | 发布时间: 星期天, 01/24/2010 - 16:23
在网上找也好多关于这方面的资料,但都没有一个可以用的,
自己研究了一下,完全可以实现,只要按照以下步骤做了,包你能把CentOS请回家
平台Windows XP; 所需软件grub4dos-0.4.3.zip; CentOS镜像文件DVD。
1.在Windows X ......
Linux中的服务认识
Linux下自动启动的服务都在/etc/rc.d/init.d/目录下,比如说mysql。如果不想让一个服务自动运行,把/etc/rc.d/init.d/目录下的这个服务脚本移除掉就可以(一定要移除吗,不可以使用类似Window下的手动启动?)。
可以操作的状态:
start   ......