From 816044987ec4fbee3b88e04aabcf0a2edf83f908 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 25 Nov 2024 21:21:17 +0100 Subject: Add a make target for producing a release archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- .gitignore | 3 +++ CHANGELOG.md | 21 +++++++++++++++++++++ Makefile | 30 ++++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.gitignore b/.gitignore index 0fc4add..85d5d6f 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,8 @@ test/*.o test/test_dt test/test_initrd +tmp/ +/fbos.tar.gz + # You can generate it with Bear: `$ bear -- make`. compile_commands.json diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..aa18331 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# State of the project by the end of SUSE Hackweek 2024 + +As part of [SUSE Hack Week +24](https://hackweek.opensuse.org/24/projects/fizzbuzz-os) I started this +project with the scope in mind to at least have something running. This is what +I have achieved by the end of this week: + +- The kernel knows how to parse the Device Tree blob to obtain the memory + location of the `initrd` blob. +- The kernel can parse the `initrd` (as referenced by the Device Tree blob) to + reference all the user-space binaries. +- The kernel can parse the ELF binary for each user-space binary in order to get + their binary entry. +- The kernel can react to the OpenSBI timer and count seconds on QEMU. +- The kernel can schedule each binary entry depending on the requirement of the + whole system. + +Hence, by the end of the week I already got a kernel that could start on QEMU +and show the whole `fizz`, `buzz`, `fizzbuzz` strings as given by user-space +processes. Even with rough edges still to be polished, my initial goals have +been met. diff --git a/Makefile b/Makefile index 03febb5..a408630 100644 --- a/Makefile +++ b/Makefile @@ -56,13 +56,15 @@ endif ## # Paths -SRC = $(filter-out kernel/fbos.ld.S, $(wildcard kernel/*.S kernel/*.c lib/*.c)) -OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SRC))) -LINKER = kernel/fbos.ld -KRNL = fbos -USR = usr/bin/init usr/bin/fizz usr/bin/buzz usr/bin/fizzbuzz -INIT = usr/initramfs.cpio -TESTS = test/test_dt test/test_initrd +SRC = $(filter-out kernel/fbos.ld.S, $(wildcard kernel/*.S kernel/*.c lib/*.c)) +OBJ = $(patsubst %.c,%.o,$(patsubst %.S,%.o,$(SRC))) +LINKER = kernel/fbos.ld +KRNL = fbos +USR = usr/bin/init usr/bin/fizz usr/bin/buzz usr/bin/fizzbuzz +INIT = usr/initramfs.cpio +TESTS = test/test_dt test/test_initrd +TMP = tmp/ +ARCHIVE = fbos.tar.gz LDFLAGS += -T $(LINKER) @@ -127,6 +129,18 @@ test/%: test/%.o $(E) " TEST " $@ $(Q) $(HOSTCC) -Iinclude/ $< test/lib/*.o -o $@ +## +# Produce an archive for releases. + +.PHONY: archive +archive: all + $(Q) rm -rf $(TMP) && mkdir -p $(TMP) + $(Q) cp -r usr/ $(TMP) && rm -r $(TMP)/usr/src + $(Q) cp $(KRNL) $(TMP) + $(Q) tar czf $(ARCHIVE) $(TMP) + $(Q) rm -rf $(TMP) + $(E) " TAR $(ARCHIVE)" + ## # Hacking @@ -144,7 +158,7 @@ gdb: .PHONY: clean clean: - $(Q) rm -f $(OBJ) $(KRNL) $(LINKER) $(USR) usr/src/*.o $(INIT) test/*.o test/lib/*.o $(TESTS) + $(Q) rm -rf $(OBJ) $(KRNL) $(LINKER) $(USR) usr/src/*.o $(INIT) test/*.o test/lib/*.o $(TESTS) $(TMP) $(ARCHIVE) .PHONY: lint lint: -- cgit v1.2.3