In v2, the esp was loaded from a global variable defined in another module. We're running in CAR, no global variables, so what I do is copy the secondary_start to low 1M, as before, but put the stackpointer right before the start of the code.
hence:
/* Set the stack pointer */
movl _secondary_start, %esp
movl $_secondary_start-4,%eax
movl 0x0(%eax),%esp
So the C code running on the BSP will put the stack pointer value right before the code. This (ought to) work -- secondary start is in ram at (for now) 0x5000.
I've verified that we're at least starting core1, but something else is going wrong. Not yet sure what.
Also I guess it's time to make printk smp-safe.
ron