summaryrefslogtreecommitdiffstats
path: root/sw/z80/kernel/boot_loader.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sw/z80/kernel/boot_loader.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/sw/z80/kernel/boot_loader.c b/sw/z80/kernel/boot_loader.c
new file mode 100644
index 0000000..ddca4f9
--- /dev/null
+++ b/sw/z80/kernel/boot_loader.c
@@ -0,0 +1,43 @@
+#include "boot.h"
+#include "progman.h"
+
+#define DEFAULT_EXEC_STATUS 0x4000
+
+struct exec_status *status = EXEC_STATUS;
+
+void boot_init() {
+
+ *status = DEFAULT_EXEC_STATUS;
+
+ // TODO other stuff
+}
+
+int8_t authenticate(const char *pwd) {
+
+ const char *c_pwd = PWD_ADDR, *c_req = pwd;
+
+ for (uint8_t i = 0; i < PWD_SIZE; i++) {
+
+ if (*c_pwd != *c_req)
+ return 0;
+
+ c_pwd++;
+ c_req++;
+ }
+
+ return 1;
+}
+
+void set_pwd(const char *pwd) {
+
+ char *c_pwd = PWD_ADDR;
+ const char *c_req = pwd;
+
+ for (uint8_t i = 0; i < PWD_SIZE; i++) {
+
+ *c_pwd = *c_req;
+
+ c_pwd++;
+ c_req++;
+ }
+} \ No newline at end of file