How to find the problem when the system can't boot correctly

I try to build a image for the special PC/104,first I use the harddisk installed QNX6.2.1 to boot,but when it came to some step,it stopped,then I try to use CD of QNX6.4 to boot,it doen’t work either,so how can i know the problem?

If you build your own image add diplay_msg statement at every instruction in the build file, that wait you can tell exaclty what program is causing the problem.