Solved

Low-level format

Posted on 2001-08-08
21
369 Views
Last Modified: 2008-03-06
How do I create a debug proggy that performs a low-level format?

0
Comment
Question by:Hypermaniak
  • 7
  • 5
  • 3
  • +3
21 Comments
 
LVL 24

Expert Comment

by:SunBow
Comment Utility
Mostly you don't. Mainly because each HD has different requirements, and the option is not available in BIOS, which is about the lowest level any proggie can go.

How this disk access function can be called debugging, I have not a clue.  This is not about distributing trojans, is it?  Low-level utilities require hands on. By definition. Forget any thought on distributions.
0
 

Author Comment

by:Hypermaniak
Comment Utility
No...not distributing trojies.  Just tryin to learn about debug DOS programming.  I did a low-level format on my HD once, but I forgot what I did.  I remember that I used debug to do it tho.  I just forget the sequence that I was told.  I figured that it might be a useful tool if I caught a viri anytime soon because of the different attacks out there nowadays (with SirCAM, CodeRed, etc.)
0
 
LVL 1

Expert Comment

by:speedguns
Comment Utility
When you did that low level format using Debug, I am assuming that you entered several lines of ASM code which set some registers, then called a bios interupt to perform the format.   Not exactly the same as creating
a Program. further, if you created a program using Debug, what would stop it from getting the virus?  Why wouldn't Debug be affected?  Wouldn't you rather clean the disk than re format it?  in any event,

you could check out the PINK SHIRT book or go to

http://www.cs.cmu.edu/afs/cs/user/ralf/pub/WWW/files.html

for a list of interupts. including Bios.
0
 

Author Comment

by:Hypermaniak
Comment Utility
No...not distributing trojies.  Just tryin to learn about debug DOS programming.  I did a low-level format on my HD once, but I forgot what I did.  I remember that I used debug to do it tho.  I just forget the sequence that I was told.  I figured that it might be a useful tool if I caught a viri anytime soon because of the different attacks out there nowadays (with SirCAM, CodeRed, etc.)
0
 
LVL 2

Expert Comment

by:XTerm
Comment Utility
Low level formatting newer disk is dangerous, since they might get damaged.
If you want to clean your disk (I mean really clean), find a windows version (for bootfloppy) of GNU dd, or (even better) get a linux resque disk with dd.

For the primary master (prolly the place of your first disk the command is:
dd if=/dev/zero of/dev/hda bs=1M
It will take a very long time, but your disk will be *empty*.
A better way is to simply
mkfs.msdos /dev/hdax -F 32
To high-level reformat the disk. (This also removes any viruses present.)
0
 
LVL 16

Expert Comment

by:t0t0
Comment Utility
I did something like this some years ago in debug....

I think you have to fire up debug and issue the following command:

G 8000

(if memory serves me right)....


0
 

Author Comment

by:Hypermaniak
Comment Utility
I'm not interested in the high level format stuff...that is eay enough to accomplish on my own.  

Must clean out entire system.  RAM signatures and all.
BIOS resident memory...the works.

Just figured it as a handy tool to know.

BTW, what does -g 8000 do?

0
 
LVL 1

Expert Comment

by:speedguns
Comment Utility
G is for GO,   which will begin executing the instruction at <address> which in this case is 8000 Hex.
It seems I remember something like this too.  Perhaps sitting at ROM address 8000 is a routine which
will do a low level format?
0
 
LVL 1

Expert Comment

by:speedguns
Comment Utility
G is for GO,   which will begin executing the instruction at <address> which in this case is 8000 Hex.
It seems I remember something like this too.  Perhaps sitting at ROM address 8000 is a routine which
will do a low level format?
0
 
LVL 16

Accepted Solution

by:
t0t0 earned 100 total points
Comment Utility
Seems like we're from the same old school speedguns....

Hypermaniak, you should be able to obtain a low level format utility from the drive's manufacturer....

Also, take a look at SpinRite - a HDD utility for mucking about with the low level stuff.

Finally, be aware that some drives should NOT be low-level formatted....

Have you considered writing your own low-level formatter using DOS BIOS routines?.... It's not rocket-science stuff....and it's fun....

-g 8000 is a ROM BIOS low-level formatting routine....don't hear of it nowadays though...
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Hypermaniak
Comment Utility
OMG! I totally forgot to award points for the answer!
0
 
LVL 3

Expert Comment

by:FlamingSword
Comment Utility
> -g 8000 is a ROM

Wow! Someone here really used Debug?
0
 
LVL 1

Expert Comment

by:speedguns
Comment Utility
Congrat's t0t0,  Perhaps I am not the only one around here with my own copy of the PINK SHIRT Book! Yes, I am from a fairly old school,  But the really good stuff, you can't learn in school,  You gotta fire up MASM and try it out.  I actually used to do all of my Assembly stuff from within QuickC which for the money was a heck of a dos dev environment.  But Alas,  Gone are the days of simple <1K TSR's to do stupid dos tricks,  Now adays, you really gotta know something prior to attempting anything analogas in WinDoze.
0
 
LVL 16

Expert Comment

by:t0t0
Comment Utility
Thanks hypermaniak.... Did you have a go at writing your own low level formatter in the end?....

Yeah, speedguns, those were the days eh?....


0
 
LVL 3

Expert Comment

by:FlamingSword
Comment Utility
> Gone are the days of simple

yeah, yesterday it had to be at least a few MB, now it has to be > 1GB or no one thinks there is any value

my 1st PC defaulted 4KB RAM, upgrade eventually allowed ~ 60k disk

1st work computer - 32 k words (not bytes)
0
 
LVL 3

Expert Comment

by:FlamingSword
Comment Utility
> Must clean out entire system.  RAM signatures and all.
BIOS resident memory...the works.

???

Hypermaniak, I do hope you heeded the cautions. There is some geometry involved, and no one solution that fits all of the drives models.

If this is also for excessing equipment, you may need to simplify. I've seen that done, contractually.
0
 

Author Comment

by:Hypermaniak
Comment Utility
yes i did, i tried various debugs in testbed harddrives, as well as contacting the HD manufacturer about settings and addresses prior to doing it on the real thing. It final string ended up to be like a 4 stage string set with a whole lotta numbers involved that i dun really remember anymore :OP heehee!  Worked perfectly (after a few trials and errors)  but many thanx to your contributions...and speedguns, if you would like some points as well, send me an e-mail via maniak@tankpolice.com and I will get a bogus question  set up to have you answer and award you some pts.

And TSRs were the bomb!  Still are.  God exposure to modern day WinOS and modern day "power users" because they are so unaware of DoS skills, that neat little harmless pranks can be pulled off via 1 or 2 TSRs in the boot files.
0
 

Author Comment

by:Hypermaniak
Comment Utility
Also the PC manufacturer's top level trouble ticket helped a bit too ^_^
0
 
LVL 1

Expert Comment

by:speedguns
Comment Utility
Thanks Hypermaniak,  But I'm All Set,  Just Glad you got it working.
0
 

Author Comment

by:Hypermaniak
Comment Utility
thanx a bundle speed :O)
0
 
LVL 24

Expert Comment

by:SunBow
Comment Utility
If you coded that much, I suggest considering tucking the few bytes in your pocket. Take home and wrap it with some I/O to run a pretty wipedisk proggie. Off boot diskette.

In olden times Norton had a useful one. Nowadays companies are upgrading so much that they have decent PCs and HDs going out the door to auctions and donations, but they want/need something to certify that corpo secrets (and licenses) are removed prior to dumping old equipment. I hear nothing of Symantec big marketing here, so IMO there's a buck to be made, if you keep it simple and don't try to charge a fortune. Perhaps model / success rate of the dude that did pkZip. Many do simple fDisk and run, or wipe only first sector. Bit too simple.

Anyway, glad it worked out for you.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now