forked from jordanbray/CECS-525-in-C-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
62 lines (52 loc) · 1.14 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* M68K C Educational Kernel
*
* Written By:
* Jordan Bray
* Phillip "Op" Flarsheim
* Jimmy Murphy
*
* Written for the M68K microprocessor that is used at the
* University of Louisville for the CECS 525 Microcomputer
* Design class.
* */
#include <screen.h>
#include <kmem.h>
#include <string.h>
#include <shell.h>
#include <tree.h>
#include <commands/commands.h>
#include <auth/authentication.h>
/**
* Main kernel function
* */
void main() {
//Must initialize the ACIA
initialize_acia();
//Init kernel memory
kmeminit();
//Setup Authentication
initAuth();
//Add Users
add_users();
//Welcome message
putstr("\nWelcome to the CECS-525 (unstable) Educational kernel!\n\
Created by: Jordan Bray, Phillip 'Op' Flarsheim and Jimmy Murphy\n\n");
initialize_shell();
while (1) {
putstr("Please login...\n");
//Check login
char *user = kmalloc((sizeof(char)*30)+1);
char *pass = kmalloc((sizeof(char)*30)+1);
do {
putstr("\nUsername: ");
getstr(user, 30);
putstr("Password: ");
getpass(pass, 30);
} while (checkLogin(user, pass) != 1);
//Begin the shell
shell(user);
kfree(user);
kfree(pass);
}
}