Excuse my ignorance but how does OS development even work? Being a mostly web developer, it just seems to arcane to change an OS - like, pre-application layer.
The book at http://ostep.org gets into some details.
Another useful illuminator: https://gwern.net/computers
As much as possible is generally done using simulators before testing on any real hardware.