Changeset View
Changeset View
Standalone View
Standalone View
stand/i386/gptboot/gptboot.c
Show All 20 Lines | |||||
#include <sys/dirent.h> | #include <sys/dirent.h> | ||||
#include <sys/reboot.h> | #include <sys/reboot.h> | ||||
#include <machine/bootinfo.h> | #include <machine/bootinfo.h> | ||||
#include <machine/elf.h> | #include <machine/elf.h> | ||||
#include <machine/pc/bios.h> | #include <machine/pc/bios.h> | ||||
#include <machine/psl.h> | #include <machine/psl.h> | ||||
#include <ufs/ffs/fs.h> | |||||
#include <stdarg.h> | #include <stdarg.h> | ||||
#include <a.out.h> | #include <a.out.h> | ||||
#include <btxv86.h> | #include <btxv86.h> | ||||
#include "stand.h" | #include "stand.h" | ||||
#include "bootargs.h" | #include "bootargs.h" | ||||
#include "lib.h" | #include "lib.h" | ||||
#include "rbx.h" | #include "rbx.h" | ||||
#include "drv.h" | #include "drv.h" | ||||
#include "cons.h" | #include "cons.h" | ||||
#include "gpt.h" | #include "gpt.h" | ||||
#include "paths.h" | #include "paths.h" | ||||
#include "ufsread.h" | |||||
#define ARGS 0x900 | #define ARGS 0x900 | ||||
#define NOPT 14 | #define NOPT 14 | ||||
#define NDEV 3 | #define NDEV 3 | ||||
#define MEM_BASE 0x12 | #define MEM_BASE 0x12 | ||||
#define MEM_EXT 0x15 | #define MEM_EXT 0x15 | ||||
#define DRV_HARD 0x80 | #define DRV_HARD 0x80 | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* The minimum amount of memory to reserve in bios_extmem for the heap. | * The minimum amount of memory to reserve in bios_extmem for the heap. | ||||
*/ | */ | ||||
#define HEAP_MIN (3 * 1024 * 1024) | #define HEAP_MIN (3 * 1024 * 1024) | ||||
static char *heap_next; | static char *heap_next; | ||||
static char *heap_end; | static char *heap_end; | ||||
int dskread(void *, daddr_t, unsigned); | |||||
static void load(void); | static void load(void); | ||||
static int parse_cmds(char *, int *); | static int parse_cmds(char *, int *); | ||||
static int dskread(void *, daddr_t, unsigned); | |||||
#ifdef LOADER_GELI_SUPPORT | #ifdef LOADER_GELI_SUPPORT | ||||
static int vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, | static int vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, | ||||
size_t bytes); | size_t bytes); | ||||
#endif | #endif | ||||
#include "ufsread.c" | |||||
#include "gpt.c" | #include "gpt.c" | ||||
#ifdef LOADER_GELI_SUPPORT | #ifdef LOADER_GELI_SUPPORT | ||||
#include "geliboot.c" | #include "geliboot.c" | ||||
static char gelipw[GELI_PW_MAXLEN]; | static char gelipw[GELI_PW_MAXLEN]; | ||||
static struct keybuf *gelibuf; | static struct keybuf *gelibuf; | ||||
#endif | #endif | ||||
static inline int | static inline int | ||||
▲ Show 20 Lines • Show All 447 Lines • ▼ Show 20 Lines | if (c == '-') { | ||||
memcpy(kname, arg, i + 1); | memcpy(kname, arg, i + 1); | ||||
} | } | ||||
} | } | ||||
arg = p; | arg = p; | ||||
} | } | ||||
return 0; | return 0; | ||||
} | } | ||||
static int | int | ||||
dskread(void *buf, daddr_t lba, unsigned nblk) | dskread(void *buf, daddr_t lba, unsigned nblk) | ||||
{ | { | ||||
int err; | int err; | ||||
err = drvread(&dsk, buf, lba + dsk.start, nblk); | err = drvread(&dsk, buf, lba + dsk.start, nblk); | ||||
#ifdef LOADER_GELI_SUPPORT | #ifdef LOADER_GELI_SUPPORT | ||||
if (err == 0 && is_geli(&dsk) == 0) { | if (err == 0 && is_geli(&dsk) == 0) { | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |