diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-21 13:09:21 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2024-11-21 13:09:21 +0100 |
| commit | 40ffc517e20c381ce8fdb3a881726a26a52e35db (patch) | |
| tree | b969f6e1bc4c400e8c2c8b1d5a18ed75d3f2fd95 /Makefile | |
| parent | d394978a73fce080128dc414e1771d8d89e1e1e0 (diff) | |
| download | fbos-40ffc517e20c381ce8fdb3a881726a26a52e35db.tar.gz fbos-40ffc517e20c381ce8fdb3a881726a26a52e35db.zip | |
Initial parsing of the provided initrd file
We expect a CPIO archive with the 'newc' format for the initrd. Parse
this archive from the given initrd address and fetch the address for
each ELF executable while also pairing which task correspond to which
ELF.
This commit leaves to do the actual parsing of the ELF file for each
task, while also leaving some string utilities to be refined.
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -60,9 +60,9 @@ 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/foo +USR = usr/bin/foo usr/bin/bar usr/bin/foobar INIT = usr/initramfs.cpio -TESTS = test/test_dt +TESTS = test/test_dt test/test_initrd LDFLAGS += -T $(LINKER) @@ -111,19 +111,21 @@ usr/bin/%: usr/src/%.o # Tests .PHONY: test -test: host_lib $(TESTS) +test: host_lib usr $(TESTS) $(Q) ./test/test_dt + $(Q) ./test/test_initrd host_lib: - $(Q) $(HOSTCC) $(WARNINGS) -Iinclude/ -g -c lib/dt.c -o lib/dt.o + $(Q) mkdir -p test/lib + $(Q) $(HOSTCC) $(WARNINGS) -Iinclude/ -g -c lib/dt.c -o test/lib/dt.o + $(Q) $(HOSTCC) $(WARNINGS) -Iinclude/ -g -c kernel/initrd.c -o test/lib/initrd.o test/%.o: test/%.c - $(E) " HOSTCC " $(basename $@) $(Q) $(HOSTCC) $(WARNINGS) -g -Iinclude/ -c $< -o $@ test/%: test/%.o - $(E) " HOSTLD " $@ - $(Q) $(HOSTCC) -Iinclude/ $< lib/dt.o -o $@ + $(E) " TEST " $@ + $(Q) $(HOSTCC) -Iinclude/ $< test/lib/*.o -o $@ ## # Hacking @@ -142,7 +144,7 @@ gdb: .PHONY: clean clean: - $(Q) rm -f $(OBJ) $(KRNL) $(LINKER) $(USR) usr/src/*.o $(INIT) test/*.o $(TESTS) + $(Q) rm -f $(OBJ) $(KRNL) $(LINKER) $(USR) usr/src/*.o $(INIT) test/*.o test/lib/*.o $(TESTS) .PHONY: lint lint: |
