Setting Up a Regtest

I want to set up my own bitcoin network and blockchain with genesis block newly created by me where I can mine a new block with CPU unlike testnet network. I wish testnet blocks could have been mined by CPU but its not. Any reference or idea how to create a new bitcoin private network. Step by step explanation from very basic would be much appreciated preferably on Ubuntu or windiows platform.