Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!polyof!ted From: ted@polyof.poly.edu (Theodore S. Kapela, Staff) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: How to write protect c: but not d: ? Keywords: write protect, device driver Message-ID: <1990Nov29.172401.15268@polyof.poly.edu> Date: 29 Nov 90 17:24:01 GMT References: <1027@gistdev.gist.com> Followup-To: comp.sys.ibm.pc.misc Distribution: comp Organization: Polytechnic University Lines: 54 In article <1027@gistdev.gist.com> flint@gistdev.gist.com (Flint Pellett) writes: > [text deleted] >What I need is the ability to write-protect the C: drive, while leaving >the D: drive read-write: then I could leave the binaries I don't want [text deleted] >-- >Flint Pellett, Global Information Systems Technology, Inc. >1800 Woodfield Drive, Savoy, IL 61874 (217) 352-1165 >uunet!gistdev!flint or flint@gistdev.gist.com There is no *ABSOLUTE* way to prevent writing to a hard drive, short of making hardware modifications. For what it sounds like you want, though, there is a suitable method, but it requires writing a device driver. You will need to catch INT 13H and monitor all attempts to write. Would would have a table of tracks (or ranges of tracks) that can not be written to. Any time an attempt is made to write to one of these tracks, your routine can return a write-protect error and IRET. You may include a short routine as part of the initialization code to ask for a password, and set a flag if the correct password is entered. (You could also write a short utility than can set a flag within the driver itself in memory to enable/disable writing to hard drive. You could then keep the only copy (AND A BACKUP, in a separate place) where only you know (or put a password routine in this utility also). When you do (or did) partition the physical drive, you told fdisk (or Disk Manager, or the like) what range of cylanders are part of each partition. By not allowing a write to a specified range of tracks (actually cylanders), you can effectively write protect a partition. Note that if you DO use Disk Manager (or the like), be sure you FULLY understand its method of operation, or you could end up with an inaccessible hard drive which will require re-partitioning (=lost data). ALSO - If you boot from a floppy that does not load this device driver, well, you could kiss the whole scheme goodbye. It will (obviously) only work while the driver is loaded. True, you could modify the partition table/boot sector as some programs do, which would effectively make the drive inaccessible unless you boot from it or a specific floppy. You could also modify the ROM BIOS (=burning new ROMS) which will prevent booting from a floppy, unless it has some specific disk ID (ie: dos, unix, etc.) Someone could then, still, conceivably write the required ID to the correct place on the disk and wammo! - a bootable floppy! Just remember, the more you modify, the more risk there is that you will end up with an inaccessible drive, requiring repartitioning. -- .............................................................................. Theodore S. Kapela (516) 755-4299 [Voice, Days] ted@polyof.poly.edu (516) 473-7746 [FAX] "Another brilliant mind corrupted by education"