-
Notifications
You must be signed in to change notification settings - Fork 2
/
zelda_config.h
125 lines (104 loc) · 3.45 KB
/
zelda_config.h
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
* Copyright (c) 2018 Jie Zheng
*/
/*
* the kernel logging level, for more definition, please refer to:
* kernel/include/printk.h
*/
//#define KERNEL_LOGGING_LEVEL LOG_TRIVIA
//#define KERNEL_LOGGING_LEVEL LOG_DEBUG
#define KERNEL_LOGGING_LEVEL LOG_INFO
/*
*KERNEL_VMA_ARRAY_LENGTH is the length of kernel VMA array, this is
*to be larger than 64
*/
#define KERNEL_VMA_ARRAY_LENGTH 1024
/*
* page space bottom set to 0x4000000, i.e. 64MB
* Kernel heap bottom set to 0x8000000, i.e. 128MB
* kernel heap top set to 0x1F000000 : 496MB
* kernel stack bottom set to 0x1F000000 : 496MB
* while kernel stack top is set to 0x20000000, i.e. 512 MB
*/
#define PAGE_SPACE_BOTTOM 0x4000000
#define PAGE_SPACE_TOP 0x8000000
#define KERNEL_HEAP_BOTTOM PAGE_SPACE_TOP
#define KERNEL_HEAP_TOP 0x1F000000
//#define KERNEL_STACK_BOTTOM KERNEL_HEAP_TOP
//#define KERNEL_STACK_TOP 0x20000000
/*
* Userspace memory layout:
* the lower 1G address space is for kernel at PL0
* the upper 2.5G address space is for user application at PL3
* the memory layout:
* +-------+
* | | (0.5G unused)
* | |
*0xE0000000+-------+ <--- USERSPACE_TOP
* | | |
* | | |
* | | |
* v | | *(mmap)
* 1G | | *(shared library)
* ^ | |
* | |-------| <--- USERSPACE_SIGNAL_STACK_TOP
* | | |
*0xA0000000+---+---+ <--- USERSPACE_STACK_TOP
* | | | | (fixed,Do Not Overlap)
* | | v |
* | | |
* v | |
* 1.5G | ^ |
* ^ +---+---+ <--- Heap Bottom
* | | | (variable)
* | | | .data & .bss
* | | | .text
*0x40000000+-------+ <--- USERSPACE_BOTTOM
* | |
* | | 1G kernel
* | |
* 0x0+-------+
*/
#define USERSPACE_BOTTOM 0x40000000
#define USERSPACE_STACK_TOP 0xA0000000
#define USERSPACE_TOP 0xE0000000
#define KERNELSPACE_TOP USERSPACE_BOTTOM
/*
*The MAX_FRAME_ON_DUMPSTACK indicates the maximum frames to dump
*the calling stack.
*/
#define MAX_FRAME_ON_DUMPSTACK 64
#define DEFAULT_TASK_PRIVILEGED_STACK_SIZE (2 * 1024 * 1024)
#define DEFAULT_TASK_NON_PRIVILEGED_STACK_SIZE (8 * 1024 * 1024)
#define DEFAULT_TASK_PRIVILEGED_SIGNAL_STACK_SIZE (512 * 1024)
#define DEFAULT_TASK_NON_PRIVILEGED_SIGNAL_STACK_SIZE (1024 * 1024)
#define USERSPACE_SIGNAL_STACK_TOP \
(USERSPACE_STACK_TOP + DEFAULT_TASK_NON_PRIVILEGED_SIGNAL_STACK_SIZE)
/*
* enable/disable task preemption
*/
#define TASK_PREEMPTION 1
/*
* maximum number of file descriptors one task can contain
*/
#define MAX_FILE_DESCRIPTR_PER_TASK 256
#define PRE_PROCESS_SIGNAL
// the size of kernel task hash table.
// it must be power of 2.
#define KERNEL_TASK_HASH_TABLE_SIZE 1024
/*
* The number of terminals, we switch terminals by group key: Alt+[F2-F7]
* the default console is switched to by enter Alt+F1
*/
#define MAX_TERMINALS 6
#define PSEUDO_BUFFER_SIZE 64
// the path to initialize Userland applications
// this path is to initiate the first PL3 task
#define USERLAND_INIT_PATH "/usr/bin/userland_init"
// default network packet amount.
// the actual memory needed is `DEFAULT_NET_PACKET_AMOUNT` * 2048
#define DEFAULT_NET_PACKET_AMOUNT (1024 * 8)
// Maximum number of Ethernet devices
// FIXME: for scale reason, given a port index,
// I should use a hash table to store and search the ethernet device.
#define MAX_NR_ETHERNET_DEVCIES 256