{"id":21,"date":"2009-05-25T22:49:28","date_gmt":"2009-05-25T17:19:28","guid":{"rendered":"http:\/\/vikku.info\/codesnippets\/?p=21"},"modified":"2009-05-25T22:57:27","modified_gmt":"2009-05-25T17:27:27","slug":"read-boot-sector-of-floppy","status":"publish","type":"post","link":"http:\/\/vikku.info\/codesnippets\/c-language-msdos\/read-boot-sector-of-floppy\/","title":{"rendered":"read boot sector of floppy"},"content":{"rendered":"<p>This program is no longer used cause no body uses a floppy&#8230; i have to update it to a 32bit program from 16bit&#8230; and manipulating a USB will be nice instead of a floppy.<\/p>\n<p>This program displays the boot sector of a floppy drive. The biosdisk function can be used to manipulate a FAT32 hard drive even now. Manipulating a FAT16 and FAT12 are straight forward using absolute disk read and absolute disk write functions provided in Borland&#8217;s Turbo C IDE. <\/p>\n<p>I am trying to write a program which will help me play with FAT32 in windows&#8230; using WIN32 API&#8230;<\/p>\n<p>anyway here is one silly program for the strong hearts&#8230;<\/p>\n<pre lang=\"C\">\r\n#include<stdio.h>\r\n#include<conio.h>\r\n#include<bios.h>\r\n\r\n\tstruct\r\n\t{\r\n\t\tchar jump[3];\r\n\t\tchar si[8];\/\/system id\r\n\t\tint bps;\/\/ no of bytes per sector\r\n\t\tchar spc;\/\/ no of sectors per cluster\r\n\t\tint res;\/\/ no of reserved area\r\n\t\tchar cof;\/\/ no of copies of fat\r\n\t\tint rde;\/\/no of root directory entries\r\n\t\tint tos;\/\/ total no of sectors\r\n\t\tchar md;\/\/ media discriptor\r\n\t\tint spf;\/\/ no of sectors per fat\r\n\t\tint spt;\/\/ no of sectors per track\r\n\t\tint sides;\/\/ no of sides\r\n\t\tint hs;\/\/ no of hidden sectors\r\n\t\tchar rest[482];\r\n\r\n\t}zero;\r\n\r\n\tvoid display_bootsector();\r\n\r\nvoid main()\r\n{\r\n\tbiosdisk(2,0x81,0,0,1,1,&zero);\r\n\tdisplay_bootsector();\r\n\r\n}\r\n\r\nvoid display_bootsector()\r\n{\r\n\tzero.jump[3]=0;\r\n\tprintf(\"\\nJump Instruction\\t\\t%s\",zero.jump);\r\n\tzero.si[8]=0;\r\n\tprintf(\"\\nSystem Id\\t\\t%s\",zero.si);\r\n\tprintf(\"\\nBytes per sector\\t%d\",zero.bps);\r\n\tprintf(\"\\nSectors per cluster\\t%d\",zero.spc);\r\n\tprintf(\"\\nReserved\\t\\t%d\",zero.res);\r\n\tprintf(\"\\nCopies of fat\\t\\t%d\",zero.cof);\r\n\tprintf(\"\\nRoot directory entries\\t%d\",zero.rde);\r\n\tprintf(\"\\nTotal no of sectors\\t%d\",zero.tos);\r\n\tprintf(\"\\nMedia discriptor\\t%0x\",zero.md);\r\n\tprintf(\"\\nSectors per fat\\t\\t%d\",zero.spf);\r\n\tprintf(\"\\nSectors per track\\t%d\",zero.spt);\r\n\tprintf(\"\\nNo of sides\\t\\t%d\",zero.sides);\r\n\tprintf(\"\\nNo of hidden sectors\\t%d\",zero.hs);\r\n\tprintf(\"\\n\");\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This program is no longer used cause no body uses a floppy&#8230; i have to update it to a 32bit program from 16bit&#8230; and manipulating a USB will be nice instead of a floppy. This program displays the boot sector of a floppy drive. The biosdisk function can be used to manipulate a FAT32 hard [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts\/21"}],"collection":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":2,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":23,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts\/21\/revisions\/23"}],"wp:attachment":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}