An x86-64 operating system built from xv6, now largely rewritten: SMP, a copy-on-write root filesystem (SchFS), PCI/USB/virtio drivers, a TTF rasteriser, and a Linux-numbered syscall ABI. No history before this point -- the tree was never under version control. This commit exists so the rename that follows has something to undo to.
19 lines
363 B
Perl
19 lines
363 B
Perl
#!/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;
|