Escolar Documentos
Profissional Documentos
Cultura Documentos
com
Linux
Word
Linux
http://www.farsight.com.cn/zt-webcasts2/linux.aspx
blog.csdn.net/fudan_abc
.......................................................................................................................4
........................................................................................................6
LINUX .............................................................................................................................6
...................................................................................................................6
...................................................................................................................8
LINUX .....................................................................................................................8
19911998 ....................................................................................9
LINUX .............................................................................................................................9
.....................................................................................................................10
19992002 ..................................................................................11
.....................................................................................................................11
LINUX................................................................................................................12
20032006 ..................................................................................12
UBUNTU 4.10..............................................................................................................................12
RICHARD STALLMAN ................................................................................................13
20072009 ..................................................................................15
.....................................................................................................................15
ANDROID ...................................................................................................................18
LINUX ............................................................................................................................18
KERNEL KCONFIG MAKEFILE......................................................................................19
MAKEFILE MAKE LOVE........................................................................................................19
KCONFIG MAKEFILE ..............................................................................20
.....................................................................................22
README........................................................................................................................22
KCONFIG MAKEFILE........................................................................................................24
.....................................................................................27
....................................................................................28
...........................................................................................................33
...........................................................................................................33
..................................................................................................................................34
.................................................................................................................................35
..................................................................................................................................36
.........................................................................................................................36
HELLO WORLD!................................................................................................37
blog.csdn.net/fudan_abc
....................................................................................................................39
....................................................................................................................44
USB ....................................................................................................44
USB ........................................................................................................45
SPEC DATASHEET ..............................................................46
LINUX ..................................................................47
LINUX .......................................................................................................47
LINUX ...............................................................................................................49
LINUX 14 ...................51
LINUX 15
..................................................................................................................................55
LINUX 16
.......................................................................................................................................59
LINUX 17 PCI
..............................................................................................................................63
LINUX 18 .......................66
LINUX 19 API...........67
LINUX 20 GIT ...................69
LINUX 21 PRINTK().........72
.........................................................................................................72
PRINTK().....................................................................................................................................73
Linux 18 18
Linux
blog.csdn.net/fudan_abc
Linux Linus
Linus
Linux
Linux
Linux
1 Linux 18
3
Kconfig
Makefile USB
411
Email maintainer
blog.csdn.net/fudan_abc
6
IRQ
7
7
8 O(1)
CFS
9
10 VFS
11 specdatasheet
12
13 12
tips
+++
+XY
blog.csdn.net/fudan_abc
Linux
Linux
Linux
Linux
google
top10
19911998
19992002
20032006
20072009
Kconfig Makefile Linux Kernel
Kconfig Makefile Kernel
blog.csdn.net/fudan_abc
kernel
USB
0.1
Linux
Linux
Linux
Linux
Linus
Linux
blog.csdn.net/fudan_abc
Hello World!
Linux Linux
reboot
insmod
rmmod
IT
Linux
specdatasheet
spec usb
datasheet
Linux
Linux ,
Linux
blog.csdn.net/fudan_abc
19911998
Linux 18 18
Linux
Linux Linux
Linux
Linux
1987
MINIX
4 Linux
1991
Linus Torvalds UNIX
Linux 10 5
Linux 0.01
1992
4 Linux comp.os.linux10 Linux
SLS
1993
8 Linux Linux Installation and Getting Started Version 1
blog.csdn.net/fudan_abc
1994
Linux 1.0 GPLGNU General Public License
Linus Torvalds Linus
1995
4 Linux Linux
1996
Linux 2.0 SMP Linux
350
1997
Linux Bliss 160 Alpha
105 Linux
1998
1 Linux Netscape
Linux
2 Eric Raymond open source
opensource.org Linux
4 Linux Linux
5 Google
Linux Linux
6 LinuxLinux
6 25 PC
7 KDE GNOME Linus
KDE KDE1.0 OracleInformixSybase
LinuxLinux
9 Dave Whitinge Dwight Johnson LinuxToday.com
Internet.com Linux
12 IDC Linux 1998 200%
150%Linux 17%
blog.csdn.net/fudan_abc
19992002
1999
1 Linux 2.2 Linus Torvalds
3 LinuxWorld Linux
Linux
8 SG Red Hat
Red Hat 50
Lineo Linux
Sun Sun Sun Community Source License StarOffice
blog.csdn.net/fudan_abc
Linux
2001
1 Linux 2.4
3 Linux2.5 Linux hacker
2002
Linus Torvalds Linux 2.4 18 Marcelo Tosatti
Linux 2.5
20032006
Ubuntu 4.10
2003
1 NEC Linux Linux
6 IDC 2003 Linux 18.2 2007
19
8 IBM
IBM eServer Linux
9 Linux CDMA SCH-i519
11 Linux 2.6 Linux
2001
blog.csdn.net/fudan_abc
2004
1 X.Org
2 Linux 2.0 Linux
5 Linux
10 20 Ubuntu Ubuntu Linux
11 Firefox 1.0 IE 1
Firefox IE
2005
10 Firefox 1
11 Sun Java
Richard Stallman
2006
6 Richard Stallman http://www.stallman.org/
I'm a single atheist white man, 52, reputedly intelligent, with unusual interests in politics, science,
music and dance.
I'd like to meet a woman with varied interests, curious about the world, comfortable expressing
her likes and dislikes (I hate struggling to guess), delighting in her ability to fascinate a man and
in being loved tenderly, who values joy, truth, beauty and justice more than "success"--so we can
share bouts of intense, passionately kind awareness of each other, alternating with tolerant
warmth while we're absorbed in other aspects of life.
My 22-year-old child, the Free Software Movement, occupies most of my life, leaving no room for
more children, but I still have room to love a sweetheart. I spend a lot of my time traveling to give
blog.csdn.net/fudan_abc
speeches, often to Europe, Asia and Latin America; it would be nice if you were free to travel with
me some of the time.
If you are interested, write to rms at stallman dot org and we'll see where it leads.
52
22
rms@stallman.org
7 Ubuntu PC World 2006 World Class Award Ubuntu 2006
100 Ubuntu
Canonical
Sun Linux
8 Linux Linuspire Kevin Carmony
Freespire 1.0 Linux
27 http://linux.inet.hr/poll_filesystem.html Your favorite file system?
11 Novell Linux
1.1
blog.csdn.net/fudan_abc
1.1 + Novell
20072009
2007
1 Second Life Linux OSDL Free
Standard Group Linux FoundationLinux
Linux
2 Bill Xu
ActiveX
Firefox
3 Novell Mac vs PCLinux
Novell Novell Linux PC
www.youtube.com 15 Novell
Linux Windows
4 Dell Ubuntu
5 Linux 42
65 OpenOffice.org 45 83
Get the Facts 1.2
Linux The Highly Reliable
Times
Linux
blog.csdn.net/fudan_abc
1.3 Firefox
6 5 Linux Xandros
blog.csdn.net/fudan_abc
blog.csdn.net/fudan_abc
blog.csdn.net/fudan_abc Linux
Android
2008
1 Nokia Qt Trolltech
2 Google Linux Photoshop
4 Sun Java
7 QQ for Linux 1.0 Preview
Linux
2009
1 Linux Unix Longene
Linux Linux
Windows Linux Windows
Linux Windows
2 GPS Tomtom 8 Tomtom GPS
Linux Linux
Linux
3 Adobe Reader 9.1 for Linux UltraEdit Linux UEX
UltraEdit for Linux
4 IDC Linux 2009
Linux 2008 21% 2009
2%
5 Nokia Qt Qt
blog.csdn.net/fudan_abc
1.5 Linux
8 Unbutu
9 2.6.31 Linux USB3.0
10 Ubuntu 9.10
11 Vim Bram Moolenaar Zimbu
Moolenaar Zimbu
Zimbu OS kernel
GUI
Kconfig Makefile
Linux Kconfig Makefile
Linux
blog.csdn.net/fudan_abc
Kconfig Makefile Linux Kernel
Kconfig Makefile Kernel
kernel
Kconfig Makefile
Kconfig Makefile
U U storage
drivers/usb/storage/
Kconfig Makefile
Kconfig
34 config USB_STORAGE_DATAFAB
35
36
37
help
38
39
Datafab
CompactFlash reader flash U
drivers/usb/storage usb mass storage
U usb mass storage
101 config USB_STORAGE_SDDR55
102
103
104
help
105
Say
here
to
include
additional
code
to
support
the
Sandisk SDDR-55
106
SanDisk SM U
CONFIG_USB_STORAGE
9 config USB_STORAGE
10
11
blog.csdn.net/fudan_abc
12
13
your
14
computer's USB port. This is the driver you need for USB
15
floppy drives, USB hard disks, USB tape drives, USB CD-ROMs,
16
17
similar devices. This driver may also be used for some cameras
18
19
20
21
22
23
24
25
Makefile
0 #
1 # Makefile for the USB Mass Storage device drivers.
2 #
3 # 15 Aug 2000, Christoph Hellwig <hch@infradead.org>
4 # Rewritten to use lists instead of if-statements.
5 #
6
7 EXTRA_CFLAGS := -Idrivers/scsi
8
9 obj-$(CONFIG_USB_STORAGE)
+= usb-storage.o
10
11 usb-storage-obj-$(CONFIG_USB_STORAGE_DEBUG) += debug.o
12 usb-storage-obj-$(CONFIG_USB_STORAGE_USBAT) += shuttle_usbat.o
13 usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR09)
+= sddr09.o
14 usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR55)
+= sddr55.o
15 usb-storage-obj-$(CONFIG_USB_STORAGE_FREECOM)
+= freecom.o
16 usb-storage-obj-$(CONFIG_USB_STORAGE_DPCM) += dpcm.o
17 usb-storage-obj-$(CONFIG_USB_STORAGE_ISD200)
+= isd200.o
18 usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB)
+= datafab.o
19 usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o
20 usb-storage-obj-$(CONFIG_USB_STORAGE_ALAUDA)
+= alauda.o
21 usb-storage-obj-$(CONFIG_USB_STORAGE_ONETOUCH) += onetouch.o
22 usb-storage-obj-$(CONFIG_USB_STORAGE_KARMA) += karma.o
23
24 usb-storage-objs := scsiglue.o protocol.o transport.o usb.o \
25
initializers.o $(usb-storage-obj-y)
26
blog.csdn.net/fudan_abc
27 ifneq ($(CONFIG_USB_LIBUSUAL),)
28
obj-$(CONFIG_USB)
+= libusual.o
29 endif
Kconfig CONFIG_USB_STORAGE
Makefile CONFIG_USB_STORAGE 9
usb-storage
Kconfig Makefile 11~22
24
scsiglue.cprotocol.ctransport.cusb.cinitializers.c .h
Kconfig Makefile
Linux Kconfig
Makefile
1.5% 80
USB
USB
README
USB drivers/usb
ls
atm
class
Makefile
core
gadget
host
image
misc
mon
serial
storage Kconfig
README usb-skeleton.c
drivers/usb 10 4 usb-skeleton.c
USB driver
ppmm
KconfigMakefileREADME
README
blog.csdn.net/fudan_abc
read read
23
Here
is
list
of
what
each
subdirectory
here
is,
and
what
is
contained in
24 them.
25
26 core/
27
28
29 host/
This
30
31
32
33 gadget/
34
35
36
37 Individual USB driver directories.
the
38 first subdirectory in the list below that it fits into.
39
40 image/
41
42 input/
43
44 media/
45
46
subsystem.
47 net/
48 serial/
51
52
53 misc/
54
README ls 10
USB CoreLinux
USB Core
Linux
drivers/usb/USB Core
blog.csdn.net/fudan_abc
drivers/usb/ core
USB Root Hub
host USB
core
host
USB gadget gadget Linux
PDA USB USB Device Controller
PC master slave USB
USB USB USB
gadget USB
SD USB PC SD
U USB gadget
USB U storage
USB input
README USB
Kconfig
Makefile
USB host
controller USB Core
core
Kconfig Makefile
drivers/usb/core ls
Kconfig
Makefile
endpoint.c
inode.c
usb.c
file.c
message.c
buffer.c
generic.c
notify.c
usb.h
wc
# wc l ./*
148 buffer.c
607 config.c
706 devices.c
1677 devio.c
1569 driver.c
357 endpoint.c
248 file.c
238 generic.c
1759 hcd.c
458 hcd.h
433 hcd-pci.c
config.c
blog.csdn.net/fudan_abc
devices.c
hcd-pci.c
hcd.c
otg_whitelist.h
devio.c
hcd.h
quirks.c
driver.c
hub.c
hub.h
sysfs.c
urb.c
3046 hub.c
195 hub.h
758 inode.c
144 Kconfig
21 Makefile
1732 message.c
68 notify.c
112 otg_whitelist.h
161 quirks.c
710 sysfs.c
589 urb.c
984 usb.c
160 usb.h
16880 total
Kconfig
15 config USB_DEVICEFS
16
17
depends on USB
18
---help---
19
the "File
20
systems"
section,
above),
you
will
get
file
/proc/bus/usb/devices
21
22
or
23
yyy the
24
programs
25
meaning
26
they are generated on the fly and not stored on the hard
drive.
27
28
You may need to mount the usbfs file system to see the
files, use
29
30
31
read
blog.csdn.net/fudan_abc
32
<file:Documentation/usb/proc_usb_info.txt>.
33
34
are the
35
users of a
36
37
/dev/bus/usb and
38
002/027 002/048
mm
100
100
usbfs USB
74 config USB_SUSPEND
75
76
77
help
78
If you say Y here, you can use driver calls or the sysfs
79
80
peripherals.
81
82
83
84
85
86
87
USB USB
non-idle
USB
Makefile
blog.csdn.net/fudan_abc
5 usbcore-objs
8
9 ifeq ($(CONFIG_PCI),y)
10
usbcore-objs
+= hcd-pci.o
11 endif
12
13 ifeq ($(CONFIG_USB_DEVICEFS),y)
14
usbcore-objs
+= inode.o devices.o
15 endif
16
17 obj-$(CONFIG_USB)
+= usbcore.o
18
19 ifeq ($(CONFIG_USB_DEBUG),y)
20 EXTRA_CFLAGS += -DDEBUG
21 endif
USB
0.1
Linux
blog.csdn.net/fudan_abc
5000
Kconfig Makefile
USB
USB
subsys_initcall module_init
drivers/usb/core/usb.c
940 subsys_initcall(usb_init);
941 module_exit(usb_exit);
subsys_initcall module_init
usbcore USB
Linux PCI
SCSI drivers/
int retval;
868
if (nousb) {
869
870
return 0;
871
872
873
retval = ksuspend_usb_init();
874
if (retval)
875
goto out;
876
retval = bus_register(&usb_bus_type);
877
if (retval)
878
879
880
goto bus_register_failed;
retval = usb_host_init();
if (retval)
881
goto host_init_failed;
882
retval = usb_major_init();
883
if (retval)
884
885
goto major_init_failed;
retval = usb_register(&usbfs_driver);
blog.csdn.net/fudan_abc
886
if (retval)
887
goto driver_register_failed;
888
retval = usb_devio_init();
889
if (retval)
890
goto usb_devio_init_failed;
891
retval = usbfs_init();
892
if (retval)
893
goto fs_init_failed;
894
retval = usb_hub_init();
895
if (retval)
896
897
goto hub_init_failed;
retval
usb_register_device_driver(&usb_generic_driver,
THIS_MODULE);
898
if (!retval)
899
goto out;
900
901
902
usb_hub_cleanup();
hub_init_failed:
903
usbfs_cleanup();
904 fs_init_failed:
905
usb_devio_cleanup();
906 usb_devio_init_failed:
907
usb_deregister(&usbfs_driver);
908 driver_register_failed:
909
usb_major_cleanup();
910 major_init_failed:
911
usb_host_cleanup();
912 host_init_failed:
913
bus_unregister(&usb_bus_type);
914 bus_register_failed:
915
ksuspend_usb_cleanup();
916 out:
917
return retval;
918 }
1__init
usb_init 865 __init
USB
__init include/linux/init.h
blog.csdn.net/fudan_abc
43 #define __init
__attribute__Linux
GNU C GNU C GNU C
__attribute__
GNU C section
GCC
section ("section-name")'
Normally, the compiler places the code it generates in the `text'
section.Sometimes, however, you need additional sections, or you
need certain particular functions to appear in special sections.
The `section' attribute specifies that a function lives in a
particular section.For example, the declaration:
extern void foobar (void) __attribute__ ((section ("bar")));
puts the function foobar' in the bar' section.
Some file formats do not support arbitrary sections so the
section' attribute is not available on all platforms.If you
need to map the entire contents of a module to a particular
section, consider using the facilities of the linker instead.
__define_initcall("4",fn,4)
__define_initcall fn initcall.init
subsys_initcall fn .initcall.init .initcall4.init
.initcall.init.init.text .initcall4.init
init bass
vmlinux.lds arch/<target>/
blog.csdn.net/fudan_abc
vmlinux.lds
initcall.init
__inicall_start = .;
.initcall.init : AT(ADDR(.initcall.init) 0xC0000000) {
*(.initcall1.init)
*(.initcall2.init)
*(.initcall3.init)
*(.initcall4.init)
*(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init)
}
__initcall_end = .;
subsys_initcall .initcall4.init
core_initcall .initcall1.init device_initcall
.initcall6.init include/linux/init.h
.initcall1.init .initcall2.init
__init .initcall.init
/init/main.c
do_initcalls __initcall_start__initcall_end
2
usb_init 868 nousb
C nousb
nousb USB Linux
USB
nousb nousb
USB support disabled usb_init
blog.csdn.net/fudan_abc
nousb drivers/usb/core/usb.c
static int nousb;
nousb
grub kernel
kernel
/boot/vmlinuz-2.6.18-kdb
root=/dev/sda1
ro
splash=silent
vga=0x314
rootsplashvga
kernel .=
modprobe usbcore autosuspend=2
kernel
usbcore.autosuspend=2
modinfo -p ${modulename}
/sys/module/$
{modulename}/parameters/ echo -n ${value} >
/sys/module/${modulename}/parameters/${parm}
3
usb_init pr_info
pr_info printk include/linux/kernel.h
printk(KERN_INFO fmt,##arg)
99 ISO C
#define debug(format, ...) fprintf (stderr, format, __VA_ARGS__)
__VA_ARGS__GCC
pr_info ##
##
debug ("A message");
##
blog.csdn.net/fudan_abc
usb_init usb
Kernel
Linux
Linux
Linux
Linus
XXX
XXX
blog.csdn.net/fudan_abc
Linux
README
Linux
Documentation/Changes
Documentation/CodingStyle
Documentation/SubmittingPatches
Documentation/SubmittingDrivers
Documentation/SubmitChecklist
SubmittingPatches
SubmittingDrivers 2.4 2.6
SubmitChecklist check
Documentation/stable_api_nonsense.txt
API
Linux
Linux
Documentation/stable_kernel_rules.txt
stable releases
Documentation/SecurityBugs
bug
blog.csdn.net/fudan_abc
Documentation/kernel-docs.txt
Documentation/applying-patches.txt
Documentation/bug-hunting
bug
Documentation/HOWTO
5 2+1+2 2 2
1 1 2 2
1 1 1
Linux
LKD
Linux
ULK LKD ULK
Linux
LDD
Linux
LVMM Linux
Linux
LINUX
Linux
5
LKD ULK
blog.csdn.net/fudan_abc
LDD
Email maintainer
Linux
Linux Kernel Mailing
ListLKML http://vger.kernel.org/vger-lists.html#linux-kernel
LKML
USB http://www.linux-usb.org/mailing.html
http://www.kernel.org/
bug
http://kerneltrap.org
LinuxBSDLKMLkerneltrap
http://lwn.net/
Linux weekly news1997Linux
blog.csdn.net/fudan_abc
http://zh-kernel.org/mailman/listinfo/linux-kernel
Herbert
Xu,Mingming CaoBryan Wu
http://linux.chinaunix.net/
Linux/Unix
Hello World!
Linux Linux
reboot
insmod
rmmod
"Hello World!"
hello world
Linux
Helloworld
Goodbyecruel
world !
/************ hello.c *********************/
1 #include <linux/init.h>
return 0;
10 }
11
12 static void __exit hello_exit(void)
blog.csdn.net/fudan_abc
13 {
14
15 }
16
17 module_init(hello_init);
18 module_exit(hello_exit);
module_init() module_exit()
Linux Kernel 2.6
module_init() insmod
module_init() rmmod
module_exit() module_init()(driver
initialization entry point)
Makefile
1 # To build modules outside of the kernel tree, we run "make"
2 # in the kernel source tree; the Makefile these then includes this
3 # Makefile once again.
4 # This conditional selects whether we are being included from the
5 # kernel Makefile or not.
6 ifeq ($(KERNELRELEASE),)
7
8
# Assume the source tree is where the running kernel was built
10
11
12
13
14 modules:
15
16
17 modules_install:
18
19
20 clean:
21
22
23 .PHONY: modules modules_install clean
24
25 else
26
# called from kernel build system: just declare what our modules
27
obj-m := hello.o
are
blog.csdn.net/fudan_abc
28 endif
lwn.net
make Linux Kernel 2.6
make make
make
make Makefile make make
hello.ko
#insmod hello.ko
Goodbyecruel world
Linux
1+1 2
B A
IT
Linux
busdevicedriver
include/linux/device.h
blog.csdn.net/fudan_abc
52 struct bus_type {
53
const char
* name;
54
struct module
* owner;
56
struct kset
subsys;
57
struct kset
drivers;
55
58
struct kset
devices;
59
struct klist
klist_devices;
60
struct klist
klist_drivers;
61
62
63
64
struct bus_attribute
65
* bus_attrs;
66
67
68
69
70
71
72
73
int
74
int
75
void
76
77
78
79
80
81
82
83 };
124 struct device_driver {
125
126
const char
* name;
struct bus_type
* bus;
128
struct kobject
kobj;
129
struct klist
klist_devices;
130
struct klist_node
knode_bus;
132
struct module
* owner;
133
const char
127
131
modules */
blog.csdn.net/fudan_abc
* mod_name;
134
struct module_kobject
* mkobj;
135
136
int
(*probe)
137
int
(*remove)
138
139
void
int
(*shutdown)
(*suspend)
state);
140
int
(*resume)
141 };
407 struct device {
408
struct klist
klist_children;
409
struct klist_node
knode_parent;
410
struct klist_node
knode_driver;
411
struct klist_node
knode_bus;
412
struct device
*parent;
413
414
415
char
416
417
unsigned
is_registered:1;
418
unsigned
uevent_suppress:1;
bus_id[BUS_ID_SIZE];
419
420
struct semaphore
sem;
421
* its driver.
422
*/
423
424
425
426
device */
427
void
*driver_data;
428
void
429
430
431
432 #ifdef CONFIG_NUMA
433
int
numa_node;
434 #endif
435
u64
*dma_mask;
436
u64
437
alloc_coherent mappings as
438
439
440
blog.csdn.net/fudan_abc
441
442
struct list_head
dma_pools;
443
444
445
override */
446
447
448
449
spinlock_t
devres_lock;
450
struct list_head
devres_head;
451
452
453
struct list_head
node;
454
struct class
*class;
455
dev_t
456
devt;
457
458
void
459 };
Q 80
21
kobject kset
blog.csdn.net/fudan_abc
Linux OO
kobject
kset kobject C
C++ class kobject
kobject
13 kobject parent
kobject kset
struct bus_type drivers devices
klist
2.6.11 struct device_driver devices
struct device
struct device_driver
device devices driver drivers
devices drivers
devices drivers
struct device
devices struct device_driver
devices ()
struct device struct device_driver
device_bind_driver
struct device struct device_driver driver
struct device_driver driver struct device struct klist klist_devices
busdevice driver
blog.csdn.net/fudan_abc
USB
USB
USB
USB drivers/usb
core usbcore
lsmod usbcore
localhost:/usr/src/linux-2.6.23/drivers/usb/core # lsmod
Module
Size
Used by
af_packet
55820
raw
89504
nfs
230840
lockd
87536
2 nfs
nfs_acl
20352
1 nfs
sunrpc
172360
4 nfs,lockd,nfs_acl
ipv6
329728
36
button
24224
battery
27272
ac
22152
apparmor
73760
aamatch_pcre
30720
1 apparmor
loop
32784
usbhid
60832
dm_mod
77232
ide_cd
57120
hw_random
22440
ehci_hcd
47624
cdrom
52392
1 ide_cd
uhci_hcd
48544
shpchp
61984
bnx2
157296
usbcore
149288
4 usbhid,ehci_hcd,uhci_hcd
e1000
130872
blog.csdn.net/fudan_abc
pci_hotplug
reiserfs
44800
1 shpchp
239616
edd
26760
fan
21896
USB core
HCD USB HCD
USB USB HCD
usbcoreusbcore HCD
HCD
core USB core
core HCD
USB
busdevicedriver
blog.csdn.net/fudan_abc
specdatasheet
specdatasheet
specdatasheet
blog.csdn.net/fudan_abc
USB USB
USB
USB spec USB
datasheet spec datasheet
drivers/input/touchscreen
spec
spec
Linux
Linux
Linux
2010 3 24
5 Linux Linux
blog.csdn.net/fudan_abc
fudan_abc
change
2010 3 23
3 1. 2.
3. linux kernel
hust_tulip
fudan_abc
linux
linux
4
hust_tulip
fudan_abc
lkd ulk
lkd
Email maintainer
LINUX
Linux usb
Linux
linux
blog.csdn.net/fudan_abc
2010 3 22
1
fudan_abc
Linux
Kconfig Makefile
2
albcamus
1
timesharedreal-timeCPU
2 C
C C
C gcc C
3 CPU
Linux
1.
Linux Linux
Linus
blog.csdn.net/fudan_abc
9
2.
3.
USB
0.1
67
4. Kconfig Makefile
Kconfig Makefile
Linux Kconfig Makefile
Linux
blog.csdn.net/fudan_abc
Linux
14
21 struct list_head {
22 struct list_head *next, *prev;
23 };
list_head list_head prev next
struct list_node {
struct list_node *next;
ElemType data;
};
blog.csdn.net/fudan_abc
hub struct usb_hub hub hub
hub
1
LIST_HEAD
INIT_LIST_HEAD()
25 #define LIST_HEAD_INIT(name) { &(name), &(name) }
26
27 #define LIST_HEAD(name) \
28 struct list_head name = LIST_HEAD_INIT(name)
29
30 static inline void INIT_LIST_HEAD(struct list_head *list)
31 {
32 list->next = list;
33 list->prev = list;
34 }
nextprev
blog.csdn.net/fudan_abc
list_add() list_add_tail()
list_del_init()
blog.csdn.net/fudan_abc
__list_del(entry->prev, entry->next);
257 INIT_LIST_HEAD(entry);
258 }
list_del_init()
5
list_head
list_entry
425 #define list_entry(ptr, type, member) \
426 container_of(ptr, type, member)
list_entry() Linux
list_entry() Linux
list_entry
list_entry() hub
hub hub
list_entry struct list_head event_list
struct usb_hub
struct list_head *tmp;
struct usb_hub *hub;
tmp = hub_event_list.next;
blog.csdn.net/fudan_abc
Linux
15
Linux
parse_args
parse_args =
= grub
kernel
kernel /boot/vmlinuz-2.6.18 root=/dev/sda1 ro splash=silent
vga=0x314 pci=noacpi
pci=noacpi
=
blog.csdn.net/fudan_abc
.=
usbcore autosuspend 2
$ modprobe usbcore autosuspend=2
usbcore.autosuspend=2
Documentation/kernel-parameters.txt
PCI
pci=option[,option...] [PCI] various PCI subsystem options:
off [X86-32] don't probe for the PCI bus
bios [X86-32] force use of PCI BIOS, don't access
the hardware directly. Use this if your machine
has a non-standard PCI host bridge.
nobios [X86-32] disallow use of PCI BIOS, only direct
hardware access methods are allowed. Use this
if you experience crashes upon bootup and you
suspect they are caused by the BIOS.
conf1 [X86-32] Force use of PCI Configuration
Mechanism 1.
conf2 [X86-32] Force use of PCI Configuration
Mechanism 2.
nommconf [X86-32,X86_64] Disable use of MMCONFIG for PCI
Configuration
nomsi [MSI] If the PCI_MSI kernel config parameter is
enabled, this kernel boot option can be used to
disable the use of MSI interrupts system-wide.
nosort [X86-32] Don't sort PCI devices according to
order given by the PCI BIOS. This sorting is
done to get a device order compatible with
older kernels.
biosirq [X86-32] Use PCI BIOS calls to get the interrupt
routing table. These calls are known to be buggy
on several machines and they hang the machine
when used, but on other computers it's the only
way to get the interrupt routing table. Try
this option if the kernel is unable to allocate
IRQs or discover secondary PCI buses on your
motherboard.
rom [X86-32] Assign address space to expansion ROMs.
Use with caution as certain devices share
address decoders between ROMs and other
blog.csdn.net/fudan_abc
resources.
irqmask=0xMMMM [X86-32] Set a bit mask of IRQs allowed to be
assigned automatically to PCI devices. You can
make the kernel exclude IRQs of your ISA cards
this way.
pirqaddr=0xAAAAA [X86-32] Specify the physical address
of the PIRQ table (normally generated
by the BIOS) if it is outside the
F0000h-100000h range.
lastbus=N [X86-32] Scan all buses thru bus #N. Can be
useful if the kernel is unable to find your
secondary buses and you want to tell it
explicitly which ones they are.
assign-busses [X86-32] Always assign all PCI bus
numbers ourselves, overriding
whatever the firmware may have done.
usepirqmask [X86-32] Honor the possible IRQ mask stored
in the BIOS $PIR table. This is needed on
some systems with broken BIOSes, notably
some HP Pavilion N5400 and Omnibook XE3
notebooks. This will have no effect if ACPI
IRQ routing is enabled.
noacpi [X86-32] Do not use ACPI for IRQ routing
or for PCI scanning.
routeirq Do IRQ routing for all PCI devices.
This is normally done in pci_enable_device(),
so this option is a temporary workaround
for broken drivers that don't call it.
firmware [ARM] Do not re-enumerate the bus but instead
just use the configuration from the
bootloader. This is currently used on
IXP2000 systems where the bus has to be
configured a certain way for adjunct CPUs.
noearly [X86] Don't do any early type 1 scanning.
This might help on some broken boards which
machine check when some devices' config space
is read. But various workarounds are disabled
and some IOMMU drivers will not work.
bfsort Sort PCI devices into breadth-first order.
This sorting is done to get a device
order compatible with older (<= 2.4) kernels.
nobfsort Don't sort PCI devices into breadth-first order.
cbiosize=nn[KMG] The fixed amount of bus space which is
reserved for the CardBus bridge's IO window.
blog.csdn.net/fudan_abc
parse_args
module_param __setup
__setup include/linux/init.h
171 #define __setup(str, fn)
\
172 __setup_param(str, fn, fn, 0)
__setup str fn
__setup str
fnstr =
netdev ether
netdev_boot_setup
__setup early_param
early_param
__setup early_param
parse_args
parse_early_param();
parse_args("Booting kernel", static_command_line, __start___param,
__stop___param - __start___param,
&unknown_bootoption);
parse_args parse_early_param
parse_args
blog.csdn.net/fudan_abc
550
early_param
early_param
parse_early_param
Linux
16
USBPCI subsys_initcall
subsys_initcall PCI
117 #define
118
119 #define
120 #define
121 #define
122 #define
123 #define
124 #define
125 #define
126 #define
127 #define
128 #define
129 #define
pure_initcall(fn)
__define_initcall("0",fn,1)
core_initcall(fn)
__define_initcall("1",fn,1)
core_initcall_sync(fn)
__define_initcall("1s",fn,1s)
postcore_initcall(fn)
__define_initcall("2",fn,2)
postcore_initcall_sync(fn)
__define_initcall("2s",fn,2s)
arch_initcall(fn)
__define_initcall("3",fn,3)
arch_initcall_sync(fn)
__define_initcall("3s",fn,3s)
subsys_initcall(fn)
__define_initcall("4",fn,4)
subsys_initcall_sync(fn)
__define_initcall("4s",fn,4s)
fs_initcall(fn)
__define_initcall("5",fn,5)
fs_initcall_sync(fn)
__define_initcall("5s",fn,5s)
rootfs_initcall(fn)
__define_initcall("rootfs",fn,rootfs)
blog.csdn.net/fudan_abc
130 #define
131 #define
132 #define
133 #define
134
135 #define
device_initcall(fn)
__define_initcall("6",fn,6)
device_initcall_sync(fn)
__define_initcall("6s",fn,6s)
late_initcall(fn)
__define_initcall("7",fn,7)
late_initcall_sync(fn)
__define_initcall("7s",fn,7s)
__initcall(fn) device_initcall(fn)
__define_initcall
__define_initcall __define_initcall
.initcall.init
.initcall.init
init bass
vmlinux.lds
arch/<target>/
vmlinux.lds initcall.init
__inicall_start = .;
.initcall.init : AT(ADDR(.initcall.init) 0xC0000000) {
*(.initcall1.init)
*(.initcall2.init)
*(.initcall3.init)
*(.initcall4.init)
*(.initcall5.init)
*(.initcall6.init)
*(.initcall7.init)
}
__initcall_end = .;
.initcall.init 7 xxx_initcall
xxx_initcall __define_initcall
core_initcall .initcall1.init
device_initcall .initcall6.init
.initcall1.init .initcall2.init
blog.csdn.net/fudan_abc
do_initcalls()
do_initcalls
do_initcall for __initcall_start __initcall_end
__initcall_start
__initcall_end .initcall.init xxx_initcall
do_initcall
.initcall.init
do_initcalls
do_initcalls
flush_scheduled_work do_initcalls
blog.csdn.net/fudan_abc
688
t1 = ktime_get();
689
delta = ktime_sub(t1, t0);
690
691
printk("initcall 0x%p", *call);
692
print_fn_descriptor_symbol(": %s()",
693
(unsigned long) *call);
694
printk(" returned %d.\n", result);
695
696
printk("initcall 0x%p ran for %Ld msecs: ",
697
*call, (unsigned long long)delta.tv64 >> 20);
698
print_fn_descriptor_symbol("%s()\n",
699
(unsigned long) *call);
700 }
701
702 if (result && result != -ENODEV && initcall_debug) {
703
sprintf(msgbuf, "error code %d", result);
704
msg = msgbuf;
705 }
706 if (preempt_count() != count) {
707
msg = "preemption imbalance";
708
preempt_count() = count;
709 }
710 if (irqs_disabled()) {
711
msg = "disabled interrupts";
712
local_irq_enable();
713 }
714 if (msg) {
715
printk(KERN_WARNING "initcall at 0x%p", *call);
716
print_fn_descriptor_symbol(": %s()",
717
(unsigned long) *call);
718
printk(": returned with %s\n", msg);
719 }
720 }
721
722 /* Make sure there is no pending stuff from the initcall sequence
*/
723 flush_scheduled_work();
724 }
blog.csdn.net/fudan_abc
Linux
17 PCI
Kconfig PCI
drivers/pci arch/i386/pci
drivers/pci arch/i386/pci PCI
PCI T
USBPCI subsys_initcall
subsys_initcall
PCI
subsys_initcall arch_initcallpostcore_initcall
arch/i386/pci/acpi.c
pci_acpi_init
subsys_initcall
.initcall4.init
arch/i386/pci/common.c
pcibios_init
subsys_initcall
.initcall4.init
arch/i386/pci/i386.c
pcibios_assign_resources
fs_initcall
.initcall5.init
arch/i386/pci/legacy.c
pci_legacy_init
subsys_initcall
.initcall4.init
drivers/pci/pci-acpi.c
acpi_pci_init
arch_initcall
.initcall3.init
drivers/pci/pci-driver.c
pci_driver_init
blog.csdn.net/fudan_abc
postcore_initcall
.initcall2.init
drivers/pci/pci-sysfs.c
pci_sysfs_init
late_initcall
.initcall7.init
drivers/pci/pci.c
pci_init
device_initcall
.initcall6.init
drivers/pci/probe.c
pcibus_class_init
postcore_initcall
.initcall2.init
drivers/pci/proc.c
pci_proc_init
__initcall
.initcall6.init
arch/i386/pci/init.c
pci_access_init
arch_initcall
.initcall3.init
xxx_initcall
keso
USB subsys_initcall
xxx_initcall .
initcall1.init .initcall2.init
.initcall2.init pcibus_class_init
pci_driver_init
pcibus_class_init pci_driver_init
do_initcalls .initcall.init for
gcc Using the GNU Compiler Collection
the linker searches and processes libraries and object files in the
order they are specified. Thus, foo.o -lz bar.o searches library z
after file foo.o but before bar.o.
drivers/pci/Makefile
5 obj-y
6
blog.csdn.net/fudan_abc
Documents/kbuild/makefile.txt 3.2
The order of files in $(obj-y) is significant.
pcibus_class_init pci_driver_init
Makefile .initcall3.init
acpi_pci_init pci_access_init
acpi_pci_init drivers/pci/pci-acpi.c pci_access_init
arch/i386 /pci/init.c
pcibus_class_init pci_driver_init
2 13
80
arch/i386/pci Makefile drivers/pci
Makefile
kbuild
Makefile Makefile
Makefile
arch/*/Makefile arch
Makefile kbuild
arch/*/ Makefile
drivers/ Makefile
kbuild Makefile
arch/* /Makefile
Makefile
kbuild Make
Makefile Makefile
arch/i386/pci
Makefile drivers/pci Makefile
pci_access_init acpi_pci_init
blog.csdn.net/fudan_abc
Linux
18
Linux
600 Linux
http://en.wikipedia.org/wiki/List_of_Linux_distributions
300
1.
http://distrowatch.com/ 100 Linux
6
2. Linux
http://polishlinux.org/choose/comparison/
Ubuntu Mandriva
blog.csdn.net/fudan_abc
Linux
19 API
SB
API
bug
Linux
Linux
bug
blog.csdn.net/fudan_abc
USB
USB throughput
USB
USB Core
USB Core
USB
Linux
USB USB
Linux
blog.csdn.net/fudan_abc
Linux
20 Git
Git
1. Git
Git Linus
Git http://git-scm.com/ Git
Git
Git clone
repository
branching
merging
blog.csdn.net/fudan_abc
Git
PerlGnomeWine Ubuntu/debian gitcore git
2. Git
Linus 2002 2 BitKeeper
BitMover BitKeeper BitKeeper
GNU Richard
Stallman Linus BitKeeper
BitKeeper
BitMover
BitKeeper Linus
Git Linus
Git the stupid content tracker Git
Linus 2.6.12rc3 Git
3.
Git Linus Google
youtube Linus Git
SVN
Git
blog.csdn.net/fudan_abc
dictator
lieutenants
4.
Git
http://www.ibm.com/developerworks/cn/linux/l-git/
Git
http://www.youtube.com/watch?v=4XpnKHJAok8
http://book.opensourceproject.org.cn/versioncontrol/git/gittutorcn.htm
Git
http://zh-cn.whygitisbetterthanx.com/#github
Kanru Git X Git
http://github.com/
GitHub Git
GitHub
fork Git
blog.csdn.net/fudan_abc
Linux
21 printk()
10km
10km
200 AB
C AC BC
BC D BD CD CD E
7
50100m
bug
bug
bug
bug
blog.csdn.net/fudan_abc
printk()
printk()
printk()
printk()
1. printk() printf()
printf() printk()
printk() printf()
printf() printk()
printk()
2. printk()
printk() printf()
printk() 8
KERN_EMERG
KERN_ALERT
KERN_CRIT
KERN_ERR
KERN_WARNING
KERN_NOTICE
KERN_INFO
KERN_DEBUG
printk() DEFAULT_MESSAGE_LOGLEVEL
KERN_WARNING
3. console_loglevel
printk
include/linux/kernel.h
DEFAULT_CONSOLE_LOGLEVEL 7 KERN_DEBUG
printk()
blog.csdn.net/fudan_abc
printk()
printk() early_printk()
printk()
blog.csdn.net/fudan_abc