Function to display the Information of partition table of master boot record MBR

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

/* Function to Display the Information Of partition table of MBR */

display()
{
unsigned int s_sec, s_trk, e_sec, e_trk, i, t1, t2 ;
char type[20], boot[5] ;

printf("\n\nPart. Boot Starting location Ending Location Relative Number of");

printf("\nType Side Cylinder Sector Side Cylinder Sector Sectors Sectors\n");

for ( i = 0 ; i <= 3 ; i++ )
{
if ( p.pt[i].bootable == 0x80 )
strcpy ( boot, "Yes" ) ;
else
strcpy ( boot, "No" ) ;

switch ( p.pt[i].parttype )
{
case 0x00 :
strcpy ( type, "Unused" ) ; break ;
case 0x1 :
strcpy ( type, "FAT12" ) ; break ;
case 0x2 :
strcpy ( type, "Xenix" ) ; break ;
case 0x3 :
strcpy ( type, "Xenix:usr" ) ; break ;
case 0x4 :
strcpy ( type, "FAT16<32M" ) ; break ;
case 0x5 :
strcpy ( type, "DOS-Ext." ) ; break ;
case 0x6 :
strcpy ( type, "FAT16>32M" ) ; break ;
case 0x7 :
strcpy ( type, "NTFS" ) ; break ;
case 0x0b :
strcpy ( type, "FAT32" ) ; break ;
case 0x0c :
strcpy ( type, "FAT32-LBA" ) ; break ;
case 0x0d :
strcpy ( type, "VFAT16" ) ; break ;
case 0x0e :
strcpy ( type, "VFAT16-LBA" ) ; break ;
case 0x0f :
strcpy ( type, "VFAT EXT" ) ; break ;
case 0x17 :
strcpy ( type, "HPFS" ) ; break ;
case 0x81 :
strcpy ( type, "Old LINUX" ) ; break ;
case 0x82 :
strcpy ( type, "LinuxSwap" ) ; break ;
case 0x83 :
strcpy ( type, "LinuxNative" ) ; break ;
case 0x85 :
strcpy ( type, "Linux Ext." ) ; break ;
default :
strcpy ( type, "Unknown" ) ; break ;
}

s_sec = ( p.pt[i].start_sec_cyl & 0x3f ) ; /* starting Sector of the partition */
t1 = ( p.pt[i].start_sec_cyl & 0xff00 ) >> 8 ;
t2 = ( p.pt[i].start_sec_cyl & 0x00c0 ) << 2 ;
s_trk = t1 | t2 ; /* Starting Cylinder */

e_sec = ( p.pt[i].end_sec_cyl & 0x3f ) ; /*Ending Sector */
t1 = ( p.pt[i].end_sec_cyl & 0xff00 ) >> 8 ;
t2 = ( p.pt[i].end_sec_cyl & 0x00c0 ) << 2 ;
e_trk = t1 | t2 ; /* ending Cylinder */

printf ( "\n%6s %3s", type, boot ) ;
printf ( "%4d %6d %8d", p.pt[i].start_side, s_trk,s_sec ) ;
printf ( "%7d %6u %8u", p.pt[i].end_side, e_trk, e_sec ) ;
printf ( " %10lu %10lu", p.pt[i].part_beg,
p.pt[i].plen ) ;

}

return 0;
}

Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13

Next page
 
 
Data Recovery Book
 
Chapter 1 An Overview of Data Recovery
Chapter 2 Introduction of Hard Disks
Chapter 3 Logical Approach to Disks and OS
Chapter 4 Number Systems
Chapter 5 Introduction of C Programming
Chapter 6 Introduction to Computer Basics
Chapter 7 Necessary DOS Commands
Chapter 8 Disk-BIOS Functions and Interrupts Handling With C
Chapter 9 Handling Large Hard Disks
Chapter 10 Data Recovery From Corrupted Floppy
Chapter 11 Making Backups
Chapter 12 Reading and Modifying MBR with Programming
Chapter 13 Reading and Modifying DBR with Programming
Chapter 14 Programming for “Raw File” Recovery
Chapter 15 Programming for Data Wipers
Chapter 16 Developing more Utilities for Disks
Appendix Glossary of Data Recovery Terms
 
 
Pro Data Doctor

Home

Products

Contact Details

Customer Support

Download Demo

Terms and Conditions

 
Pro Data Doctor