9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7d263add03234a3f0aba33da8c3b055b338cb7f4
parent 575a36a35100d06c05f81eb2ebd2ec2ed2edb60f
Author: Roberto E. Vargas Caballero <roberto.vargas@midokura.com>
Date:   Thu, 17 Nov 2022 10:51:50 +0100

os9: Move info to sys.c

It is going to be used in every main() function

Diffstat:
Minclude/os9/os9.h | 3++-
Asrc/os9/.gitignore | 1+
Msrc/os9/Makefile | 8++++++++
Msrc/os9/arch/arm64/.gitignore | 1-
Msrc/os9/arch/arm64/Makefile | 7+------
Msrc/os9/arch/arm64/main.c | 7-------
Msrc/os9/hosted/main.c | 1+
Rsrc/os9/arch/arm64/mkver -> src/os9/mkver | 0
Msrc/os9/sys.c | 9+++++++++
9 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/include/os9/os9.h b/include/os9/os9.h @@ -245,8 +245,9 @@ extern void *alloc(size_t); extern void *allocb(int); extern void freeb(void *); -/* init.c */ +/* sys.c */ extern void isys(void); +extern void info(void); /* dlang.c */ extern int debug(void); diff --git a/src/os9/.gitignore b/src/os9/.gitignore @@ -0,0 +1 @@ +version.h diff --git a/src/os9/Makefile b/src/os9/Makefile @@ -17,6 +17,11 @@ OBJS =\ all: image +version.h: + ./mkver + +sys.o: version.h + image: builtin.o FORCE +test $(MODE) = hosted && cd hosted || cd arch && $(MAKE) @@ -24,3 +29,6 @@ builtin.o: $(OBJS) $(LD) $(PROJ_LDFLAGS) -r -o $@ $(OBJS) dev/builtin.o: dev + +clean: + rm -f version.h diff --git a/src/os9/arch/arm64/.gitignore b/src/os9/arch/arm64/.gitignore @@ -1,4 +1,3 @@ ecstr.c sysreg.h sysreg.s -version.h diff --git a/src/os9/arch/arm64/Makefile b/src/os9/arch/arm64/Makefile @@ -37,17 +37,12 @@ ecstr.c: ec.h $(COMMON_OBJS): sysreg.h -main.o: version.h - sysreg.h: sysreg.lst ./mksysreg -h sysreg.lst sysreg.s: sysreg.lst ./mksysreg -s sysreg.lst -version.h: - ./mkver - $(BINDIR)/9fvp.elf: $(9FVP_OBJS) $(LIBDEP) $(LD) $(FLAGS) $(9FVP_OBJS) -lk -lc $(PROJ_LDLIBS) -o $@ @@ -57,4 +52,4 @@ $(BINDIR)/9pi3.elf: $(9RPI3_OBJS) $(LIBDEP) clean: rm -f ecstr.c rm -f $(TARGET) - rm -f sysreg.h sysreg.s version.h + rm -f sysreg.h sysreg.s diff --git a/src/os9/arch/arm64/main.c b/src/os9/arch/arm64/main.c @@ -6,13 +6,6 @@ #include "sysreg.h" #include "arch.h" -static void -info(void) -{ - kprint("Booting os9\n"); - kprint("os9: version %s\n", OS9VERSION); -} - int getch(void) { diff --git a/src/os9/hosted/main.c b/src/os9/hosted/main.c @@ -56,6 +56,7 @@ imach(void) int main(int argc, char *argv[]) { + info(); imach(); isys(); diff --git a/src/os9/arch/arm64/mkver b/src/os9/mkver diff --git a/src/os9/sys.c b/src/os9/sys.c @@ -5,6 +5,8 @@ #include <ctype.h> #include <string.h> +#include "version.h" + Chan *console; static void @@ -103,6 +105,13 @@ iconf(void) } void +info(void) +{ + kprint("Booting os9\n"); + kprint("os9: version %s\n", OS9VERSION); +} + +void isys(void) { idev();