zoukankan      html  css  js  c++  java
  • uboot命令

    uboot是怎么启动kernel的呢?

    先熟悉一下uboot的命令吧.

    首先是md, 查看内存.

    OpenJTAG> md 0
    00000000: ea000014 e59ff014 e59ff014 e59ff014    ................
    00000010: e59ff014 e59ff014 e59ff014 e59ff014    ................
    00000020: 33f80140 33f801a0 33f80200 33f80260    @..3...3...3`..3
    00000030: 33f802c0 33f80320 33f80360 deadbeef    ...3 ..3`..3....
    00000040: 33f80000 33f80000 33fa94a4 33faf4c8    ...3...3...3...3
    00000050: 0badc0de 0badc0de e10f0000 e3c0001f    ................
    00000060: e38000d3 e129f000 e3a00453 e3a01000    ......).S.......
    00000070: e5801000 e3e01000 e59f0320 e5801000    ........ .......
    00000080: e59f131c e59f031c e5801000 e59f0318    ................
    00000090: e3a01003 e5801000 eb000019 e24f00a4    ..............O.
    000000a0: e51f1068 e1500001 0a000007 e51f2070    h.....P.....p ..
    000000b0: e51f3070 e0432002 e0802002 e8b007f8    p0... C.. ......
    000000c0: e8a107f8 e1500002 dafffffb e51f0094    ......P.........
    000000d0: e2400701 e2400080 e2400a02 e240d00c    ..@...@...@...@.
    000000e0: e51f00a0 e51f10a0 e3a02000 e5802000    ......... ... ..
    000000f0: e2800004 e1500001 dafffffb e51ff004    ......P.........

    接着是查看norflash命令: flinfo, 因为用的cfi驱动, 所以看起来是这样的:

    OpenJTAG> flinfo
    Bank # 1: CFI conformant FLASH (16 x 16)  Size: 2 MB in 35 Sectors
     Erase timeout 16384 ms, write timeout 1 ms, buffer write timeout 1 ms, buffer size 1
      Sector Start Addresses:
        00000000 (RO) 00004000 (RO) 00006000 (RO) 00008000 (RO) 00010000 (RO)
        00020000 (RO) 00030000      00040000      00050000      00060000
        00070000      00080000      00090000      000A0000      000B0000
        000C0000      000D0000      000E0000      000F0000      00100000
        00110000      00120000      00130000      00140000      00150000
        00160000      00170000      00180000      00190000      001A0000
        001B0000      001C0000      001D0000      001E0000      001F0000

    print命令显示环境变量或者叫环境设置

    OpenJTAG> print
    bootargs=noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
    bootcmd=nand read.jffs2 0x30007FC0 kernel; bootm 0x30007FC0
    bootdelay=2
    baudrate=115200
    ethaddr=08:00:3e:26:0a:5b
    netmask=255.255.255.0
    mtdids=nand0=nandflash0
    mtdparts=mtdparts=nandflash0:256k@0(bootloader),128k(params),2m(kernel),-(root)
    partition=nand0,0
    mtddevnum=0
    mtddevname=bootloader
    ipaddr=192.168.123.3
    serverip=192.168.123.124
    stdin=serial
    stdout=serial
    stderr=serial

    Environment size: 447/131068 bytes

    nandflash操作用nand命令:
    OpenJTAG> nand info
    Device 0: NAND 256MiB 3,3V 8-bit, sector size 128 KiB

    启动的命令

    bootargs=noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
    bootcmd=nand read.jffs2 0x30007FC0 kernel; bootm 0x30007FC0

    ----------------

    先md 30007FC0内存里面都是啥:

    OpenJTAG> md 30007FC0
    30007fc0: 00000000 00000000 00000000 00000000    ................
    30007fd0: 00000000 00000000 00000000 00000000    ................
    30007fe0: 00000000 00000000 00000000 00000000    ................
    30007ff0: 30490011 30490411 30002031 30002431    ..I0..I01 .01$.0
    30008000: 3a726572 00000000 72657355 6567412d    rer:....User-Age
    30008010: 003a746e 68747541 7a69726f 6f697461    nt:.Authorizatio
    30008020: 00003a6e 69736142 00000063 2d696763    n:..Basic...cgi-
    30008030: 2f6e6962 00000000 65646e69 74682e78    bin/....index.ht
    30008040: 00006c6d 6967632f 6e69622d 646e692f    ml../cgi-bin/ind
    30008050: 632e7865 00006967 20626557 76726553    ex.cgi..Web Serv
    30008060: 41207265 65687475 6369746e 6f697461    er Authenticatio
    30008070: 0000006e 00003038 693a7676 00000066    n...80..vv:if...
    30008080: 3a643a63 3a653a68 3a6d3a72 66693a70    c:d:h:e:r:m:p:if
    30008090: 00000076 64252326 0000003b 00243124    v...&#%d;...$1$.
    300080a0: 000b2b74 00000000 000b2b08 000b2b78    t+.......+..x+..
    300080b0: 000b2b9c 000b2bac 000b2bd4 000b2be4    .+...+...+...+..

    然后读nand_flash到内存

    nand read.jffs2 0x30007FC0 kernel

    再看看

    OpenJTAG> md 30007FC0
    30007fc0: 56190527 15ea7647 beee8d51 5c351c00    '..VGv..Q.....5
    30007fd0: 00800030 00800030 fb1c00e3 00020205    0...0...........
    30007fe0: 756e694c 2e322d78 32322e36 0000362e    Linux-2.6.22.6..
    30007ff0: 00000000 00000000 00000000 00000000    ................
    30008000: e1a00000 e1a00000 e1a00000 e1a00000    ................
    30008010: e1a00000 e1a00000 e1a00000 e1a00000    ................
    30008020: ea000002 016f2818 00000000 001c355c    .....(o.....5..
    30008030: e1a07001 e1a08002 e10f2000 e3120003    .p....... ......
    30008040: 1a000001 e3a00017 ef123456 e10f2000    ........V4... ..
    30008050: e38220c0 e121f002 00000000 00000000    . ....!.........
    30008060: e28f00d0 e890307e e0500001 0a00000a    ....~0....P.....
    30008070: e0855000 e0866000 e08cc000 e0822000    .P...`....... ..
    30008080: e0833000 e08dd000 e5961000 e0811000    .0..............
    30008090: e4861004 e156000c 3afffffa e3a00000    ......V....:....
    300080a0: e4820004 e4820004 e4820004 e4820004    ................
    300080b0: e1520003 3afffff9 eb000028 e1a0100d    ..R....:(.......

    被载入了nand里面的linux内核镜像

    bootm 0x30007FC0

    bootm 地址, 表示从地址启动内核, 也可以用go 地址, 但是貌似用了go, 直接就重启了.

    U-Boot 1.1.6 (Jan  5 2017 - 18:28:43)

    DRAM:  64 MB
    Flash:  2 MB
    NAND:  256 MiB
    In:    serial
    Out:   serial
    Err:   serial
    Hit any key to stop autoboot:  0

    NAND read: device 0 offset 0x60000, size 0x200000

    Reading data from 0x25f800 -- 100% complete.
     2097152 bytes read: OK
    ## Booting image at 30007fc0 ...
       Image Name:   Linux-2.6.22.6
       Created:      2013-05-11   7:09:50 UTC
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    1848668 Bytes =  1.8 MB
       Load Address: 30008000
       Entry Point:  30008000
       Verifying Checksum ... OK
    OK

    Starting kernel ...

    Uncompressing Linux...................................................................................................................... done, booting the kernel.
    Linux version 2.6.22.6 (book@book-desktop) (gcc version 3.4.5) #1 Sat May 11 15:09:41 CST 2013
    CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
    Machine: SMDK2440
    Memory policy: ECC disabled, Data cache writeback
    CPU S3C2440A (id 0x32440001)
    S3C244X: core 405.000 MHz, memory 101.250 MHz, peripheral 50.625 MHz
    S3C24XX Clocks, (c) 2004 Simtec Electronics
    CLOCK: Slow mode (1.500 MHz), fast, MPLL on, UPLL on
    CPU0: D VIVT write-back cache
    CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
    CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
    Built 1 zonelists.  Total pages: 16256
    Kernel command line: noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0
    irq: clearing subpending status 00000003
    irq: clearing subpending status 00000002
    PID hash table entries: 256 (order: 8, 1024 bytes)
    timer tcon=00500000, tcnt a4ca, tcfg 00000200,00000000, usec 00001e57
    Console: colour dummy device 80x30
    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
    Memory: 64MB = 64MB total
    Memory: 60976KB available (3264K code, 458K data, 140K init)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    NET: Registered protocol family 16
    S3C2410 Power Management, (c) 2004 Simtec Electronics
    S3C2440: Initialising architecture
    S3C2440: IRQ Support
    S3C2440: Clock Support, DVS off
    S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
    DMA channel 0 at c4800000, irq 33
    DMA channel 1 at c4800040, irq 34
    DMA channel 2 at c4800080, irq 35
    DMA channel 3 at c48000c0, irq 36
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 2048 (order: 2, 16384 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 2048 bind 2048)
    TCP reno registered
    NetWinder Floating Point Emulator V0.97 (double precision)
    Registering GDB sysrq handler
    JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    yaffs May 11 2013 15:08:01 Installing.
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    io scheduler deadline registered
    io scheduler cfq registered
    Console: switching to colour frame buffer device 60x34
    fb0: s3c2410fb frame buffer device
    lp: driver loaded but no devices found
    ppdev: user-space parallel port driver
    S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics
    Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
    s3c2440-uart.0: s3c2410_serial0 at MMIO map 0x50000000 mem 0xf0400000 (irq = 70) is a S3C2440
    s3c2440-uart.1: s3c2410_serial1 at MMIO map 0x50004000 mem 0xf0404000 (irq = 73) is a S3C2440
    s3c2440-uart.2: s3c2410_serial2 at MMIO map 0x50008000 mem 0xf0408000 (irq = 76) is a S3C2440
    RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
    loop: module loaded
    line 400 <DM9KS> I/O: c486a000, VID: 90000a46
    line 408 <DM9KS> I/O: c486a000, VID: 90000a46
    <DM9KS> error version, chip_revision = 0x1a, chip_info = 0x3
    id_val=0
    S3C24XX NAND Driver, (c) 2004 Simtec Electronics
    s3c2440-nand s3c2440-nand: Tacls=3, 29ns Twrph0=7 69ns, Twrph1=3 29ns
    NAND device: Manufacturer ID: 0xec, Chip ID: 0xda (Samsung NAND 256MiB 3,3V 8-bit)
    Scanning device for bad blocks
    Bad eraseblock 63 at 0x007e0000
    Bad eraseblock 65 at 0x00820000
    Bad eraseblock 136 at 0x01100000
    Bad eraseblock 964 at 0x07880000
    Bad eraseblock 1262 at 0x09dc0000
    Bad eraseblock 1270 at 0x09ec0000
    Bad eraseblock 1385 at 0x0ad20000
    Bad eraseblock 1856 at 0x0e800000
    Bad eraseblock 1918 at 0x0efc0000
    Creating 4 MTD partitions on "NAND 256MiB 3,3V 8-bit":
    0x00000000-0x00040000 : "bootloader"
    0x00040000-0x00060000 : "params"
    0x00060000-0x00260000 : "kernel"
    0x00260000-0x10000000 : "root"
    s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
    s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
    s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 2 ports detected
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    mice: PS/2 mouse device common for all mice
    s3c2410 TouchScreen successfully loaded
    input: s3c2410 TouchScreen as /class/input/input0
    S3C24XX RTC, (c) 2004,2006 Simtec Electronics
    s3c2440-i2c s3c2440-i2c: slave address 0x10
    s3c2440-i2c s3c2440-i2c: bus frequency set to 98 KHz
    s3c2440-i2c s3c2440-i2c: i2c-0: S3C I2C adapter
    mapped channel 0 to 0
    s3c2440-sdi s3c2440-sdi: powered down.
    s3c2440-sdi s3c2440-sdi: initialisation done.
    usbcore: registered new interface driver hiddev
    usbcore: registered new interface driver usbhid
    drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver
    Advanced Linux Sound Architecture Driver Version 1.0.14 (Thu May 31 09:03:25 2007 UTC).
    ASoC version 0.13.1
    s3c2410iis_probe...
    UDA1341 audio driver initialized
    ALSA device list:
      No soundcards found.
    TCP cubic registered
    NET: Registered protocol family 1
    drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    UDF-fs: No VRS found
    yaffs: dev is 32505859 name is "mtdblock3"
    yaffs: passed flags ""
    yaffs: Attempting MTD mount on 31.3, "mtdblock3"
    yaffs: auto selecting yaffs2
    block 45 is bad
    block 47 is bad
    block 118 is bad
    block 946 is bad
    block 1244 is bad
    block 1252 is bad
    block 1367 is bad
    block 1838 is bad
    block 1900 is bad
    s3c2440-sdi s3c2440-sdi: running at 0kHz (requested: 0kHz).
    s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
    s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
    s3c2440-sdi s3c2440-sdi: running at 198kHz (requested: 197kHz).
    s3c2440-sdi s3c2440-sdi: CMD[TIMEOUT] #2 op:UNKNOWN(8) arg:0x000001aa flags:0x0875 retries:0 Status:nothing to complete
    s3c2440-sdi s3c2440-sdi: CMD[TIMEOUT] #3 op:APP_CMD(55) arg:0x00000000 flags:0x0875 retries:0 Status:nothing to complete
    s3c2440-sdi s3c2440-sdi: CMD[TIMEOUT] #4 op:APP_CMD(55) arg:0x00000000 flags:0x0875 retries:0 Status:nothing to complete
    s3c2440-sdi s3c2440-sdi: CMD[TIMEOUT] #5 op:APP_CMD(55) arg:0x00000000 flags:0x0875 retries:0 Status:nothing to complete
    s3c2440-sdi s3c2440-sdi: CMD[TIMEOUT] #6 op:APP_CMD(55) arg:0x00000000 flags:0x0875 retries:0 Status:nothing to complete
    s3c2440-sdi s3c2440-sdi: CMD[TIMEOUT] #7 op:ALL_SEND_OCR(1) arg:0x00000000 flags:0x0861 retries:0 Status:nothing to complete
    s3c2440-sdi s3c2440-sdi: powered down.
    VFS: Mounted root (yaffs filesystem).
    Freeing init memory: 140K
    init started: BusyBox v1.7.0 (2008-01-22 10:04:09 EST)
    starting pid 764, tty '': '/etc/init.d/rcS'

    Please press Enter to activate this console. tsdev (compaq touchscreen emulation) is scheduled for removal.
    See Documentation/feature-removal-schedule.txt for details.
    Warning: TimeZone::data Can't create a valid data object for 'Europe/Oslo'
    Warning: could not register server

  • 相关阅读:
    硝烟中的Scrum和XP-我们如何实施Scrum 12)发布计划 13)组合XP
    php array key 的存储规则
    IE下单选按钮隐藏后点击对应label无法选中的bug解决
    使用QML自绘页面导航条
    unity 获取物体尺寸
    输出众数,输出超限问题
    HTTP请求具体解释
    app 设计原则 ,步骤
    Distinct Subsequences
    OSX: 禁止iCloud钥匙链?
  • 原文地址:https://www.cnblogs.com/Montauk/p/6255593.html
Copyright © 2011-2022 走看看