diff options
author | rtm <rtm> | 2006-06-12 15:22:12 +0000 |
---|---|---|
committer | rtm <rtm> | 2006-06-12 15:22:12 +0000 |
commit | 55e95b16db458b7f9abeca96e541acbdf8d7f85b (patch) | |
tree | 92a1fcb6f1cdede7ab83b37acabf76e1bc1b10f4 /sign.pl | |
download | xv6-labs-55e95b16db458b7f9abeca96e541acbdf8d7f85b.tar.gz xv6-labs-55e95b16db458b7f9abeca96e541acbdf8d7f85b.tar.bz2 xv6-labs-55e95b16db458b7f9abeca96e541acbdf8d7f85b.zip |
import
Diffstat (limited to 'sign.pl')
-rwxr-xr-x | sign.pl | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +#!/usr/bin/perl + +open(SIG, $ARGV[0]) || die "open $ARGV[0]: $!"; + +$n = sysread(SIG, $buf, 1000); + +if($n > 510){ + print STDERR "boot block too large: $n bytes (max 510)\n"; + exit 1; +} + +print STDERR "boot block is $n bytes (max 510)\n"; + +$buf .= "\0" x (510-$n); +$buf .= "\x55\xAA"; + +open(SIG, ">$ARGV[0]") || die "open >$ARGV[0]: $!"; +print SIG $buf; +close SIG; |