Lines Matching full:boot
49 static uint16_t init_geometry_boot(union bootsector *boot, struct device *dev, in init_geometry_boot() argument
58 set_word(boot->boot.nsect, dev->sectors); in init_geometry_boot()
59 set_word(boot->boot.nheads, dev->heads); in init_geometry_boot()
66 set_word(boot->boot.psect, (uint16_t) *tot_sectors); in init_geometry_boot()
67 set_dword(boot->boot.bigsect, 0); in init_geometry_boot()
68 set_word(boot->boot.nhs, (uint16_t) dev->hidden); in init_geometry_boot()
70 set_word(boot->boot.psect, 0); in init_geometry_boot()
71 set_dword(boot->boot.bigsect, (uint32_t) *tot_sectors); in init_geometry_boot()
72 set_dword(boot->boot.nhs, dev->hidden); in init_geometry_boot()
80 strncpy(boot->boot.banner, "2M-STV04", 8); in init_geometry_boot()
81 boot->boot.ext.old.res_2m = 0; in init_geometry_boot()
82 boot->boot.ext.old.fmt_2mf = 6; in init_geometry_boot()
84 boot->boot.ext.old.wt = 1; in init_geometry_boot()
86 boot->boot.ext.old.wt = 0; in init_geometry_boot()
87 boot->boot.ext.old.rate_0= rate_0; in init_geometry_boot()
88 boot->boot.ext.old.rate_any= rate_any; in init_geometry_boot()
89 if (boot->boot.ext.old.rate_any== 2 ) in init_geometry_boot()
90 boot->boot.ext.old.rate_any= 1; in init_geometry_boot()
94 set_word(boot->boot.ext.old.Infp0, i); in init_geometry_boot()
95 boot->bytes[i++] = sectors0; in init_geometry_boot()
96 boot->bytes[i++] = 108; in init_geometry_boot()
98 boot->bytes[i++] = j; in init_geometry_boot()
100 set_word(boot->boot.ext.old.InfpX, i); in init_geometry_boot()
102 boot->bytes[i++] = 64; in init_geometry_boot()
103 boot->bytes[i++] = 3; in init_geometry_boot()
111 boot->bytes[i++] = 128 + j; in init_geometry_boot()
112 boot->bytes[i++] = j++; in init_geometry_boot()
113 boot->bytes[i++] = size2; in init_geometry_boot()
116 boot->bytes[nb_renum] = (uint8_t)(( i - nb_renum - 1 )/3); in init_geometry_boot()
118 set_word(boot->boot.ext.old.InfTm, i); in init_geometry_boot()
125 boot->bytes[i++] = size2; in init_geometry_boot()
129 set_word(boot->boot.ext.old.BootP,i); in init_geometry_boot()
134 sum += boot->bytes[j];/* checksum */ in init_geometry_boot()
135 boot->boot.ext.old.CheckSum=(unsigned char)-sum; in init_geometry_boot()
139 boot->boot.jump[0] = 0xeb; in init_geometry_boot()
140 boot->boot.jump[1] = 0; in init_geometry_boot()
141 boot->boot.jump[2] = 0x90; in init_geometry_boot()
142 strncpy(boot->boot.banner, mformat_banner, 8); in init_geometry_boot()
159 static __inline__ void inst_boot_prg(union bootsector *boot, uint16_t offset) in inst_boot_prg() argument
161 memcpy(boot->bytes + offset, bootprog, sizeof(bootprog)); in inst_boot_prg()
164 boot->boot.jump[0] = 0xeb; in inst_boot_prg()
165 boot->boot.jump[1] = (uint8_t) (offset -2); in inst_boot_prg()
166 boot->boot.jump[2] = 0x90; in inst_boot_prg()
169 boot->boot.jump[0] = 0xe9; in inst_boot_prg()
170 boot->boot.jump[1] = (uint8_t) (offset - 3); in inst_boot_prg()
171 boot->boot.jump[2] = (uint8_t) ( (offset - 3) >> 8); in inst_boot_prg()
173 set_word(boot->boot.jump + offset + 20, offset + 24); in inst_boot_prg()
177 static __inline__ void format_root(Fs_t *Fs, char *label, union bootsector *boot) in format_root() argument
215 set_word(boot->boot.dirents, 0); in format_root()
217 set_word(boot->boot.dirents, in format_root()
391 * may_change_boot_size try_cluster_size may increase number of boot
398 * boot sectors, fat length or root_size to take up
483 /* "Pad" fat by artifically adding sectors to boot sectors, in try_cluster_size()
504 * "wasting" space by adding more reserved (boot) in try_cluster_size()
866 union bootsector boot; in mformat() local
1217 &boot.characters, 0, Fs->sector_size) != in mformat()
1248 PWRITES(Fs->head.Next, &boot.characters, in mformat()
1253 /* the boot sector */ in mformat()
1260 perror("open boot sector"); in mformat()
1263 ret=read(fd, &boot.bytes, blocksize); in mformat()
1265 perror("short read on boot sector"); in mformat()
1272 memset(boot.characters, '\0', Fs->sector_size); in mformat()
1279 boot.boot.nfat = Fs->num_fat; in mformat()
1281 set_word(&boot.bytes[510], 0xaa55); in mformat()
1284 set_word(boot.boot.nsect, used_dev.sectors); in mformat()
1285 set_word(boot.boot.nheads, used_dev.heads); in mformat()
1288 &boot.boot.descr)) { in mformat()
1310 (&boot.bytes[0x1ae]); in mformat()
1321 set_word(boot.boot.fatlen, 0); in mformat()
1322 set_dword(boot.boot.ext.fat32.bigFat, Fs->fat_len); in mformat()
1327 set_word(boot.boot.ext.fat32.extFlags,0); in mformat()
1330 set_word(boot.boot.ext.fat32.fsVersion,fsVersion); in mformat()
1333 set_dword(boot.boot.ext.fat32.rootCluster, Fs->rootCluster = 2); in mformat()
1336 set_word(boot.boot.ext.fat32.infoSector, Fs->infoSectorLoc = 1); in mformat()
1339 /* no backup boot sector */ in mformat()
1340 set_word(boot.boot.ext.fat32.backupBoot, Fs->backupBoot); in mformat()
1342 labelBlock = & boot.boot.ext.fat32.labelBlock; in mformat()
1344 set_word(boot.boot.fatlen, (uint16_t) Fs->fat_len); in mformat()
1347 labelBlock = & boot.boot.ext.old.labelBlock; in mformat()
1375 set_word(boot.boot.secsiz, Fs->sector_size); in mformat()
1376 boot.boot.clsiz = (unsigned char) Fs->cluster_size; in mformat()
1377 set_word(boot.boot.nrsvsect, Fs->fat_start); in mformat()
1379 bootOffset = init_geometry_boot(&boot, &used_dev, sectors0, in mformat()
1383 bootOffset = ptrdiff((char *) labelBlock, (char*)boot.bytes) + in mformat()
1387 boot.boot.banner[4] = 0; in mformat()
1388 boot.boot.banner[5] = (char) random(); in mformat()
1389 boot.boot.banner[6] = (char) random(); in mformat()
1390 boot.boot.banner[7] = (char) random(); in mformat()
1394 inst_boot_prg(&boot, (uint16_t)bootOffset); in mformat()
1399 boot.boot.jump[0] = 0xeb; in mformat()
1400 boot.boot.jump[1] = 0x80; in mformat()
1401 boot.boot.jump[2] = 0x90; in mformat()
1406 boot.boot.descr=mediaDesc; in mformat()
1409 zero_fat(Fs, boot.boot.descr); in mformat()
1421 format_root(Fs, label, &boot); in mformat()
1422 if(PWRITES((Stream_t *)Fs, boot.characters, 0, Fs->sector_size) < 0) { in mformat()
1423 fprintf(stderr, "Error writing boot sector\n"); in mformat()
1428 if(PWRITES((Stream_t *)Fs, boot.characters, in mformat()
1431 fprintf(stderr, "Error writing backup boot sector\n"); in mformat()