Runtime modification of kernel code is a difficult problem. However, the need of modifiable kernel is increasing because new requirements and services that are unanticipated at the time of kernel design keep coming in such a system for modern embedded application. Especially, advances of communication technologies prompt the need of flexible kernel because traditional kernel is not suitable to support various services resulting from new communication technologies. For the first step of a dynamic and flexible kernel, in this paper, we introduce a trapbased mechanism that can modify kernel code in runtime. The main advantage of trap-based mechanism is small cost in dynamic reconfiguration in fully configurable kernel. In order to prove it, we compare average cost of our trap-based mechanism with one of previous jmp-based mechanism, and our experimental result shows that average cost reduces by about 80%.