Products & Services Solutions Academia Support User Community Company

Learn more about xPC Target   

DOSLoader Mode

Introduction

DOSLoader mode allows you to boot the xPC Target kernel on a target PC from a fixed or removable device with DOS boot capability, such as a hard disk or flash memory. After booting the target PC, you can download your application from the host PC over the serial or network communication between the host and target PCs. See DOSLoader Mode Setup for details.

DOSLoader Mode Setup

The following is a step-by-step procedure for using DOSLoader mode. This procedure assumes you have serial or network communication between your host and target PCs. Also note that to use this mode, you need a minimal DOS system on the target PC boot device. See Creating a DOS System Disk for details.

  1. On the host computer, start a MATLAB session.

  2. In the MATLAB Command Window, type:

    xpcexplr

    The xPC Target Explorer window opens.

  3. In the xPC Target Hierarchy pane, expand the node of the target PC that you want to set up for DOSLoader mode and select the Configuration node.

  4. In the Configuration pane, select the DOSLoader tab.

  5. In the Location field, enter or browse to the directory where you want to create the DOSLoader boot files and click OK. This location can be a local directory on the host PC or a removable storage device that you will use to boot the target PC. By default, the directory is the current working directory.

  6. Click Apply.

  7. Click Create DOS Loader.

    This operation creates the following boot files in the specified location:

    autoexec.bat
    xpcboot.com
    *.rtb
  8. If you create boot files on a local hard disk, copy these files to a floppy disk, CD/DVD, or any other removable storage media.

  9. Transfer the boot files to your target PC or insert the removable media containing the boot files for booting the target PC.

  10. Ensure that the autoexec.bat file must be on the DOS boot path, which is typically the root directory.

  11. Ensure that the appropriate boot device is selected in the BIOS of the target PC.

  12. Boot the target PC.

    When the target PC boots, it loads DOS, which starts the autoexec.bat file. This file starts the xPC Target kernel (*.rtb). The target PC then awaits commands from the host PC.

Restrictions

To use DOSLoader mode, your DOS environment must comply with the following restrictions:

Creating a Target Application for DOSLoader Mode

After booting the target PC using DOSLoader mode, create a target application on a host PC and download it to the target PC.

Set the Simulink and Real-Time Workshop parameters for code generation with the xPC Target software in your Simulink model. Next, build and download the application to the target PC.

  1. In the MATLAB Command Window, type the name of a Simulink model. For example:

    xpc_osc3

    A Simulink window opens with the model.

  2. From the Tools menu, select Real-Time Workshop, and then click Build Model.

The Real-Time Workshop and xPC Target products create a target application and download it to your target.

Creating DOSLoader Files with a Command-Line Interface

To create DOSLoader files for the current xPC Target environment and use them to boot the target PC, use the following procedure:

  1. In the MATLAB Command Window, type:

    getxpcenv
  2. Ensure that the following xPC Target properties are set as indicated:

    • TargetBootDOSLoader

    • DOSLoaderLocation — Your host PC DOSLoader files location

  3. If these properties are not set with the correct values, use the setxpcenv function to set them. For example:

    setxpcenv('TargetBoot','DOSLoader')
    setxpcenv('DOSLoaderLocation','c:\work\xpc\dosloader_files')
    updatexpcenv

    If you have multiple target PCs connected to the host PC, the above commands set the environment properties for the default target PC only. To set these properties for a specific target PC, you can retrieve the specific target PC environment object from the xpctarget.targets class and modify its environment properties. For example:

    tgs = xpctarget.targets;
    tgEnv = tgs.Item('TargetPC2'); 
    set(tgEnv, 'TargetBoot', ‘DOSLoader');
    set(tgEnv, 'DOSLoaderLocation', 'c:\work\xpc\dosloader_files');
  4. In the MATLAB Command Window, type:

    xpcbootdisk

    The xPC Target software displays the following message and creates the DOSLoader files:

    Current boot mode: DOSLoader
    xPC Target DOS Loader files are successfully created
  5. Transfer the DOSLoader files as described in DOSLoader Mode Setup.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2010- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS