How to get Source Code?

How developers get the source code to develop a custom rom?
for example, How CyanogenMod get marshmallow source code for SIII 9300 which hasn't have this Android version?
I wan't to develop my own rom for my device, but I can't find specially Marshmallow pure source code for s3.

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by tiara.stroman
2 hours ago
Last post by cole.morgan
2 hours ago
Last post by frieda38
5 hours ago
Last post by kozey.russ
57 minutes ago
Last post by reanna02
3 hours ago
Last post by ruben02
2 hours ago
Last post by maggio.jazmin
3 hours ago
Last post by johnnie.zboncak
1 hour ago
Last post by lemke.jaylin
4 hours ago
Last post by daltenwerth
35 minutes ago