diff options
author | leleraffa97@hotmail.it <leleraffa97@hotmail.it> | 2017-06-19 15:06:25 +0200 |
---|---|---|
committer | leleraffa97@hotmail.it <leleraffa97@hotmail.it> | 2017-06-19 15:06:25 +0200 |
commit | acee9e74f6bd183b284af028b1f08aab666df9be (patch) | |
tree | 02d8df6267dd75dd92760ab9b8e924f4f4b8b400 /sw/z80/kernel/boot_loader.c | |
parent | Merge branch 'master' of github.com:NaoPross/z80uPC into atlas (diff) | |
download | z80uPC-master.tar.gz z80uPC-master.zip |
boot improved
program allocation
Diffstat (limited to 'sw/z80/kernel/boot_loader.c')
-rw-r--r-- | sw/z80/kernel/boot_loader.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/sw/z80/kernel/boot_loader.c b/sw/z80/kernel/boot_loader.c index ddca4f9..03a52b5 100644 --- a/sw/z80/kernel/boot_loader.c +++ b/sw/z80/kernel/boot_loader.c @@ -1,5 +1,6 @@ #include "boot.h" #include "progman.h" +#include "string.h" #define DEFAULT_EXEC_STATUS 0x4000 @@ -14,30 +15,10 @@ void boot_init() { 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; + return !memcmp(PWD_ADDR, pwd, PWD_SIZE); } 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++; - } + memcpy(PWD_ADDR, pwd, PWD_SIZE); }
\ No newline at end of file |