#include <stdio.h>#include <stddef.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/ioctl.h>#include <stdlib.h>#include <unistd.h>#include <fcntl.h>#include <string.h>#include <errno.h>#include <dirent.h>#include <a.out.h>#include <minix/config.h>#include <minix/const.h>#include <minix/partition.h>#include <minix/u64.h>#include "rawfs.h"#include "image.h"Include dependency graph for installboot.c:

Go to the source code of this file.
Defines | |
| #define | nil 0 |
| #define | _POSIX_SOURCE 1 |
| #define | _MINIX 1 |
| #define | BOOTBLOCK 0 |
| #define | SECTOR_SIZE 512 |
| #define | RATIO(b) ((b)/SECTOR_SIZE) |
| #define | SIGNATURE 0xAA55 |
| #define | BOOT_MAX 64 |
| #define | SIGPOS 510 |
| #define | PARTPOS 446 |
| #define | between(a, c, z) ((unsigned) ((c) - (a)) <= ((z) - (a))) |
| #define | control(c) between('\0', (c), '\37') |
| #define | BOOT_BLOCK_SIZE 1024 |
| #define | align(n) (((n) + ((SECTOR_SIZE) - 1)) & ~((SECTOR_SIZE) - 1)) |
Enumerations | |
| enum | howto { FS, BOOT } |
Functions | |
| void | report (char *label) |
| void | fatal (char *label) |
| char * | basename (char *name) |
| void | bread (FILE *f, char *name, void *buf, size_t len) |
| void | bwrite (FILE *f, char *name, void *buf, size_t len) |
| void | read_header (int talk, char *proc, FILE *procf, struct image_header *ihdr) |
| void | padimage (char *image, FILE *imagef, int n) |
| void | copyexec (char *proc, FILE *procf, char *image, FILE *imagef, long n) |
| void | make_image (char *image, char **procv) |
| void | extractexec (FILE *imagef, char *image, FILE *procf, char *proc, long count, off_t *alen) |
| void | extract_image (char *image) |
| void | readblock (off_t blk, char *buf, int block_size) |
| void | writeblock (off_t blk, char *buf, int block_size) |
| int | raw_install (char *file, off_t *start, off_t *len, int block_size) |
| void | make_bootable (enum howto how, char *device, char *bootblock, char *bootcode, char **imagev) |
| void | install_master (char *device, char *masterboot, char **guide) |
| void | usage (void) |
| int | isoption (char *option, char *test) |
| int | main (int argc, char **argv) |
Variables | |
| long | total_text = 0 |
| long | total_data = 0 |
| long | total_bss = 0 |
| int | making_image = 0 |
| int | rawfd |
| char * | rawdev |
|
|
Definition at line 8 of file installboot.c. |
|
|
Definition at line 7 of file installboot.c. |
|
|
Definition at line 172 of file installboot.c. |
|
|
Definition at line 38 of file installboot.c. |
|
|
Definition at line 41 of file installboot.c. Referenced by install_master(), and raw_install(). |
|
|
Definition at line 32 of file installboot.c. Referenced by make_bootable(). |
|
|
Definition at line 28 of file installboot.c. Referenced by install_master(). |
|
|
Definition at line 39 of file installboot.c. Referenced by print(). |
|
|
Definition at line 6 of file installboot.c. |
|
|
Definition at line 34 of file installboot.c. Referenced by install_master(). |
|
|
Definition at line 30 of file installboot.c. |
|
|
Definition at line 29 of file installboot.c. |
|
|
Definition at line 31 of file installboot.c. |
|
|
Definition at line 33 of file installboot.c. Referenced by install_master(). |
|
|
Definition at line 417 of file installboot.c. |
|
|
Definition at line 55 of file installboot.c. References base, bp, IM_NAME_MAX, nil, p, strchr, and strrchr(). |
|
||||||||||||||||||||
|
Definition at line 78 of file installboot.c. References exit(), f, fatal(), ferror, fprintf(), fread(), and stderr. Referenced by add_file(), copy(), extract_image(), extractexec(), install_master(), mread(), read_header(), and skip_entry(). |
|
||||||||||||||||||||
|
Definition at line 88 of file installboot.c. References f, fatal(), and fwrite(). Referenced by extract_image(), extractexec(), make_image(), and mwrite(). |
|
||||||||||||||||||||||||
|
Definition at line 174 of file installboot.c. References align, c, EOF, exit(), fatal(), ferror, fprintf(), getc, pad, padimage(), putc, and stderr. Referenced by make_image(). |
|
|
Definition at line 284 of file installboot.c. References exec::a_data, exec::a_flags, exec::a_hdrlen, A_PAL, A_SEP, exec::a_text, bread(), bwrite(), EOF, extractexec(), fatal(), fclose(), fopen(), memcpy(), nil, read_header(), S_ISREG, SECTOR_SIZE, st, stat::st_mode, stat::st_size, and stat. Referenced by main(). |
|
||||||||||||||||||||||||||||
|
Definition at line 268 of file installboot.c. References bread(), bwrite(), and SECTOR_SIZE. Referenced by extract_image(). |
|
|
||||||||||||||||
|
Definition at line 687 of file installboot.c. References _MAX_BLOCK_SIZE, exec::a_data, exec::a_text, partition::base, between, BOOT_BLOCK_SIZE, BOOTBLOCK, bread(), DIOCGETP, div64u(), exit(), fatal(), fileno(), fopen(), fprintf(), fstat, geometry, i, ioctl, memcpy(), memset(), nil, O_RDONLY, O_RDWR, offset, open, PARTPOS, image_header::process, read_header(), readblock(), S_ISBLK, SECTOR_SIZE, SIGNATURE, SIGPOS, size, st, stat::st_mode, stderr, and writeblock(). Referenced by main(). |
|
||||||||||||
|
Definition at line 795 of file installboot.c. References strcmp, and strlen(). Referenced by main(). |
|
||||||||||||
|
Definition at line 807 of file installboot.c. References exit(), extract_image(), FS, install_master(), isoption(), make_bootable(), make_image(), and usage. |
|
||||||||||||||||||||||||
|
Definition at line 419 of file installboot.c. References _MAX_BLOCK_SIZE, addr, address(), block_size, BOOT_MAX, count, dummy, exit(), fatal(), fflush(), fprintf(), fputc(), FS, image, labels, O_RDWR, open, pos, printf, r_super(), s, sector, sleep, st, stderr, and stdout. Referenced by main(). |
|
||||||||||||
|
Definition at line 195 of file installboot.c. References exec::a_data, exec::a_flags, exec::a_hdrlen, A_NSYM, A_PAL, A_SEP, exec::a_syms, exec::a_text, bwrite(), copyexec(), EISDIR, errno, fatal(), fclose(), fopen(), making_image, nil, padimage(), image_header::process, read_header(), rewind(), S_ISREG, SECTOR_SIZE, st, stat::st_mode, stat, and strchr. Referenced by main(). |
|
||||||||||||||||
|
Definition at line 163 of file installboot.c. References EOF, fatal(), and putc. Referenced by copyexec(), and make_image(). |
|
||||||||||||||||||||
|
Definition at line 362 of file installboot.c. References _MAX_BLOCK_SIZE, banner, BOOT_BLOCK_SIZE, cv64ul(), DIOCGETP, entry, f, fatal(), fclose(), ferror, file, fopen(), fprintf(), fread(), ioctl, nil, off, printf, RATIO, SECTOR_SIZE, entry::size, stderr, and writeblock(). |
|
||||||||||||||||||||
|
Definition at line 96 of file installboot.c. References exec::a_bss, exec::a_cpu, exec::a_data, exec::a_flags, exec::a_hdrlen, A_I8086, A_MINHDR, A_SEP, exec::a_text, BADMAG, banner, basename, bread(), data, exit(), fatal(), ferror, fprintf(), fread(), IM_NAME_MAX, memset(), n, nil, printf, image_header::process, stderr, strncpy(), total_bss, total_data, and total_text. Referenced by do_exec(), extract_image(), install_master(), make_image(), nm(), and strip(). |
|
||||||||||||||||
|
Definition at line 339 of file installboot.c. References exit(), fatal(), fprintf(), lseek, n, read, SEEK_SET, and stderr. |
|
|
Definition at line 43 of file installboot.c. |
|
|
Definition at line 784 of file installboot.c. |
|
||||||||||||||||
|
Definition at line 354 of file installboot.c. References fatal(), lseek, SEEK_SET, and write. Referenced by install_master(), and raw_install(). |
|
|
Definition at line 94 of file installboot.c. Referenced by make_image(). |
|
|
Definition at line 337 of file installboot.c. |
|
|
Definition at line 336 of file installboot.c. |
|
|
Definition at line 93 of file installboot.c. Referenced by read_header(). |
|
|
Definition at line 93 of file installboot.c. Referenced by read_header(). |
|
|
Definition at line 93 of file installboot.c. Referenced by read_header(). |
1.4.6