Lines Matching defs:bootstrap
294 warnx("Patch area in stage1 bootstrap is too small");
310 } disk_buf, bootstrap;
322 if (params->s1stat.st_size > (off_t)(sizeof bootstrap)) {
323 warnx("stage1 bootstrap `%s' (%u bytes) is larger than 8192 bytes",
328 warnx("stage1 bootstrap `%s' (%u bytes) is too small",
354 /* Read the new bootstrap code. */
355 rv = pread(params->s1fd, &bootstrap, params->s1stat.st_size, 0);
367 * The bootstrap code is either 512 bytes for booting FAT16, or best
372 magic = (void *)(bootstrap.b + 512 - 16 + 4);
376 magic = (void *)(bootstrap.b + 512 * 2 + 4);
383 if (!is_zero(bootstrap.b + 512-2-64, 64)) {
384 warnx("Data in mbr partition table of new bootstrap");
387 if (!is_zero(bootstrap.b + 512, 512)) {
388 warnx("Data in label part of new bootstrap");
392 memcpy(bootstrap.b + 512-2-64, disk_buf.b + 512-2-64, 64);
393 memcpy(bootstrap.b + 512, disk_buf.b + 512, 512);
398 warnx("Invalid magic in stage1 bootstrap %x != %x",
423 if (bootstrap.b[0] != 0xeb || bootstrap.b[2] != 0x90) {
424 warnx("No BPB in new bootstrap %02x:%02x:%02x" USE_F,
425 bootstrap.b[0], bootstrap.b[1], bootstrap.b[2]);
452 if (disk_buf.b[1] > bootstrap.b[1]) {
454 if (!is_zero(disk_buf.b + 2 + bootstrap.b[1],
455 disk_buf.b[1] - bootstrap.b[1])) {
459 u = bootstrap.b[1];
467 memcpy(bootstrap.b + 2, disk_buf.b + 2, u);
485 /* Copy new bootstrap data into disk buffer, ignoring label area */
486 memcpy(&disk_buf, &bootstrap, 512);
488 memcpy(disk_buf.b + 2 * 512, bootstrap.b + 2 * 512,
515 * Read in the existing bootstrap.
541 bootstrap");