ReactOS 0.4.15-dev-7712-gbbbcd8e
boot.c File Reference
#include <schily/mconfig.h>
#include "mkisofs.h"
#include <schily/fcntl.h>
#include <schily/utypes.h>
#include <schily/intcvt.h>
#include <schily/schily.h>
#include "sunlabel.h"
Include dependency graph for boot.c:

Go to the source code of this file.

Functions

LOCAL void init_sparc_label __PR ((void))
 
EXPORT int sparc_boot_label __PR ((char *label))
 
EXPORT int scan_sparc_boot __PR ((char *files))
 
LOCAL void dup_sun_label __PR ((int part))
 
LOCAL int sunboot_write __PR ((FILE *outfile))
 
LOCAL int sunlabel_size __PR ((UInt32_t starting_extent))
 
LOCAL void init_sparc_label ()
 
LOCAL void init_sunx86_label ()
 
EXPORT int sparc_boot_label (char *label)
 
EXPORT int sunx86_boot_label (char *label)
 
EXPORT int scan_sparc_boot (char *files)
 
EXPORT int scan_sunx86_boot (char *files)
 
EXPORT int make_sun_label ()
 
EXPORT int make_sunx86_label ()
 
LOCAL void dup_sun_label (int part)
 
LOCAL int sunboot_write (FILE *outfile)
 
LOCAL int sunlabel_size (UInt32_t starting_extent)
 
LOCAL int sunlabel_write (FILE *outfile)
 
LOCAL int genboot_size (UInt32_t starting_extent)
 
LOCAL int genboot_write (FILE *outfile)
 

Variables

static UConst char sccsid []
 
int use_sunx86boot
 
LOCAL struct sun_label cd_label
 
LOCAL struct x86_label sx86_label
 
LOCAL struct pc_part fdisk_part
 
LOCAL charboot_files [NDKMAP]
 
struct output_fragment sunboot_desc = {NULL, NULL, NULL, sunboot_write, "Sun Boot" }
 
struct output_fragment sunlabel_desc = {NULL, sunlabel_size, NULL, sunlabel_write, "Sun Disk Label" }
 
struct output_fragment genboot_desc = {NULL, genboot_size, NULL, genboot_write, "Generic Boot" }
 

Function Documentation

◆ __PR() [1/6]

EXPORT int scan_sparc_boot __PR ( (char *files)  )

◆ __PR() [2/6]

◆ __PR() [3/6]

◆ __PR() [4/6]

LOCAL void dup_sun_label __PR ( (int part)  )

◆ __PR() [5/6]

LOCAL int sunlabel_size __PR ( (UInt32_t starting_extent)  )

◆ __PR() [6/6]

◆ dup_sun_label()

LOCAL void dup_sun_label ( int  part)

Definition at line 347 of file boot.c.

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}
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
#define a_to_4_byte(a)
Definition: intcvt.h:75
#define i_to_2_byte(a, i)
Definition: intcvt.h:31
#define i_to_4_byte(a, i)
Definition: intcvt.h:38
LOCAL struct sun_label cd_label
Definition: boot.c:37
#define V_RONLY
Definition: sunlabel.h:67
#define NDKMAP
Definition: sunlabel.h:29
#define V_ROOT
Definition: sunlabel.h:64

Referenced by make_sun_label().

◆ genboot_size()

LOCAL int genboot_size ( UInt32_t  starting_extent)

Definition at line 515 of file boot.c.

517{
518 if (last_extent > (session_start + 1))
519 comerrno(EX_BAD, _("Cannot create generic boot on offset != 0.\n"));
521 return (0);
522}
EXPORT void comerrno(int err, char *msg, va_alist)
Definition: comerr.c:137
#define _(X)
Definition: i386-dis.c:35
UInt32_t session_start
Definition: mkisofs.c:77
UInt32_t last_extent
Definition: mkisofs.c:76
#define EX_BAD
Definition: standard.h:62

◆ genboot_write()

LOCAL int genboot_write ( FILE outfile)

Definition at line 529 of file boot.c.

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}
#define O_BINARY
Definition: acwin.h:109
#define read
Definition: acwin.h:96
#define O_RDONLY
Definition: acwin.h:108
#define open
Definition: acwin.h:95
#define close
Definition: acwin.h:98
#define SECTOR_SIZE
Definition: fs.h:22
EXPORT void comerr(char *msg, va_alist)
Definition: comerr.c:84
#define FALSE
Definition: types.h:117
GLuint buffer
Definition: glext.h:5915
GLfloat f
Definition: glext.h:7540
#define f
Definition: ke_i.h:83
char * genboot_image
Definition: mkisofs.c:170
UInt32_t last_extent_written
Definition: write.c:303
#define memset(x, y, z)
Definition: compat.h:39
EXPORT void xfwrite(void *buffer, int size, int count, FILE *file, int submode, BOOL islast)
Definition: write.c:168
static FILE * outfile
Definition: wrjpgcom.c:81

◆ init_sparc_label()

LOCAL void init_sparc_label ( )

Definition at line 63 of file boot.c.

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}
#define CD_NCYL
Definition: sunlabel.h:50
#define DKL_MAGIC_1
Definition: sunlabel.h:33
#define DKL_MAGIC_0
Definition: sunlabel.h:32
#define CD_PCYL
Definition: sunlabel.h:47
#define CD_NHEAD
Definition: sunlabel.h:52
#define CD_INTRLV
Definition: sunlabel.h:49
#define CD_APC
Definition: sunlabel.h:48
#define VTOC_SANE
Definition: sunlabel.h:62
#define V_VERSION
Definition: sunlabel.h:61
#define CD_ACYL
Definition: sunlabel.h:51
#define CD_NSECT
Definition: sunlabel.h:53
#define CD_RPM
Definition: sunlabel.h:46

Referenced by scan_sparc_boot().

◆ init_sunx86_label()

LOCAL void init_sunx86_label ( )

Definition at line 83 of file boot.c.

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
93 li_to_2_byte(sx86_label.dkl_bcyl, 0);
94
98 li_to_2_byte(sx86_label.dkl_skew, 0);
101
102 li_to_2_byte(sx86_label.dkl_write_reinstruct, 0);
103 li_to_2_byte(sx86_label.dkl_read_reinstruct, 0);
104
106}
#define li_to_2_byte(a, i)
Definition: intcvt.h:80
#define li_to_4_byte(a, i)
Definition: intcvt.h:87
LOCAL struct x86_label sx86_label
Definition: boot.c:38
#define DKL_MAGIC
Definition: sunlabel.h:31
#define NX86MAP
Definition: sunlabel.h:30

Referenced by scan_sunx86_boot().

◆ make_sun_label()

EXPORT int make_sun_label ( )

Definition at line 243 of file boot.c.

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') {
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}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define NULL
Definition: types.h:112
GLfloat GLfloat p
Definition: glext.h:8902
static UINT UINT last
Definition: font.c:45
#define roundup(x, y)
Definition: multi.c:48
LOCAL void dup_sun_label(int part)
Definition: boot.c:347
LOCAL char * boot_files[NDKMAP]
Definition: boot.c:40
#define CD_CYLSIZE
Definition: sunlabel.h:59

Referenced by main().

◆ make_sunx86_label()

EXPORT int make_sunx86_label ( )

Definition at line 287 of file boot.c.

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}
#define la_to_4_byte(a)
Definition: intcvt.h:112
LOCAL struct pc_part fdisk_part
Definition: boot.c:39
#define TYPE_SOLARIS
Definition: sunlabel.h:183
#define STATUS_ACTIVE
Definition: sunlabel.h:174

Referenced by main().

◆ scan_sparc_boot()

EXPORT int scan_sparc_boot ( char files)

Definition at line 133 of file boot.c.

135{
136 char *p;
137 int i = 1;
138 struct stat statbuf;
139 int status;
140extern int use_sparcboot;
141extern int use_sunx86boot;
142
143 if (use_sunx86boot)
145 _("-sparc-boot and -sunx86-boot are mutual exclusive.\n"));
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}
char * strchr(const char *String, int ch)
Definition: utclib.c:501
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
int use_sparcboot
Definition: mkisofs.c:107
#define R_OK
Definition: io.h:171
int use_sunx86boot
Definition: mkisofs.c:108
LOCAL void init_sparc_label()
Definition: boot.c:63
EXPORT int stat_filter(char *path, struct stat *st)
Definition: tree.c:232
Definition: stat.h:55
Definition: ps.c:97
#define V_USR
Definition: sunlabel.h:65

◆ scan_sunx86_boot()

EXPORT int scan_sunx86_boot ( char files)

Definition at line 182 of file boot.c.

184{
185 char *p;
186 int i = 0;
187 struct stat statbuf;
188 int status;
189extern int use_sparcboot;
190extern int use_sunx86boot;
191
192 if (use_sparcboot)
194 _("-sparc-boot and -sunx86-boot are mutual exclusive.\n"));
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}
LOCAL void init_sunx86_label()
Definition: boot.c:83

◆ sparc_boot_label()

EXPORT int sparc_boot_label ( char label)

Definition at line 112 of file boot.c.

114{
115 strncpy(cd_label.dkl_ascilabel, label, 127);
116 cd_label.dkl_ascilabel[127] = '\0';
117 return (1);
118}
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
static const WCHAR label[]
Definition: itemdlg.c:1546

◆ sunboot_write()

LOCAL int sunboot_write ( FILE outfile)

Definition at line 373 of file boot.c.

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}
GLdouble n
Definition: glext.h:7729
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)

◆ sunlabel_size()

LOCAL int sunlabel_size ( UInt32_t  starting_extent)

Definition at line 438 of file boot.c.

440{
442 comerrno(EX_BAD, _("Cannot create sparc boot on offset != 0.\n"));
443 last_extent++;
444 return (0);
445}

◆ sunlabel_write()

LOCAL int sunlabel_write ( FILE outfile)

Definition at line 454 of file boot.c.

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}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define CD_X86LABEL
Definition: sunlabel.h:36
#define CD_DEFLABEL
Definition: sunlabel.h:35
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

◆ sunx86_boot_label()

EXPORT int sunx86_boot_label ( char label)

Definition at line 121 of file boot.c.

123{
124 strncpy(sx86_label.dkl_vtoc.v_asciilabel, label, 127);
125 sx86_label.dkl_vtoc.v_asciilabel[127] = '\0';
126 return (1);
127}

Variable Documentation

◆ boot_files

LOCAL char* boot_files[NDKMAP]

Definition at line 40 of file boot.c.

Referenced by make_sun_label(), scan_sparc_boot(), scan_sunx86_boot(), and sunboot_write().

◆ cd_label

◆ fdisk_part

LOCAL struct pc_part fdisk_part

Definition at line 39 of file boot.c.

Referenced by make_sunx86_label(), and sunlabel_write().

◆ genboot_desc

struct output_fragment genboot_desc = {NULL, genboot_size, NULL, genboot_write, "Generic Boot" }

Definition at line 555 of file boot.c.

Referenced by main().

◆ sccsid

UConst char sccsid[]
static
Initial value:
=
"@(#)boot.c 1.28 16/10/23 Copyright 1999-2016 J. Schilling"

Definition at line 4 of file boot.c.

◆ sunboot_desc

struct output_fragment sunboot_desc = {NULL, NULL, NULL, sunboot_write, "Sun Boot" }

Definition at line 553 of file boot.c.

Referenced by main().

◆ sunlabel_desc

struct output_fragment sunlabel_desc = {NULL, sunlabel_size, NULL, sunlabel_write, "Sun Disk Label" }

Definition at line 554 of file boot.c.

Referenced by main().

◆ sx86_label

◆ use_sunx86boot

int use_sunx86boot
extern

Definition at line 108 of file mkisofs.c.

Referenced by main(), scan_sparc_boot(), scan_sunx86_boot(), sunboot_write(), and sunlabel_write().