From 3154c067ebd5e23b8be9693a1a790c70a9634344 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Thu, 7 Mar 2024 22:46:25 -0500 Subject: build: Create init stub Signed-off-by: Ian Moffett --- Makefile.in | 8 ++++++-- usr.sbin/Makefile | 6 ++++++ usr.sbin/init/Makefile | 7 +++++++ usr.sbin/init/init | Bin 0 -> 944 bytes usr.sbin/init/main.c | 6 ++++++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 usr.sbin/Makefile create mode 100644 usr.sbin/init/Makefile create mode 100755 usr.sbin/init/init create mode 100644 usr.sbin/init/main.c diff --git a/Makefile.in b/Makefile.in index f61c4e9..daa0cf9 100644 --- a/Makefile.in +++ b/Makefile.in @@ -69,10 +69,14 @@ override KERNEL_ASMOBJECTS = $(KERNEL_ASMFILES:.S=.S.o) override KERNEL_HEADER_DEPS = $(KERNEL_CFILES:.c=.d) .PHONY: all -all: base lib base/usr/lib/ld.so base/boot/hyra-kernel +all: base init lib base/usr/lib/ld.so base/boot/hyra-kernel rm -f sys/include/machine rm -rf iso_root +base/boot/init: usr.sbin/init/ + cd usr.sbin/; make CC=$(CC) LD=$(LD) + cp usr.sbin/init/init base/boot/ + base: mkdir -p base/usr/lib/ @@ -96,6 +100,7 @@ distclean: rm -f $(KERNEL_ASMOBJECTS) $(KERNEL_OBJECTS) $(KERNEL_HEADER_DEPS) rm -f sys/include/machine rm -f base/usr/lib/ld.so + rm -f base/boot/init cd lib/; make clean .PHONY: clean @@ -115,7 +120,6 @@ base/usr/lib/ld.so: lib/mlibc/ base/boot/hyra-kernel: $(KERNEL_OBJECTS) $(KERNEL_ASMOBJECTS) rm -rf iso_root - mkdir -p base/boot/ $(PROMPT) " LD " $(shell pwd)/base/boot/hyra-kernel $(LD) $(KERNEL_LDFLAGS) $(KERNEL_OBJECTS) $(KERNEL_ASMOBJECTS) -o base/boot/hyra-kernel tools/ksyms sys/kern/ksyms.c base/boot/hyra-kernel diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile new file mode 100644 index 0000000..7cf3d01 --- /dev/null +++ b/usr.sbin/Makefile @@ -0,0 +1,6 @@ +CC = +LD = + +.PHONY: all +all: + cd init/; make CC=$(CC) LD=$(LD) diff --git a/usr.sbin/init/Makefile b/usr.sbin/init/Makefile new file mode 100644 index 0000000..4b578f8 --- /dev/null +++ b/usr.sbin/init/Makefile @@ -0,0 +1,7 @@ +CC = +LD = + +.PHONY: all +all: + $(CC) -c main.c -o main.o; + $(LD) main.o -o init -e main diff --git a/usr.sbin/init/init b/usr.sbin/init/init new file mode 100755 index 0000000..8b83844 Binary files /dev/null and b/usr.sbin/init/init differ diff --git a/usr.sbin/init/main.c b/usr.sbin/init/main.c new file mode 100644 index 0000000..af62d76 --- /dev/null +++ b/usr.sbin/init/main.c @@ -0,0 +1,6 @@ +int +main(void) +{ + /* Do nothing */ + while (1); +} -- cgit v1.2.3