From 3dc51d60222155f5f2c20c233403f108f0c70fef Mon Sep 17 00:00:00 2001 From: DualFroz Date: Tue, 1 Sep 2026 16:00:17 +0200 Subject: [PATCH] chore: refresh Makefile --- Makefile | 173 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) diff --git a/Makefile b/Makefile index b17590f..807b9f8 100644 --- a/Makefile +++ b/Makefile @@ -303,6 +303,179 @@ $(UBUILD)/stopchldtarget.elf: $(UBUILD)/stopchldtarget.o $(USERCOMMON) user/user # nodefertest is spawned directly by kmain.c at boot; it is a single, # self-contained process (self-raises signals against its own pid) with no # spawned counterpart, unlike every other pair above. +$(UBUILD)/nodefertest.elf: $(UBUILD)/nodefertest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x2E0000000 -o $@ $(UBUILD)/nodefertest.o $(USERCOMMON) + +$(UBUILD)/alarmtest.elf: $(UBUILD)/alarmtest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x2F0000000 -o $@ $(UBUILD)/alarmtest.o $(USERCOMMON) + +$(UBUILD)/alarmdefault.elf: $(UBUILD)/alarmdefault.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x300000000 -o $@ $(UBUILD)/alarmdefault.o $(USERCOMMON) + +$(UBUILD)/siginfotest.elf: $(UBUILD)/siginfotest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x310000000 -o $@ $(UBUILD)/siginfotest.o $(USERCOMMON) + +$(UBUILD)/siginfotarget.elf: $(UBUILD)/siginfotarget.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x320000000 -o $@ $(UBUILD)/siginfotarget.o $(USERCOMMON) + +# pgroupfg/pgroupbg are both spawned directly by kmain.c at boot, with no +# parent-child relationship to each other (unlike every *test/*target pair +# above) -- each simply becomes its own default process group leader +# (sched.c's initialPgid), the same way two independently boot-launched +# programs already do for consolereader1/consolereader2 above. +$(UBUILD)/pgroupfg.elf: $(UBUILD)/pgroupfg.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x330000000 -o $@ $(UBUILD)/pgroupfg.o $(USERCOMMON) + +$(UBUILD)/pgroupbg.elf: $(UBUILD)/pgroupbg.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x340000000 -o $@ $(UBUILD)/pgroupbg.o $(USERCOMMON) + +# jobctlfg/jobctlbg are never spawned by kmain.c at all -- unlike every +# other program in this list, they are loaded on demand, at runtime, when +# kmain.c's jobctlDriverThread types their names at the real interactive +# shell (shell.c), which resolves them through jobctl.c exactly like a real +# shell's $PATH lookup. They still need their own fixed link slot up front +# like any other binary (elf.h's elfLoad maps a binary at whatever address +# it was linked at, chosen here, not at load time). +$(UBUILD)/jobctlfg.elf: $(UBUILD)/jobctlfg.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x350000000 -o $@ $(UBUILD)/jobctlfg.o $(USERCOMMON) + +$(UBUILD)/jobctlbg.elf: $(UBUILD)/jobctlbg.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x360000000 -o $@ $(UBUILD)/jobctlbg.o $(USERCOMMON) + +$(UBUILD)/polltest.elf: $(UBUILD)/polltest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x370000000 -o $@ $(UBUILD)/polltest.o $(USERCOMMON) + +$(UBUILD)/pollwriter.elf: $(UBUILD)/pollwriter.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x380000000 -o $@ $(UBUILD)/pollwriter.o $(USERCOMMON) + +# pipesrc/pipesink are, like jobctlfg/jobctlbg above, never spawned by +# kmain.c directly -- loaded on demand when the real interactive shell +# processes a typed "pipesrc | pipesink" line (shell.c's new pipeline +# syntax, kmain.c's pipelineDriverThread). +$(UBUILD)/pipesrc.elf: $(UBUILD)/pipesrc.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x390000000 -o $@ $(UBUILD)/pipesrc.o $(USERCOMMON) + +$(UBUILD)/pipesink.elf: $(UBUILD)/pipesink.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x3A0000000 -o $@ $(UBUILD)/pipesink.o $(USERCOMMON) + +# redirwriter/redirreader are, like pipesrc/pipesink above, never spawned by +# kmain.c directly -- loaded on demand when the real interactive shell +# processes typed "redirwriter > FILE" / "redirwriter >> FILE" / +# "redirreader < FILE" lines (shell.c's new file redirection syntax, +# kmain.c's redirDriverThread). +$(UBUILD)/redirwriter.elf: $(UBUILD)/redirwriter.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x3B0000000 -o $@ $(UBUILD)/redirwriter.o $(USERCOMMON) + +$(UBUILD)/redirreader.elf: $(UBUILD)/redirreader.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x3C0000000 -o $@ $(UBUILD)/redirreader.o $(USERCOMMON) + +# stderrwriter/stderrreader are, like redirwriter/redirreader above, never +# spawned by kmain.c directly -- loaded on demand when the real interactive +# shell processes typed "stderrwriter 2> FILE" / "stderrwriter 2>> FILE" / +# "stderrreader < FILE" lines (shell.c's new stderr redirection syntax, +# kmain.c's stderrDriverThread). +$(UBUILD)/stderrwriter.elf: $(UBUILD)/stderrwriter.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x3D0000000 -o $@ $(UBUILD)/stderrwriter.o $(USERCOMMON) + +$(UBUILD)/stderrreader.elf: $(UBUILD)/stderrreader.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x3E0000000 -o $@ $(UBUILD)/stderrreader.o $(USERCOMMON) + +# selfstoptest is spawned directly by kmain.c at boot; selfstoptarget is +# only ever spawned at runtime by selfstoptest itself (userSpawn), the same +# relationship jobtest.elf/jobtarget.elf above already have. +$(UBUILD)/selfstoptest.elf: $(UBUILD)/selfstoptest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x3F0000000 -o $@ $(UBUILD)/selfstoptest.o $(USERCOMMON) + +$(UBUILD)/selfstoptarget.elf: $(UBUILD)/selfstoptarget.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x400000000 -o $@ $(UBUILD)/selfstoptarget.o $(USERCOMMON) + +# herestest is, like redirreader/stderrreader above, never spawned by kmain.c +# directly -- loaded on demand when the real interactive shell processes a +# typed "herestest <<< TEXT" line (shell.c's new here-string redirection +# syntax, kmain.c's hereDriverThread). Unlike redirreader/stderrreader it has +# no writer counterpart binary at all -- the "writer" is the shell's own +# kernel thread, feeding the typed text straight into a pipe (jobctl.c's +# jobctlSpawnHereStringPiped), never another spawned process's stdout. +$(UBUILD)/herestest.elf: $(UBUILD)/herestest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x410000000 -o $@ $(UBUILD)/herestest.o $(USERCOMMON) + +# hcat/hsink are, like pipesrc/pipesink above, never spawned by kmain.c +# directly -- loaded on demand when the real interactive shell processes a +# typed "hcat <<< TEXT | hsink" line (shell.c's new here-string-into- +# pipeline syntax, jobctl.c's jobctlSpawnPipedHereString, kmain.c's +# hereStringPipelineDriverThread). +$(UBUILD)/hcat.elf: $(UBUILD)/hcat.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x420000000 -o $@ $(UBUILD)/hcat.o $(USERCOMMON) + +$(UBUILD)/hsink.elf: $(UBUILD)/hsink.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x430000000 -o $@ $(UBUILD)/hsink.o $(USERCOMMON) + +# pipecat is, like pipesrc/pipesink above, never spawned by kmain.c directly +# -- loaded on demand when the real interactive shell processes a typed +# "pipesrc | pipecat | pipesink" line (shell.c's new N-stage pipeline +# syntax, kmain.c's threeStagePipelineDriverThread). It is the middle stage +# of that pipeline: unlike hcat/hsink above, both its fd 0 and fd 1 are real +# process-to-process pipes, never the console or a here-string. +$(UBUILD)/pipecat.elf: $(UBUILD)/pipecat.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x440000000 -o $@ $(UBUILD)/pipecat.o $(USERCOMMON) + +# cwdtest is spawned directly by kmain.c at boot; cwdtarget is only ever +# spawned at runtime by cwdtest itself (userSpawn, no argv), the same +# relationship jobtest.elf/jobtarget.elf above already have -- except this +# pair rendezvous purely through the real per-process cwd the kernel itself +# hands cwdtarget at creation time (sched.c's initialCwd), not a shared +# pipe handle passed as an argv string. +$(UBUILD)/cwdtest.elf: $(UBUILD)/cwdtest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x450000000 -o $@ $(UBUILD)/cwdtest.o $(USERCOMMON) + +$(UBUILD)/cwdtarget.elf: $(UBUILD)/cwdtarget.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x460000000 -o $@ $(UBUILD)/cwdtarget.o $(USERCOMMON) + +# envprint is, like jobctlfg/jobctlbg/hcat/pipecat above, never spawned by +# kmain.c directly -- loaded on demand when the real interactive shell +# processes a typed "envprint" line (shell.c's fallback /bin/ lookup, +# kmain.c's new envDriverThread). +$(UBUILD)/envprint.elf: $(UBUILD)/envprint.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x470000000 -o $@ $(UBUILD)/envprint.o $(USERCOMMON) + +# nicetest is spawned directly by kmain.c at boot; nicetarget is only ever +# spawned at runtime by nicetest itself (userSpawn, no argv), the same +# *test / *target relationship cwdtest.elf/cwdtarget.elf above already +# have -- this pair rendezvous purely through sysNice/sysGetPriority +# (syscall.c), never a shared pipe handle or the filesystem. +$(UBUILD)/nicetest.elf: $(UBUILD)/nicetest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x480000000 -o $@ $(UBUILD)/nicetest.o $(USERCOMMON) + +$(UBUILD)/nicetarget.elf: $(UBUILD)/nicetarget.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x490000000 -o $@ $(UBUILD)/nicetarget.o $(USERCOMMON) + +# date is spawned directly by kmain.c at boot, fully synchronous like +# nicetest.elf above -- no shell rendezvous, no injected keystroke. +$(UBUILD)/date.elf: $(UBUILD)/date.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x4A0000000 -o $@ $(UBUILD)/date.o $(USERCOMMON) + +# globcat is, like envprint/hcat/pipecat above, never spawned by kmain.c +# directly -- loaded on demand when the real interactive shell processes a +# typed "globcat /tmp/gd/*.txt" line (shell.c's new wildcard glob +# expansion, kmain.c's new globDriverThread). USER_BASE picks up well past +# the last-used slot (date.elf, plus its own boot-time spawnUser stack +# address) rather than the immediately-following one, to stay clear of any +# address this file's own boot-time spawnUser calls already reference. +$(UBUILD)/globcat.elf: $(UBUILD)/globcat.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x4C0000000 -o $@ $(UBUILD)/globcat.o $(USERCOMMON) + +# timetest is spawned directly by kmain.c at boot, fully synchronous like +# nicetest.elf/date.elf above -- no shell rendezvous, no injected keystroke. +# USER_BASE is the slot right after globcat.elf's (the last one reserved); +# nothing else references any address in or past this slot. +$(UBUILD)/timetest.elf: $(UBUILD)/timetest.o $(USERCOMMON) user/user.ld + $(LD) $(ULDFLAGS) --defsym USER_BASE=0x4D0000000 -o $@ $(UBUILD)/timetest.o $(USERCOMMON) + +# false is, like globcat above, never spawned by kmain.c directly -- +# loaded on demand when the real interactive shell processes a typed +# `false && echo X || echo ...` line (shell.c's new `&&`/`||` conditional +# chaining, kmain.c's new andOrDriverThread). USER_BASE picks up the slot +# right after timetest.elf's (the last one reserved). $(MKTAR): tools/mktar.c | $(BUILD) gcc -O2 -Wall -Wextra -o $@ $<