Comment: without hacking hardware? (Score 1) 578
No idea what your trying to do... art, fast file system, error recovery, special new virus etc... but I'd start in one of two places.
If you are trying to write your own filesystem because everyone else is "doing it wrong" then check out Oracles "unbreakable" installation.... a bit dated and I don't know if they still do it this way, but the gist is you mount the drives with "rawfs" and they have their own file system stack that runs on top. Pretty effective way to trim down the layers of stuff before reads and writes and speed up raw access. .... again, depends on your implementation if this would be useful to you.
If you actually want to write ones and zeros I'd check the source for fdisk and see what its doing.... might be a gem there since it clearly is aware of geometry and has some access to writing in places you normally wouldn't.
Good luck!