[Samsung Galaxy Note 8 ROMs, Kernels, Recoveries, &] BigCountry907:
Clarification Of Fish - Safestrap

Fish is a similar hijack to safestrap.

It runs a script on boot but uses su.d (supersu) to run a script on boot.

Fish kills all running processes and deletes the ramdisk that is loaded on boot and replaces it with any ramdisk you want.

Safestrap does about the same but the script don't rely on supersu.

The script replaces the e2fsck binary with the hijack script.

When safestrap runs it either bypasses the hijack and performs normal boot.

Or it will boot TWRP (SS Recovery) about the same as fish.

The safestrap script is more advanced but it still does the same thing. Kills all running processes deletes (actually moves) existing files then replaces the files by extracting a new ramdisk and boots the new ramdisk (root file system).

Safestrap has the rom slot function, Far as i know it is not currently working right.

But even so YES I can hardcode in safestrap to mount the partitions off a sdcard and run them like they are on the UFS.

But you are still very limited. Its all about the KERNEL.

So yes you can run modified stock roms or any rom you want as long as it will work with the stock kernel.

Fish or Safestrap do not and can not touch the kernel. The kernel is loaded and is responsible for executing the init binary in the ramdisk. Once the kernel is loaded to memory it is there till you shut down. The kernel controls all.

On a device that the stock kernel has ( Loadable Module Support ) safestrap can go a step further. It can load a custom kernel. This is done with the KEXEC KERNEL MODULE. In this case where you can kexec boot from safestrap I do believe the rom slots would be useable.

The N950U stock kernel is lacking Loadable Module Support so you can not use kexec.

You are stuck with the stock kernel so even though you can mount partitions from anywhere you want you are limited on what you can run.

So lets just say it like this....... After the kernel is loaded we are in USER-SPACE

It does not mean we are fully booted into android.

It means that the kernel is loaded and has control of the system. Everything we execute goes through the kernel.

Several post back I did a good write up about all of this.

This is where I want to use U-Boot. U-Boot is like the kernel. ( But it's a bootloader)

It is loaded into RAM like the kernel and has control of the system until the kernel is loaded and it passes off control to the kernel.

The question is how to get U-Boot.bin loaded to RAM and start its execution when the kernel is already loaded!!

I think it's possible to compile a executable binary version of the U-Boot functions we need to get U-Boot loaded and running from safestrap. Or maybe a bare metal arm binary that is run by init. I'm not sure yet. I did not make it that far.

First i am going to get U-Boot up and running on 2 devices that are unlocked.

Dragonboard 410 and my Tab E T560NU.

Once everything is working correctly and i know how it is supposed to work then i will take these devices and see if i can get U-Boot loaded from safestrap on them.

This way many of the variables will be out of the picture.

I will know U-Boot works right and the devices boot correctly. ( In Unlocked State )

So all i will need to do is figure out the Binary U-Boot loader.

Since all the rest will be verified working any troubles i have would indefinitely be the Loader.

In the meantime. If anyone out there has any idea how we can load U-Boot please let me know.

It may be possible to replace the init binary with a binary loader. The loader simply needs to copy U-boot.bin to a specific start address in ram and then execute it.