Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Write Bits Directly Onto a Hard Drive Platter?

kdawson posted more than 4 years ago | from the old-old-skool dept.

Data Storage 578

kidcharles writes "I'm working on a project that requires writing bits to a magnetic hard drive platter in a completely controlled fashion. I need to be able to control exactly where 1s and 0s will appear physically on the platter. Normally when data is written to a drive the actual bits that get written are determined by the file system being used, as modified by whatever kind of error handling the drive itself is using (e.g. Reed-Solomon). All of the modern innovations in file systems and error handling are great for reliable and efficient data storage, but they are making my particular task quite daunting. My question for Slashdot: is there a way to get down to the 'bare metal' and write these bits? Any good utilities out there to do this? Obviously a free and open source solution would be preferable, but I'm open to anything at this point."

cancel ×

578 comments

Sorry! There are no comments related to the filter you selected.

magic marker (5, Funny)

Rivalz (1431453) | more than 4 years ago | (#31342810)

It works for me. http://www.staples.com/Staples-Dry-Erase-Markers-Chisel-Tip-Black-4-Pack/product_607101?cmArea=FEATURED:SC1:CG11:DP1101 [staples.com] Now that someone has said it no one else can be a smart ass and they have to be informative.

I tried it once (4, Funny)

Taco Cowboy (5327) | more than 4 years ago | (#31343024)

Got myself a disk editor, and wrote something on the very first sector.

After that I can't use the HD anymore.

The computer can't even recognize it anymore.

May I suggest (2, Funny)

Blazarov (894987) | more than 4 years ago | (#31342812)

May I suggest a magnetic needle and a steady hand? http://xkcd.com/378/ [xkcd.com]

Slashdot trolled (5, Insightful)

dotgain (630123) | more than 4 years ago | (#31342898)

The submitter appears to know enough about what he's asking to know that it's also impossible / completely impractical. Recording ones and zeros directly isn't done for a reason, submitter appears to understand this.

Re:Slashdot trolled (5, Interesting)

bertok (226922) | more than 4 years ago | (#31343176)

The submitter appears to know enough about what he's asking to know that it's also impossible / completely impractical. Recording ones and zeros directly isn't done for a reason, submitter appears to understand this.

Keep in mind that the question is not just why the submitter wants to write directly to the magnetic domains of a hard disk, but why the submitter asked the question of how to write directly to a hard disk.

I can think of a number of reasons for the latter:

- The submitter could be an author writing some cyberpunk techno-thriller, and wanted some technical feedback from the 'experts' on Slashdot.

- The submitter could be a CIA drone trying to write a report on how it's impossible for the terrorists to somehow 'hide' data on hard drives that even 'dd' can't read.

- The submitter could be a troll.

That's just off the top of my head.

On the other hand, I seriously can't think of a good reason why anyone would want to actually damage a hard drive that way. If all you wanted to do is very precisely create a surface with a complex pattern of specifically oriented magnetic domains, there's easier ways. For example, there are equipment suppliers that can provide high-precision two axis steppers with ready to use computer control interfaces. It's not hard to get equipment that'll go down to atomic precision [wikipedia.org] .

Real Programmers (-1, Redundant)

Anonymous Coward | more than 4 years ago | (#31342820)

Yes! [xkcd.com]

Sure (5, Informative)

Jurily (900488) | more than 4 years ago | (#31342826)

Just make your own controller chip for the drive.

Re:Sure (2, Interesting)

Anonymous Coward | more than 4 years ago | (#31342884)

Agreed. I would find is difficult to believe there is a practical use for this, but if there is an actual requirement to control zero and ones in specific tracks/sectors, you might as well build your own chip for a drive. :)

If the solution sucks that maybe they're trying to solve the wrong problem. :)

Re:Sure (1)

sznupi (719324) | more than 4 years ago | (#31342936)

Anybody actually does this or is it mostly about using, say, an ARM controller; almost off the shelf?

Re:Sure (0)

Anonymous Coward | more than 4 years ago | (#31342982)

I think parent actually meant "program your own FPGA for the drive"

http://en.wikipedia.org/wiki/FPGA

It's not "good utilities" as the poster asked, but it's the closest (and relatively, easiest, as I'm an EE. CS might just find it easier to hack the firmware) thing to do to achieve what the poster want.

Re:Sure (4, Informative)

amn108 (1231606) | more than 4 years ago | (#31343018)

Modern drives come with their own on-drive controllers, as far as I know. Chaining another controller on top will not give you any power to override the on-drive controller behavior. If the on-drive controller makes its own decisions on where and how to write data, your custom controller will not be able to override these decisions, I am afraid.

Re:Sure (5, Insightful)

Smidge204 (605297) | more than 4 years ago | (#31343212)

The custom controller would REPLACE the the on-drive controller, not sit on top of it.

=Smidge=

Re:Sure (1)

amn108 (1231606) | more than 4 years ago | (#31343238)

Right. Might work then. However, don't those on-drive controllers use very proprietary hardware interfaces?

Re:Sure (4, Insightful)

adolf (21054) | more than 4 years ago | (#31343032)

A whole chip? Really? That sounds hard.

Just Ebay an old 20MB Seagate ST-225 MFM drive, and write whatever bits you want.

It doesn't know any better.

Hard disk firmware hacking (1, Insightful)

Anonymous Coward | more than 4 years ago | (#31342828)

I'm fairly sure you would have to go fairly deep and directly hack/modify hard disk firmware to do what you describe. Such hack would be non-trivial and most likely model-specific.

man dd (0)

Anonymous Coward | more than 4 years ago | (#31342830)

(nt)

Re:man dd (1)

maxwell demon (590494) | more than 4 years ago | (#31342850)

RTFS

Re:man dd (2, Informative)

1s44c (552956) | more than 4 years ago | (#31342968)

RTFS

Knowing everything there is to know about dd isn't going to tell you where on a physical disk your data is stored. dd only sees a long string of zeros and ones that are a far abstruction from what physically happens on the drive.

There doesn't seem to be any way to be sure exactly where the data is written except by a deep understanding and maybe a replacement of the drive firmware.

Re:man dd (1)

maxwell demon (590494) | more than 4 years ago | (#31343286)

And why are you replying to me instead of the OP?

Re:man dd (1, Informative)

qubex (206736) | more than 4 years ago | (#31343326)

*abstraction*, not *abstruction*

No. (1, Informative)

Anonymous Coward | more than 4 years ago | (#31342840)

No, there aren't.

You would need to completely bypass the drive firmware in a way that would make the drive quite unusable afterwards; this is generally not possible in hardware. It's not like they're going to let you control the voice coil circuitry directly as permanent damage to the drive would likely result! This is likely going to be a highly custom solution and you will need special equipment to do it. Contact the drive manufacturers or a very big data recovery specialist.

Re:No. (1)

PiSkyHi (1049584) | more than 4 years ago | (#31343310)

Never mind the MFM or GCR encoding that is required to know how many 1's or 0's you've actually written.

The heads essentially detect change within a certain timeframe - if the timeframe is too long, the head cannot be certain how many consecutive bits were written.

That is gonna be hard (5, Insightful)

PaulIsTheName (1646771) | more than 4 years ago | (#31342848)

You would need to replace the firmware inside the drive or use an undocumented manufacturer mode. Whatever they use to write the servo tracks would be interesting to you. You will be in the situation of the firmware writer: There will be problems all the way. Be prepared to find a way to position the heads (ever tried to find a servo track?). Most likely you also need to at least parametrize the amplifiers in the DSP part of the firmware that does the analog-to-something-to-digital so you can have direct influence on the "bits". Good luck

You Da Man!!! (1)

KJSwartz (254652) | more than 4 years ago | (#31342852)

First thought was - WoW! Somebody wants to defeat disk caching, ECC and make life bloody difficult to boot. The best way, if you really want to do direct disk RMW operations - is to use Flash. Its fast, reasonably portable, and won't fail you if you use it properly.

Re:You Da Man!!! (3, Informative)

maxwell demon (590494) | more than 4 years ago | (#31342908)

Besides the fact that Flash doesn't have a hard disk platter (his problem obviously isn't just to save data), Flash chips also contain internal logic to map out defective blocks, and in addition they remap in order to avoid writing single blocks too often in order to prevent them from failing early. So even if the HDD platter isn't really needed, he won't get exact control on Flash either.

If you had at least suggested a floppy. There you can indeed control exactly where your bits go, and it's even a magnetic medium.

Re:You Da Man!!! (3, Insightful)

dotgain (630123) | more than 4 years ago | (#31343002)

If you had at least suggested a floppy.

Actually that's the best suggestion yet. After he's spent a week banging bits into the 82072A, he'll either have gone insane, or will have realised he's well and truly barking up the wrong tree. Once again, OP: I'd love to know what you're up to, if it's not trolling Ask Slashdot.

Re:You Da Man!!! (1, Interesting)

Anonymous Coward | more than 4 years ago | (#31343110)

. Once again, OP: I'd love to know what you're up to, if it's not trolling Ask Slashdot.

My first thought was steganography using bit position. My second was a defeating mechanism for NSA-level data-recovery methods which use bit position to help infer overwritten data. Those seem the only reasons anyone would ever want to worry about their bit position on a track.

Re:You Da Man!!! (1)

marcansoft (727665) | more than 4 years ago | (#31343086)

Flash chips also contain internal logic to map out defective blocks, and in addition they remap in order to avoid writing single blocks too often in order to prevent them from failing early.

Flash controllers do that, not flash chips (well, some very smart flash chips have a built-in controller, but they aren't exactly common). It's very easy to buy a raw NOR or NAND flash chip and control every bit (with NOR you don't even need bad block management, as all blocks are guaranteed valid within the specified number of writes).

Re:You Da Man!!! (2, Interesting)

1s44c (552956) | more than 4 years ago | (#31342978)

First thought was - WoW! Somebody wants to defeat disk caching, ECC and make life bloody difficult to boot. The best way, if you really want to do direct disk RMW operations - is to use Flash. Its fast, reasonably portable, and won't fail you if you use it properly.

You still won't know where the data is actually written. Flash does wear leveling.

Re:You Da Man!!! (2, Informative)

marcansoft (727665) | more than 4 years ago | (#31343070)

NOR flash doesn't require or use wear leveling, error correction, or bad sector management (as long as your wear pattern isn't ridiculously unbalanced) - use that if you want true "write raw bits" style functionality. Most microcontrollers use this type of flash, and chips are readily available, though they are expensive compared to NAND flash and only exist in smaller sizes.

NAND flash requires you do your own wear leveling, error correction, and bad sector management. You can still control all the bits, but be prepared to have the chip eat some of them.

Only "cooked" NAND flash devices such as SSDs and SD cards actually do all that on a built-in controller.

How about (0)

Anonymous Coward | more than 4 years ago | (#31342858)

I'm not 100% sure, but on a *nix system you might be able to do this by writing to /dev/, where device represents the HDD.

Re:How about (1)

maxwell demon (590494) | more than 4 years ago | (#31342870)

That would bypass the file system, but not the drive's internal logic.

Re:How about (1)

ComaVN (325750) | more than 4 years ago | (#31342874)

This only skips the file system, not whatever the firmware does.

Re:How about (3, Informative)

PaulIsTheName (1646771) | more than 4 years ago | (#31342894)

They (the bits you write to your typical /dev/sd* device) would still be wrapped up in sectors, the sectors be enhanced with error correction, then encoded (NRZ, Manchester or whatever is appropriate to the magnetic storage) and then written out. What OP wanted is to manipulate the bit that comes out of encoding. Given the usual stack of SCSI-like commands (and not direct access to the write head signal as early HDD controllers had) this does not seem feasible.

Your own Disk controller chipset? (3, Insightful)

Anonymous Coward | more than 4 years ago | (#31342876)

If you don't need lots of bytes, you should use an old disk. I mean very old, maybe going back to those 300-400MB disks we had on 486 computers or even older.

Recent disks have embedded error-handling mechanisms which will prevent you from writing what you want, where you want (physically speaking of course). The disk controller translates your "physical" disk addresses into its own internal mappings. The only way to bypass this would be to remove the disk controller's chip and put your own in place.

Maybe your question would be: "how hard is it to create my own disk controller's chipset?"

Re:Your own Disk controller chipset? (2, Informative)

ranulf (182665) | more than 4 years ago | (#31343048)

> I mean very old, maybe going back to those 300-400MB disks we had on 486 computers or even older.

Hahaha. 300-400MB isn't "very old". It's only 20 years since I bought a 80MB hard disk for £150 and that was considered massive as a couple of years earlier 20MB was cutting edge and cost a few hundred pounds.

Re:Your own Disk controller chipset? (0)

Anonymous Coward | more than 4 years ago | (#31343154)

Agreed :-). But at what point did we start to get "smart" disk controllers? I was assuming that 400Mb drives were still mostly mechanical beasts, but I might be wrong...

Re:Your own Disk controller chipset? (1)

squizzar (1031726) | more than 4 years ago | (#31343234)

When we got IDE - Integrated Drive Electronics. Before then the controller was on the motherboard.

Re:Your own Disk controller chipset? (5, Informative)

Anonymous Coward | more than 4 years ago | (#31343296)

I think anything > 120MB may be unsuitable for this purpose, as they are likely to use ZBR, i.e. different sector densities depending on the circumference of the track. I'd also recommend a really old MFM or RLL disk, where the head movement is controlled with one set of wires and the analog signals from the read/write heads use another set of wires. MFM and RLL drives use the ST506 interface [wikipedia.org] , which should be "easy" to control with microcontroller and a little bit of glue logic.

DD (-1, Redundant)

LordAzuzu (1701760) | more than 4 years ago | (#31342890)

I guess the dd utility is not enough for your needs, otherwise you would have already tried it.
Right?

Re:DD (5, Insightful)

dotgain (630123) | more than 4 years ago | (#31342956)

Read the summary - there's a lot more going on with the data after 'dd' has done with it. Even if I write a continuous stream of zeroes to the disk, that's not what will wind up on the disk. For some reason we've yet to establish, he wants direct control over exactly what bits are recorded where. Unfortunately, doing this will mean it'll be damn near impossible to read the data back, as there will now be no reliable way to determine what track / sector we're located at. There'll be no means to detect errors, let alone correct them. He probably won't even be able to verify what he's just written.

I'm actually more interested in why the fuck he wants to do this, much less how it would be achieved.

Re:DD (2, Informative)

Lord Byron Eee PC (1579911) | more than 4 years ago | (#31342966)

dd only bypasses the filesystem. It doesn't override the HDD firmware, which has to avoid bad sectors and write ECC information to the platter as well.

I would love to hear why the submitter thinks he needs to write directly to the platter.

Re:DD (-1, Flamebait)

Anonymous Coward | more than 4 years ago | (#31343150)

Hahaha how cute. This high school student thinks he knows something. And smug as we

Re:DD (1, Insightful)

Slashcrap (869349) | more than 4 years ago | (#31343152)

I guess the dd utility is not enough for your needs, otherwise you would have already tried it.
Right?

I was just thinking that the submitter might be an idiot. Then I read your post. You're definitely an idiot.

Why (0)

Anonymous Coward | more than 4 years ago | (#31342892)

What possible reason would need to do what your suggesting
may be its my lack of imagination but why

Re:Why (1)

RivieraKid (994682) | more than 4 years ago | (#31343058)

The only time I've seen something like this is back in the day when software companies marked floppy disk sectors as bad for copy protection. The OS wouldn't touch them so when you copied the disk it either wouldn't copy due to read errors, or it would copy but the crucial data written in the bad sectors would be missing so the software wouldn't run.

Data Recovery (1)

ResistanceIsIrritati (808817) | more than 4 years ago | (#31342900)

Presumably there is a way of at least reading specific sectors. Surely data recovery people use something like this to get raw data from a damaged drive bypassing anything the drive might do to try and correct errors. Maybe a data recovery specialist could help you.

Re:Data Recovery (1, Interesting)

Anonymous Coward | more than 4 years ago | (#31342962)

My guess would be that data recovery is exactly what they are looking to do. The tools they use from my understanding for these sorts or purposes tend to be firmware specific to to particular drive manufacturers, models, and even batches. All of these things also tend to be super proprietary and super locked up in NDAs and the like.

Your best bet is going to be going through data recovery guys. If this is a company project that your company demands to have done entirely in house without contracting out any of the work prepare for things to get very expensive. If you outsource this though or use some data recovery people to get you equipped and set up for this project it might have a cost, but no where near what it would be to building this yourself.

Re:Data Recovery (1)

RivieraKid (994682) | more than 4 years ago | (#31343062)

Except he's asking about writing to the platters - data recovery would only ever need to read.

Re:Data Recovery (2, Funny)

paulatz (744216) | more than 4 years ago | (#31343230)

Once you can read, you can also write. I've learned it at schools some 20 years ago

Re:Data Recovery (2, Funny)

obarthelemy (160321) | more than 4 years ago | (#31343328)

Good. Go write "Paulatz wuz here" next to the HOLLYWOOD sign.

Read before write (1)

deniable (76198) | more than 4 years ago | (#31342904)

How are you planning to read the data back? Solve that, then think about writing. As others have said, you'll probably have to build your own drive controller.

Wrong. (5, Insightful)

feepness (543479) | more than 4 years ago | (#31342912)

Your requirements are wrong, sorry.

Yes, I don't what they are. Still wrong.

Some ideas (0)

Anonymous Coward | more than 4 years ago | (#31342914)

You could try this [google.com] , or ask yourself again: is this what you really want to do?

Seriously, you are out of luck. Unless you come across a sympathetic hard drive manufacturer there is very little you can do.

Be careful! (5, Funny)

Anonymous Coward | more than 4 years ago | (#31342918)

I can't help directly, but can give one important advice - careful how you distribute the bits! If too many ones get on the same side of the platter this will destabilize it, causing it to wobble due to the weight difference ( a one weighs quite a bit more than a zero, you know!) and potentially tearing the platter in two!

Re:Be careful! (1)

jlebrech (810586) | more than 4 years ago | (#31342986)

I've noticed a full hard drive seems to weight more than an empty one. But that may just be a placebo effect.

Re:Be careful! (5, Funny)

Anonymous Coward | more than 4 years ago | (#31343182)

I can attest that improper bit stacking is a very real danger - one that almost cost me my life.

It was in 1999 in Sierra Leone, and my last assignment before I left for Sydney was to punt three hundred reams of bit-printed A4 four kilometres up the Moa to a nearby monastery.

It had been a hectic week and the crew the boss had assigned to load the raft had already worked a double shift. Subsequently, they failed to read the job sheet properly and loaded the raft with the all the paper with the zero-bit set on one side and the one-bit set on the other.

I got about three hundred meters from the dock when I was startled by a large black snake swimming past. I quickly moved from where I was sitting on the zero-bit stack to the one-bit stack, and of course the raft immediately capsized.

I was told when I reached the shore that the snake had most probably been a mamba - one of the deadliest snakes in Africa. If I had been bitten I would have been dead within minutes.

I hope this serves as a warning to anyone involved in any kind of data stacking. In short, always properly disperse your bits - your life may depend on it!

Hm ... (5, Insightful)

garry_g (106621) | more than 4 years ago | (#31342920)

This kind of copy protection has been outdated for quite some while and should have died with floppy disks ...

Butterflies (-1, Redundant)

16K Ram Pack (690082) | more than 4 years ago | (#31342932)

Obligatory [xkcd.com]

Re:Butterflies (1)

dotgain (630123) | more than 4 years ago | (#31343022)

Reading the discussion to see if three others have already posted exactly the same comic (a sure bet with xkcd) and been modded down (becoming a similarly sure bet) is also obligatory

Tell us your project? (5, Insightful)

marcansoft (727665) | more than 4 years ago | (#31342940)

These kinds of questions are stupid: "I need to do XYZ for a project, how do I do XYZ?", where XYZ is one or more of complicated, ridiculous, vague, nonsensical, etc. Try telling us what your project is, and then we might be able to suggest a useful solution, possibly not involving XYZ at all, or involving a very particular/practical version of XYZ.

Re:Tell us your project? (1)

xtracto (837672) | more than 4 years ago | (#31343108)

What you don't know is that his project is the implementation of an übersecret disk-writing algorithm to millionuple the speed of access to your hard drive.

 

Re:Tell us your project? (1)

hany (3601) | more than 4 years ago | (#31343248)

patent pending, copyright, TM, ... :)

Re:Tell us your project? (0)

Anonymous Coward | more than 4 years ago | (#31343114)

Sounds like he is trying to develop a new hard disk firmware...

Re:Tell us your project? (4, Insightful)

Scutter (18425) | more than 4 years ago | (#31343280)

These kinds of questions are stupid: "I need to do XYZ for a project, how do I do XYZ?", where XYZ is one or more of complicated, ridiculous, vague, nonsensical, etc. Try telling us what your project is, and then we might be able to suggest a useful solution, possibly not involving XYZ at all, or involving a very particular/practical version of XYZ.

Except he doesn't want your alternate solution. He wants the solution he requested. If you don't know of a way to do it, then move on.

Re:Tell us your project? (0)

QuoteMstr (55051) | more than 4 years ago | (#31343316)

Except he doesn't want your alternate solution. He wants the solution he requested. If you don't know of a way to do it, then move on.

If he fucking wants a yes man, he can pay for one.

If you have to ask, it's hopeless (4, Insightful)

vadim_t (324782) | more than 4 years ago | (#31342942)

"I'm working on a project to build a nuclear powerplant. Is there documentation on how to do it? Obviously a free and open source solution would be preferable, but I'm open to anything at this point."

It seems to me that if you're involved in such a project and have to ask how to do it, it's doomed.

Also, the whole idea of it seems rather impossible. Why would you want to do this in the first place? Have in mind that hard disks don't write bits as is, not just because of ECC. They use an encoding to ensure that there are no long strings of 1s or 0s. If you just wrote some data without regards to that you'd run into a sequence you'd be unable to read later, due to not having a clock signal to figure out where a bit ends and the next begins.

Modern hard disks require using special encodings and servo data in order to be readable at those densities. It just makes little sense to me to want to bypass it. Unless you're working for a disk manufacturer this just seems very odd, but in that case you'd have access to the required equipment and information.

Talk to Steve Gibson author of Spinrite (0)

Anonymous Coward | more than 4 years ago | (#31342958)

The person who would probably know for sure if it is even possible to achieve that level of control is Steve Gibson from grc.com, the author of Spinrite http://www.grc.com/sr/spinrite.htm [grc.com] . Spinrite has some amazing low level hard drive access, that it uses for data recovery and drive maintenance.

Re:Talk to Steve Gibson author of Spinrite (4, Interesting)

marcansoft (727665) | more than 4 years ago | (#31343014)

The stuff Spinrite does stopped working 15 years ago. On modern drives you're pretty much doomed. Considering Gibson has been known to rip off SYN cookies and spout such nonsense as "Windows RAW sockets are going to destroy the internet", I wouldn't go anywhere near him for advice.

Re:Talk to Steve Gibson author of Spinrite (3, Informative)

Joce640k (829181) | more than 4 years ago | (#31343068)

No it doesn't.

If I read it correctly (it was a couple of years ago) all Spinrite does is move the head to different tracks before trying to read the data. The theory is that a seek from different distances might align the drive head slightly differently to the data.

As far as I know there's no way to position drive heads directly via IDE/SATA, much less write individual bits. IDE/SATA are high level protocols, all the low-level logic is inside the drive controller.

Old IDE drives (1)

AC-x (735297) | more than 4 years ago | (#31342980)

Can you tell us what it's for, or is it secret? I assume whatever you're up to involves the destruction of the HD in question?

If you can find a working *very old* IDE drive (back from the era when they had bad blocks printed on the label that you had to map manually) I'd guess those use purely physical sector / block mapping.

if you have time to waste... (1)

chentiangemalc (1710624) | more than 4 years ago | (#31342988)

somehow I doubt whoever is running this project hasn't heard of something called ROI. however if you have money and time to waste some options include: 1) find a better solution to meet your requirement - i.e. think "what is the end result I need to achieve" before thinking of the technical solution "how am I going to achieve this" 2) partnership with hard disk controller manufacturer 3) reverse engineer firwmare on a hard disk controller and remove any error correction code/etc (and take the data unreliability that comes with that) + create your code to actually write and read the disk. In addition this will lock your product to a particular model of a particular brand of hard disk. anyway if you ever succeed let us know how it was done.

too late? (-1, Redundant)

random string of num (1676550) | more than 4 years ago | (#31343010)

Re:too late? (1, Funny)

Anonymous Coward | more than 4 years ago | (#31343214)

yup

You're doing it wrong! (2, Insightful)

sfraggle (212671) | more than 4 years ago | (#31343020)

I need to be able to control exactly where 1s and 0s will appear physically on the platter.

No you don't. Rethink what it is that you're actually trying to achieve and try again.

Re:You're doing it wrong! (0)

Anonymous Coward | more than 4 years ago | (#31343140)

If you're trying to store analogue audio on the platter, for instance, yes. Yes you do. There isn't enough information in the OP to claim that he doesn't need to do this.

Reference: http://hackaday.com/2009/04/24/analog-audio-recorded-on-a-floppy/

Re:You're doing it wrong! (1)

Tapewolf (1639955) | more than 4 years ago | (#31343224)

At one point I was considering something like this as an alternative to a tape delay, something along the lines of the Binson echorec. However I didn't really have the electronics skill to pull it off unfortunately. I suspect you'd have an interesting time getting it the record bias right for a coating optimised for recording binary data rather than an analogue signal.

Re:You're doing it wrong! (1)

sfraggle (212671) | more than 4 years ago | (#31343278)

Neat hack, but the OP specifically mentions binary data ("writing bits ... in a completely controlled fashion", "1s and 0s") :-)

Re:You're doing it wrong! (2, Interesting)

Anonymous Coward | more than 4 years ago | (#31343160)

You can calculate this by finding out C/H/S parameters (and the physical dimensions of the platter(s)), calculating the LBA, reading the sector where the bit should 'appear' and rewriting it with the 'one' bit changed (ATA controllers read/write 512 bytes at a time (sector size)).
Simple, LBA [wikipedia.org] .

Re:You're doing it wrong! (5, Insightful)

Goaway (82658) | more than 4 years ago | (#31343304)

And if he's trying to see if he can read data patterns off platters by hand from a dismantled drive, and needs a known test pattern to calibrate his equipment with?

Hmmm. The twisted, it is strong in this one. (4, Insightful)

Noryungi (70322) | more than 4 years ago | (#31343028)

Short answer: no, it's not possible to do that. It's not impossible, simply incredibly hard to do. Unless you happen to be very handy with a soldering iron and go dumpster-diving in the backyard of an HDD company (as many others have pointed out).

Longer answer: how about creating a 'virtual' hard drive? There are utilities out there that probably let you create (a) a virtual interface (let's say IDE) and (b) a virtual hard drive, attached to said interface. The next step, of course, is to hack these (VirtualBox?) in order to make them do whatever it is you want them to do. This being said, I strongly suspect it involves non-trivial virtual machine hacking and that it probably does not respond to whatever your needs are.

Other than this (very twisted) idea, sorry, bare metal writing has been disabled a long time ago, and for good reasons, too.

Tape (0)

Anonymous Coward | more than 4 years ago | (#31343034)

Use a linear tape drive, you'll be able to control exactly where the ones and zeroes are on the tape. ...Oh, platter? Fuck that.

Solution: (5, Informative)

VulpesFoxnik (1493687) | more than 4 years ago | (#31343044)

Old MFM hard drive should do the work. The entire device was controlled via software in dos. I have one lying around. A whopping 5 MB!

http://en.wikipedia.org/wiki/Modified_Frequency_Modulation [wikipedia.org]

Now all you need is a 8 bit ISA slot and you are set.

DRM? (5, Interesting)

ilo.v (1445373) | more than 4 years ago | (#31343052)

The cynic in me wonders if he is working for some hack start-up company trying to develop a DRM scheme for a hard drive, similar to the crap the studios do to DVD's to make them difficult to rip. Typically this involves creating some sort of currupt/invalid area on the disk that your particular device will know to ignore, but will lock up anyone else trying to read the data off the drive.

The optimist in me wonders if he is trying to defeat such a scheme.

Re:DRM? (0)

Anonymous Coward | more than 4 years ago | (#31343254)

I think it's probably a first-year PhD student. Look at all the layers of abstraction and technology needed to go from magnetic bits to "fread"/"fwrite"!!!! Wouldn't it be faster or more power-efficient if the HDD controller understood the filesystem and serviced the system calls directly?!?! Wouldn't it?!?!

My gut feeling is "probably not". But the way to find out is to make a HDD simulator and connect it to a virtual machine, as someone else suggested. That way, you find out where the performance/energy bottleneck actually is, without needing to reverse engineer an actual HDD controller.

You can't do it. (4, Informative)

PhunkySchtuff (208108) | more than 4 years ago | (#31343066)

It can not be done with off-the shelf equipment and software for many reasons, some of which are:
Line Codes [wikipedia.org]
Error Correcting Codes [wikipedia.org]
PRML [wikipedia.org]
SMART [wikipedia.org]
LBA [wikipedia.org]
etc.

There is a real possibility to do this. (2, Funny)

Anonymous Coward | more than 4 years ago | (#31343072)

>Any good utilities out there to do this?

Yes. My solution involves a screwdriver and a sharpie. And you can write bits of information to the bare metal, like "this drive is broken, dont waste your time trying to fix it".

My colleague was not happy finding the drive on his desk and told me its a low level joke. Well, yes.

So dismantle the drive! (1)

91degrees (207121) | more than 4 years ago | (#31343074)

Remove the control hardware. Build your own.

If that's beyond your skill then you're attempting to do a project beyond your skillset.

CHS mode (0)

Anonymous Coward | more than 4 years ago | (#31343084)

Use an old drive and take clue from
http://en.wikipedia.org/wiki/Cylinder-head-sector

Defrag software? (-1, Redundant)

Anonymous Coward | more than 4 years ago | (#31343090)

Doesn't defragging software do something kinda like this? I know there are some open-source things out there for defragging.

I know the solution!! (1)

drewhk (1744562) | more than 4 years ago | (#31343102)

...but I tell you only when you tell us what do you want to achieve.

Perpendicular or normal? (1, Interesting)

Anonymous Coward | more than 4 years ago | (#31343136)

I guess you want to use modern drive technology to write fine magnetic structures to a plate. Probably producing the equivalent of a magnetic image or a hologram. What you need to do is keep the disk's platter, motor, head, etc. and dump all the electronics. Draw a line on the disk, radial to produce an index and use an optical sensor to read it. Drive the disk at a reasonable speed and then draw your patterns one scan line at a time, using the optical as a trigger to your circuit. You can step inwards from the edge after you are sure that each line is drawn correctly, perhaps with a second head linked to an o.s.
Have you considered the difference between previous tech and perpendicular recording? I suggest perp. is better for you.

Use butterflies (-1, Redundant)

Anonymous Coward | more than 4 years ago | (#31343138)

This might be what you need: http://xkcd.com/378/

get a drive (0)

Anonymous Coward | more than 4 years ago | (#31343166)

start with a drive less than 528 mb

8-bit ST412/506 MFM + Linux circa 1994-5 (5, Informative)

aussersterne (212916) | more than 4 years ago | (#31343172)

Get yourself an old, totally unintelligent S412/506 MFM controller from out of an IBM PC or PC/XT. These were fairly dumb devices (g=c800:5 in debug, anyone?) for which you were meant to enter a "bad sectors list" printed on the front of the drive after performing the low-level format yourself. The earlier the drive, the closer to bare metal, so you might want to look for any of the 2, 5, or 10MB (yes, MB) full-height (2 x 5.25" drive bays stacked on top of one another) drives that were floating around then. You'll also want to get yourself a set of ribbon cables.

You should be able to use a drive/controller combination like this with any machine with ISA bus slots up through about the 386/486 era, and that would let you also go back and grab an early Linux distro (say, kernel 1.2.13 days, like Slackware 3 or so) that included drivers for such a controller that were actually in use and known to work at the time, giving you a base on which to build more code.

If 10MB is too small, you might just have luck going up to the largest of the MFM (80MB) or even RLL drives (160-200MB, just get an RLL controller instead) drives. I don't remember whether there were any ESDI drives back in the day that didn't remap their own sectors, but if there were, these controllers were 16-bit ISA and somewhat smarter (also with Linux drivers from the period available) and went up to 680MB or so.

But if you're looking for the best chance of success for your purposes and don't need tons of storage, my educated guess would be that the MFM controller out of an IBM 5150 PC plugged into a 5MB ST506 hard drive and connected to a SIMM-based 80386DX mainboard with 8 SIMM slots (for 8MB ram) might be the easiest combo to find and get working in practical terms that has a chance of doing what you want.

Define "exactly" (-1, Redundant)

Anonymous Coward | more than 4 years ago | (#31343194)

You can never place something "exactly", since that is limited by the Heisenberg Uncertainty Principle!

So, what do you mean by "exactly" in your application? For example, what are the units in which you are measuring the degree to which it is exact - track+sector, or radius+angle etc etc.

Do you want to be able to write a single spiral track like a CD?

What does "exactly" even mean if the bits are spread across the platter due error correcting codes etc?

pen? (0)

Anonymous Coward | more than 4 years ago | (#31343288)

how about taking the hard drive apart and then using a pen to write 1s or 0s exactly where you want them on the platter. To control exactly where these are written you might need some kind of clamp and robot arm but you should be able to get these fairly simply and use open source software to control it

Have you tried... (-1, Redundant)

wertigon (1204486) | more than 4 years ago | (#31343290)

C-x M-c M-butterfly [xkcd.com] yet?
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>