Profile Photo

CS609-System Programming

  • Public Group
  • 5 months, 3 weeks ago
  • 16

    posts

  • 8

    members

CS609_ Assignment No.3, Solution & Discussion. Due Date: … July 2019

Dashboard Forums CS609-System Programming CS609_ Assignment No.3, Solution & Discussion. Due Date: … July 2019

This topic contains 1 voice and has 0 replies.
1 voice
0 replies
  • Author
    Posts
    • #6904
      مَلیکا ایمان
      Moderator
      Topics: 137
      Replies: 258
      Has thanked: 14 times
      Been thanked: 47 times
      Points: 266

      CS609_ Assignment No.3,

      Solution & Discussion.

      Due Date: ….. July  2019

      Question: Write a program which reads two physically addressed blocks from disk using biosdisk() function.

      Solution:

      #include <bios.h>

      #include <dos.h>

      FILE *fp;

      unsigned char buf[1024];

      unsigned char st[60];

      unsigned char headno[10];

      unsigned char secno[10];

      unsigned char trackno[10];

      void main (void)

      {

      int i;

      for (i=0; i<1024; i++)

      buf=0;

      gets(st);

      fp=fopeon(st,”wb”);

      printf(“Head”);

      gets(headno);

      puts(headno);

      printf(“/nsector ”);

      gets(secno);

      puts(secno);

      printf(“/ntrack ”);

      gets(trackno);

      puts(trackno);

      i = biosdisk(2, 0x80, atoi(headno), atoi(trackno), atoi(trackno), 2,buf);

      }

      if(*(((char *)(&i))+1)= =0)

      {

      fwrite(buf,2,1024,fp);

      fclose(fp);

      }

      else

      {

      printf(“cannot read errors# = %x” i);

      }

      Attachments:

You must be logged in to reply to this topic.

More Active Groups

Recently Active Members

Profile picture of ❛❀⋆·☽♛❣️ℛᴬ₦ii: Hk Du:rRᴬ₦ii:❣️♛☾˙✰‧༄⚜️❜✔️
Profile picture of Sana
Profile picture of Romeo
Profile picture of Kristoff
Profile picture of Noumanbutt
Profile picture of Pasta pins
Profile picture of 🥀 Pomi 🌼
Profile picture of ٹمبکٹو
Profile picture of Shining Pearl
Profile picture of Muzalfa Waqas

Community Media

Photos
Videos
Audios
Files

©[2019] All rights reserved to buraqq.com

Log in with your credentials

or    

Forgot your details?

Create Account