The invention relates to a method for generation by a biomass. The method utilizes the gasification technology, which converts the forestry and agricultural residues comprising wasted straws, sawdust, haulms, rice husks, bagasse, etc. into the flammable gas approaching the coal gas; after the dust and the tar of the flammable gas is removed by a purifier, the flammable gas is conveyed in a gas internal combustion engine or a gas turbine for generation. The invention has strong raw material adaptability, can dispose the biomass raw material of different types, and has the advantages of large production intensity, high gas heat value, little tar content, high gasification efficiency, strong load adaptability, easy start and stop, large adjustable range, stable operation, extremely high flexibility in scale. Furthermore, the generation scale depends on the quantity of the raw material and the requirement of the power, and can be designed and matched according to the requirement of the user.