Binary files yaboot-1.3.6.orig/second/.yaboot.c.swp and yaboot-1.3.6/second/.yaboot.c.swp differ diff -uNr yaboot-1.3.6.orig/second/file.c yaboot-1.3.6/second/file.c --- yaboot-1.3.6.orig/second/file.c Sat Dec 1 03:58:10 2001 +++ yaboot-1.3.6/second/file.c Fri Mar 15 15:40:42 2002 @@ -166,8 +166,13 @@ p->part_number, p->part_start, p->part_size ); if (partition == -1) { file->fs = fs_open( file, dev_name, p, file_name ); +#if 0 if (file->fs != NULL) goto bail; +#else + if(fserrorno==FILE_ERR_OK) + goto bail; +#endif } if ((partition >= 0) && (partition == p->part_number)) found = p; diff -uNr yaboot-1.3.6.orig/second/fs_ext2.c yaboot-1.3.6/second/fs_ext2.c --- yaboot-1.3.6.orig/second/fs_ext2.c Sat Dec 1 03:58:10 2001 +++ yaboot-1.3.6/second/fs_ext2.c Fri Mar 15 14:48:13 2002 @@ -159,7 +159,14 @@ /* Open the OF device for the entire disk */ strncpy(buffer, dev_name, 1020); - strcat(buffer, ":0"); + + /* on pop I think this is wrong + strcat(buffer, ":0"); + instead it should be :x where x == partition number */ + + strcat(buffer, ":3"); + + DEBUG_F("<%s>\n", buffer); diff -uNr yaboot-1.3.6.orig/second/fs_of.c yaboot-1.3.6/second/fs_of.c --- yaboot-1.3.6.orig/second/fs_of.c Sat Dec 1 03:58:10 2001 +++ yaboot-1.3.6/second/fs_of.c Fri Mar 15 16:32:58 2002 @@ -89,12 +89,12 @@ DEBUG_OPEN; strncpy(buffer, dev_name, 768); - strcat(buffer, ":"); - if (part) { + strcat(buffer, ":1"); + /* if (part) { char pn[3]; sprintf(pn, "%02d", part->part_number); strcat(buffer, pn); - } + } */ if (file_name && strlen(file_name)) { if (part) strcat(buffer, ","); diff -uNr yaboot-1.3.6.orig/second/prom.c yaboot-1.3.6/second/prom.c --- yaboot-1.3.6.orig/second/prom.c Sat Dec 1 03:58:10 2001 +++ yaboot-1.3.6/second/prom.c Fri Mar 15 14:02:02 2002 @@ -223,6 +223,7 @@ prom_printf ("Adding OF methods...\n"); #endif +#if 0 prom_interpret ( /* All values in this forth code are in hex */ "hex " @@ -257,7 +258,7 @@ ": ^mem mem# $CM ; " ": ^mmu mmu# $CM ; " ); - +#endif DEBUG_F("OF interface initialized.\n"); } diff -uNr yaboot-1.3.6.orig/second/yaboot.c yaboot-1.3.6/second/yaboot.c --- yaboot-1.3.6.orig/second/yaboot.c Sat Dec 1 03:58:10 2001 +++ yaboot-1.3.6/second/yaboot.c Tue Mar 19 18:26:08 2002 @@ -55,7 +55,7 @@ #include "bootinfo.h" #include "debug.h" -#define CONFIG_FILE_NAME "yaboot.conf" +#define CONFIG_FILE_NAME "yaboot.cnf" #define CONFIG_FILE_MAX 0x8000 /* 32k */ #ifdef USE_MD5_PASSWORDS @@ -194,7 +194,8 @@ prom_init ((prom_entry) r5); /* Allocate some memory for malloc'ator */ - malloc_base = prom_claim((void *)MALLOCADDR, MALLOCSIZE, 0); +/* malloc_base = prom_claim((void *)MALLOCADDR, MALLOCSIZE, 0); */ + malloc_base = prom_claim((void *)0, MALLOCSIZE, 4); if (malloc_base == (void *)-1) { prom_printf("Can't claim malloc buffer (%d bytes at 0x%08x)\n", MALLOCSIZE, MALLOCADDR); @@ -383,10 +384,10 @@ DEBUG_F("Config file successfully parsed, %d bytes\n", sz); /* Now, we do the initialisations stored in the config file */ +#if 0 p = cfg_get_strg(0, "init-code"); if (p) prom_interpret(p); - password = cfg_get_strg(0, "password"); #ifdef CONFIG_COLOR_TEXT @@ -419,10 +420,14 @@ prom_interpret(temp); } #endif /* CONFIG_COLOR_TEXT */ - +#endif +#if 0 p = cfg_get_strg(0, "init-message"); if (p) prom_printf("%s\n", p); +#endif + + prom_printf("TAG 1\n"); p = cfg_get_strg(0, "message"); if (p) @@ -941,22 +946,25 @@ * can't tell the size it will be so we claim an arbitrary amount * of 4Mb. */ - if (flat_vmlinux && params.rd.file) { - if(strlen(boot.file) && !strcmp(boot.file,"\\\\") && params.rd.file[0] != '/' + if (flat_vmlinux && params.rd.file) { + if(strlen(boot.file) && !strcmp(boot.file,"\\\\") && params.rd.file[0] != '/' && params.kernel.file[0] != '\\') - { - if (loc) free(loc); - loc=(char*)malloc(strlen(params.rd.file)+3); - if (!loc) { - prom_printf ("Malloc error\n"); - goto next; - } - strcpy(loc,boot.file); - strcat(loc,params.rd.file); - free(params.rd.file); - params.rd.file=loc; - } + { + if (loc) free(loc); + loc=(char*)malloc(strlen(params.rd.file)+3); + if (!loc) { + prom_printf ("Malloc error\n"); + goto next; + } + strcpy(loc,boot.file); + strcat(loc,params.rd.file); + free(params.rd.file); + params.rd.file=loc; + } + prom_printf("load rd %s\n", params.rd.file); prom_printf("Loading ramdisk...\n"); + prom_printf("load rd %s from dev\n", params.rd.dev); + params.rd.part=params.kernel.part; result = open_file(¶ms.rd, &file); if (result != FILE_ERR_OK) { prom_printf("%s:%d,", params.rd.dev, params.rd.part); @@ -964,18 +972,23 @@ } else { #define INITRD_CHUNKSIZE 0x400000 - initrd_base = prom_claim(loadinfo.base+loadinfo.memsize, INITRD_CHUNKSIZE, 0); + /* initrd_base = prom_claim(loadinfo.base+loadinfo.memsize, INITRD_CHUNKSIZE, 0); */ + /* alloc 8 meg for a ram disk ... dangerous I know.... */ + initrd_base = prom_claim(loadinfo.base+loadinfo.memsize, 8000000,0); if (initrd_base == (void *)-1) { prom_printf("Claim failed for initrd memory\n"); initrd_base = 0; } else { - initrd_size = file.fs->read(&file, INITRD_CHUNKSIZE, initrd_base); + initrd_size = file.fs->read(&file, 8000000, initrd_base); if (initrd_size == 0) initrd_base = 0; +#if 0 initrd_read = initrd_size; initrd_more = initrd_base; + while (initrd_read == INITRD_CHUNKSIZE ) { /* need to read more? */ initrd_want = (void *)((unsigned long)initrd_more+INITRD_CHUNKSIZE); + /* malloc_base = prom_claim((void *)0, MALLOCSIZE, 4); */ initrd_more = prom_claim(initrd_want, INITRD_CHUNKSIZE, 0); if (initrd_more != initrd_want) { prom_printf("Claim failed for initrd memory at %p rc=%p\n",initrd_want,initrd_more); @@ -985,6 +998,7 @@ DEBUG_F(" block at %p rc=%lu\n",initrd_more,initrd_read); initrd_size += initrd_read; } +#endif } file.fs->close(&file); memset(&file, 0, sizeof(file)); @@ -1352,6 +1366,24 @@ { Elf32_Ehdr *e = &(loadinfo->elf.elf32hdr); + /*let's print what we have */ + if (e->e_ident[EI_MAG0] == ELFMAG0) + prom_printf("EI_MAG0\n"); + if (e->e_ident[EI_MAG1] == ELFMAG1) + prom_printf("EI_MAG1\n"); + if (e->e_ident[EI_MAG2] == ELFMAG2) + prom_printf("EI_MAG2\n"); + if (e->e_ident[EI_MAG3] == ELFMAG3) + prom_printf("EI_MAG3\n"); + if (e->e_ident[EI_CLASS] == ELFCLASS32) + prom_printf("EI_CLASS\n"); + if (e->e_ident[EI_DATA] == ELFDATA2MSB) + prom_printf("ELFDATA\n"); + if (e->e_type == ET_EXEC) + prom_printf("ET_EXEC\n"); + if (e->e_machine == EM_PPC) + prom_printf("EM_PPC\n"); + return (e->e_ident[EI_MAG0] == ELFMAG0 && e->e_ident[EI_MAG1] == ELFMAG1 && e->e_ident[EI_MAG2] == ELFMAG2 && @@ -1501,6 +1533,13 @@ } DEBUG_F("After pmac path kludgeup: dev=%s, part=%d, file=%s\n", boot.dev, boot.part, boot.file); + + boot.part=-1; /* ok this part is mighty messed up, you can't assume + for pop that just because you made a partition reference + in your bootpath, that that partition is in fact where + everything is... see on pop that's an MSDOS FAT16 piece of + of trash and well... who wants to add the code to + deal with trash? -- not I! */ useconf = load_config_file(boot.dev, boot.file, boot.part);