From 87ebd29213b0e10c2103a7e6adea86ab16848338 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Wed, 26 May 2021 17:51:26 +0300 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ Makefile | 15 +++++++++++++++ main.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5b7a1b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +kvm-minippc +*.o diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6a3183c --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +CFLAGS += -Wall -Wextra -g +LDFLAGS += -Wl,-O1 + +NAME = kvm-minippc +SRC = $(wildcard *.c) + +.PHONY: all clean + +all: $(NAME) + +$(NAME): $(SRC) + $(CC) $(SRC) -o $(NAME) $(CFLAGS) $(LDFLAGS) + +clean: + rm -f *.o $(NAME) diff --git a/main.c b/main.c new file mode 100644 index 0000000..5fe7e27 --- /dev/null +++ b/main.c @@ -0,0 +1,32 @@ +#define _GNU_SOURCE + +#include +#include +#include +#include +#include + +static void help(const char argv0[]) { + + printf("Usage: %s [args] -i file.bin\n\n" + + "-i --binary file Raw, bare metal executable\n" + "-g --intregs file Text file setting up GPRs\n" + "-f --fpregs file Text file setting up FPRs\n" + "-s --spregs file Text file setting up SPRs (unnecessary if only LR is needed)\n" + "-l --load file:addr Load this binary to RAM\n" + "-d --dump file:addr:len Save this RAM area after running\n" + "-t --trace file Save a full trace to this file\n" + "-h --help This help\n\n" + + "Load and dump may be given multiple times. GPR/FPR are numbered,\n" + "SPRs are named.\n", argv0); + + exit(0); +} + +int main(int argc, char **argv) { + + + return 0; +} -- 2.30.2