From: <bob...@us...> - 2007-07-15 08:33:28
|
Revision: 1151 http://svn.sourceforge.net/hackndev/?rev=1151&view=rev Author: bobofdoom Date: 2007-07-15 01:33:23 -0700 (Sun, 15 Jul 2007) Log Message: ----------- Cocoboot: Reverted initrd copy removal as it's causing trouble and didn't solve the initial problem. Modified Paths: -------------- cocoboot/trunk/Changelog cocoboot/trunk/arm/boot.c cocoboot/trunk/m68k/imgloader.c cocoboot/trunk/m68k/mainform.c Modified: cocoboot/trunk/Changelog =================================================================== --- cocoboot/trunk/Changelog 2007-07-15 08:02:12 UTC (rev 1150) +++ cocoboot/trunk/Changelog 2007-07-15 08:33:23 UTC (rev 1151) @@ -1,5 +1,3 @@ - - Removed initrd relocation for speed and reliability (suggested by phire) - version 0.3: - Added overflow-buffer as last resort to allocation problem (slapin's idea) - Cleaned up treo code (removed all #ifdefs) Modified: cocoboot/trunk/arm/boot.c =================================================================== --- cocoboot/trunk/arm/boot.c 2007-07-15 08:02:12 UTC (rev 1150) +++ cocoboot/trunk/arm/boot.c 2007-07-15 08:33:23 UTC (rev 1151) @@ -24,11 +24,9 @@ #define MACH_TYPE_T3XSCALE 829 #define TAG_OFFSET 0x100 +#define INITRD_OFFSET 0x0400000 -UInt32 make_4k_aligned(UInt32 addr) -{ - return addr + 0x1000 - (addr & 0xfff); -} +#define T3_INITRD_OFFSET 0x1500000 static void jump_to_kernel(void *kernel_base, UInt32 tag_base, UInt32 mach) { @@ -86,6 +84,7 @@ if(!kernel || !cmdline) { return 0xc0ffee; } + UInt32 initrd_offset; /* since we're going to turn off the MMU, we need to translate * all out pointers to physical addresses. @@ -102,13 +101,6 @@ return 0xbadc01a; } - /* force our pointers to be 4k aligned, imgloader will have shifted - * the image forward. - */ - kernel = (void*) make_4k_aligned((UInt32)kernel); - if (initrd) - initrd = (void*) make_4k_aligned((UInt32)initrd); - /* that includes the stack pointer ... */ asm volatile ("mov %0, sp" : "=r"(vstack) ); pstack = (void *)virt_to_phys(g, (UInt32) vstack); @@ -184,10 +176,21 @@ setup_xscale_cpu(); } + if (pg->mach_num==MACH_TYPE_T3XSCALE){ + initrd_offset=T3_INITRD_OFFSET; + } else { + initrd_offset=INITRD_OFFSET; + } + /* place kernel parameters in memory */ setup_atags(pg->ram_base + TAG_OFFSET, pg->ram_base, pg->ram_size, cmdline, - initrd, initrd_size); + pg->ram_base + initrd_offset, initrd_size); + /* copy initrd into place */ + if (initrd) { + copy_image((void*)(pg->ram_base + initrd_offset), initrd, initrd_size); + } + /* bring on the penguin! */ jump_to_kernel(kernel, pg->ram_base + TAG_OFFSET, pg->mach_num); Modified: cocoboot/trunk/m68k/imgloader.c =================================================================== --- cocoboot/trunk/m68k/imgloader.c 2007-07-15 08:02:12 UTC (rev 1150) +++ cocoboot/trunk/m68k/imgloader.c 2007-07-15 08:33:23 UTC (rev 1151) @@ -56,9 +56,6 @@ err = VFSFileOpen(vol_ref, name, vfsModeRead, &f); if(err != errNone) return -2; - /* ensure the image is 4k aligned. */ - offset = 0x1000 - (((UInt32)buffer) & 0xfff); - VFSFileReadData(f, size, buffer, offset, &bytes_read); VFSFileClose(f); @@ -154,7 +151,7 @@ } } else { /* vfs */ - return load_file(name, vol_ref, size, buffer, 0x0); + return load_file(name, vol_ref, size, buffer, 0); } out_unlock: Modified: cocoboot/trunk/m68k/mainform.c =================================================================== --- cocoboot/trunk/m68k/mainform.c 2007-07-15 08:02:12 UTC (rev 1150) +++ cocoboot/trunk/m68k/mainform.c 2007-07-15 08:33:23 UTC (rev 1151) @@ -202,7 +202,7 @@ vol = search_image(name, loc, sizeof(loc), &size); if(vol < -1) goto out; - ftr_size = size + 0x1000; /* allocate an extra 4k so we can align the image */ + ftr_size = size; while (ftr_size) { if(!(err=FtrPtrNew (CREATOR_ID, FEATURE_NUM + n, ftr_size, image))) { break; @@ -372,7 +372,7 @@ cmdline_p = FrmGetObjectPtr(form, FrmGetObjectIndex(form, CommandLine)); cmdline_th = MemHandleNew(size); cmdline_tp = MemHandleLock(cmdline_th); - StrCopy(cmdline_tp, " "); /* default value */ + StrCopy(cmdline_tp, "init=/linuxrc root=/dev/mmcblk0p2"); /* default value */ //PrefGetAppPreferences ('CcBt', 1, cmdline_tp, &size, true); MemHandleUnlock(cmdline_th); FldSetTextHandle(cmdline_p, cmdline_th); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |