Cut the squash in half and use a spoon to scoop out the seeds and fibrous flesh. Peel and cut the squash into small chunks and place in a roasting tin. Sprinkle over the oil and rosemary, and season well with salt and pepper. Roast in a preheated oven, 200°C (400°F), Gas Mark 6, for 45 minutes.
Meanwhile, place the lentils in a saucepan, cover with water, bring to the boil and boil rapidly for 10 minutes. Strain, then return the lentils to a clean saucepan with the onion and stock and simmer for 5 minutes. Season to taste.
Remove the squash from the oven, mash the flesh with a fork and add to the soup. Simmer for 25 minutes and then ladle into bowls. Garnish with more rosemary before serving.