| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
| On this page… |
|---|
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.
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.
In the MATLAB Command Window, type:
xpcexplr
The xPC Target Explorer window opens.
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.
In the Configuration pane, select the DOSLoader tab.
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.
Click Apply.
Click Create DOS Loader.
This operation creates the following boot files in the specified location:
| autoexec.bat |
| xpcboot.com |
| *.rtb |
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.
Transfer the boot files to your target PC or insert the removable media containing the boot files for booting the target PC.
Ensure that the autoexec.bat file must be on the DOS boot path, which is typically the root directory.
Ensure that the appropriate boot device is selected in the BIOS of the target PC.
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.
To use DOSLoader mode, your DOS environment must comply with the following restrictions:
The CPU must execute in real mode.
While loaded in memory, the DOS partition must not overlap the address range of a target application.
To satisfy these restrictions:
Do not use additional memory managers like emm386 or qemm.
Avoid any utilities that attempt to load in high memory (for example, himem.sys). If the target PC DOS environment does not use a config.sys file or memory manager entries in the autoexec.bat file, there should typically be no problems when starting the xPC Target software.
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.
In the MATLAB Command Window, type the name of a Simulink model. For example:
xpc_osc3
A Simulink window opens with the model.
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.
To create DOSLoader files for the current xPC Target environment and use them to boot the target PC, use the following procedure:
In the MATLAB Command Window, type:
getxpcenv
Ensure that the following xPC Target properties are set as indicated:
TargetBoot — DOSLoader
DOSLoaderLocation — Your host PC DOSLoader files location
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')
updatexpcenvIf 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');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
Transfer the DOSLoader files as described in DOSLoader Mode Setup.
![]() | Booting from a DOS Device | Creating a DOS System Disk | ![]() |

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 |