-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
63 lines (49 loc) · 1.24 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
63
#include "interrupt.h"
#include "timer.h"
#include "io.h"
#include "util.h"
#include "memory_map.h"
#include "buddy_allocator.h"
#include "paging.h"
#include "threads.h"
#include "lock.h"
#include "test_thread.h"
#include "file_system.h"
#include "initramfs.h"
void main(void) {
start_critical_section();
get_memory_map();
init_buddy();
map_init();
print_mempry_map();
init_malloc_small();
init_threads();
init_interrupt(); // инициализируем прерывание
init_timer();
init_file_system();
initramfs_to_fs();
/*int id = open("/file", O_CREAT|O_WRONLY|O_TRUNC);
open("/file2", O_CREAT|O_WRONLY|O_TRUNC);
open("/file3", O_WRONLY|O_TRUNC);
mkdir("/dir1");
mkdir("/dir1/dir2");
open("/dir1/dir2/file2", O_CREAT|O_WRONLY|O_TRUNC);
open("/dir1/file179", O_CREAT|O_WRONLY|O_TRUNC);
for (int i = 0; i < 50; ++i) {
write(id, "a", 1);
}
close(id);
id = open("/file", O_RDONLY);
printf("%d\n", id);
char s[3];
int size = 0;
while ((size = read(id, s, 3)) > 0) {
for (int i= 0; i < size; ++i) {
printf("%c", s[i]);
}
}
printf("\n");*/
print_file_system();
end_critical_section();
hang();
}