Initial commit
authorLauri Kasanen <cand@gmx.com>
Wed, 26 May 2021 14:51:26 +0000 (17:51 +0300)
committerLauri Kasanen <cand@gmx.com>
Wed, 26 May 2021 14:51:26 +0000 (17:51 +0300)
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
main.c [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..d5b7a1b
--- /dev/null
@@ -0,0 +1,2 @@
+kvm-minippc
+*.o
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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 (file)
index 0000000..5fe7e27
--- /dev/null
+++ b/main.c
@@ -0,0 +1,32 @@
+#define _GNU_SOURCE
+
+#include <getopt.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+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;
+}