Where would I start, writing a program that created partitions, resized them, and so on on an HDD?
Where would I start, writing a program that created partitions, resized them, and so on on an HDD?
You'll want to start learning a lot about Hard Drives such as CHS addressing and the (newer) LBA addressing mode.
You'll also want to learn about partition tables and master boot records, and file systems as well.
Then you'll have to decide what operating system you want to write it for (or maybe even a liveUSB, fair bit harder though) and look for the OS specific functions for editing raw sectors on a hard drive.
If you're on windows, you can do things like opening LogicalVolumes that you'll want to read into.
Not sure about GNU+Linux.
I know CHS and LBA addressing, I have a bootloader written. What I don't know is how to actually create partitions, etc. on the HDD.
Master boot records are kind of annoying because there are a couple of different types. The 'IBM' (I think that's what it's called) master boot record contains a partition table which holds information about the partitions on the volume.
Now, I'm not sure if editing/creating this is all you have to do but it's certainly a start.
Also, not all drives start with this type of master boot record. The FAT Master Boot record contains no partition table so you might have to edit some things to get it to work.
This is pretty much as far as I know on partitioning.
Anyone else on creating an MBR?
This is a gold mine for FAT32 clicky. just do a google search for "<file system> mbr specifications"