05.06.2014 Views

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

QNX Neutrino Programmer's Guide [6.5.0 SP1] - QNX Software ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

© 2012, <strong>QNX</strong> <strong>Software</strong> Systems Limited Using libraries<br />

• A PowerPC 800 FADS board and ELF boot prefix code are being used to boot.<br />

• The image should contain devc-serppc800, the serial communications manager<br />

for the PowerPC 80x family, as well as hello (our test program).<br />

• devc-serppc800 should be started in the background (specified by the &<br />

character). This manager will use a clock rate of 20 MHz, a baud rate of 9600, and<br />

an smc1 device.<br />

• Standard input, output, and error should be redirected to /dev/ser1 (via the<br />

reopen command, which by default redirects to /dev/console, which we’ve<br />

linked to /dev/ser1).<br />

• Finally, our hello program should run.<br />

Let’s assume that the above buildfile is called hello.bld. Using the mkifs utility,<br />

you could then build an image by typing:<br />

mkifs hello.bld hello.ifs<br />

Step 2: Transfer the system image to the target.<br />

You now have to transfer the image hello.ifs to the target system. If your target is a<br />

PC, the most universal method of booting is to make a bootable floppy diskette.<br />

If you’re developing on a platform that has TCP/IP networking and connectivity to<br />

your target, you may be able to boot your <strong>Neutrino</strong> target system using a BOOTP<br />

server. For details, see the “BOOTP section” in the Customizing IPL Programs chapter<br />

in Building Embedded Systems.<br />

If your development system is <strong>Neutrino</strong>, transfer your image to a floppy by issuing this<br />

command:<br />

dinit -f hello.ifs /dev/fd0<br />

If your development system is Windows NT or Windows 95/98, transfer your image to<br />

a floppy by issuing this command:<br />

dinit -f hello.ifs a:<br />

Step 3: Boot the target.<br />

Using libraries<br />

Place the floppy diskette into your target system and reboot your machine. The<br />

message “Hello, world!” should appear on your screen.<br />

When you’re developing code, you almost always make use of a library —a<br />

collection of code modules that you or someone else has already developed (and<br />

hopefully debugged). Under <strong>Neutrino</strong>, we have three different ways of using libraries:<br />

June 14, 2012 Chapter 1 • Compiling and Debugging 11

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!