It has been an important issue needing solved in the information security field to detect malware[4][5]. Negative selection algorithm as one of the core algorithm of artificial immune system, can be applied to detect malware. Negative selection algorithm based on binary coding is one of the most basic and important detecting model. But the application of negative selection algorithm mainly exist in the software and net work systems, there is not a ready-made approach to apply negative selection algorithm to detect malicious attacks for embedded system at present. This paper focuses in proposing an approach to add a hardware immune mechanism to the embedded processor to defense malicious attacks and improving the traditional negative selection algorithm so that we can actually apply the algorithm in malware detection for embedded system in further work.