Thread: Low-Level hard drive access

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    31

    Low-Level hard drive access

    Hi, I was wondering how low-level functions of the hard drive can be accessed. I'd like to be able to retrieve the MBR (or any other sector for that matter) if anybody knows how to do that. I realize it's most likely very different between operating systems.

    Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Yes, the answer is very different for each OS.

    How about being specific?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    31
    Well ideally I'd like to know both, so I'll take information about whatever you know best.

    Thanks again,

    Mike

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    > Well ideally I'd like to know both, so I'll take information about whatever you know best.
    You do realize that there are more than two OS'es in existence?

  5. #5
    Registered User
    Join Date
    Feb 2005
    Posts
    31
    Heh, I definitely know that, but I wasn't expecting a solution for CP/M or something. Besides, this forum only has sections for Windows and Linux.

  6. #6
    Massively Single Player AverageSoftware's Avatar
    Join Date
    May 2007
    Location
    Buffalo, NY
    Posts
    141
    Quote Originally Posted by SgtMuffles View Post
    Heh, I definitely know that, but I wasn't expecting a solution for CP/M or something. Besides, this forum only has sections for Windows and Linux.
    Incidentally, why isn't there a Mac section?
    There is no greater sign that a computing technology is worthless than the association of the word "solution" with it.

  7. #7
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    No one likes macs that is why
    Woop?

  8. #8
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    There's a hidden DOS section on these forums.

  9. #9
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195
    Quote Originally Posted by Salem View Post
    Yes, the answer is very different for each OS.

    How about being specific?
    No the answer is the same regardless of the OS, and the answer is that it depoends on your BIOS, but for PC's you use INT 21

    Quote Originally Posted by AverageSoftware View Post
    Incidentally, why isn't there a Mac section?
    Mac's are for noobs and hippie graphics artist types

  10. #10
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    I thought I saw one for BeOS, too!

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > No the answer is the same regardless of the OS, and the answer is that it depoends on your BIOS
    Except that is a crummy old 16-bit interface, which would be
    a) difficult to access from your protected OS
    b) restricted to the first few hundred MB of your super-large disk.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  12. #12
    Registered User
    Join Date
    May 2007
    Posts
    147
    Depending on what one really means by low level access (I know what you're saying)....


    This is an in depth topic that's so way beyond a forum's posts that I'm certain you could easily be induced into destroying the contents of a drive from a simple mistake. You'll need to consider serious technical research on the topic.

    There are two basic approaches to research, that which the OS may provide and an even lower level hardware access gained by writing directly to the drive's controllers.

    Access from the OS can allow you to format that drive, examine sectors - much of that will be limited to the defined partitions of the drive, but there is a distinction between logical drives and physical drives in that level of work.

    Nearly all drives have a controller that responds to SCSI command. Even the IDE controller types, SATA, etc. all respond to a set of commands based on SCSI. Unfortunately, it's a bit of a black art (especially for CD/DVD), but apparently workable. If you write directly to the controller (usually using the DeviceIOControl in Windows), you can command the drive in operations even beyond the notion of physical/logical drive boundaries. Just WHAT you'd do at that level presumes that you already know what you're doing.

    Frankly, unless you're an engineer preparing to make a product or toolset, I can't see how going down this road returns much benefit these days.

    Years ago I did work in this area for drive recovery, specialized formatting for floppies - but at this point it's just not worth the effort.

    Which prompts me to ask, what are you up to?

  13. #13
    Massively Single Player AverageSoftware's Avatar
    Join Date
    May 2007
    Location
    Buffalo, NY
    Posts
    141
    Quote Originally Posted by prog-bman View Post
    No one likes macs that is why
    I do, so that shoots your theory.

    Mac's are for noobs and hippie graphics artist types
    I own three Macs (one running Linux) and I am neither a "noob" nor a hippie graphic artist type. I can't even draw a potato.

    Does anyone have a real reason?
    There is no greater sign that a computing technology is worthless than the association of the word "solution" with it.

  14. #14
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    Probably the same reason why a forum on "vehicles for parenthood" will most likely have forums on Minivans and SUVs but not likely to have one on "Sports Coupes". In other words, macs are not as notorious for their capacity as applications development platforms as Unix/Windows.
    Have you seen their commercials lately? It actually looks like they've come to embrace their role in the computing industry as "noob-friendly" caterers for simpletons and their target audience of "neo-political, death-to-the-man, new-age, graphical-media-information-exchange-technologist, long-haired-hippy" types. After all, its only what you would expect from a company that develops computers with one-button mice while the rest of the world is progressing onto motion-detecting thermal-surfaces. Then again, their one-button mouse fits perfectly into their one -response "ok" dialogs for prompts that clearly require at *least* a "yes/no" option. But they've targetted their demographic well, knowing that their users probably aren't mentally equipped enough to handle anything more than one choice at a time.

    god, after watching all those "mac is for cool people" commercials, I knew I was due for some good-'ol-fashioned, mac-bashing is fun!
    Don't get me wrong, this is not to say you *can't* develop on a mac, or that all mac users are as described above, but the generalization is true enough not to warrant a seperate forum for macs.
    Last edited by @nthony; 06-08-2007 at 10:37 PM.

  15. #15
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Hmm the only commercials we have here are some guy as a 'mac' bagging some 'PC' guy... Such as, MAC: "What's the problem?", PC: "I'm sick, I've got a virus", MAC: "Well Mac's don't get viruses" or something along those lines

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Detect SCSI Hard Drive Serial Number
    By mercury529 in forum Windows Programming
    Replies: 3
    Last Post: 10-17-2006, 06:23 PM
  2. Low Level Drive Access?
    By coldfusion244 in forum C++ Programming
    Replies: 1
    Last Post: 03-09-2005, 08:19 AM
  3. 'Installing' to hard drive and 'Saving' to hard drive
    By Leeman_s in forum C++ Programming
    Replies: 4
    Last Post: 04-17-2002, 02:37 PM
  4. Getting the hard drive serial number?
    By kes103 in forum Windows Programming
    Replies: 2
    Last Post: 01-18-2002, 03:03 PM
  5. Getting the hard drive serial number?
    By kes103 in forum C Programming
    Replies: 2
    Last Post: 01-18-2002, 01:43 PM