#include "boot.h" unsigned short itoms(), mstoi(); /* * Write a booter header on a hard diskk */ main () { char buf [1024]; long offset; char *a; int n, c, h, s; struct block0 b; b.ncyl = itoms (512); b.nhead = itoms (8); b.nsect = itoms (17); b.norigin = itoms (0); b.interleave = itoms (1); b.bps = itoms (512); b.delay = itoms (0); b.precomp = itoms (512); b.lowcurrent = itoms (512); b.bootcyl = itoms (511); b.boothead = itoms (0); b.bootsect = itoms (0); b.bootcount = itoms (30); b.parkcyl = itoms (0); mwopen (); mwwrite (0, 0, 0, &b); n = b.bootcount; c = b.bootcyl; s = b.bootsect; h = b.boothead; a = "This is a test ... This is a test .. I'm here I'm here hi!!!"; while (n--) { mwwrite (c, h, s, a); /* a += d.bps; */ if (++s >= b.nsect) { s = 0; /* new head */ if (++h >= b.nhead) { h = 0; /* new cylinder */ if (++c >= b.ncyl) { c = 0; /* wrap around */ } } } } } unsigned short itoms (a) unsigned short a; { #ifdef K68 return a; #else return (a >> 8) | (a << 8); #endif } unsigned short mstoi (a) unsigned short a; { return itoms (a); } djread () { }