-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.c
More file actions
50 lines (41 loc) · 997 Bytes
/
kernel.c
File metadata and controls
50 lines (41 loc) · 997 Bytes
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
#include "drivers/disp.h"
#include "drivers/keyboard.h"
#include "isr.h"
#include "idt.h"
#include "mem.h"
#include "shell.h"
#include "drivers/pci.h"
void main(){
//cls();
print_s("installing isrs \n");
isr_install();
print_s("enabeling external interrupts \n");
asm volatile("sti");
print_s("init keyboard");
init_keyboard();
allocate_first();
print_s("checking for pci devices");
checkallbuses();
//cls();
//pribnr();
int n =5;
char *ptr = (char*) alloc(n*sizeof(char));
for(int i = 0;i<n;i++){
ptr[i] = 'A'+i;
}
for(int i = 0;i<n;i++){
print_c(ptr[i]);
}
char addr[60];
stringaddr(ptr,addr);
print_s("the first pointer stored");
print_s(addr);
freee(ptr);
char *ptr2 = (char*) alloc(n*sizeof(char));
for(int i = 0;i<n;i++){
ptr2[i] = 'A'+(2*i);
}
stringaddr(ptr2,addr);
print_s("the second pointer stored");
print_s(addr);
}