Permalink
Comparing changes
Open a pull request
- 13 commits
- 29 files changed
- 0 commit comments
- 4 contributors
Unified
Split
Showing
with
429 additions
and 393 deletions.
- +9 −4 Dockerfile
- +2 −2 Makefile
- +1 −1 NX_Sysmodules
- +5 −5 README.md
- BIN data/es_patch.rxp
- +18 −13 docker-build.sh
- +3 −3 link.ld
- +25 −1 src/bootloader.c
- +0 −1 src/bootrom.c
- +2 −2 src/error.c
- +0 −1 src/error.h
- +56 −75 src/firmware.c
- +5 −6 src/firmware.h
- +8 −2 src/fs.c
- +2 −1 src/fs.h
- +0 −47 src/fuse.c
- +0 −21 src/fuse.h
- +4 −1 src/hwinit.h
- +1 −1 src/hwinit/pmc.h
- +1 −0 src/hwinit/types.h
- +13 −0 src/hwinit/util.c
- +1 −0 src/hwinit/util.h
- +0 −112 src/kippatches.c
- +0 −31 src/kippatches.h
- +61 −0 src/kippatches/fs.inc
- +134 −2 src/package.c
- +60 −0 src/package.h
- +0 −34 src/reloc.s
- +18 −27 src/start.s
| @@ -1,6 +1,11 @@ | ||
| FROM devkitpro/devkitarm:latest | ||
| MAINTAINER jski "jski185@gmail.com" | ||
| FROM devkitpro/devkita64 | ||
| MAINTAINER elelphatp "elephantp@elephantp.blog" | ||
| ADD . / | ||
| RUN dkp-pacman -Syyu --noconfirm devkitARM && \ | ||
| dkp-pacman -Scc --noconfirm | ||
| ENTRYPOINT ["make"] | ||
| ENV DEVKITARM=${DEVKITPRO}/devkitARM | ||
| WORKDIR /developer | ||
| ENTRYPOINT ["make"] |
| @@ -9,6 +9,7 @@ LD = $(DEVKITARM)/bin/arm-none-eabi-ld | ||
| OBJCOPY = $(DEVKITARM)/bin/arm-none-eabi-objcopy | ||
| name := ReiNX | ||
| ver := 1.6 | ||
| dir_source := src | ||
| dir_data := data | ||
| @@ -17,7 +18,7 @@ dir_out := out | ||
| dir_sysmod := NX_Sysmodules | ||
| ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork | ||
| CFLAGS = $(ARCH) -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -fno-builtin -std=gnu11# -Wall | ||
| CFLAGS = $(ARCH) -DVERSION='"$(ver)"' -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -fno-builtin -std=gnu11# -Wall | ||
| LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections | ||
| objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \ | ||
| @@ -53,7 +54,6 @@ $(dir_out)/$(name).bin: $(dir_build)/$(name).elf | ||
| @mkdir -p "$(dir_out)/ReiNX/patches" | ||
| @cp $(dir_sysmod)/loader/loader.kip $(dir_out)/ReiNX/sysmodules/ | ||
| @cp $(dir_sysmod)/sm/sm.kip $(dir_out)/ReiNX/sysmodules/ | ||
| @cp $(dir_sysmod)/fs_mitm/fs_mitm.kip $(dir_out)/ReiNX/sysmodules/ | ||
| @cp -R $(dir_data)/*.bin $(dir_out)/ReiNX/ | ||
| @cp -R $(dir_data)/*.rxp $(dir_out)/ReiNX/patches | ||
| $(OBJCOPY) -S -O binary $< $@ | ||
Submodule NX_Sysmodules
updated
3 files
| +1 −1 | Makefile | |
| +8 −1 | fs_mitm/source/fsmitm_service.hpp | |
| +1 −1 | pm/source/pm_boot2.cpp |
| @@ -11,7 +11,7 @@ Put `ReiNX` folder on the root of your switch's SD card and run `ReiNX.bin` with | ||
| You'll need devkitpro with devkitARM and run `make` | ||
| To compile with Docker, `chmod +x docker-build.sh` and run the shell script `./docker-build.sh`. This will compile without requiring installation of DevKit* dependencies. | ||
| To compile with Docker, `chmod +x docker-build.sh` and run the shell script `./docker-build.sh`. After that, just check `out` dir. This will compile without requiring installation of DevKit* dependencies. | ||
| **Features:** | ||
| @@ -29,11 +29,11 @@ To compile with Docker, `chmod +x docker-build.sh` and run the shell script `./d | ||
| [HERE](https://gbatemp.net/threads/official-reinx-thread.512203/) | ||
| **Credits:** | ||
| Naehrwert for hardware init code and generally being helpful! | ||
| CTCaer and st4rk for their contribution to the hardware code aswell! | ||
| SciresM for sysmodules! | ||
| The community for your support! | ||
Binary file not shown.
| @@ -1,16 +1,21 @@ | ||
| #!/usr/bin/env bash | ||
| ECHO "" | ||
| ECHO "Emptying out /build and /out folders..." | ||
| ECHO "" | ||
| rm -rf ./build | ||
| rm -rf ./out | ||
| echo "Checking reinx-builder image..." | ||
| ECHO "" | ||
| ECHO "Building docker image locally..." | ||
| ECHO "" | ||
| docker build . -t reinx-builder:latest | ||
| IMAGE=`docker image ls|grep reinx-builder -c` | ||
| if [[ "$IMAGE" == 1 ]]; then | ||
| echo "Reinx-builder image is exist" | ||
| else | ||
| echo "" | ||
| echo "Building docker image locally..." | ||
| echo "" | ||
| docker build . -t reinx-builder | ||
| fi | ||
| ECHO "" | ||
| ECHO "Running image and generating build..." | ||
| ECHO "" | ||
| docker run -v $(pwd)/build:/build -v $(pwd)/out:/out reinx-builder:latest | ||
| echo "Checking container...." | ||
| CONTAINER=`docker ps -a|grep reinx-builder -c` | ||
| echo "Building..." | ||
| if [[ "$CONTAINER" == 1 ]]; then | ||
| docker start -a reinx-builder | ||
| else | ||
| docker run -a stdout -a stderr --name reinx-builder -v $(pwd):/developer reinx-builder | ||
| fi |
| @@ -2,8 +2,8 @@ ENTRY(_start) | ||
| SECTIONS | ||
| { | ||
| PROVIDE(__ipl_start = 0x40003000); | ||
| . = __ipl_start; | ||
| PROVIDE(payload_start = 0x40003000); | ||
| . = payload_start; | ||
| .text.start : | ||
| { | ||
| *(.text.start) | ||
| @@ -18,7 +18,7 @@ SECTIONS | ||
| *(.rodata*); | ||
| } | ||
| . = ALIGN(0x10); | ||
| __ipl_end = .; | ||
| payload_end = .; | ||
| .bss : | ||
| { | ||
| __bss_start = .; | ||
| @@ -15,7 +15,6 @@ | ||
| */ | ||
| #include "hwinit.h" | ||
| #include "fuse.h" | ||
| #include "error.h" | ||
| #include "bootloader.h" | ||
| @@ -24,6 +23,31 @@ void check_sku() { | ||
| panic(); | ||
| } | ||
| u32 get_unknown_config() { | ||
| u32 res = 0; | ||
| u32 deviceInfo = FUSE(FUSE_RESERVED_ODMX(4)); | ||
| u32 config = ((deviceInfo & 4u) >> 2) | 2 * ((deviceInfo & 0x100u) >> 8); | ||
| if(config == 1) | ||
| return 0; | ||
| if(config == 2) | ||
| return 1; | ||
| if(config || (res = FUSE(FUSE_SPARE_BIT_5)) != 0) | ||
| res = 3; | ||
| return res; | ||
| } | ||
| u32 get_unit_type() { | ||
| u32 deviceInfo = FUSE(FUSE_RESERVED_ODMX(4)); | ||
| u32 deviceType = deviceInfo & 3 | 4 * ((deviceInfo & 0x200u) >> 9); | ||
| if(deviceType == 3) | ||
| return 0; | ||
| if(deviceType == 4) | ||
| return 1; | ||
| return 2; | ||
| } | ||
| void check_config_fuses() { | ||
| u32 config = get_unknown_config(); | ||
| u32 unitType = get_unit_type(); | ||
| @@ -36,5 +36,4 @@ void bootrom(void) { | ||
| // Clear the boot reason to avoid problems later | ||
| PMC(APBDEV_PMC_SCRATCH200) = 0x0; | ||
| PMC(APBDEV_PMC_RST_STATUS_0) = 0x0; | ||
| PMC(APBDEV_PMC_SCRATCH49_0) = 0x0; | ||
| } | ||
| @@ -31,6 +31,6 @@ void panic() { | ||
| void error(char *errStr) { | ||
| gfx_con_setcol(&gfx_con, RED, 0, 0); | ||
| print(strcat("Error: ", errStr)); | ||
| gfx_con_setcol(&gfx_con, ORANGE, 0, 0); | ||
| print("Error: %s", errStr); | ||
| gfx_con_setcol(&gfx_con, DEFAULT_TEXT_COL, 0, 0); | ||
| } | ||
| @@ -17,7 +17,6 @@ | ||
| #pragma once | ||
| #include "hwinit/types.h" | ||
| #include "hwinit/gfx.h" | ||
| void panic(); | ||
| void error(char *errStr); | ||
Oops, something went wrong.