ok i looked in the hpc2000 and cenet bootloader for a few mins.
i've fixed the issue. and, *maybe* now i can do reliable soft reset via software on a 900c
(and probably 900 too
) without having to press reset button.
now testing..
update: ok i've confirmed it. the thing is that the bootloaders
(any version, 900, 900c
) check for a specific flag
(actually two
) in ram when booting up and this happens before resuming CE. if the flags have a specific combination then it will change its mind about the resume and will enter reset mode. it will believe it is hard resetting but before last real check on whether soft reset or hard reset, the bootloaders check for a specific signature in ram
(my hunch right now is it is not NEC specific but CE kernel related
), and if the sig is there the "hard reset" will change to a soft reset.
(CE kernel itself also checks this sig later.
) if it is corrupt it will be a hard reset even if it was a soft reset in reality.
(i've tested that now too
)
the problem is: the hpc2000 bootloader checks for the first flags in a different place than the cenet bootloaders. thats ok most of the time because usually the bootloader sets the flags, and the kernel
(or a driver
) should not do anything with them.
but something in the hpc2000 kernel
(or a driver? lets say kernel for now
) touches a memory location that happens to be the one that the cenet bootloader stores one of its flags into. it has to be #2 to not modify the reset controller value, i.e. let it continue resuming CE instead of rebooting CE. the kernel seems to write a #0 into it when you close-open the lid without suspending.. actually it must happen only when you reopen it because if you let it suspend while closed there will be no reset, also this is more logical.
if i write #2 back into it before pressing power button after the lid close-open, it will be able to properly resume.
then..i can make this the other way around
write #0 into it before suspend and it will reset
one more press of the power button will complete the soft reset ...might find a way to make it into only one. for some reason the bootloader goes into sleep instead of continuing boot, thats why you need to press it twice.
right now, the fix for downgraded 900c's needs to be coded in a user friendly way. best way is to find what the kernel does and mod that. anyway proof of concept for now
of course making the soft reset app is easier
it would be nicer though if it didnt require an extra button press so will look into that.
(can do the suspend itself from software so that's no problem
)
note: this #0 flag works right only on 4.10 bootloader
(but works reliably!!
). it will hard reset with 4.5.1-6, will check this later.
if anyone wants to try, the address and the flags:
0xa001e868
if #0: reboot
if #2: dont change value of reset controller status register
(so if resume was in progress it will remain a resume
)
you can use test_com attached here to play.
usage:
to reboot with cenet 4.10 bootloader only
(please be aware this hard resets if the bootloader version is 4.5.1-6
):
w a001e868 0
to resume on a downgraded 900c after opening lid but before pressing power off button
(with cenet bootloader
):
w a001e868 2
Edited by cmonex 2007-09-11 8:09 AM
Attachments
----------------
test_com.exe (5KB - 2 downloads)