ARM linux开发之linux内核启动简介

  • 1.内核的作用
    1)进程的管理和进程的通信:进程的创建和删除、进程之间优先级抢占、进程的时间片轮转调度、进程间的通信。
    2)内存管理:内存分配算法,每个进程的内存空间由Linux进行分配。
    3)支持的文件系统,可以通过cat /proc/filesystems
    4)设备的管理,聚焦到linux驱动:字符设备、块设备、网络设备、中断、内核时钟。
    5)网络协议:TCP/IP。
    linux内核的官网

  • 2.开发板开机的打印信息

1)uboot加载内核

## Booting kernel from Legacy Image at 48000000 ...
   Image Name:   Linux-3.4.39-gec//内核版本,3.4.39,该镜像由gec定制
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5540912 Bytes = 5.3 MiB//内核镜像的大小5.3MB
   Load Address: 40008000//内核是存储在内存地址空间0x40008000
   Entry Point:  40008000//内核执行的入口地址0x40008000
   Verifying Checksum ... OK//校验镜像的内容是否完整
   Loading Kernel Image ... OK//若校验成功,则启动内核
Starting kernel ...

2)linux内核启动

[    0.000000] Booting Linux on physical CPU 0 //它只是用CPU0进行linux启动

3)告诉当前linux内核的版本、使用到的编译器、编译生成时间

[    0.000000] Linux version 3.4.39-gec (zr@boLe) (gcc version 4.8 (GCC) ) #9 SMP PREEMPT Sun Nov 19 10:01:10 CST 2017

注意:在编译驱动时,内核版本要和开发板上版本一样,编译器版本要和编译内核时的版本一样(如这里使用的gcc 4.8版本,编译驱动时候,也用对应版本的编译器)
4)uboot传递给内核的信息,使用lcd、触摸屏是什么型号、串口的配置等信息

[    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

5)内存管理

[    0.000000] Memory: 1024MB = 1024MB total
[    0.000000] Memory: 810792k/810792k available, 237784k 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 - 0xc0a561c8   (10553 kB)
[    0.000000]       .init : 0xc0a57000 - 0xc0a94100   ( 245 kB)
[    0.000000]       .data : 0xc0a96000 - 0xc0b307b0   ( 618 kB)
[    0.000000]        .bss : 0xc0b307d4 - 0xc0d10508   (1920 kB)
[    0.000000]        .bss : 0xc0b307d4 - 0xc0d10508   (1920 kB)
[    0.000000] SLUB: Genslabs=11, HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1

6)设备管理,初始化各种硬件(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.209000] i2c-gpio i2c-gpio.0: using pins 99 (SDA) and 98 (SCL)
[    0.209000] i2c-gpio i2c-gpio.1: using pins 101 (SDA) and 100 (SCL)
[    0.209000] i2c-gpio i2c-gpio.3: using pins 80 (SDA) and 79 (SCL)
[    0.211000] s3c-i2c s3c2440-i2c.2: i2c-2: S3C I2C adapter
[    0.211000] s3c-i2c s3c2440-i2c.2: slave address 0x10
[    0.211000] s3c-i2c s3c2440-i2c.2: bus frequency set to 195 KHz
 
[    0.211000] Linux media interface: v0.10
[    0.212000] Linux video capture interface: v2.00
 
[    0.218000] axp_mfd 3-0034: AXP (CHIP ID: 0x06) detected
 
[    0.309000] Advanced Linux Sound Architecture Driver Version 1.0.25.
[    0.309000] Bluetooth: Core ver 2.16
[    0.310000] NET: Registered protocol family 31
[    0.310000] Bluetooth: HCI device and connection manager initialized
[    0.310000] Bluetooth: HCI socket layer initialized
......

7)挂载根文件系统

[    3.967000] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    3.969000] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    3.976000] devtmpfs: mounted

8)进入命令行

[root@GEC6818 /]#
原文地址:https://www.cnblogs.com/risesource/p/12011193.html