From: ljsebald <ljs...@us...> - 2024-01-12 03:58:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 76c6da9946e995f7d99133d8628fc5f87cd4b2a8 (commit) from af86ae57218ec25e374581d0a13e84382ed22d71 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 76c6da9946e995f7d99133d8628fc5f87cd4b2a8 Author: Falco Girgis <gyr...@gm...> Date: Thu Jan 11 21:57:50 2024 -0600 Hello Example Cleanup and Update (#459) * Cleaned up and updated hello example ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/hello/Makefile | 27 +++++++++++++++----------- examples/dreamcast/hello/hello.c | 33 ++++++++++++++++++++++---------- examples/dreamcast/hello/romdisk/.keepme | 0 3 files changed, 39 insertions(+), 21 deletions(-) delete mode 100644 examples/dreamcast/hello/romdisk/.keepme diff --git a/examples/dreamcast/hello/Makefile b/examples/dreamcast/hello/Makefile index a33d1085..909fc481 100644 --- a/examples/dreamcast/hello/Makefile +++ b/examples/dreamcast/hello/Makefile @@ -1,37 +1,42 @@ # # Basic KallistiOS skeleton / test program -# Copyright (C)2001-2004 Megan Potter +# Copyright (C) 2001-2004 Megan Potter +# Copyright (C) 2024 Falco Girgis # # Put the filename of the output binary here TARGET = hello.elf -# List all of your C files here, but change the extension to ".o" -# Include "romdisk.o" if you want a rom disk. -OBJS = hello.o romdisk.o +# List all of your C or C++ files here, but change the extension to ".o" +OBJS = hello.o -# If you define this, the Makefile.rules will create a romdisk.o for you -# from the named dir. -KOS_ROMDISK_DIR = romdisk +# Optional path to a directory of resources to bundle within your ELF binary. +# Its contents are accessible via the "/rd/" virtual directory at runtime. +#KOS_ROMDISK_DIR = romdisk -# The rm-elf step is to remove the target before building, to force the -# re-creation of the rom disk. +# Main rule which forces our ELF binary to be built all: rm-elf $(TARGET) +# Include the common KOS Makefile rules and configuration include $(KOS_BASE)/Makefile.rules +# Cleans the binary ELF file plus the intermediate .o files clean: rm-elf -rm -f $(OBJS) +# Removes the binary ELF file rm-elf: - -rm -f $(TARGET) romdisk.* + -rm -f $(TARGET) +# Invokes the compiler to build the target from our object files $(TARGET): $(OBJS) kos-cc -o $(TARGET) $(OBJS) +# Attempts to run the target using the configured loader application run: $(TARGET) $(KOS_LOADER) $(TARGET) +# Creates a distributable/release ELF which strips away its debug symbols dist: $(TARGET) - -rm -f $(OBJS) romdisk.img + -rm -f $(OBJS) $(KOS_STRIP) $(TARGET) diff --git a/examples/dreamcast/hello/hello.c b/examples/dreamcast/hello/hello.c index c1da1c68..7703d21d 100644 --- a/examples/dreamcast/hello/hello.c +++ b/examples/dreamcast/hello/hello.c @@ -2,25 +2,38 @@ hello.c Copyright (C) 2001 Megan Potter + Copyright (C) 2024 Falco Girgis */ -#include <kos.h> +#include <stdio.h> -/* These macros tell KOS how to initialize itself. All of this initialization - happens before main() gets called, and the shutdown happens afterwards. So - you need to set any flags you want here. Here are some possibilities: +/* #include <kos.h> + KOS_INIT_FLAGS(INIT_DEFAULT); +*/ + +/* KOS_INIT_FLAGS() tells KOS how to initialize itself and which drivers to + pull into your executable. All of this initialization happens before main() + gets called, and the shutdown happens afterwards. + + Here are some possible flags to pass to KOS_INIT_FLAGS(): - INIT_NONE -- don't do any auto init - INIT_IRQ -- Enable IRQs + INIT_DEFAULT -- do a normal init with the most common settings + INIT_IRQ -- Enable IRQs (implied by INIT_DEFAULT) INIT_NET -- Enable networking (including sockets) INIT_MALLOCSTATS -- Enable a call to malloc_stats() right before shutdown + INIT_NONE -- don't do any auto init (you must manually init hardware) - You can OR any or all of those together. If you want to start out with - the current KOS defaults, use INIT_DEFAULT (or leave it out entirely). */ -KOS_INIT_FLAGS(INIT_DEFAULT | INIT_MALLOCSTATS); + Refer to kos/init.h and arch/init_flags.h for the full list of flags. + You can OR any or all of these together. + + If you wish to use the default initialization settings, specify + INIT_DEFAULT in your KOS_INIT_FLAGS(). You may also omit KOS_INIT_FLAGS() + from your program (as we are doing here since the above code is commented + out), which will automatically use the default initialization settings. +*/ /* Your program's main entry point */ -int main(int argc, char **argv) { +int main(int argc, char *argv[]) { /* The requisite line */ printf("\nHello world!\n\n"); diff --git a/examples/dreamcast/hello/romdisk/.keepme b/examples/dreamcast/hello/romdisk/.keepme deleted file mode 100644 index e69de29b..00000000 hooks/post-receive -- A pseudo Operating System for the Dreamcast. |