Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-12-2019, 08:42 PM   #1
schuhumi
Member
schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.schuhumi ought to be getting tired of karma fortunes by now.
 
Posts: 17
Karma: 222224
Join Date: Jul 2018
Device: PW3
Kernel development / no kexec syscall

Hi,

so my PW3 is on firmware 5.10.1.1 currently, and the kexec syscall is disabled (it seems like it was enabled some time ago https://wiki.mobileread.com/wiki/Kin...el_Development ). So ideally I'd like a solution that doesn't require flashing to boot another kernel (so that it can be distributed without bricking people's devices), but it should also work without a pc.

To start out I'd also like to try the tethered variant as well (I can't find it right now but I read somewhere that using the bootloader a kernel can also just be written into RAM and booted from there). This is probably the most stupid question but in this guide
Quote:
Bring the Kindle into bootloader mode by:
- Pressing the power button until power LED goes off.
- Keep on pressing power button and start pressing the "magic" key.
- Release power button while still pressing "magic" key.
- Release "magic" key.
what is the "magic key" (which seemingly was the home button on older models) on a PW3 which only has literally 1 button - the power one?

To boot another kernel without a kernel and without the kexec syscall enabled, there seems to be the possibility to make kexec a module, which can then be loaded. See this: https://github.com/amonakov/kexec-module
But I just can't get the .ko out of it. I cloned the repo besides the kernel folder (the latter I build already) and modified the Makefile for the kernel part in the following way:
Code:
[simon@yogal390 kernel]$ cat Makefile 
KDIR ?= ../../linux-3.0.35
ARCH ?= arm
MYPWD ?= /home/simon/Downloads/gplrelease/kexec-module/kernel

default: orig
	$(MAKE) -C $(KDIR) -I$(MYPWD)

orig:
	mkdir $@
	ln -s $(KDIR)/arch/$(ARCH)/kernel/relocate_kernel.S
	ln -s $(KDIR)/arch/$(ARCH)/kernel/machine_kexec.c $@/
	ln -s $(KDIR)/kernel/kexec.c $@/
And can actually compile like this (which is pretty much amazing considering this was made for another kernel version):
Code:
[simon@yogal390 kernel]$  make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- 
make -C ../../linux-3.0.35 -I/home/simon/Downloads/gplrelease/kexec-module/kernel
make[1]: Verzeichnis „/home/simon/Downloads/gplrelease/linux-3.0.35“ wird betreten
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[2]: „include/generated/mach-types.h“ ist bereits aktuell.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  Kernel: arch/arm/boot/Image is ready
  SHIPPED arch/arm/boot/compressed/lib1funcs.S
  AS      arch/arm/boot/compressed/lib1funcs.o
  LD      arch/arm/boot/compressed/vmlinux
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  Building modules, stage 2.
  MODPOST 36 modules
make[1]: Verzeichnis „/home/simon/Downloads/gplrelease/linux-3.0.35“ wird verlassen
[simon@yogal390 kernel]$ ls
built-in.o  kexec.c      kexec-mod.h      Makefile  relocate_kernel.S
Kbuild      kexec-drv.c  machine_kexec.c  orig
But no built module to be found... But maybe that's because I don't quite grasp how it should build, and it doesn't do anything with that code from the repository.

What this approach stems from is the kindle fire actually: https://forum.xda-developers.com/ama...-ford-t3270272

Has anybody toyed with stuff like this since the kexec syscall is gone? How have you gone about it? Essentially I just want to boot a kernel with the risk of permanent damage
schuhumi is offline   Reply With Quote
Old 09-13-2019, 03:02 AM   #2
encol
Addict
encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.encol ought to be getting tired of karma fortunes by now.
 
Posts: 394
Karma: 750286
Join Date: Apr 2016
Location: Italy
Device: Kindle PW3 5.8.5.0.1
As far as i remember, PW3 has no "magic key"
encol is offline   Reply With Quote
Old 09-14-2019, 01:33 PM   #3
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 12
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by encol View Post
As far as i remember, PW3 has no "magic key"
Correct. The last device with the Magic Key was the Kindle Touch. On newer devices, it's either serial port access to U-Boot -or- pre-existing jailbreak and the idme command.

Quote:
Essentially I just want to boot a kernel with the risk of permanent damage
You probably mean without the risk of permanent damage.
WaseemAlkurdi is offline   Reply With Quote
Old 09-16-2019, 10:23 AM   #4
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,182
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Both u-boot and the kernel are both network filesystem enabled.
"not requiring a pc" ::

*) use your NSS which is part of most home routers.
*) put the network filesystem on a cloud server
*) use a Linux, Mac, or (*)BSD system


PS: DO NOT put swap on the network filesystem, the Kindle kernels are not configured to support such use (we have threads on that subject here).
knc1 is offline   Reply With Quote
Old 09-18-2019, 01:56 PM   #5
WaseemAlkurdi
Zealot
WaseemAlkurdi began at the beginning.
 
Posts: 147
Karma: 12
Join Date: Jul 2019
Device: Kindle Touch (K5) Wi-Fi x 2, Kindle (7th Gen, KT2), Paperwhite 3rd Gen
Quote:
Originally Posted by knc1 View Post
Both u-boot and the kernel are both network filesystem enabled.
"not requiring a pc" ::

*) use your NSS which is part of most home routers.
*) put the network filesystem on a cloud server
*) use a Linux, Mac, or (*)BSD system


PS: DO NOT put swap on the network filesystem, the Kindle kernels are not configured to support such use (we have threads on that subject here).
I have the U-Boot commands for netboot on file, but how are you supposed to connect to the Kindle when it's still in U-Boot? We don't have an Ethernet port. Is it some sort of fancy USB Networking mode in U-Boot?
WaseemAlkurdi is offline   Reply With Quote
Old 03-20-2020, 05:08 PM   #6
edrex
Member
edrex began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Mar 2020
Device: Kindle PW3
Just noticed this thread.

I'm very interested in working to get a newer kernel booting on PW3, and would like a method that allows testing kernels with low risk of bricking.

I hadn't heard of idme until now, and didn't know kindles had fastboot.

@WaseemAlkurdi Is this the same fastboot from Android world?
Can I use the standard android fastboot util to send an image with fastboot boot?
edrex is offline   Reply With Quote
Old 03-20-2020, 05:35 PM   #7
edrex
Member
edrex began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Mar 2020
Device: Kindle PW3
oic, fastboot requires soldering to usb serial pads.
edrex is offline   Reply With Quote
Old 03-20-2020, 08:32 PM   #8
knc1
99.44/100% On Holiday
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,182
Karma: 18200597
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by edrex View Post
Just noticed this thread.

I'm very interested in working to get a newer kernel booting on PW3, and would like a method that allows testing kernels with low risk of bricking.

I hadn't heard of idme until now, and didn't know kindles had fastboot.

@WaseemAlkurdi Is this the same fastboot from Android world?
Can I use the standard android fastboot util to send an image with fastboot boot?
Quote:
Originally Posted by edrex View Post
oic, fastboot requires soldering to usb serial pads.
*) It is a "Kindle special" variety of fastboot.
It is available on this forum. I do not have a link to it.

*) What size image?
The "Kindle fastboot" can not handle the size of the 'main' file system image.

*) Fastboot boot: Haven't heard it mentioned, give it a try.
Let us know the details of your new brick.

*) Hot soldering to serial port is not requited.
You do have to connect to the serial port, but the serial port thread contains at least three ways to avoid use of hot solder.

*) Low risk testing: both the startup of the Kindle's u-boot and of the Kindle's kernel support network filesystems.
That is: boot from an external source, if it breaks, don't boot from an external source next time.
That is the way 'real' embedded devices are developed.

Last edited by knc1; 03-21-2020 at 03:14 PM.
knc1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrading or kexec-ing newer kernel? Yasen6275 Kindle Developer's Corner 6 04-02-2014 04:28 AM
[K3] Custom Kernel (rescue shell !, kexec, patched recovery) seaniko7 Kindle Developer's Corner 16 03-29-2014 05:13 PM
Custom 3.3 kernel with kexec support and patched recovery seaniko7 Kindle Developer's Corner 10 09-09-2012 04:14 PM
PRS-T1 How-to: Compiling the kernel and kernel modules altruizine Sony Reader Dev Corner 9 09-03-2012 09:12 PM
iLiad iLiad kernel development jayakumar iRex Developer's Corner 65 07-05-2010 04:00 AM


All times are GMT -4. The time now is 09:57 PM.


MobileRead.com is a privately owned, operated and funded community.