Watch for Rolling Rocks
From the Super Mario Wiki
Depending on the version of the game being played, the Power Star is obtained differently. In both versions, the player needs to take the path on the left from the start of the level to enter the room with the rolling boulders.
In Super Mario 64, Mario has to run up the ramp while dodging the rolling boulders. Just before the door, the player has to Wall Kick up the two walls to reach the Power Star on top of the ledge to the right of the door.
In Super Mario 64 DS, the player as Wario has to first destroy a Black Brick to the left of the ramp to find a Super Mushroom. Once it's collected and Wario grows, the player then has to destroy two of the rolling boulders by running into them or letting them roll into Wario to cause the Power Star to appear. Alternatively, Wario can simply punch or kick a boulder without the use of the Super Mushroom.
Names in other languages