Add to Favorites    Make Home Page 1500 Online  
 Language Categories  
 Our Services  

Home » C Home » Hardware Interaction Through C Home » Reading The Master Boot Record & FAT of a Normal 1.44 MB Floppy disk (Mini Project)

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Reading The Master Boot Record & FAT of a Normal 1.44 MB Floppy disk (Mini Project)
Author Rahul Anand Sharma
Author Email rahul_aurora_it [at] yahoo.co.in
Description Below program reads the content of MBR and FAT of a 3(1/2)floppy disk and stores the content in files named MBR.dat(for MBR info)and FAT.dat(For FAT info)

Category C » Hardware Interaction Through C
Hits 385656
Code Select and Copy the Code
Code : #include<stdio.h> #include<conio.h> #include<dos.h> #include<string.h> char buffer[512],buf[512],c; /*Procedure To read the content of MBR and place it ina file*/ char *mbr() { FILE *f; strcpy(buffer,"The MBR is not Good"); _BX=(unsigned)buffer; //Reading The MBR _ES=_DS; _AX=0x0201; _CX=0x0001; // Head:00 Track:00 Sector:01 _DX=0x0000; geninterrupt(0x13); if(strcmp(buffer,"The MBR is not Good")>0) { f=fopen("MBR.DAT","wb+"); fwrite(buffer, sizeof(buffer), 1, f); // Wiriting Content into a file fclose(f); } else printf(" Not A Good Floppy Disk"); return(buffer); } char *FAT_table() { FILE *f; char *bu; strcpy(buffer,"PART I is not good"); strcpy(buf,"PART II is not good"); printf(" Loading Frist Part "); _BX=(unsigned) buffer; _ES=_DS; _AX=0x0201; //Reading Frist Part FAT table _CX=0x0002; // Head:00 Track:00 Sector:02 _DX=0x0000; geninterrupt(0x13); printf(" PRESS A KEY TO CONTINUE "); getch(); printf(" Loading Second Part"); _BX=(unsigned) buf; _ES=_DS; _AX=0x0201; // Reading Second Part of FAT _CX=0x0003; // Head:00 Track:00 Sector:03 _DX=0x0000; geninterrupt(0x13); if(strcmp(buffer,"PART I is not good")>0&&strcmp(buf,"PART II is not good")>0) { f=fopen("FAT.DAT","wb+"); fwrite(buffer,sizeof(buffer),1,f); fwrite(buf,sizeof(buf),1,f); // Writing the content in a file fclose(f); } else printf(" Not a Good Disk"); strcat(buffer,buf); strcpy(bu,buffer); textcolor(15); cprintf(" Finished Loading"); return(bu); } void main() { x:clrscr(); textcolor(15); cprintf(" INSERT FLOPPY IN A: DRIVE"); cprintf(" PRESS 'ENTER' TO READ THE MBR & FAT CONTENT"); if((c=getch())==13)// To press 'Enter' key { mbr();FAT_table(); } else goto x; getch(); }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi �դ ?�� ��??���
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=897


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review