Lock hard disk

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Nav

Lock hard disk

Post by Nav »

hai every body,

how can a hard disk or drive be write protected?

thanks
Chase

RE:Lock hard disk

Post by Chase »

It depends at what level of software you want to write protect the drive...

I've seen BIOSes with a drive write protect option but I think all that did was disable int0x13 write commands. *Some* scsi drives have a jumper to set write protection on but it's not standard. You're stuck at coding write protection into the OS layer and not allowing apps direct hardware access.

-Chase
Nav

RE:Lock hard disk

Post by Nav »

I need asm code or c++ source code to lock(write protection) and unlock(allowing writting) on the hard disk. if you know something please help me.

thanks
carbonBased

RE:Lock hard disk

Post by carbonBased »

I think you're making it too complicated, dude.

void writeBlock(char *data) {
  if(hd->isWriteable()) writeData();
  else error("HD is write protected");
  return;
}

As far as I know, there is no standard way to write protect an HD in hardware... you'll have to make your own software substitude.

Jeff
Post Reply