1、内核的作用
2、Linux内核的官网:https://www.kernel.org
3、输出信息
GEC6818#dmesg //打印内核的调试信息
GEC6818#dmesg | tail -100 //打印末尾100行的内核调试信息
1)它只是用CPU0进行linux内核
[ 0.000000] Booting Linux on physical CPU 0
2)告诉当前linux内核的版本是3.4.39-gec,使用到的编译器gcc 4.8,内核编译生成时间
[ 0.000000] Linux version 3.4.39-gec (root@ubuntu) (gcc version 4.8 (GCC) ) #8 SMP PREEMPT Thu Jan 17 00:57:42 PST 2019
3)当前CPU的型号
[ 0.000000] Machine: s5p6818
4)初始化时钟
[ 0.000000] GEC6818 : done board initialize ...
[ 0.000000] CPU : Clock Generator= 58 EA, DVFS = support, PLL.1
[ 0.000000] PLL : [0] = 800000000, [1] = 800000000, [2] = 780000000, [3] = 800000000
[ 0.000000] (0) PLL1: CPU FCLK = 800000000, HCLK = 200000000 (G0)
[ 0.000000] (7) PLL1: CPU FCLK = 800000000, HCLK = 200000000 (G1)
[ 0.000000] (2) PLL3: MEM FCLK = 800000000, DCLK = 800000000, BCLK = 400000000, PCLK = 200000000
[ 0.000000] (1) PLL0: BUS BCLK = 400000000, PCLK = 200000000
[ 0.000000] (8) PLL0: CCI4 BCLK = 400000000, PCLK = 200000000
[ 0.000000] (3) PLL0: G3D BCLK = 400000000
[ 0.000000] (4) PLL0: CODA BCLK = 400000000, PCLK = 200000000
[ 0.000000] (5) PLL0: DISP BCLK = 400000000, PCLK = 200000000
[ 0.000000] (6) PLL0: HDMI PCLK = 133333333
5)uboot传递给内核的信息
[ 0.000000] Kernel command line: console=ttySAC0,115200n8 androidboot.hardware=GEC6818 androidboot.console=ttySAC0 androidboot.serialno=0123456789abcdef initrd=0x49000000,0x1000000 lcd=at070tn92 tp=gslx680-linux root=/dev/mmcblk0p2 rw rootfstype=ext4
6)内存管理
[ 0.000000] Memory: 1024MB = 1024MB total
[ 0.000000] Memory: 810732k/810732k available, 237844k reserved, 272384K highmem
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xef800000 - 0xfee00000 ( 246 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xef600000 ( 758 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0a63748 (10606 kB)
[ 0.000000] .init : 0xc0a64000 - 0xc0aa1100 ( 245 kB)
[ 0.000000] .data : 0xc0aa2000 - 0xc0b3eae0 ( 627 kB)
[ 0.000000] .bss : 0xc0b3eb04 - 0xc0d1f288 (1922 kB)
7)设备管理,初始化各种硬件(gpio、串口、i2c、网络硬件、usb....),加载各个硬件的驱动
[ 0.000000] GIC @f0009000: start 0 (gic 31)
[ 0.000000] GPIO @f001a000: start 106, mask 0xffffffff (gpio 85)
[ 0.000000] GPIO @f001b000: start 138, mask 0xffffffff (gpio 86)
[ 0.000000] GPIO @f001c000: start 170, mask 0xffffffff (gpio 87)
[ 0.000000] GPIO @f001d000: start 202, mask 0xffffffff (gpio 88)
[ 0.000000] GPIO @f001e000: start 234, mask 0xffffffff (gpio 89)
[ 0.000000] ALIVE @f0010800: start 266, mask 0x000000ff (alive 36, num 6)
[ 0.000000] timer.0: source, 10000000(HZ:1000), mult:3355443200
[ 0.000000] timer.1: event , 10000000(HZ:1000), mult:42949673
......
[ 0.121000] mach: add amba device pl08xdmac.0
[ 0.121000] mach: add amba device pl08xdmac.1
[ 0.121000] mach: add device uart0
[ 0.121000] mach: add device uart1
[ 0.122000] mach: add device uart2
[ 0.123000] mach: add device uart3
[ 0.124000] mach: add device syncgen [2]
[ 0.125000] mach: add device lcd
[ 0.125000] mach: add device lvds
[ 0.125000] mach: add device mipi
[ 0.125000] mach: add device i2c bus (array:3)
[ 0.125000] mach: add device Real Time Clock
[ 0.125000] mach: add device generic pwm (array:4)
[ 0.125000] mach: add device generic gpio (array:6)
[ 0.125000] mach: add device i2s (array:1)
[ 0.125000] mach: add device spdif tx
[ 0.125000] mach: add device usb_ehci
[ 0.125000] mach: add device usb otg
[ 0.126000] mach: add device ion-nxp
[ 0.126000] mach: add device adc
......
8)挂载文件系统
[ 2.659000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 2.661000] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 2.668000] devtmpfs: mounted
9)进入命令行
[root@GEC6818 /]#
1、什么是根文件系统
Linux内核挂载第一个文件系统,该文件系统是挂载到根目录下的文件系统,简称为“根文件系统”(rootfs),它其实就是一个容器,里面包含各种各样的文件与目录。
[root@GEC6818 /]#ls
bin sbin lib etc home mnt proc var dev ......
1)linux的shell命令
/bin,一般的shell命令
/sbin,超级管理员就是root用户才能够使用的命令,这些命令都是跟硬件相关。
/usr/bin,应用程序与工具
/usr/sbin,shell命令和工具
2)设备节点
/dev目录,里面是应用程序访问硬件的接口,里面只要字符设备和块设备的设备文件,网络设备是没有设备文件。
Lcd设备,/dev/fb0
触摸屏设备,/dev/input/event0
[root@GEC6818 /]#ls -l /dev/fb0
crw-rw---- 1 root root 29, 0 Jan 1 1970 /dev/fb0 //c--->字符设备
[root@GEC6818 /]#ls -l /dev/mmcblk0
brw-rw---- 1 root root 179, 0 Jan 1 1970 /dev/mmcblk0 //--->块设备
3)系统的配置文件
/etc目录:用户名、密码、主机名、网络配置、系统各种信息
4)实时反映linux系统的工作状态
/proc目录
.数字,PID进程编号和状态信息
.version <版本信息>
[root@GEC6818 /proc]#cat version //查看版本信息指令
Linux version 3.4.39-gec (root@ubuntu) (gcc version 4.8 (GCC) ) #8 SMP PREEMPT Thu Jan 17 00:57:42 PST 2019
.cpuinfo
[root@GEC6818 /proc]#cat cpuinfo //查看cpu信息指令
Processor : ARMv7 Processor rev 3 (v7l)
processor : 0
BogoMIPS : 1581.05
processor : 1
BogoMIPS : 1591.29
processor : 2
BogoMIPS : 1591.29
processor : 3
BogoMIPS : 1601.53
processor : 4
BogoMIPS : 1601.53
processor : 5
BogoMIPS : 1591.29
processor : 6
BogoMIPS : 1591.29
processor : 7
BogoMIPS : 1591.29
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 3
Hardware : s5p6818
Revision : 0000
Serial : 0000000000000000
.meminfo <内存信息>
[root@GEC6818 /proc]#cat meminfo //查看内存信息指令
MemTotal: 827360 kB
MemFree: 804224 kB
Buffers: 924 kB
Cached: 2744 kB
SwapCached: 0 kB
Active: 1416 kB
Inactive: 2476 kB
Active(anon): 236 kB
Inactive(anon): 0 kB
Active(file): 1180 kB
Inactive(file): 2476 kB
Unevictable: 0 kB
Mlocked: 0 kB
HighTotal: 272384 kB
HighFree: 268364 kB
LowTotal: 554976 kB
LowFree: 535860 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 236 kB
Mapped: 800 kB
Shmem: 0 kB
Slab: 10880 kB
SReclaimable: 4404 kB
SUnreclaim: 6476 kB
KernelStack: 736 kB
PageTables: 60 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 413680 kB
Committed_AS: 1096 kB
VmallocTotal: 251904 kB
VmallocUsed: 8280 kB
VmallocChunk: 235520 kB
.devices,设备信息 /*** 重点,跟驱动编程相关 ***/
[root@GEC6818 /proc]#cat devices
Character devices:
1 mem
4 /dev/vc/0
4 tty
5 /dev/tty
5 /dev/console
5 /dev/ptmx
5 ttyprintk
7 vcs
10 misc
13 input
14 sound
21 sg
29 fb
81 video4linux
86 ch
89 i2c
108 ppp
116 alsa
128 ptm
136 pts
153 spi
166 ttyACM
180 usb
188 ttyUSB
189 usb_device
204 ttySAC
216 rfcomm
245 roccat
246 BaseRemoteCtl
247 ttyGS
248 usbmon
249 bsg
250 iio
251 ptp
252 pps
253 media
254 rtc
5)库的路径
/lib
/usr/lib
/usr/local/lib
6)系统的挂载
/mnt
7)设备驱动的详细信息
/sys
例如,触摸屏设备驱动的详细
[root@GEC6818 /sys/devices/virtual/rc/rc0/input1/event0]#cat uevent
MAJOR=13
MINOR=64
DEVNAME=input/event0