If I remember correctly SunOs was based on BSD 4.3.
In the early 1990's Sun decided to move to the AT&T version.
This was a System V based Operating System at that time released as AT&T System 5.4. Sun had some very limited experience with the earlier SYS 5.3 when they bought a company called Inertactive. In the event AT&T sold the Unix souces rights to Novell. Sun then purchased a once only sources code version from Novell and used this as the basis of their new 5.4 port, now called Solaris. It is this code that has been developed over the last few years, they dropped the 5 prefix a few years ago.