Home - EstAK/zephyr-aslr GitHub Wiki

Welcome to the zephyr-aslr wiki!

porting the khadas edge2

first, you have to tweak the uboot source code (as its broken atm) -> fixing uboot

make a fake file file system

dd if=/dev/zero of=fs.img bs=1 count=524288
mkfs.ext4 fs.img

the size depends on the size of the extracted dtb.img that was extracted + some padding -> 512 KiB should be enough

then, put the dtb.img at the root of the fs

burn a zephyr image on the board

  1. download rkdeveloptool I will assume from here that it was added to path
  2. put the card in maskrom mode (press fun three times)
  3. burn the khadas spl (either the one obtained from compiling or the provided one)
rkdeveloptool db rk3588_spl_loader_*.sh
  1. burn uboot
rkdeveloptool wl 0x4000 uboot.img
  1. (lie to the bootloader) burn a file system on its rootfs
rkdeveloptool wl 0x6000 ../../fs.img
  1. load the zephyr image on a random sector of the eMMC
rkdeveloptool wl 0x100000 zephyr.img
rkdeveloptool rd

Ox100000 was arbitrarily chosen, if you change it be sure to change all of its occurrences from here onwards

  1. in the uboot console,
mmc read $pxefile_addr_r 0x100000 0x11b
bootm start pxefile_addr_r
bootm loados
bootm go

the 0x11b is the size number of blocks taken by the image to get it do hex(ceil(image_size / 512))