aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-25 21:21:17 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-11-25 21:21:17 +0100
commit816044987ec4fbee3b88e04aabcf0a2edf83f908 (patch)
treeee2646f8bb953b7d85a88f0b508e999c32e6e273
parent2429f8aaf1584084b4d8c7c85c27c1d78ccab153 (diff)
downloadfbos-816044987ec4fbee3b88e04aabcf0a2edf83f908.tar.gz
fbos-816044987ec4fbee3b88e04aabcf0a2edf83f908.zip
Add a make target for producing a release archive
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
-rw-r--r--.gitignore3
-rw-r--r--CHANGELOG.md21
-rw-r--r--Makefile30
3 files changed, 46 insertions, 8 deletions
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)
@@ -128,6 +130,18 @@ test/%: test/%.o
$(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
.PHONY: qemu
@@ -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: