ReactOS  0.4.14-dev-390-g34947ad
boot.c
Go to the documentation of this file.
1 /* @(#)boot.c 1.28 16/10/23 Copyright 1999-2016 J. Schilling */
2 #include <schily/mconfig.h>
3 #ifndef lint
4 static UConst char sccsid[] =
5  "@(#)boot.c 1.28 16/10/23 Copyright 1999-2016 J. Schilling";
6 #endif
7 /*
8  * Support for generic boot (sector 0..16)
9  * and to boot Sun sparc and Sun x86 systems.
10  *
11  * Copyright (c) 1999-2016 J. Schilling
12  */
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License version 2
16  * as published by the Free Software Foundation.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License along with
24  * this program; see the file COPYING. If not, write to the Free Software
25  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  */
27 
28 #include "mkisofs.h"
29 #include <schily/fcntl.h>
30 #include <schily/utypes.h>
31 #include <schily/intcvt.h>
32 #include <schily/schily.h>
33 #include "sunlabel.h"
34 
35 extern int use_sunx86boot;
36 
40 LOCAL char *boot_files[NDKMAP]; /* Change this for > 8 x86 parts */
41 
42 LOCAL void init_sparc_label __PR((void));
43 LOCAL void init_sunx86_label __PR((void));
44 EXPORT int sparc_boot_label __PR((char *label));
45 EXPORT int sunx86_boot_label __PR((char *label));
46 EXPORT int scan_sparc_boot __PR((char *files));
47 EXPORT int scan_sunx86_boot __PR((char *files));
48 EXPORT int make_sun_label __PR((void));
49 EXPORT int make_sunx86_label __PR((void));
50 LOCAL void dup_sun_label __PR((int part));
52 LOCAL int sunlabel_size __PR((UInt32_t starting_extent));
54 LOCAL int genboot_size __PR((UInt32_t starting_extent));
56 
57 /*
58  * Set the virtual geometry in the disk label.
59  * If we like to make the geometry variable, we may change
60  * dkl_ncyl and dkl_pcyl later.
61  */
62 LOCAL void
64 {
65  i_to_4_byte(cd_label.dkl_vtoc.v_version, V_VERSION);
66  i_to_2_byte(cd_label.dkl_vtoc.v_nparts, NDKMAP);
67  i_to_4_byte(cd_label.dkl_vtoc.v_sanity, VTOC_SANE);
68 
69  i_to_2_byte(cd_label.dkl_rpm, CD_RPM);
70  i_to_2_byte(cd_label.dkl_pcyl, CD_PCYL);
71  i_to_2_byte(cd_label.dkl_apc, CD_APC);
72  i_to_2_byte(cd_label.dkl_intrlv, CD_INTRLV);
73  i_to_2_byte(cd_label.dkl_ncyl, CD_NCYL);
74  i_to_2_byte(cd_label.dkl_acyl, CD_ACYL);
75  i_to_2_byte(cd_label.dkl_nhead, CD_NHEAD);
76  i_to_2_byte(cd_label.dkl_nsect, CD_NSECT);
77 
78  cd_label.dkl_magic[0] = DKL_MAGIC_0;
79  cd_label.dkl_magic[1] = DKL_MAGIC_1;
80 }
81 
82 LOCAL void
84 {
85  li_to_4_byte(sx86_label.dkl_vtoc.v_sanity, VTOC_SANE);
86  li_to_4_byte(sx86_label.dkl_vtoc.v_version, V_VERSION);
87  li_to_2_byte(sx86_label.dkl_vtoc.v_sectorsz, 512);
88  li_to_2_byte(sx86_label.dkl_vtoc.v_nparts, NX86MAP);
89 
90  li_to_4_byte(sx86_label.dkl_pcyl, CD_PCYL);
91  li_to_4_byte(sx86_label.dkl_ncyl, CD_NCYL);
92  li_to_2_byte(sx86_label.dkl_acyl, CD_ACYL);
93  li_to_2_byte(sx86_label.dkl_bcyl, 0);
94 
95  li_to_4_byte(sx86_label.dkl_nhead, CD_NHEAD);
96  li_to_4_byte(sx86_label.dkl_nsect, CD_NSECT);
97  li_to_2_byte(sx86_label.dkl_intrlv, CD_INTRLV);
98  li_to_2_byte(sx86_label.dkl_skew, 0);
99  li_to_2_byte(sx86_label.dkl_apc, CD_APC);
100  li_to_2_byte(sx86_label.dkl_rpm, CD_RPM);
101 
102  li_to_2_byte(sx86_label.dkl_write_reinstruct, 0);
103  li_to_2_byte(sx86_label.dkl_read_reinstruct, 0);
104 
105  li_to_2_byte(sx86_label.dkl_magic, DKL_MAGIC);
106 }
107 
108 /*
109  * For command line parser: set ASCII label.
110  */
111 EXPORT int
113  char *label;
114 {
115  strncpy(cd_label.dkl_ascilabel, label, 127);
116  cd_label.dkl_ascilabel[127] = '\0';
117  return (1);
118 }
119 
120 EXPORT int
122  char *label;
123 {
124  strncpy(sx86_label.dkl_vtoc.v_asciilabel, label, 127);
125  sx86_label.dkl_vtoc.v_asciilabel[127] = '\0';
126  return (1);
127 }
128 
129 /*
130  * Parse the command line argument for boot images.
131  */
132 EXPORT int
134  char *files;
135 {
136  char *p;
137  int i = 1;
138  struct stat statbuf;
139  int status;
140 extern int use_sparcboot;
141 extern int use_sunx86boot;
142 
143  if (use_sunx86boot)
145  _("-sparc-boot and -sunx86-boot are mutual exclusive.\n"));
146  use_sparcboot++;
147 
149 
150  do {
151  if (i >= NDKMAP)
152  comerrno(EX_BAD, _("Too many boot partitions.\n"));
153  boot_files[i++] = files;
154  if ((p = strchr(files, ',')) != NULL)
155  *p++ = '\0';
156  files = p;
157  } while (p);
158 
159  i_to_2_byte(cd_label.dkl_vtoc.v_part[0].p_tag, V_USR);
160  i_to_2_byte(cd_label.dkl_vtoc.v_part[0].p_flag, V_RONLY);
161  for (i = 0; i < NDKMAP; i++) {
162  p = boot_files[i];
163  if (p == NULL || *p == '\0')
164  continue;
165  if (strcmp(p, "...") == '\0')
166  break;
167 
168  status = stat_filter(p, &statbuf);
169  if (status < 0 || access(p, R_OK) < 0)
170  comerr(_("Cannot access '%s'.\n"), p);
171 
172  i_to_4_byte(cd_label.dkl_map[i].dkl_nblk,
173  roundup(statbuf.st_size, CD_CYLSIZE)/512);
174 
175  i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_tag, V_ROOT);
176  i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_flag, V_RONLY);
177  }
178  return (1);
179 }
180 
181 EXPORT int
183  char *files;
184 {
185  char *p;
186  int i = 0;
187  struct stat statbuf;
188  int status;
189 extern int use_sparcboot;
190 extern int use_sunx86boot;
191 
192  if (use_sparcboot)
194  _("-sparc-boot and -sunx86-boot are mutual exclusive.\n"));
195  use_sunx86boot++;
196 
197 
199 
200  do {
201  if (i >= NDKMAP)
202  comerrno(EX_BAD, _("Too many boot partitions.\n"));
203  boot_files[i++] = files;
204  if ((p = strchr(files, ',')) != NULL)
205  *p++ = '\0';
206  files = p;
207  } while (p);
208 
209  li_to_2_byte(sx86_label.dkl_vtoc.v_part[0].p_tag, V_ROOT); /* UFS */
210  li_to_2_byte(sx86_label.dkl_vtoc.v_part[0].p_flag, V_RONLY);
211  li_to_2_byte(sx86_label.dkl_vtoc.v_part[1].p_tag, V_USR); /* ISO */
212  li_to_2_byte(sx86_label.dkl_vtoc.v_part[1].p_flag, V_RONLY);
213  li_to_2_byte(sx86_label.dkl_vtoc.v_part[2].p_tag, 0); /* ALL */
214  li_to_2_byte(sx86_label.dkl_vtoc.v_part[2].p_flag, 0);
215  for (i = 0; i < NDKMAP; i++) {
216  p = boot_files[i];
217  if (p == NULL || *p == '\0')
218  continue;
219  if (i == 1 || i == 2) {
221  _("Partition %d may not have a filename.\n"), i);
222  }
223 
224  status = stat_filter(p, &statbuf);
225  if (status < 0 || access(p, R_OK) < 0)
226  comerr(_("Cannot access '%s'.\n"), p);
227 
228  li_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_size,
229  roundup(statbuf.st_size, CD_CYLSIZE)/512);
230 
231  if (i > 2) {
232  li_to_2_byte(sx86_label.dkl_vtoc.v_part[i].p_tag, V_USR);
233  li_to_2_byte(sx86_label.dkl_vtoc.v_part[i].p_flag, V_RONLY);
234  }
235  }
236  return (1);
237 }
238 
239 /*
240  * Finish the Sun disk label and compute the size of the additional data.
241  */
242 EXPORT int
244 {
245  int last;
246  int cyl = 0;
247  int nblk;
248  int bsize;
249  int i;
250  char *p;
251 
252  /*
253  * Compute the size of the padding for the iso9660 image
254  * to allow the next partition to start on a cylinder boundary.
255  */
257 
258  i_to_4_byte(cd_label.dkl_map[0].dkl_nblk, last*4);
259  bsize = 0;
260  for (i = 0; i < NDKMAP; i++) {
261  p = boot_files[i];
262  if (p != NULL && strcmp(p, "...") == '\0') {
263  dup_sun_label(i);
264  break;
265  }
266  if ((nblk = a_to_4_byte(cd_label.dkl_map[i].dkl_nblk)) == 0)
267  continue;
268 
269  i_to_4_byte(cd_label.dkl_map[i].dkl_cylno, cyl);
270  cyl += nblk / (CD_CYLSIZE/512);
271  if (i > 0)
272  bsize += nblk;
273  }
274  bsize /= 4;
275  return (last-last_extent+bsize);
276 }
277 
278 /*
279  * A typical Solaris boot/install CD from a Sun CD set looks
280  * this way:
281  *
282  * UFS Part 0 tag 2 flag 10 start 3839 size 1314560
283  * ISO Part 1 tag 4 flag 10 start 0 size 3839
284  * ALL Part 2 tag 0 flag 0 start 0 size 1318400
285  */
286 EXPORT int
288 {
289  int last;
290  int cyl = 0;
291  int nblk;
292  int bsize;
293  int i;
294  int partoff = 1; /* The offset of the Solaris 0x82 partition */
295 
296  /*
297  * Compute the size of the padding for the iso9660 image
298  * to allow the next partition to start on a cylinder boundary.
299  */
301 
302  li_to_4_byte(sx86_label.dkl_vtoc.v_part[1].p_size, last*4);
303 
304  /*
305  * Note that the Solaris fdisk partition with fdisk signature 0x82
306  * is created at fixed offset 1 sector == 512 Bytes by this
307  * implementation.
308  * We need subtract this partition offset from all absolute
309  * partition offsets in order to get offsets relative to the
310  * Solaris primary partition.
311  */
312  bsize = 0;
313  for (i = 0; i < NDKMAP; i++) {
314  if (i == 2) /* Never include the whole disk in */
315  continue; /* size/offset computations */
316 
317  if ((nblk = la_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_size)) == 0)
318  continue;
319 
320  li_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_start,
321  cyl*(CD_CYLSIZE/512)-partoff);
322  cyl += nblk / (CD_CYLSIZE/512);
323  if (i == 0 || i > 2)
324  bsize += nblk;
325  }
326  li_to_4_byte(sx86_label.dkl_vtoc.v_part[0].p_start, last*4-partoff);
327  li_to_4_byte(sx86_label.dkl_vtoc.v_part[1].p_start, 0);
328  li_to_4_byte(sx86_label.dkl_vtoc.v_part[1].p_size, last*4-partoff);
329  li_to_4_byte(sx86_label.dkl_vtoc.v_part[2].p_start, 0);
330  li_to_4_byte(sx86_label.dkl_vtoc.v_part[2].p_size, last*4+bsize);
331 
332  fdisk_part.part[0].pr_status = STATUS_ACTIVE;
333  fdisk_part.part[0].pr_type = TYPE_SOLARIS;
334  li_to_4_byte(fdisk_part.part[0].pr_partoff, partoff);
335  li_to_4_byte(fdisk_part.part[0].pr_nsect, last*4+bsize-partoff);
336  fdisk_part.magic[0] = 0x55;
337  fdisk_part.magic[1] = 0xAA;
338 
339  bsize /= 4;
340  return (last-last_extent+bsize);
341 }
342 
343 /*
344  * Duplicate a partition of the Sun disk label until all partitions are filled up.
345  */
346 LOCAL void
348  int part;
349 {
350  int cyl;
351  int nblk;
352  int i;
353 
354 
355  if (part < 1 || part >= NDKMAP)
356  part = 1;
357  cyl = a_to_4_byte(cd_label.dkl_map[part-1].dkl_cylno);
358  nblk = a_to_4_byte(cd_label.dkl_map[part-1].dkl_nblk);
359 
360  for (i = part; i < NDKMAP; i++) {
361  i_to_4_byte(cd_label.dkl_map[i].dkl_cylno, cyl);
362  i_to_4_byte(cd_label.dkl_map[i].dkl_nblk, nblk);
363 
364  i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_tag, V_ROOT);
365  i_to_2_byte(cd_label.dkl_vtoc.v_part[i].p_flag, V_RONLY);
366  }
367 }
368 
369 /*
370  * Write out Sun boot partitions.
371  */
372 LOCAL int
374  FILE *outfile;
375 {
376  char buffer[SECTOR_SIZE];
377  int i;
378  int n;
379  int nblk;
380  int amt;
381  int f;
382  char *p;
383 
384  memset(buffer, 0, sizeof (buffer));
385 
386  /*
387  * Write padding to the iso9660 image to allow the
388  * boot partitions to start on a cylinder boundary.
389  */
391  for (n = 0; n < amt; n++) {
394  }
395  if (use_sunx86boot)
396  i = 0;
397  else
398  i = 1;
399  for (; i < NDKMAP; i++) {
400  if (use_sunx86boot && (i == 1 || i == 2))
401  continue;
402  p = boot_files[i];
403  if (p == NULL || *p == '\0')
404  continue;
405  if (p != NULL && strcmp(p, "...") == '\0')
406  break;
407  if (use_sunx86boot) {
408  if ((nblk = la_to_4_byte(sx86_label.dkl_vtoc.v_part[i].p_size)) == 0)
409  continue;
410  } else {
411  if ((nblk = a_to_4_byte(cd_label.dkl_map[i].dkl_nblk)) == 0)
412  continue;
413  }
414  if ((f = open(boot_files[i], O_RDONLY| O_BINARY)) < 0)
415  comerr(_("Cannot open '%s'.\n"), boot_files[i]);
416 
417  amt = nblk / 4;
418  for (n = 0; n < amt; n++) {
419  memset(buffer, 0, sizeof (buffer));
420  if (read(f, buffer, SECTOR_SIZE) < 0)
421  comerr(_("Read error on '%s'.\n"), boot_files[i]);
424  }
425  close(f);
426  }
427  fprintf(stderr, _("Total extents including %s boot = %u\n"),
428  use_sunx86boot ? "Solaris x86":"sparc",
430  return (0);
431 }
432 
433 /*
434  * Do size management for the Sun disk label that is located in the first
435  * sector of a disk.
436  */
437 LOCAL int
438 sunlabel_size(starting_extent)
439  UInt32_t starting_extent;
440 {
441  if (last_extent != session_start)
442  comerrno(EX_BAD, _("Cannot create sparc boot on offset != 0.\n"));
443  last_extent++;
444  return (0);
445 }
446 
447 /*
448  * Compute the checksum and write a Sun disk label to the first sector
449  * of the disk.
450  * If the -generic-boot option has been specified too, overlay the
451  * Sun disk label on the first 512 bytes of the generic boot code.
452  */
453 LOCAL int
455  FILE *outfile;
456 {
457  char buffer[SECTOR_SIZE];
458  register char *p;
459  register short count = (512/2) - 1;
460  int f;
461 
462  memset(buffer, 0, sizeof (buffer));
463  if (genboot_image) {
464  if ((f = open(genboot_image, O_RDONLY| O_BINARY)) < 0)
465  comerr(_("Cannot open '%s'.\n"), genboot_image);
466 
467  if (read(f, buffer, SECTOR_SIZE) < 0)
468  comerr(_("Read error on '%s'.\n"), genboot_image);
469  close(f);
470  }
471 
472  if (use_sunx86boot) {
473  if (sx86_label.dkl_vtoc.v_asciilabel[0] == '\0')
474  strcpy(sx86_label.dkl_vtoc.v_asciilabel, CD_X86LABEL);
475 
476  p = (char *)&sx86_label;
477  sx86_label.dkl_cksum[0] = 0;
478  sx86_label.dkl_cksum[1] = 0;
479  while (count-- > 0) {
480  sx86_label.dkl_cksum[0] ^= *p++;
481  sx86_label.dkl_cksum[1] ^= *p++;
482  }
483  memcpy(&buffer[0x1BE], fdisk_part.part, sizeof (fdisk_part.part));
484  p = &buffer[510];
485  *p++ = 0x55;
486  *p = 0xAA;
487  memcpy(&buffer[1024], &sx86_label, 512);
488  } else {
489  /*
490  * If we don't already have a Sun disk label text
491  * set up the default.
492  */
493  if (cd_label.dkl_ascilabel[0] == '\0')
494  strcpy(cd_label.dkl_ascilabel, CD_DEFLABEL);
495 
496  p = (char *)&cd_label;
497  cd_label.dkl_cksum[0] = 0;
498  cd_label.dkl_cksum[1] = 0;
499  while (count--) {
500  cd_label.dkl_cksum[0] ^= *p++;
501  cd_label.dkl_cksum[1] ^= *p++;
502  }
503  memcpy(buffer, &cd_label, 512);
504  }
505 
508  return (0);
509 }
510 
511 /*
512  * Do size management for the generic boot code on sectors 0..16.
513  */
514 LOCAL int
515 genboot_size(starting_extent)
516  UInt32_t starting_extent;
517 {
518  if (last_extent > (session_start + 1))
519  comerrno(EX_BAD, _("Cannot create generic boot on offset != 0.\n"));
520  last_extent = session_start + 16;
521  return (0);
522 }
523 
524 /*
525  * Write the generic boot code to sectors 0..16.
526  * If there is a Sun disk label, start writing at sector 1.
527  */
528 LOCAL int
530  FILE *outfile;
531 {
532  char buffer[SECTOR_SIZE];
533  int i;
534  int f;
535 
536  if ((f = open(genboot_image, O_RDONLY| O_BINARY)) < 0)
537  comerr(_("Cannot open '%s'.\n"), genboot_image);
538 
539  for (i = 0; i < 16; i++) {
540  memset(buffer, 0, sizeof (buffer));
541  if (read(f, buffer, SECTOR_SIZE) < 0)
542  comerr(_("Read error on '%s'.\n"), genboot_image);
543 
544  if (i != 0 || last_extent_written == session_start) {
547  }
548  }
549  close(f);
550  return (0);
551 }
552 
EXPORT int scan_sunx86_boot(char *files)
Definition: boot.c:182
EXPORT int make_sunx86_label()
Definition: boot.c:287
struct output_fragment genboot_desc
Definition: boot.c:555
EXPORT int sunx86_boot_label(char *label)
Definition: boot.c:121
#define li_to_4_byte(a, i)
Definition: intcvt.h:87
#define V_ROOT
Definition: sunlabel.h:64
int use_sunx86boot
Definition: mkisofs.c:108
EXPORT void comerr(char *msg, va_alist)
Definition: comerr.c:84
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define open
Definition: acwin.h:95
POINT last
Definition: font.c:46
#define i_to_4_byte(a, i)
Definition: intcvt.h:38
EXPORT void xfwrite(void *buffer, int size, int count, FILE *file, int submode, BOOL islast)
Definition: write.c:168
GLuint GLuint GLsizei count
Definition: gl.h:1545
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define V_VERSION
Definition: sunlabel.h:61
LOCAL void init_sunx86_label()
Definition: boot.c:83
int use_sparcboot
Definition: mkisofs.c:107
LOCAL void dup_sun_label(int part)
Definition: boot.c:347
#define UConst
Definition: ccomdefs.h:72
GLdouble n
Definition: glext.h:7729
char * genboot_image
Definition: mkisofs.c:170
GLuint buffer
Definition: glext.h:5915
#define DKL_MAGIC
Definition: sunlabel.h:31
#define CD_NCYL
Definition: sunlabel.h:50
EXPORT int stat_filter(char *path, struct stat *st)
Definition: tree.c:232
#define CD_ACYL
Definition: sunlabel.h:51
static FILE * outfile
Definition: wrjpgcom.c:81
EXPORT int scan_sparc_boot(char *files)
Definition: boot.c:133
#define R_OK
Definition: io.h:171
static UConst char sccsid[]
Definition: boot.c:4
#define NDKMAP
Definition: sunlabel.h:29
#define CD_X86LABEL
Definition: sunlabel.h:36
LOCAL struct x86_label sx86_label
Definition: boot.c:38
struct output_fragment sunboot_desc
Definition: boot.c:553
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
LOCAL void init_sparc_label()
Definition: boot.c:63
#define STATUS_ACTIVE
Definition: sunlabel.h:174
#define _(X)
Definition: i386-dis.c:36
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
#define VTOC_SANE
Definition: sunlabel.h:62
UInt32_t last_extent
Definition: mkisofs.c:76
#define DKL_MAGIC_1
Definition: sunlabel.h:33
smooth NULL
Definition: ftsmooth.c:416
struct output_fragment sunlabel_desc
Definition: boot.c:554
EXPORT int sparc_boot_label(char *label)
Definition: boot.c:112
#define roundup(x, y)
Definition: multi.c:48
EXPORT int make_sun_label()
Definition: boot.c:243
#define LOCAL(type)
Definition: jmorecfg.h:289
GLfloat f
Definition: glext.h:7540
#define CD_NSECT
Definition: sunlabel.h:53
#define CD_CYLSIZE
Definition: sunlabel.h:59
#define a_to_4_byte(a)
Definition: intcvt.h:75
LOCAL int genboot_write(FILE *outfile)
Definition: boot.c:529
#define V_RONLY
Definition: sunlabel.h:67
LOCAL void init_sparc_label __PR((void))
UInt32_t session_start
Definition: mkisofs.c:77
#define CD_INTRLV
Definition: sunlabel.h:49
LOCAL int sunlabel_write(FILE *outfile)
Definition: boot.c:454
struct pc_pr part[4]
Definition: sunlabel.h:192
#define li_to_2_byte(a, i)
Definition: intcvt.h:80
UInt32_t last_extent_written
Definition: write.c:303
#define NX86MAP
Definition: sunlabel.h:30
#define TYPE_SOLARIS
Definition: sunlabel.h:183
Definition: stat.h:55
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
LOCAL struct sun_label cd_label
Definition: boot.c:37
#define close
Definition: acwin.h:98
uint8_t label[11]
Definition: fsck.fat.h:65
#define V_USR
Definition: sunlabel.h:65
#define i_to_2_byte(a, i)
Definition: intcvt.h:31
#define CD_APC
Definition: sunlabel.h:48
#define DKL_MAGIC_0
Definition: sunlabel.h:32
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
#define f
Definition: ke_i.h:83
#define O_BINARY
Definition: acwin.h:109
LOCAL int genboot_size(UInt32_t starting_extent)
Definition: boot.c:515
EXPORT void comerrno(int err, char *msg, va_alist)
Definition: comerr.c:137
char * strchr(const char *String, int ch)
Definition: utclib.c:501
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
FILE * stderr
#define CD_RPM
Definition: sunlabel.h:46
#define CD_PCYL
Definition: sunlabel.h:47
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define SECTOR_SIZE
Definition: fs.h:22
GLfloat GLfloat p
Definition: glext.h:8902
#define memset(x, y, z)
Definition: compat.h:39
static SERVICE_STATUS status
Definition: service.c:31
LOCAL struct pc_part fdisk_part
Definition: boot.c:39
LOCAL int sunlabel_size(UInt32_t starting_extent)
Definition: boot.c:438
#define la_to_4_byte(a)
Definition: intcvt.h:112
LOCAL char * boot_files[NDKMAP]
Definition: boot.c:40
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)
LOCAL int sunboot_write(FILE *outfile)
Definition: boot.c:373
_off_t st_size
Definition: stat.h:63
#define O_RDONLY
Definition: acwin.h:108
#define CD_NHEAD
Definition: sunlabel.h:52
Definition: ps.c:97
#define EX_BAD
Definition: standard.h:62
#define CD_DEFLABEL
Definition: sunlabel.h:35