www.beck-ipc.com

Command Processor - SC12 @CHIP-RTOS V1.10


    IPC@CHIP Documentation Index

COMMAND

Command processor
Interprets the commands in autoexec.bat and those issued at the console.


New in version 1.10B: Modified IPCFG command
New in version 1.10B: Display list of all detected errors.

  • DEL filename
  • DIR filename
  • TYPE file
  • COPY file1 file2
  • REN file1 file2
  • MD dir
  • XTRANS
  • MEMOPT 0/1
  • CD dir
  • RD dir
  • CON
  • IW
  • IB
  • OW
  • OB
  • PCS
  • ALE
  • ADR
  • PIO
  • IP address
  • NETMASK mask
  • GATEWAY address
  • DHCP 0/1
  • IPETH
  • TCPIPMEM
  • BATCHMODE
  • FTP 0/1
  • TFTP
  • IPCFG
  • REBOOT
  • WAIT secs
  • FORMAT A: [/C:n] [/E] [/R:n]
  • VER
  • MEM
  • CGISTAT
  • CLOSETELNET
  • WEBSTAT
  • PING
  • TASKS
  • UTASKS
  • HELP
  • ERRORS

  • In the autoexec.bat or any other batch file you can only list the internal commands
    and the names of any program files on the flash drive.   A batch file must have the file
    extension .bat, e.g. test.bat.

    The commands are executed sequentially, with one difference to the 'normal' DOS:
    When the IPC@CHIP's BATCHMODE is configured for concurrent batch file execution,
    the next command is executed before a previous command has finished.   The only
    exceptions are the WAIT and REBOOT commands.

    Please note that very little syntax checking is done.


    DEL filename
    Delete a file

    Delete a file or all files that match the wildcard.

    Example

    del *.dat
    
    

    Top of list
    Index page

    DIR filename
    List a directory.

    List the directory entry or all entries that match the wildcard.

    Comments

    If no argument is given, *.* is assumed.

    Example

    dir *.exe
    
    

    Top of list
    Index page

    TYPE file
    Type a file.

    Show contents of a file on the console.


    Top of list
    Index page

    COPY file1 file2
    Copy a file.

    Copy a file.   The two file specifiers must be complete file names.
    Wildcards such as * or ? are not allowed.


    Top of list
    Index page

    REN file1 file2
    Rename a file.

    Rename a file.   The two file specifiers must be complete file names.
    Wildcards such as * or ? are not allowed.
    Both files must reside in the same directory.


    Top of list
    Index page

    MD dir
    Creates a directory.

    Creates a directory.

    Example

    md temp
    
    

    Top of list
    Index page

    XTRANS
    File transfer: Send/Receive file with Xmodem.

    Send/Receive file with XMODEM/CRC protocol.   Possible devices are COM or EXT.

    Example

    XTRANS COM R chip.ini  ;Receive chip.ini file over COM
    
    XTRANS EXT S test.txt  ;Send test.txt file over EXT
    
    

    Top of list
    Index page

    MEMOPT 0/1
    Disable or enable memory optimize when loading exe file.

    Use MEMOPT 1 to optimize memory usage when loading an exe file.

    By default, the memory optimization is disabled.   An exe file will obtain almost all memory available at startup.   In the startup code, the program will then resize this memory.

    When enabled, the program will obtain only the memory it defines as required in the header of the exe file.   This can leave more memory to other programs, but it can result in errors when allocating memory from the heap.

    Users of Borland C/C++ will probably not need this command.   Only users of Borland Pascal might need it since programs written in Pascal usually do not resize their memory at startup.

    Comments

    With SC12 @CHIP-RTOS version 0.67, the default for MEMOPT is disabled.   Earlier versions had this feature enabled but this resulted in errors with malloc() .

    Example

    MEMOPT 0
    
    

    Top of list
    Index page

    CD dir
    Change the current working directory.

    Changes the current working directory.

    Example

    cd temp
    
    

    Top of list
    Index page

    RD dir
    Removes a directory.

    Removes a directory.   This command cannot be executed on directories containing data.

    Example

    rd temp
    
    

    Top of list
    Index page

    CON
    Direct console I/O.

    Define what device is used as the console.   Possible devices are COM, EXT or TELNET.   Multiple devices are possible.

    Comments

    This setting is only valid until the next reboot.

    Example

    CON COM
    
    CON EXT
    
    CON COM TELNET
    
    

    Related Topics

    Default input device STDIN initial value
    Default output device STDOUT initial value

    Top of list
    Index page

    IW
    Input word.

    Perform a 16 bit input from a given I/O address.
    The address and the result are hexadecimal.

    Example

    IW 600
    
    

    Top of list
    Index page

    IB
    Input byte.

    Perform an 8 bit input from a given I/O address.
    The address and the result are hexadecimal.

    Example

    IB 600
    
    

    Top of list
    Index page

    OW
    Output word.

    Perform a 16 bit output on a given I/O address with given data.
    The address and the data are hexadecimal.   The address is the first
    parameter followed by data.

    Example

    OW 600 F
    
    

    Top of list
    Index page

    OB
    Output byte.

    Perform an 8 bit output on a given I/O address with given data.
    The address and the data are hexadecimal.   The address is the first
    parameter followed by data.

    Example

    OB 600 F
    
    

    Top of list
    Index page

    PCS
    Enable chip select.

    Enables a chip select line.
    The command expects only one parameter: the chip select line. Valid arguments are 0, 1, 2, 3, 5 or 6.

    Example

    PCS 6
    
    

    Top of list
    Index page

    ALE
    Enable/disable ALE pin.

    Enables the address latch enable (ALE) pin.
    The command expects only one parameter: 1 enable / 0 disable.

    Example

    ALE 1
    
    

    Top of list
    Index page

    ADR
    Enable non-multiplexed address bus pins.

    Enables the non-multiplexed address bus pins (A0/A1/A2).
    The command expects only one parameter: 0=enable A0 / 1=enable A1 / 2=enable A2

    Example

    ADR 0
    
    

    Top of list
    Index page

    PIO
    Enable and show PIO pins.

    Enables the programmable PIO pins (PIO0-13).
    The command expects two parameters: PIO MODE

    PIO: PIO number (0-13)
    MODE: PIO mode
        1 = Input without pullup/pulldown
        2 = Input with pullup (not PIO13)
        3 = Input with pulldown (only for PIO3 and PIO13)
        4 = Output value = High
        5 = Output value = Low

    When no command line argument is given, the PIO state is shown.

    Example

    PIO 3 5  = PIO3 Output low
    
    PIO      = Shows PIO states
    
    

    Top of list
    Index page

    IP address
    Sets the IP address of the Ethernet interface.

    Sets the IP address of this device of the internal Ethernet interface.

    Comments

    This command modifies the information stored in A:\chip.ini.

    The DHCP option is also switched off.

    The new address is not used until after a IPETH command or a restart of the system.

    Use the IPCFG command to verify your entry before restarting the system.

    Example

    IP 195.243.140.85
    
    

    Related Topics

    IP address initial value
    Set IP Address API function
    PPP server initial IP address
    Initial DHCP setting

    Top of list
    Index page

    NETMASK mask
    Set the network mask for IP addressing of the Ethernet interface.

    Sets the subnet mask for IP addressing of the internal Ethernet interface.

    Comments

    This command modifies the information stored in A:\chip.ini.

    The DHCP option is also switched off.

    The new subnet mask is not used until after a IPETH command or a restart of the system.

    Use the IPCFG command to verify your entry before restarting the system.

    Example

    NETMASK 255.255.255.192
    
    

    Related Topics

    IP subnet mask initial value
    Initial DHCP setting
    Set IP subnet mask API function

    Top of list
    Index page

    GATEWAY address
    Define the IP address of the gateway

    Sets the IP address of the default gateway to use.

    Comments

    This command modifies the information stored in A:\chip.ini.

    The DHCP option is also switched off.

    The new gateway address is not used until after a IPETH command or a restart of the system.

    Use the IPCFG command to verify your entry before restarting the system.

    Example

    GATEWAY 195.243.140.1
    
    

    Related Topics

    IP GATEWAY initial value
    Set gateway IP address API function
    ADD_DEFAULT_GATEWAY API function
    Initial DHCP setting

    Top of list
    Index page

    DHCP 0/1
    Enable/Disable DHCP.

    Enables or disables the use of DHCP for the internal Ethernet interface to obtain an IP configuration.

    Comments

    DHCP is an abbreviation for "Dynamic Host Configuration Protocol".
    Using a DHCP Server, the network administrator can define the IP configuration of the network, without manually configuring each device on the network.
    Network servers and some ISDN routers offer a DHCP server.

    Example

    dhcp 1
    
    

    Related Topics

    Initial DHCP setting

    Top of list
    Index page

    IPETH
    Restart the Ethernet interface

    Restart the internal Ethernet interface, e.g. after changing the IP configuration,
    without rebooting the system.

    Comments

    If the restart command prints an error message, check your IP parameters.
    In most cases an invalid gateway IP address is the reason why the restart failed.
    The error code 237 signals that a Ethernet configuration was already in progress


    Top of list
    Index page

    TCPIPMEM
    Display TCP/IP memory usage

    Displays TCP/IP memory usage.   This command shows the maximum reserved memory for the TCP/IP stack and the current TCP/IP stack memory used.


    Top of list
    Index page

    BATCHMODE
    Set batch file execution mode

    Sets the batch file execution mode of DOS programs for either concurrent or sequential execution.
    See BATCHMODE initialization documentation for details.

    Example

    BATCHMODE 1  ;  Selects sequential batch file processing mode
    
    
    
    BATCHMODE 0  ;  Selects concurrent batch file processing mode
    
    

    Related Topics

    Initial BATCHMODE setting
    Run-time batch mode selection API

    Top of list
    Index page

    FTP 0/1
    Enable/Disable FTP.

    Enables or disables the start of the FTP server after a reboot.
    The file chip.ini contains the new value for FTP enable to be applied after rebooting the system.

    Example

    FTP 1
    
    

    Related Topics

    Initial FTP ENABLE setting

    Top of list
    Index page

    TFTP
    Enable/Disable TFTP

    Enables or disables file transfers via TFTP server.
    0 disables the server, 1 enables TFTP file transfer.

    Comments

    By default the TFTP server is disabled to avoid security leaks.

    Example

    TFTP 1
    
    

    Top of list
    Index page

    IPCFG
    Display current IP configuration of all installed TCP/IP device interfaces.

    Displays for each installed TCP/IP device interface:

      Interface name
      Type: ETH(Ethernet), LPK(Internal loopback), PPP or Unknown
      Internal index number of the device interface
      IP address
      Network mask
      MAC address
      Default gateway

    Example

    IPCFG
    
    

    Top of list
    Index page

    REBOOT
    Restart the system

    Restarts the system.
    First, the file system is closed, then the watchdog is configured to issue a reset.
    Please note that the tasks are not informed of this restart !

    Example

    reboot
    
    

    Top of list
    Index page

    WAIT secs
    Suspends the command interpreter.

    Suspends execution of the command interpreter for the specified interval.
    The time interval is defined in seconds.

    Example

    wait 1
    
    

    Top of list
    Index page

    FORMAT A: [/C:n] [/E] [/R:n]
    Format Flash disk A:.

    Format flash disk A:.

    All information on drive A: will be lost !

    The cluster size parameter /C: is optional, a value of 2 is default on A:, value 4 on B:.

    If the /E parameter is specified, the data area will be filled with null-data.

    With parameter /R you can select the number of root directory entries. Note: This must be a multiple of 16.

    Comments

    Make sure that other tasks do not access drive A: when formatting.

    Important : If you use retentive operators, only format flash disk with default cluster size!!

    Example

    FORMAT A: /C:2 /E
    
    FORMAT B: /C:4
    
    FORMAT B: /R:256
    
    

    Top of list
    Index page

    VER
    @CHIP-RTOS Version.

    Output the IPC@CHIP serial number, @CHIP-RTOS version and build date.


    Top of list
    Index page

    MEM
    Display memory map.

    Displays a memory map, including the name of the task owning the memory.

    Comments

    The size indicated is the actual usable size.
    One sector (16 bytes) is added for memory management.


    Top of list
    Index page

    CGISTAT
    List Installed CGI handlers.

    This function will list all installed CGI handlers.

    Related Topics

    CGI_INSTALL API function

    Top of list
    Index page

    CLOSETELNET
    Closing current telnet session.

    This function will finish the current Telnet session.


    Top of list
    Index page

    WEBSTAT
    Show the current settings of the Web server

    This function will show the current settings of the Web server:
    e.g. root directory, root drive,...., default start page.

    See WEB config for the available chip.ini entries for the Web server.


    Top of list
    Index page

    PING
    The ICMP echo request (ping)

    Test the network connection with the ICMP command ping.

    This command sends 4 ICMP echo requests (64 Bytes) to the remote host,
    with an interval of 1 second and shows the results.

    Example

    PING 192.168.200.10<nl>
    
    

    Related Topics

    PING_OPEN API function

    Top of list
    Index page

    TASKS
    Display list of tasks.

    Displays a lists of all tasks, including the CPU load caused by the task, the task status and the stack space usage.

    Sample output:
        task 1094 count 3515 MTSK prio= 12 stack=3000 used=35% state=0
        task 1606 count 81 ETH0 prio= 5 stack=2048 used=41% state=4
        task 256 count 4568 AMXK prio= 0
        task 2374 count 1072 WEBS prio= 41 stack=2048 used=24% state=81
        task 2886 count 100 DOS1 prio= 25 stack=128 used=78% state=81
        task 3142 count 157 DOS2 prio= 25 stack=128 used=78% state=81
        task 1862 count 24 CFGS prio= 7 stack=1400 used=28% state=4

    At every one millisecond clock tick, the count for the active task is increased by one.   After 10 seconds, the counters are copied and reset to zero.

    Comments

    At the first call of TASKS, the timer interrupt routine of the RTOS is exchanged by a version for the task monitor.   Only after 10 seconds will the TASKS command return usable results.

    The command shows for DOS applications only a task stack size of 128 Byte,
    since the DOS program at run time switches to its own internal stack which is
    is not visible to the Kernel.

    A maximum of 35 tasks can by monitored.

    Please be aware that using TASKS has a performance penalty.   Use UTASKS command to
    shut off the task monitoring.

    The listed task state is only a one moment snapshot.   The task state bit field is a 16 bit hexadecimal value defined as follows:

            Bit0        timer wait (used with other bits)
            Bit1        trigger wait (i.e. idle)
            Bit2        semaphore wait
            Bit3        event group wait
            Bit4        message exchange wait
            Bit5        message send wait
            Bit6        suspended (waiting for resume)
            Bit7        waiting for wake
            Bit8-15        internal use only


    Current running system tasks (if not disabled in chip.ini)
        Very high priority:
            AMXK         prio= 00        Kernel task
            ETH0         prio= 05        Ethernet receiver task
        Normal:
            PPPS         prio= 06        PPP server
            TCPT         prio= 06        TCP/IP timer task
            CFGS         prio= 07        UDP config server
            TELN         prio= 11        Telnet server
            MTSK         prio= 12        Console task (command shell)
        Low priority:
            WEBS         prio= 41        Web server
            FTPS         prio= 41        FTP server



    Top of list
    Index page

    UTASKS
    Disables the Task Monitor.

    Disables the Task Monitor which was installed using TASKS command.

    If you do not need the Task Monitor anymore, you should disable it using this command because the Task Monitor has a performance penalty.


    Top of list
    Index page

    HELP
    Display list of all console commands.

    Displays a list of all available console commands.


    Top of list
    Index page

    ERRORS
    Display list of all detected errors.

    Displays a list of all detected errors.


    Top of list
    Index page


    End of document