To get the percent you just need two values: the total (sum) for all groups, and the value for the individual element. Then it's just a matter of number formatting.
Since your data is static, you can calculate a sum as a separate variable anytime after defining the data.
var total= d3.sum(data, function(d){return d.value;});
Then your text label function would be something like this:
.text(function(d, i) {
return (data[i].os + "( " + d3.round(100* d.value / total, 1) + "% " + ")" ) ;
});
Or create a D3 formatting function and use it to format the percent:
var toPercent = d3.format("0.1%");
and then the text function would be
.text(function(d, i) { return (data[i].os + "( " + toPercent(d.value / total)+ " )" ) ; });
One last thing: currently your text labels get cropped off if they are wider than the pie segment to which they relate and a later pie segment overlaps. You'll need to either re-arrange your code so all the text elements come after all the path elements (annoying) or use transparent colours on your pie sections (easier, but may not look great). Unfortunately, you can't just use a CSS z-index on SVG elements to make the text float to the top -- everything gets drawn in the order they appear in the DOM. The "annoying" version involves adding the labels individually after drawing all the slices, which means repeating the datajoin, and losing the logical grouping of the paths and matching labels.
--ABR