Where to start?

This is a discussion on Where to start? within the C Programming forums, part of the General Programming Boards category; Where would I start, writing a program that created partitions, resized them, and so on on an HDD?...

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    30

    Where to start?

    Where would I start, writing a program that created partitions, resized them, and so on on an HDD?

  2. #2
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    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.

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    30
    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.

  4. #4
    Registered User
    Join Date
    Jan 2009
    Location
    Australia
    Posts
    375
    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.

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    30
    Anyone else on creating an MBR?

  6. #6
    Registered User ITAmember's Avatar
    Join Date
    Mar 2009
    Location
    Nebraska
    Posts
    72
    This is a gold mine for FAT32 clicky. just do a google search for "<file system> mbr specifications"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 08:35 AM
  2. Adventures in labyrinth generation.
    By guesst in forum Game Programming
    Replies: 8
    Last Post: 10-12-2008, 01:30 PM
  3. C++ gui for windows where to start
    By prixone in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2006, 10:48 PM
  4. GNOME Desktop won't start (Mandriva)
    By psychopath in forum Tech Board
    Replies: 10
    Last Post: 07-19-2006, 01:21 PM
  5. Start bar color in WinXP
    By confuted in forum Tech Board
    Replies: 4
    Last Post: 05-03-2003, 06:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21