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.
Program To Display Disk Sectors
Re:Program To Display Disk Sectors
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]
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]
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Program To Display Disk Sectors
you can also try
Code: Select all
hexdump -C /dev/hda