Page 1 of 1

Program To Display Disk Sectors

Posted: Tue May 20, 2003 8:37 pm
by Simrook
Does anyone know of a program that would let me do the following?

Enter disk: /dev/loop1
Enter cylinder: 5
Enter sector: 54
Cyldiner 5/Sector 54 contains: xxxx...

I'm looking for something that will display the data in a specific cylinder/sector for me. I'm writting a FS/Hard-disk driver, and i'm pretty sure that i'm screwing up the cylinder/sector caculations. A tool like this would be very usefull. Anyone heard of something like this for linux?

thanks,

Simrook.

Re:Program To Display Disk Sectors

Posted: Tue May 20, 2003 9:53 pm
by gtsphere
Hello,
I actually wrote a program for linux that does something very similar to it. First of all, its hardcoded to use /dev/hda but that can be changed extremely quickly with a recompile.
This program takes the Cylinder Head Sector and displays in hex, or you can change it to whatever you need displayed.
Feel free to edit this code, just as long as my name stays in the source at the top! I hope this helps you out! :-)

program usage: rdev <cylinder #> <head #> <sector #>
also, make sure you put your own hard drive (or whatever) geometery into the section on lines:
61 and 62.

->>They should be according to your own HDD.<<--

to compile: gcc rdev.c -o rdev


-GT

[attachment deleted by admin]

Re:Program To Display Disk Sectors

Posted: Wed May 21, 2003 1:32 am
by Pype.Clicker
you can also try

Code: Select all

hexdump -C /dev/hda
8)