summaryrefslogtreecommitdiffstats
path: root/sw/z80/kernel/boot_loader.c
diff options
context:
space:
mode:
authorleleraffa97@hotmail.it <leleraffa97@hotmail.it>2017-06-19 13:46:16 +0200
committerleleraffa97@hotmail.it <leleraffa97@hotmail.it>2017-06-19 13:46:16 +0200
commitf85e54f7982d5fefecddccbb11f5aabd478b91d6 (patch)
treeb94a1b06b32119e73c5722fdf97144ae3411321e /sw/z80/kernel/boot_loader.c
parentBoot loader structures (WORK IN PROGRESS) (diff)
downloadz80uPC-f85e54f7982d5fefecddccbb11f5aabd478b91d6.tar.gz
z80uPC-f85e54f7982d5fefecddccbb11f5aabd478b91d6.zip
Authentication section
Programs management
Diffstat (limited to 'sw/z80/kernel/boot_loader.c')
-rw-r--r--sw/z80/kernel/boot_loader.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/sw/z80/kernel/boot_loader.c b/sw/z80/kernel/boot_loader.c
index b7873ec..ddca4f9 100644
--- a/sw/z80/kernel/boot_loader.c
+++ b/sw/z80/kernel/boot_loader.c
@@ -10,4 +10,34 @@ 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