From 25116eaee46a977afc0b3d4308916177e071a0fd Mon Sep 17 00:00:00 2001 From: pointer-to-bios Date: Mon, 19 Feb 2024 05:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=AF=91=E6=97=B6?= =?UTF-8?q?=E7=A1=AE=E5=AE=9A=E7=9A=84allocator=5Fmagic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Makefile | 4 +++- src/kernel/Makefile | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index 7ccfc6c..00bec68 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,9 +12,11 @@ ifdef release release = 1 endif +ALLOCATOR_MAGIC = $(shell doas hwclock | sha512sum | head -c 128 | md5sum | head -c 8) + SUBOBJS = kernel/kernel.o libk/libk.o rust.o -DEFINES = ARCH="${ARCH}" ASM="${ASM}" ASMFLAGS="${ASMFLAGS}" SOURCE="${SOURCE}" PWD="${PWD}" +DEFINES = ARCH="${ARCH}" ASM="${ASM}" ASMFLAGS="${ASMFLAGS}" SOURCE="${SOURCE}" PWD="${PWD}" ALLOCATOR_MAGIC="${ALLOCATOR_MAGIC}" ifdef release DEFINES := ${DEFINES} release=1 endif diff --git a/src/kernel/Makefile b/src/kernel/Makefile index f47b005..e4ab8de 100644 --- a/src/kernel/Makefile +++ b/src/kernel/Makefile @@ -6,7 +6,8 @@ CC = gcc CCFLAGS = -m64 -mcmodel=large -I ../../include \ -fno-stack-protector -fno-exceptions \ - -fno-builtin -nostdinc -nostdlib + -fno-builtin -nostdinc -nostdlib \ + -DMEMM_ALLOCATOR_MAGIC=\"${ALLOCATOR_MAGIC}\" ifdef release CCFLAGS := ${CCFLAGS} -O2 endif