head     1.1;
branch   1.1.1;
access   ;
symbols  start:1.1.1.1 webdox:1.1.1;
locks    ; strict;
comment  @# @;


1.1
date     2003.03.15.00.57.45;  author redpain;  state Exp;
branches 1.1.1.1;
next     ;

1.1.1.1
date     2003.03.15.00.57.45;  author redpain;  state Exp;
branches ;
next     ;


desc
@@



1.1
log
@Initial revision
@
text
@#! /usr/bin/perl

# This script is used for creating a file full of zeroes,
# which we use to create the hard disk image used by bochs.

use strict qw(refs vars);
use FileHandle;
use IO::Seekable;

if ( scalar(@@ARGV) != 2 ) {
    print "Usage: zerofile <output file> <num sectors>\n";
    exit 1;
}

my $outfile = shift @@ARGV;
my $numsecs = shift @@ARGV;

my $buf = chr(0) x 1;

my $fh = new FileHandle(">$outfile");
(defined $fh) || die "Couldn't open $outfile: $!\n";
binmode $fh;

if ( !sysseek( $fh, ($numsecs * 512) - 1, SEEK_SET ) ) {
    die "Couldn't seek in $outfile: $!\n";
}
if ( !syswrite( $fh, $buf, 1 ) ) {
    die "Couldn't write to $outfile: $!\n";
}

$fh->close();
@


1.1.1.1
log
@Project Start
@
text
@@
