bring 1 litre of salted water to the boil and whisk in the polenta. cook for 45 minutes over low heat, stirring frequently with a wooden spoon. turn the polenta out on a large wooden board and flatten. leave to set for a couple of hours. leave the saucepan to soak overnight - the crust on the bottom will come off easily after that).
preheat the oven to 180˚C and butter a large ovenproof dish.
cut the sausages into thick slices. heat the olive oil and fry the sausage slices until browned on all sides. add the onion and cook over moderate heat for 5 minutes until the onion has softened. pour in the stock and add half the herbs. season to taste.
cut the polenta into smaller bits. arrange half the polenta on the bottom of the buttered dish. add half the sausage mixture and half the cheeses. cover with the remaining polenta, then add the rest of the sausage mixture and cheeses. sprinkle with the remaining herbs, some black pepper and dot with butter.
bake uncovered for 40 minutes.