A couple of times I wrote bootloaders for new chips. I relied heavily on the chip vendors documentation. It was usually almost non-existent, and no more than text saying what things I had to do in what sequence. But taking that info, then looking at other bootloaders for operating systems (to see if there was environment specific things I should be considering) I was able to create boot loaders.