Custom fields for posts in Wordpress

Can anybody recommend a tutorial on how to create more advanced custom fields for Wordpress? The web is awash with tutorials that only show how to create simple text fields, but I have yet to find one that explains how to create custom fields with more advanced functions. I know I could use something like this but if I do that I could run into issues and besides I want to (at least) attempt to know what I am doing (in other words write my own code, not use a plugin and have no idea how to make it do what I want). For example I want to build a custom post type called “downloads” with a custom field labelled “Operating System” and want the latter to have multiple checkboxes, one for each supported operating system. For example if a program supports Windows 8 x64 and Windows 2000, I can check those two, and leave Windows XP 64 bit unchecked.

Here’s how to create custom post types:
Then you can add as many meta-boxes to your custom post type:
Each meta-box is a grouping of mutually related fields.