Re: Tracking down problem with booting large kernels (bug in locore.s)
Richard Todd wrote: In message [EMAIL PROTECTED], Peter Wemm writes: Richard Todd wrote: No crashes as of here pushl $begin /* jump to high virtualized add ress */ ret /* now running relocated at KERNBASE where the system is linked to run */ begin: crashes before it gets here!!! /* set up bootstrap stack */ movlproc0paddr,%eax /* location of in-kernel pages */ I have some suspicions.. Can you do a nm on your kernel? peter@daintree[8:41pm]~-102 nm /boot/kernel/kernel |grep begin c0123689 t begin Sure. A working kernel (the one I'm booted off of now) shows: 55 ichotolot ~[11:49PM] Z% nm /boot/kernel.good5/kernel | grep begin c0128c79 t begin c0368b3f t mp_begin and one that crashes shows: 56 ichotolot ~[11:50PM] Z% nm /boot/kernel.old/kernel | grep begin c01290a9 t begin c038d49f t mp_begin Now I am confused. I can't see any logical reason why the jump to "begin" should fail like that... It is only ~168K into the text section... Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Tracking down problem with booting large kernels (bug in locore.s)
Peter Wemm wrote: Richard Todd wrote: In message [EMAIL PROTECTED], Peter Wemm write s: Richard Todd wrote: No crashes as of here pushl $begin /* jump to high virtualized add ress */ ret /* now running relocated at KERNBASE where the system is linked to run * / begin: crashes before it gets here!!! /* set up bootstrap stack */ movlproc0paddr,%eax /* location of in-kernel pages */ I have some suspicions.. Can you do a nm on your kernel? peter@daintree[8:41pm]~-102 nm /boot/kernel/kernel |grep begin c0123689 t begin Sure. A working kernel (the one I'm booted off of now) shows: 55 ichotolot ~[11:49PM] Z% nm /boot/kernel.good5/kernel | grep begin c0128c79 t begin c0368b3f t mp_begin and one that crashes shows: 56 ichotolot ~[11:50PM] Z% nm /boot/kernel.old/kernel | grep begin c01290a9 t begin c038d49f t mp_begin Now I am confused. I can't see any logical reason why the jump to "begin" should fail like that... It is only ~168K into the text section... Actually, now I understand it completely. The problem was the location of the stack. If text was too large, the stack (in the data segment) got pushed beyond the limit of the temporary 4MB P==V mapping during boot. This is (fortunately) an easy fix. SMP suffers the same problem during AP bootstrap and needs fixing there. I've known about the SMP one for a while. Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Tracking down problem with booting large kernels (bug in locore.s)
Richard Todd wrote: No crashes as of here pushl $begin /* jump to high virtualized add ress */ ret /* now running relocated at KERNBASE where the system is linked to run */ begin: crashes before it gets here!!! /* set up bootstrap stack */ movlproc0paddr,%eax /* location of in-kernel pages */ I have some suspicions.. Can you do a nm on your kernel? peter@daintree[8:41pm]~-102 nm /boot/kernel/kernel |grep begin c0123689 t begin .. and let us know where "begin" is on your crashing kernel? Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Tracking down problem with booting large kernels (bug in locore.s)
Richard Todd wrote: [..] The pushl and ret is where the boot code is jumping to "begin:" at its proper virtual address after the page tables are setup. I'm guessing that create_pagetables is somehow losing and creating bogus page tables such that the jump to the kernel virtual address space goes into deep space somewhere, but frankly the details of page tables on the i386 are beyond my expertise. So I'm posting this in hopes that someone on here *does* know enough to figur e out what's going wrong when the kernel size is sufficiently large. Just a thought.. You might try this: Index: locore.s === RCS file: /home/ncvs/src/sys/i386/i386/locore.s,v retrieving revision 1.142 diff -u -r1.142 locore.s --- locore.s2001/02/25 07:44:39 1.142 +++ locore.s2001/03/14 04:46:27 @@ -889,7 +889,7 @@ /* install a pde for temporary double map of bottom of VA */ movlR(KPTphys), %eax xorl%ebx, %ebx - movl$1, %ecx + movl$NKPT, %ecx fillkpt(R(IdlePTD), $PG_RW) /* install pde's for pt's */ And see if you get past it. (Sorry for the xterm cut/paste spam). Dont run with this if it does get past it, or badness will result as the temporary mappings wont be turned off and you'll leave yourself a massive root exploitable hole. This is just a hunch to see if it gets you past *that specific point*. If so, a proper fix is pretty trivial from there. No guarantees as to whether this will even boot though. :-] Cheers, -Peter -- Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: Tracking down problem with booting large kernels (bug in locore.s)
In message [EMAIL PROTECTED], Peter Wemm writes: Richard Todd wrote: No crashes as of here pushl $begin /* jump to high virtualized add ress */ ret /* now running relocated at KERNBASE where the system is linked to run */ begin: crashes before it gets here!!! /* set up bootstrap stack */ movlproc0paddr,%eax /* location of in-kernel pages */ I have some suspicions.. Can you do a nm on your kernel? peter@daintree[8:41pm]~-102 nm /boot/kernel/kernel |grep begin c0123689 t begin Sure. A working kernel (the one I'm booted off of now) shows: 55 ichotolot ~[11:49PM] Z% nm /boot/kernel.good5/kernel | grep begin c0128c79 t begin c0368b3f t mp_begin and one that crashes shows: 56 ichotolot ~[11:50PM] Z% nm /boot/kernel.old/kernel | grep begin c01290a9 t begin c038d49f t mp_begin To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message