#define CONFIG_FILE_NAME "yaboot.conf"
#define CONFIG_FILE_MAX 0x8000 /* 32k */
+#define MESSAGE_FILE_MAX 2048
+
#ifdef USE_MD5_PASSWORDS
#include "md5.h"
#endif /* USE_MD5_PASSWORDS */
{
int result;
void* malloc_base = NULL;
- unsigned long addr;
prom_handle root;
/* OF seems to do it, but I'm not very confident */
prom_init ((prom_entry) r5);
/* Allocate some memory for malloc'ator */
- for (addr = MALLOCADDR; addr <= MALLOCADDR * 16 ;addr+=0x100000) {
- malloc_base = prom_claim((void *)addr, MALLOCSIZE, 0);
- if (malloc_base != (void *)-1) break;
- }
+ malloc_base = prom_claim_chunk((void *)MALLOCADDR, MALLOCSIZE, 0);
if (malloc_base == (void *)-1) {
prom_printf("Can't claim malloc buffer (%d bytes at 0x%08x)\n",
MALLOCSIZE, MALLOCADDR);
} else
opened = 1;
- msg = malloc(2001);
+ msg = malloc(MESSAGE_FILE_MAX + 1);
if (!msg)
goto done;
else
- memset(msg, 0, 2001);
+ memset(msg, 0, MESSAGE_FILE_MAX + 1);
- if (file.fs->read(&file, 2000, msg) <= 0)
+ if (file.fs->read(&file, MESSAGE_FILE_MAX, msg) <= 0)
goto done;
else
prom_printf("%s", msg);
/* check if user seted to use a initrd file from boot console */
if (!definitrd && p != manualinitrd) {
- if (manualinitrd[0] != "/" && (prom_get_devtype(defdevice_bak) != FILE_DEVICE_NET)) {
+ if (manualinitrd[0] != '/' && (prom_get_devtype(defdevice_bak) != FILE_DEVICE_NET)) {
strcpy(initrdpath, "/");
strcat(initrdpath, manualinitrd);
} else
void
yaboot_text_ui(void)
{
-#define MAX_HEADERS 32
-
struct boot_file_t file;
int result;
static struct boot_param_t params;
loadinfo->entry = e->e_entry;
- if (e->e_phnum > MAX_HEADERS) {
- prom_printf ("Can only load kernels with one program header\n");
- goto bail;
- }
-
ph = (Elf32_Phdr *)malloc(sizeof(Elf32_Phdr) * e->e_phnum);
if (!ph) {
prom_printf ("Malloc error\n");
loadinfo->entry = e->e_entry;
- if (e->e_phnum > MAX_HEADERS) {
- prom_printf ("Can only load kernels with one program header\n");
- goto bail;
- }
-
ph = (Elf64_Phdr *)malloc(sizeof(Elf64_Phdr) * e->e_phnum);
if (!ph) {
prom_printf ("Malloc error\n");