From b8284137d4e0eec11c78bc14047243fce6a51373 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 6 Sep 2020 15:47:06 -0400 Subject: minor changes, redoing makefile, meminfo program --- src/user/init/init.c | 31 +++++++++++++++++++++++++++++++ src/user/init/main.c | 31 ------------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) create mode 100644 src/user/init/init.c delete mode 100644 src/user/init/main.c (limited to 'src/user/init') diff --git a/src/user/init/init.c b/src/user/init/init.c new file mode 100644 index 0000000..b8536be --- /dev/null +++ b/src/user/init/init.c @@ -0,0 +1,31 @@ +#include +#include +#include + +void main() { + struct file *f = open_file("SYS/STARTUP.RC"); + if (!f) { + tell_user_sz("Could not open SYS/STARTUP.RC\n"); + return; + } + + char buf[1024]; + char *bufp = buf; + while (read_from_file(f, 1, bufp)) { + if (*bufp == '\n') { + if (bufp == buf) + continue; + *bufp = '\0'; + try_run_command(buf); + bufp = buf; + } + else + ++bufp; + } + if (bufp != buf) { + *bufp = '\0'; + try_run_command(buf); + } + + close_file(f); +} diff --git a/src/user/init/main.c b/src/user/init/main.c deleted file mode 100644 index c301a78..0000000 --- a/src/user/init/main.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include - -void main() { - struct file *f = open_file("SYS/STARTUP.RC"); - if (!f) { - tell_user_sz("\nCould not open SYS/STARTUP.RC"); - return; - } - - char buf[1024]; - char *bufp = buf; - while (read_from_file(f, 1, bufp)) { - if (*bufp == '\n') { - if (bufp == buf) - continue; - *bufp = '\0'; - try_run_command(buf); - bufp = buf; - } - else - ++bufp; - } - if (bufp != buf) { - *bufp = '\0'; - try_run_command(buf); - } - - close_file(f); -} -- cgit v1.2.3