I'm not asking for an eta. I'm asking how the current development is going. I want to see what issues need to be solved before I can attempt porting it to the Z.
why ?
Sorry, i am a noob, maybe i will participate in this topic, only by watching it, good luck
I'm trying to stop every kernel interrupts before jump into new kernel.
I have fix few things like stuppid bugs in kexec_module and relocate_kernel.
I have patch from scratch doom kernel with hardboot.
Try to stop everything in a running stock kernel is hard, even from early in boot.
For eg. i need to stop all CPU (X 4)...
just for information...
compressed kernel with lzma his bigger than no lzma lol
4,1 Vs 4,15
so, i thave try :
kexec --load zImage.lzma --mem-min=0x0f00000000 --command-line="$(cat /proc/cmdline)"
debug: Focus 1 - argc '5' ; argv 'bea96754' ; kernel_buf 'b6bdf008' ; kernel_size '3f5414' ; info 'bea96528' ; i '1' ; file_type.name 'zImage'
debug: malloc - xmalloc mem_range '4511824'
Could not find a free area of memory of 3fd414 bytes...
lol ... if you could find a way to reduced size ??
+#if defined(CONFIG_KEXEC_HARDBOOT)
+static void kexec_hardboot_reserve(void)
+{
+ if (memblock_reserve(KEXEC_HARDBOOT_START, KEXEC_HARDBOOT_SIZE)) {
+ printk(KERN_ERR "Failed to reserve memory for KEXEC_HARDBOOT: "
+ "%dM@0x%.8X\n",
+ KEXEC_HARDBOOT_SIZE / SZ_1M, KEXEC_HARDBOOT_START);
+ return;
+ }
+ memblock_free(KEXEC_HARDBOOT_START, KEXEC_HARDBOOT_SIZE);
+ memblock_remove(KEXEC_HARDBOOT_START, KEXEC_HARDBOOT_SIZE);
+
+ kexec_hardboot_device.num_resources = ARRAY_SIZE(kexec_hardboot_resources);
+ kexec_hardboot_device.resource = kexec_hardboot_resources;
+}
+#endif
Hi, what is a curent status of our things? Is kexec boot kernel? Curent problems is?
Some info related to kernel. Last time when I played with kexec I found something interesting: seccond kernel (ota kernel - dumped from oem partition) booted with kexec! So that mean - host kernel loaded these stock oem kernel (seems ota kernel is allready kexec patched?
But all other kernels which I tried was not abble to load by kexec because was not kexec patched! Only kexec patched kernels was abble to boot in host kernel!). So I think before you try to load an kernel you need to patch these kernel.
You can try: try to build stock kernel, than see what is missing in .config, than enable missing defconfig things (things needed for kexec - but try to build them as a module - if something fail to build as a module, try to add them (there will be a lot of problems aka duplicate symbols, missing symbols...blabla, but I think we can get them working). I will try them soon as I get Z1 Compat.
Another thing which I found in ramdisk init script: there was a service aka kexec.dyn (have no idea whats usage of them since there was no binary in /system/bin). Maybe you can check them in your ramdisk (probably thats related to the oem kernel ramdsk - I not checked).
Some info related to kernel. Last time when I played with kexec I found something interesting: seccond kernel (ota kernel - dumped from ota partition) booted with kexec! So that mean - host kernel loaded these stock ota kernel (seems ota kernel is allready kexec patched? But all other kernels which I tried was not abble to load by kexec because was not kexec patched! Only kexec patched kernels was abble to boot in host kernel!). So I think before you try to load an kernel you need to patch these kernel. You can try: try to build stock kernel, than see what is missing in .config, than enable missing defconfig things (things needed for kexec - but try to build them as a module - if something fail to build as a module, try to add missing things (there will be a lot of problems aka duplicate symbols, missing symbols...blabla, but I think we can get them working). I will try soon as I get Z1 Compat.
Another thing which I found in ramdisk init script: there was a service aka kexec.dyn (have no idea whats usage of them since there was no these binary in /system/bin). Maybe you can check them in your ramdisk (probably thats related to the ota kernel ramdsk - I not checked).
Do you have a kernel git? Just want to see reboot code.
Are you sure it's an ota kernel ? Not a part of bootloader you run and launch the stock kernel ? (ota process ??)
If it's really a safe kernel (may be a secured kernel to unbrick device by sony), without sources it's useless... but interresting to see and to test kexec tool
Just for info I have erased these partition and I can create new partition there! So allso I think these partition can be mounted for something, for example you can store there recovery ramdisk and an kernel for booting them with kexec! If you realy need more info please search in xperia go forum (sorry, I forgot where I posted them, maybe in general section?!) where I created a thread related to custom partitioning on xperia go (changed userdata, cache...etc size, merged 2 unused partitons, increased data, created custom one...blabla!).Bootloader won't allow booting of kernels off FOTAKernel partition... Though you should be able.to use that space other wise...
Sent from my C6902 using xda app-developers app
Just for info I have erased these partition and I can create new partition there! So allso I think these partition can be mounted for something, for example you can store there recovery ramdisk and an kernel for booting them with kexec! If you realy need more info please search in xperia go forum (sorry, I forgot where I posted them, maybe in general section?!) where I created a thread related to custom partitioning on xperia go (changed userdata, cache...etc size, merged 2 unused partitons, increased data, created custom one...blabla!).
Edit:
found my post -> http://xdaforums.com/showthread.php?t=2418241&page=8
[ 5.787506] init: cannot find '/system/xbin/kexec.dyn', disabling 'kexec'
My kernel already support sola,go,p,u and kexec allready working on these phones! Please find a proper thread to post any question since our thread is for Z1 only! Search in P forum for kexec thread!
echo 0 > /proc/sys/kernel/dmesg_restrict
echo 0 > /proc/sys/kernel/kptr_restrict
cat /proc/kallsyms
# uname -r
# strings kexec_load.ko | grep vermagic
vermagic=3.4.0-perf-g66807d4-02450-g9a218f1 SMP preempt mod_unload modversions ARMv7
"include/config/kernel.release" and add :
"3.4.0-perf-g66807d4-02450-g9a218f1"
sed -i 's/\x32\x76\x86\x29/\x72\xFF\x5E\x20/' procfs_rw.ko
sed -i 's/\x32\x76\x86\x29/\x72\xFF\x5E\x20/' kexec_load.ko
sed -i 's/\xBB\xD0\xF8\x4D/\x0E\x1C\x63\x77/' kexec_load.ko
sed -i 's/\xA6\x26\x81\x1A/\xD4\x56\x02\x7E/' kexec_load.ko
sed -i 's/\xA3\xD1\xEC\x96/\xEC\x43\x28\x1A/' kexec_load.ko
sed -i 's/\x8C\xE6\x6A\x5F/\x3D\xDF\x02\xF2/' kexec_load.ko
sed -i 's/\x3E\xF3\xEF\xE9/\x18\x7F\xA6\x8A/' kexec_load.ko
sed -i 's/\x8B\xD2\x92\x10/\xC8\x19\x08\x9C/' kexec_load.ko
sed -i 's/\x1C\xE8\x18\xE1/\x7C\x71\x9E\xEF/' kexec_load.ko
sed -i 's/\xAB\x2C\x2F\x8B/\x8E\xD7\x63\xC0/' kexec_load.ko
sed -i 's/\xF5\x62\xAA\x4B/\x34\x80\x1B\x74/' kexec_load.ko
sed -i 's/\x00\x52\xD6\xD7/\x6F\x80\x91\x20/' kexec_load.ko
sed -i 's/\x4F\x77\x57\x6A/\x0C\x57\xC7\x63/' kexec_load.ko
sed -i 's/\xCA\x2F\x65\x71/\x92\xB8\x7F\x53/' kexec_load.ko
sed -i 's/\x0F\xD0\xA0\x91/\xFA\x80\x15\xB4/' kexec_load.ko
sed -i 's/\x29\xA0\x6D\x48/\x6C\x6B\x96\x54/' kexec_load.ko
sed -i 's/\x6D\x1F\x1F\x37/\xCC\x5E\x79\x8B/' kexec_load.ko
sed -i 's/\xFD\x23\xD0\xFB/\xE3\xE3\x68\x52/' kexec_load.ko
hexdump kexec_load.ko | grep ff72
0003d50 b0b0 80ac ff72 205e 6f6d 7564 656c 6c5f
# dmesg
# cat /proc/last_kmsg
# cat /dev/kexec_driver
You can send kernel by this communication channel.
Type following commands for help
=> echo help >/dev/kexec_driver
=> dmesg | grep Kexec
# echo help >/dev/kexec_driver
# cat /dev/kexec_driver
Last command : 'help'
Please type following command :
=> dmesg|grep Kexec
# dmesg|grep Kexec
<4>[15050.521628] Kexec: Starting kexec_module...
<6>[15050.521656] Kexec: kexec_driver_contener allocation
<6>[15050.521673] Kexec: kexec_memory_buffer allocation
<4>[15050.521691] Kexec:----------------------------------------------------
<4>[15050.521710] Kexec: kexec_driver created with major : '100'
<4>[15050.521728] Kexec: Please, prepare by typing the following commands :
<4>[15050.521746] Kexec: => mknod /dev/kexec_driver c 100 0
<4>[15050.521761] Kexec: => cat /dev/kexec_driver
<4>[15050.521775] Kexec:-----------------------------------------------------
<4>[15050.521791] Kexec: For help
<4>[15050.521803] Kexec: => echo help >/dev/kexec_driver
(...)
Attempts on Xperia P (sorry IF i noob-ed with this post)
http://xdaforums.com/showthread.php?t=2053466
Sent from my LT22i using xda app-developers app
insmod kexec_load.ko
mknod /dev/kexec_driver c 254 0
(...)
crw-rw-rw- root root 254, 0 2013-11-11 15:26 kexec_driver
just for information...
compressed kernel with lzma his bigger than no lzma lol
4,1 Vs 4,15
so, i thave try :
kexec --load zImage.lzma --mem-min=0x0f00000000 --command-line="$(cat /proc/cmdline)"
debug: Focus 1 - argc '5' ; argv 'bea96754' ; kernel_buf 'b6bdf008' ; kernel_size '3f5414' ; info 'bea96528' ; i '1' ; file_type.name 'zImage'
debug: malloc - xmalloc mem_range '4511824'
Could not find a free area of memory of 3fd414 bytes...
lol ... if you could find a way to reduced size ??
+#if defined(CONFIG_KEXEC_HARDBOOT)
+static void kexec_hardboot_reserve(void)
+{
+ if (memblock_reserve(KEXEC_HARDBOOT_START, KEXEC_HARDBOOT_SIZE)) {
+ printk(KERN_ERR "Failed to reserve memory for KEXEC_HARDBOOT: "
+ "%dM@0x%.8X\n",
+ KEXEC_HARDBOOT_SIZE / SZ_1M, KEXEC_HARDBOOT_START);
+ return;
+ }
+ memblock_free(KEXEC_HARDBOOT_START, KEXEC_HARDBOOT_SIZE);
+ memblock_remove(KEXEC_HARDBOOT_START, KEXEC_HARDBOOT_SIZE);
+
+ kexec_hardboot_device.num_resources = ARRAY_SIZE(kexec_hardboot_resources);
+ kexec_hardboot_device.resource = kexec_hardboot_resources;
+}
+#endif
Excellent work Delewer!
So is it currently functional but with bugs or does it still need work before others can start testing it?
Are your tests at the moment with Sony stock kernel (i,e, DooMKernel) or with AOSP kernel (i.e. CM kernel running CM10 or equivalent)?