Home | History | Annotate | Download | only in util

Lines Matching refs:rom

8 use constant PCI_PTR_LOC => 0x18;	# from beginning of ROM
10 use constant PNP_PTR_LOC => 0x1a; # from beginning of ROM
18 use constant UNDI_PTR_LOC => 0x16; # from beginning of ROM
32 print STDERR "BIOS extension ROM Image did not start with 0x55 0xAA\n"
36 print STDERR "$size is a strange size for a boot ROM\n"
93 # Point to device id string at end of ROM image
149 my ($rom, $romsize, $stubsize);
152 $ARGV[0] or die "Usage: $0 [-s romsize] [-i ident] [-p vendorid,deviceid] [-n] [-x] [-3] rom-file\n";
154 # Read in the whole ROM in one gulp
155 my $filesize = read(R, $rom, MAXROMSIZE+1);
161 substr($rom, 2, 1) = chr((length($rom) + 511) / 512);
162 writerom($ARGV[0], \$rom);
179 print STDERR "ROM size of $romsize not big enough for data, ";
185 $rom .= "\xFF" x ($romsize - length($rom));
186 # If this is a stub ROM, don't force header size to the full amount
189 print "Warning: ROM size exceeds extension BIOS limit\n";
191 substr($rom, 2, 1) = chr(($romsize / 512) % 256);
193 $stubsize = ord(substr($rom, 2, 1)) * 512;
196 print "ROM size is $romsize\n" if $opts{'v'};
198 my $pnp_hdr_offset = unpack('v', substr($rom, PNP_PTR_LOC, 2));
199 my $identoffset = substr($rom, $pnp_hdr_offset+PNP_DEVICE_OFF, 2) eq "\0\0" ? addident(\$rom) : undef;
200 pcipnpheaders(\$rom, $identoffset);
201 undiheaders(\$rom);
203 substr($rom, MINROMSIZE-2, 2) = "\x80\x80"
205 checksum(\$rom, $opts{'n'} ? $stubsize : $romsize);
206 writerom($ARGV[0], \$rom);
210 my ($rom);
213 $ARGV[0] or die "Usage: $0 [-p vendorid,deviceid] rom-file\n";
215 # Read in the whole ROM in one gulp
216 my $filesize = read(R, $rom, MAXROMSIZE+1);
220 pcipnpheaders(\$rom, undef);
221 undiheaders(\$rom);
222 checksum(\$rom, ord(substr($rom, 2, 1)) * 512);
223 writerom($ARGV[0], \$rom);