these had been brought into the castle , against a siege expected to last longer , and penned in the smaller second courtyard : maddened by the noise of battle and the dragons wild overhead , they had got loose and now went careening indiscriminately through the grounds , a flock of hens crying around their feet , until they broke their legs or necks in flight , or found their way by chance outside the castle grounds .