Navigation

    Cyberian
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Pro Blog
    • Users
    • Groups
    • Unsolved
    • Solved

    SOLVED CS609 Assignment No. 03 Solution and Discussion

    CS609 - System Programming
    assignment cs609 solution discussion spring 2019
    3
    4
    503
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • zaasmi
      zaasmi Cyberian's Gold last edited by zareen

      5d2b418e-1dd4-4b12-93ac-655f3b17699c-image.png
      Semester: Spring 2019
      CS609: System Programming
      Graded
      Assignment No. 03
      Total Marks: 20

      Due Date: July 16, 2019

      Instructions:

      Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:

      ♣ The assignment is submitted after due date.
      ♣ The submitted assignment does not open or file is corrupt.
      ♣ You have not followed steps described in Detailed Instructions of the problem statement.
      ♣ Assignment is copied (partial or full) from any source (websites, forums, students, etc.) Strict action will be taken in this regard.

      Note: You have to upload only .doc or .docx file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks.

      Objectives:

      The objective of this assignment is to provide hands-on experience of System Programming concepts including:

      • Hard Disk interrupts
      • Hard Disk data reading
      • Hard Disk BioDisk() function

      For any assignment related query, contact at [email protected]

      Problem Statement:

      Q: Write a program which reads two physically addressed blocks from disk using biosdisk() function.
      Instructions:
      • Declare arrays to handle head, sector and track numbers to read from hard disk.
      unsigned char headno[10];
      unsigned char secno[10];
      unsigned char trackno[10];
      • Similarly declare a buffer of 1024 char to store data 2 blocks data etc.
      • unsigned char buf[1024];
      • Use printf to print message of entering head no. i.e printf("Head ");
      • Use gets function to get head no. from user i.e gets(headno);
      • Use puts function to put headno in array of headno
      • Use biodisk function to read two blocks i.e
      biosdisk(2,0x80,atoi(headno),atoi(trackno),atoi(secno),2,buf) ;
      • Similarly get and put sector and track numbers.
      • Show error message in case of failure of biodisk() function.

      Note: Your assignment file should be a single Word file (.doc or .docx) containing code only.

      Best of Luck!

      Discussion is right way to get Solution of the every assignment, Quiz and GDB.
      We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
      Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
      NOTE: Don't copy or replicating idea solutions.
      Quiz Copy Solution
      Mid and Final Past Papers
      Live Chat

      1 Reply Last reply Reply Quote 0
      • cyberian
        cyberian Cyberian's @moaaz last edited by

        @moaaz
        Another Idea 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[i]=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 Error# = %x” i);
        
        }
        
        

        Discussion is right way to get Solution of the every assignment, Quiz and GDB.
        We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
        Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
        NOTE: Don't copy or replicating idea solutions.
        Quiz Copy Solution
        Mid and Final Past Papers
        Live Chat
        Mobile Tax Calculator

        1 Reply Last reply Reply Quote 0
        • M
          moaaz Cyberian's Gold last edited by

          Idea Solution

          #include #include 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[i]=0;
          gets(st); 
          fp=fopen(st,"wb"); 
          printf("Head "); 
          gets(headno); 
          puts (headno);
          i = biosdisk(2,0x80,atoi(headno), atoi(trackno),atoi(secno),2,buf) ; 
          if (*(((char *)(&i))+1)==0) { 
          fwrite(buf,2,1024,fp); fclose(fp);
          } 
          else printf("Cannot Read Error# = %x",i); 
          }
          

          Discussion is right way to get Solution of the every assignment, Quiz and GDB.
          We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
          Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
          NOTE: Don't copy or replicating idea solutions.

          How to Get Earning from Cyberian

          Quiz Copy Solution
          Mid and Final Past Papers
          Live Chat

          For instructions on how to use this Cyberian discussion board

          cyberian 1 Reply Last reply Reply Quote 1
          • cyberian
            cyberian Cyberian's last edited by

            @Anaya-Ali

            Discussion is right way to get Solution of the every assignment, Quiz and GDB.
            We are always here to discuss and Guideline, Please Don't visit Cyberian only for Solution.
            Cyberian Team always happy to facilitate to provide the idea solution. Please don't hesitate to contact us!
            NOTE: Don't copy or replicating idea solutions.
            Quiz Copy Solution
            Mid and Final Past Papers
            Live Chat
            Mobile Tax Calculator

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Insaf Sehat Card Live Cricket Streaming

            100% Off on Your FEE Join US! Ask Me How?

            Quiz 100% Result If you want to know how you can join us and get 100% Discount on your FEE ask Cyberian in Chat Room!
            Quiz 100% Result Quiz 100% Result
            solution1255 discussion1206 fall 2019813 assignment 1433 assignment 2297 spring 2020265 gdb 1248 assignment 382 crw10174 spring 201955
            | |
            Copyright © 2021 Cyberian Inc. Pakistan | Contributors
            Live Chat