mirror of
https://github.com/ivoszbg/uniLoader.git
synced 2026-08-15 05:18:32 +00:00
c6b486f0edee49ed0c20e013f6e866cd2e556512
All newer exynos devices with s-boot have the "feature" of placing the android kernel at a random location in dram, specifically around 0x80000000 and 0x83000000. This made it hard to assume where we are at, hence why we made everything as PiE (position-independent) as possible. This, however, resulted in a lot of issues. I usually managed to get around them with ugly hacks, but in the last 5-6 commits, with the fixed support for armv7, everything fell apart for arm64. So, the solution for this is to implement code at the beginning of the bootloader that relocates it to a safe place in memory. This is currently enabled for dreamlte, and it must be enabled and configured for all other boards with that issue. Otherwise they will NOT boot anymore. Boards that don't need this can keep CONFIG_POSITION_INDEPENDENT disabled.
uniLoader
A secondary bootloader that is capable of loading the upstream Linux kernel for Android and iOS-based devices.
The purpose behind it is to provide a small shim for avoiding vendor bootloader quirks.
(ex.: some newer Exynos phones leave decon framebuffer refreshing disabled right before jumping to kernel, which makes initial debugging efforts when bringing up the platform to upstream linux hard)
The currently supported architectures are ARMV7 and AARCH64.
Preparation
- Install a toolchain that matches your target architecture (ex. AArch64 cross-toolchain):
sudo apt install aarch64-linux-gnu - Clone the repository:
git clone https://github.com/ivoszbg/uniLoader - Navigate to the project directory:
cd uniLoader - Place your kernel and device tree blobs under the
blob/directory.
Make Syntax
make ARCH=<arch> CROSS_COMPILE=<toolchain>
Building Example
sudo apt install aarch64-linux-gnu
git clone https://github.com/ivoszbg/uniLoader
cd uniLoader
cp /home/user/linux/arch/arm64/boot/Image blob/Image
cp /home/user/linux/arch/arm64/boot/dts/exynos/exynos8895-dreamlte.dtb blob/dtb
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j4 dreamlte_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j4
Usage
For Apple devices: Load the generated uniLoader binary via PongoOS.
For Android devices: Replace the Linux kernel in your boot.img with the uniLoader binary.
TODO LIST
- [C] Allow loading instead of PongoOS for Apple devices;
- [C] Fix/replace the libc implementation;
- [M] Implement a serial library and make the debug lib less hacky;
- [M] Implement more features:
New devices
Boot menu with countdown timer and selectable items via GPIO volume keys
Threaded execution
[C] = Critical for overall ease of use and functionality
[M] = Nice to have :)
License
This project is licensed under GPL2.
Languages
C
82.7%
C++
5.9%
Makefile
4.4%
Assembly
2.9%
Yacc
1.8%
Other
2.3%