flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > Trouble Installing MenuetOS

Author
Thread Post new topic Reply to topic
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
I wrote a program in C to copy a kernel image on floppy disk and used it to
copy the MenuetOS Image "M32-084.IMG"
But after booting the system with floppy the computer just hung up
showing the following messages:

Starting MenuetOS
KERNEL MNT ?


Here is the source code of my C Program for your reference:

********************************************************
#include <stdio.h>
#include <string.h>
#include <dos.h>

int main()
{
union REGS in, out;
FILE *infp;
char fname[128];
char buffer[512];
int n, tries;
int track, sect;
long kb;

printf("Full path-name of file: ");
fgets(fname, sizeof fname, stdin);
fname[strlen(fname)-1] = '\0';

if ((infp = fopen(fname, "rb")) == NULL)
{
printf("Could not open: %s", fname);
return 1;
}

sect = 1;
track = 0;
while (1)
{
memset(buffer, 0, sizeof buffer);
n = fread(buffer, 1, sizeof buffer, infp);
if (n <= 0) break;
if (track == 80)
{
puts("Disk full,");
return 3;
}


memset((char*)&out, 0, sizeof out);
for (tries=10; tries; tries--)
{
in.x.ax = 0x0301;
in.x.bx = (int)buffer;
in.h.ch = track;
in.h.cl = sect;
in.h.dh = 0;
in.h.dl = 0; // A:

int86(0x13, &in, &out);

if (!out.x.cflag)
{
break;
}
}
if (!tries)
{
puts("Disk write failed.");
return 2;
}


kb = ((track * 18L + sect-1) * 512L + n) / 1024L;
printf("Tracks: %d, Sectors: %d (%ld KBs)\n", track, sect, kb);

if(++sect > 1Cool
{
track++;
sect = 1;
}
}

puts("Done !");

fclose(infp);

return 0;
}

_________________
Attitude!
Post 11 Jun 2007, 07:33
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
Shocked Question

_________________
Attitude!
Post 11 Jun 2007, 15:28
View user's profile Send private message Reply with quote
Ville



Joined: 17 Jun 2003
Posts: 230
Ville
Have you tried with Rawrite, Winimage or the Unix equivalent dd if=diskimage.img of=/dev/fd0 bs=1440k ?
Post 11 Jun 2007, 17:46
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.