PMON常用命令解析

在pmon下输入h,可以看到pmon支持的所有命令。

PMON> h
                             Boot and Load                            
           oload  load memory from hostport                                              
            load  load file                                                              
                                 Misc                                 
           devls  list devices                                                           
          reboot  reboot system                                                          
            halt  reboot system                                                          
              tr  transparent mode                                                       
     spieraseall  Erase spi flash full chip                                              
      spiprogram  Programm spi flash with LPC Flash                                      
   save_ddrparam  Save MC parameters into FALSH                                          
     showwindows  Show all windows configuration for 3A                                  
       setfanpwm  Set fan DC for board with W83527 chip                                  
        ltc_test  test the i2c rtc is ok?                                                
         eepread  read a address from an eeprom chip                                     
         usbtest  LS2K usbtest : usbtest                                                 
        satatest  LS2K satatest: satatest                                                
         slttest  LS2K pcie link status test: slttest                                    
                                MyCmds                                
            cp0s  access cp0                                                             
           disks  select disk                                                            
              d2  dump address half world                                                
              d8  dump address double word                                               
              m2  mofify address half world                                              
              m8  modify address double word                                             
         initkbd  kbd_initialize                                                         
            loop  loopcmd count cmd...                                                   
         testide  test ide dma                                                           
           fdisk  dump disk partation                                                    
            ifup  ifup fxp0                                                              
          rtlist  rtlist                                                                 
           sleep  sleep ms                                                               
          memcpy  mymemcpy src dst count                                                 
           mycmp  mecmp s1 s2 len                                                        
          flashs  select flash for read/write                                            
          xmodem  xmodem [base=baseaddr] [file=filename]                                 
         sysinfo  hardware test                                                          
           newmt  new memory test                                                        
               |  run cmd and return 0                                                   
           rnand  read nand                                                              
           enand  erase nand                                                             
       mtd_erase  (null)                                                                 
      mtd_findbb  find badblock, keep data or erase                                      
         cpuexec  boot cpu 1 from pc                                                     
         dc_freq  config dc clk(khz)                                                     
       spi_initw  spi_initw(sst25vf080b)                                                 
      write_pmon  write_pmon(sst25vf080b)                                                
 write_pmon_byte  write_pmon_byte(sst25vf080b)                                           
          spicmd  spicmd [cs] [[-]data]...                                               
            i2cs  test i2c                                                               
                               Debugger                               
               t  trace (single step)                                                    
              db  delete break point(s)                                                  
               g  start execution (go)                                                   
              ls  list symbols                                                           
               l  list (disassemble) memory                                              
              bt  stack backtrace                                                        
                                 Shell                                
               h  on-line help                                                           
            vers  print version info                                                     
              hi  display command history                                                
           about  about PMON2000                                                         
                                Network                               
            ping  ping remote host                                                       
                           grub like command                          
          initrd  load initrd/initramfs image                                            
                                Memory                                
               d  display memory                                                         
            copy  copy memory to memory                                                  
          search  search memory                                                          
       spacescan  ALL space cached scan test                                             
                                  Pci                                 
         pciscan  scan pci bus                                                           
           lspci  scan pci bus                                                           
                              Environment                             
             set  display/set variable                                                   
            eset  edit variable                                                          
                               MainCmds                               
            main  Simulates the MAIN BIOS SETUP                                          
                             USB commands                             
             usb  general usb commands                                                   
                                 rays                                 
              bl  Load Boot menu from config file                                        
                      RAYS Commands for PMON 2000                     
                         test nand read write                         
   test_nand_r_w  test nand read and write                                               
                   Set CPU and DDR Frequency Command                  
    set_ddr_freq  set ddr freq cmd: cmd freq                                             
    get_cpu_freq  get cpu freq cmd: cmd                                                  
                             ls2h commands                            
     set_cpu_vol  Dynamic set cpu voltage                                                
                                  FDT                                 
             fdt  show all fdt cmds                                                      
       print_dtb  print dtb at <path> [prop]                                             
     rm_dtb_node  Delete the node or [property] in dtb                                   
        save_dtb  erase dtb file in flash                                                
                               ls2k can                               
         can_sel  test the can function                                                  
          can_rx  test the can function                                                  
         can_cfg  test the can function                                                  
     can_tx_test  test the can function                                                  
    can1_tx_test  test the can function                                                  
    can1_rx_test  test the can function                                                  
                               ahcisata                               
        ahcisata  ahci sata read write                                                   
PMON>

输入h 具体命令,可以查看该命令的用法

PMON> h load
            load  [-beastifr][-o offs]                                                    load file
                               -s    don't clear old symbols
                               -b    don't clear breakpoints
                               -e    don't clear exception handlers
                               -a    don't add offset to symbols
                               -t    load at top of memory
                               -i    ignore checksum errors
                  -f flash_addr -o load_addr offsetr    
                               -n    don't load symbols
                               -y    only load symbols
                               -v    verbose messages
                               -w    reverse endianness
                               -k    prepare for kernel symbols
                         -o<offs>    load offset
                               -r    load raw file
                             path    path and filename
                  
 Most frequenty cmds about load:	
	load from fat_usb:load /dev/fat/usb0/vmlinuxboot	
	load from tftp server:load tftp://10.2.5.22/vmlinux	
	update bios: load -r -f 0xbfc00000 tftp://10.2.5.22/gzrom.bin
    (null)
PMON>

下面挑选部分常用命令进行简单介绍。

读写环境变量 set/unset

set可以查看所有的环境变量;
set 变量名 可以查看特定环境变量;
set 变量名 值 可以设置变量值。

PMON> set
 activecom = 0x00      
 em_enable = 0x00      
   ethaddr = 00:00:00:00:00:00
       wdt = 300       
   ls2kver = 0         
   memsize = 240       
highmemsize = 1792      
  cpuclock = 200000000 
  busclock = 66000000  
   systype = FCR       
    brkcmd = "l -r @cpc 1"
  datasize = -b          [-b -h -w -d]
    dlecho = off         [off on lfeed]
   dlproto = none        [none XonXoff EtxAck]
     bootp = no          [no sec pri save]
  hostport = tty0      
   inalpha = hex         [hex symbol]
    inbase = 16          [auto 8 10 16]
    moresz = 10        
    prompt = "PMON> "
  regstyle = sw          [hw sw]
   regsize = 32          [32 64]
    rptcmd = trace       [off on trace]
   trabort = ^K        
      ulcr = cr          [cr lf crlf]
     uleof = %         
   showsym = yes         [no yes]
     fpfmt = both        [both double single none]
     fpdis = yes         [no yes]
  mtdparts = nand-flash:30M@0(kernel),-(rootfs);spinand_flash:30M@0(kernel),-(rootfs)
 bootdelay = 3         
      uuid = 25C583A3-F36B-1400-4BDE-000000000000
        FR = 1         
installdelay = 5         
autoinstall = /dev/fs/ext2@usb0/vmlinuxboot
        al = /dev/fs/iso9600@cd0/boot/vmlinux
    append = "console=tty root=/dev/sda1"
       al1 = /dev/fs/ext2@wd0/boot/vmlinux
PMON> 

PMON> set bootdelay
 bootdelay = 3         
PMON> 
PMON> set bootdelay 6
PMON> set bootdelay  
 bootdelay = 6         
PMON>

如果不需要某环境变量,可以通过 unset 变量名 来删除环境变量,或者用该命令恢复系统环境变量的默认值。

devls 显示当前设备

该命令可以显示所有设备或者网络设备。

PMON> h devls
           devls  [-an]                                                                   list devices
                               -a    show all device types
                               -n    show network devices
PMON> devls
Device name  Type
syn0         IFNET
syn1         IFNET
wd0          DISK
PMON>
设置mac地址

可以通过set ethaddr XX来设置mac地址或者通过setmac命令设置mac地址。

PMON> h setmac
          setmac                                                                          set the Mac address of LS2K syn0 and syn1
PMON> set ethaddr
   ethaddr = 00:00:00:00:00:00
PMON>
设置网口IP
PMON> h ifconfig
        ifconfig  ifname                                                                  ifconig fx0 [up|down|remove|stat|setmac|readrom|writerom|addr [netmask]
PMON>

该命令设置IP地址重启后失效。

分区擦除
mtd_erase /dev/mtd0 #跳过坏块擦除
mtd_erase /dev/mtd0r #不跳过坏块擦除
PMON> mtd_erase -h
       mtd_erase  [option] mtd_dev                                                        (null)
                               -h    HELP
                               -H    HELP
                               -j    format the device for jffs2,the clearmark-size is 12 Byte
                               -c    check for bad block
PMON>
烧写文件
PMON> h devcp
           devcp  srcfile dstfile [bs=0x20000] [count=-1] [seek=0] [skip=0] [quiet=0]     copy form src to dst
PMON>

主要用于将内核或者文件系统烧写到falsh中。

加载文件
PMON> h load
            load  [-beastifr][-o offs]                                                    load file
                               -s    don't clear old symbols
                               -b    don't clear breakpoints
                               -e    don't clear exception handlers
                               -a    don't add offset to symbols
                               -t    load at top of memory
                               -i    ignore checksum errors
                  -f flash_addr -o load_addr offsetr    
                               -n    don't load symbols
                               -y    only load symbols
                               -v    verbose messages
                               -w    reverse endianness
                               -k    prepare for kernel symbols
                         -o<offs>    load offset
                               -r    load raw file
                             path    path and filename
                  
 Most frequenty cmds about load:	
	load from fat_usb:load /dev/fat/usb0/vmlinuxboot	
	load from tftp server:load tftp://10.2.5.22/vmlinux	
	update bios: load -r -f 0xbfc00000 tftp://10.2.5.22/gzrom.bin
    (null)
PMON>

load命令经常用来加载内核。

运行内核
PMON> h g
               g  [-s][-b bpadr][-e adr][-- args]                                         start execution (go)
                               -s    don't set client sp
                         -e <adr>    start address
                      -b <bptadr>    temporary breakpoint
                        -- <args>    args to be passed to client
PMON>

运行内核命令,一般在load内内核之后执行。

ping命令
PMON> h ping
            ping  [-fqrv] [-c cnt] [-s sz] host                                           ping remote host
PMON>

用于测试网络情况。

内核地址指定

通过设置环境变量al,可以指定内核地址,可以设置为网络、U盘、本地flash等方式

set al /dev/fs/ext2@usb0/boot/vmlinux
set al tftp://192.168.1.190/boot/vmlinux
set al /dev/mtd0
PMON> set al
        al = /dev/fs/iso9600@cd0/boot/vmlinux
PMON>
内核运行参数
PMON> set append
    append = "console=tty root=/dev/sda1"
PMON>

环境变量append用于保存内核运行的参数。

1c862b164d0a2513b2d28cd3ddda962a.jpeg

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值