<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS609 Assignment No. 03 Solution and Discussion]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1562845125643-5d2b418e-1dd4-4b12-93ac-655f3b17699c-image.png" alt="5d2b418e-1dd4-4b12-93ac-655f3b17699c-image.png" class=" img-fluid img-markdown" /><br />
Semester: Spring 2019<br />
CS609: System Programming<br />
Graded<br />
Assignment No. 03<br />
Total Marks: 20</p>
<p dir="auto">Due Date: July 16, 2019</p>
<p dir="auto">Instructions:</p>
<p dir="auto">Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:</p>
<p dir="auto">♣	The assignment is submitted after due date.<br />
♣	The submitted assignment does not open or file is corrupt.<br />
♣	You have not followed steps described in Detailed Instructions of the problem statement.<br />
♣	Assignment is copied (partial or full) from any source (websites, forums, students, etc.) Strict action will be taken in this regard.</p>
<p dir="auto">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.</p>
<p dir="auto">Objectives:</p>
<p dir="auto">The objective of this assignment is to provide hands-on experience of System Programming concepts including:</p>
<p dir="auto">•	Hard Disk interrupts<br />
•	Hard Disk data reading<br />
•	Hard Disk BioDisk() function</p>
<p dir="auto">For any assignment related query, contact at <a href="mailto:CS609@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">CS609@vu.edu.pk</a></p>
<p dir="auto">Problem Statement:</p>
<p dir="auto">Q: Write a program which reads two physically addressed blocks from disk using biosdisk() function.<br />
Instructions:<br />
•	Declare arrays to handle head, sector and track numbers to read from hard disk.<br />
unsigned char headno[10];<br />
unsigned char secno[10];<br />
unsigned char trackno[10];<br />
•	Similarly declare a buffer of 1024 char to store data 2 blocks data etc.<br />
•	unsigned char buf[1024];<br />
•	Use printf to print message of entering head no. i.e printf("Head ");<br />
•	Use gets function to get head no. from user i.e gets(headno);<br />
•	Use puts function to put headno in array of headno<br />
•	Use biodisk function to read two blocks i.e<br />
biosdisk(2,0x80,atoi(headno),atoi(trackno),atoi(secno),2,buf) ;<br />
•	Similarly get and put sector and track numbers.<br />
•	Show error message in case of failure of biodisk() function.</p>
<p dir="auto">Note: Your assignment file should be a single Word file (.doc or .docx) containing code only.</p>
<p dir="auto">Best of Luck!</p>
]]></description><link>https://community.secnto.com//topic/184/cs609-assignment-no-03-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 19:59:35 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/184.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Jul 2019 11:40:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS609 Assignment No. 03 Solution and Discussion on Wed, 17 Jul 2019 09:52:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/moaaz" aria-label="Profile: moaaz">@<bdi>moaaz</bdi></a><br />
Another Idea solution</p>
<pre><code>#include &lt;bios.h&gt;

#include &lt;dos.h&gt;

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&lt;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 *)(&amp;i))+1)= =0)

{

fwrite(buf,2,1024,fp);

fclose(fp);

}

else

{

printf(“Cannot Read Error# = %x” i);

}

</code></pre>
]]></description><link>https://community.secnto.com//post/492</link><guid isPermaLink="true">https://community.secnto.com//post/492</guid><dc:creator><![CDATA[cyberian]]></dc:creator><pubDate>Wed, 17 Jul 2019 09:52:48 GMT</pubDate></item><item><title><![CDATA[Reply to CS609 Assignment No. 03 Solution and Discussion on Wed, 17 Jul 2019 09:51:22 GMT]]></title><description><![CDATA[<p dir="auto">Idea Solution</p>
<pre><code>#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&lt;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 *)(&amp;i))+1)==0) { 
fwrite(buf,2,1024,fp); fclose(fp);
} 
else printf("Cannot Read Error# = %x",i); 
}
</code></pre>
]]></description><link>https://community.secnto.com//post/491</link><guid isPermaLink="true">https://community.secnto.com//post/491</guid><dc:creator><![CDATA[moaaz]]></dc:creator><pubDate>Wed, 17 Jul 2019 09:51:22 GMT</pubDate></item><item><title><![CDATA[Reply to CS609 Assignment No. 03 Solution and Discussion on Wed, 17 Jul 2019 09:45:59 GMT]]></title><description><![CDATA[<p dir="auto">@Anaya-Ali</p>
]]></description><link>https://community.secnto.com//post/490</link><guid isPermaLink="true">https://community.secnto.com//post/490</guid><dc:creator><![CDATA[cyberian]]></dc:creator><pubDate>Wed, 17 Jul 2019 09:45:59 GMT</pubDate></item></channel></rss>