From abfb35a231af0fe8370eedeb147587cb8fac58d2 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 12 Nov 2023 18:50:47 +0000 Subject: [PATCH] and entryPoint --- devices/belkin-rt3200/default.nix | 2 +- devices/gl-ar750/default.nix | 2 +- devices/gl-mt300a/default.nix | 4 ++-- devices/gl-mt300n-v2/default.nix | 2 +- devices/qemu-aarch64/default.nix | 2 +- devices/qemu-armv7l/default.nix | 2 +- modules/hardware.nix | 2 +- pkgs/kernel/uimage.nix | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/devices/belkin-rt3200/default.nix b/devices/belkin-rt3200/default.nix index 46ee22a..72a0b0d 100644 --- a/devices/belkin-rt3200/default.nix +++ b/devices/belkin-rt3200/default.nix @@ -181,7 +181,7 @@ # image and DTB underneath, but maybe this is a terrible waste of # RAM unless the kernel is able to reuse it later. Oh well loadAddress = lim.parseInt "0x42000000"; - entryPoint = "0x42000000"; + entryPoint = lim.parseInt "0x42000000"; rootDevice = "ubi0:liminix"; dts = { src = "${openwrt.src}/target/linux/mediatek/dts/mt7622-linksys-e8450-ubi.dts"; diff --git a/devices/gl-ar750/default.nix b/devices/gl-ar750/default.nix index d8f9157..9418241 100644 --- a/devices/gl-ar750/default.nix +++ b/devices/gl-ar750/default.nix @@ -104,7 +104,7 @@ hardware = { defaultOutput = "flashimage"; loadAddress = lim.parseInt "0x80060000"; - entryPoint = "0x80060000"; + entryPoint = lim.parseInt "0x80060000"; flash = { address = "0x9F060000"; size ="0xfa0000"; diff --git a/devices/gl-mt300a/default.nix b/devices/gl-mt300a/default.nix index 684b15a..28ca20e 100644 --- a/devices/gl-mt300a/default.nix +++ b/devices/gl-mt300a/default.nix @@ -55,8 +55,8 @@ imports = [ ../../modules/arch/mipsel.nix ]; hardware = { defaultOutput = "flashimage"; - loadAddress = lim.parseInt "0x80000000"; - entryPoint = "0x80000000"; + loadAddress = lim.parseInt "0x80000000"; + entryPoint = lim.parseInt "0x80000000"; # Creating 5 MTD partitions on "spi0.0": # 0x000000000000-0x000000030000 : "u-boot" diff --git a/devices/gl-mt300n-v2/default.nix b/devices/gl-mt300n-v2/default.nix index 45f6c58..e3d1774 100644 --- a/devices/gl-mt300n-v2/default.nix +++ b/devices/gl-mt300n-v2/default.nix @@ -63,7 +63,7 @@ hardware = { defaultOutput = "flashimage"; loadAddress = lim.parseInt "0x80000000"; - entryPoint = "0x80000000"; + entryPoint = lim.parseInt "0x80000000"; flash = { address = "0xbc050000"; diff --git a/devices/qemu-aarch64/default.nix b/devices/qemu-aarch64/default.nix index e827173..cc7b07e 100644 --- a/devices/qemu-aarch64/default.nix +++ b/devices/qemu-aarch64/default.nix @@ -66,7 +66,7 @@ in { defaultOutput = "vmroot"; loadAddress = lim.parseInt "0x0"; - entryPoint = "0x0"; + entryPoint = lim.parseInt "0x0"; rootDevice = "/dev/mtdblock0"; flash.eraseBlockSize = "65536"; # c.f. pkgs/mips-vm/mips-vm.sh diff --git a/devices/qemu-armv7l/default.nix b/devices/qemu-armv7l/default.nix index f603eb8..201d39e 100644 --- a/devices/qemu-armv7l/default.nix +++ b/devices/qemu-armv7l/default.nix @@ -68,7 +68,7 @@ in { defaultOutput = "vmroot"; loadAddress = lim.parseInt "0x00010000"; - entryPoint = "0x00010000"; + entryPoint = lim.parseInt "0x00010000"; rootDevice = "/dev/mtdblock0"; flash.eraseBlockSize = "65536"; # c.f. pkgs/mips-vm/mips-vm.sh diff --git a/modules/hardware.nix b/modules/hardware.nix index 7c9dcd8..938df1a 100644 --- a/modules/hardware.nix +++ b/modules/hardware.nix @@ -60,7 +60,7 @@ in { }; }; loadAddress = mkOption { type = types.ints.unsigned; default = null; }; - entryPoint = mkOption { }; + entryPoint = mkOption { type = types.ints.unsigned; }; radios = mkOption { description = '' Kernel modules (from mac80211 package) required for the diff --git a/pkgs/kernel/uimage.nix b/pkgs/kernel/uimage.nix index f2caeea..e096a91 100644 --- a/pkgs/kernel/uimage.nix +++ b/pkgs/kernel/uimage.nix @@ -46,7 +46,7 @@ in { buildPhaseUImage = '' test -f tmp.dtb && ${objcopy} --update-section .appended_dtb=tmp.dtb vmlinux.elf || ${objcopy} --add-section .appended_dtb=tmp.dtb vmlinux.elf ${stripAndZip} - mkimage -A ${arch} -O linux -T kernel -C lzma -a 0x${lib.toHexString loadAddress} -e ${entryPoint} -n '${lib.toUpper arch} Liminix Linux ${extraName}' -d vmlinux.bin.lzma kernel.uimage + mkimage -A ${arch} -O linux -T kernel -C lzma -a 0x${lib.toHexString loadAddress} -e 0x${lib.tohexString entryPoint} -n '${lib.toUpper arch} Liminix Linux ${extraName}' -d vmlinux.bin.lzma kernel.uimage ''; buildPhaseFIT = '' @@ -58,7 +58,7 @@ in { kernel { data = /incbin/("./vmlinux.bin.lzma"); load = <0x${lib.toHexString loadAddress}>; - entry = <${entryPoint}>; + entry = <0x${lib.toHexString entryPoint}>; arch = "${arch}"; compression = "lzma"; };