Rev 388 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 388 | Rev 394 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | endp |
30 | endp |
31 | 31 | ||
Line 32... | Line 32... | ||
32 | align 4 |
32 | align 4 |
33 | proc init_mem |
33 | proc init_mem |
34 | - | ||
35 | mov eax, [MEM_AMOUNT-OS_BASE] |
34 | mov eax, [MEM_AMOUNT-OS_BASE] |
36 | mov [pg_data.mem_amount-OS_BASE], eax |
35 | mov [pg_data.mem_amount-OS_BASE], eax |
37 | mov [pg_data.kernel_max-OS_BASE], eax |
36 | mov [pg_data.kernel_max-OS_BASE], eax |
Line 38... | Line 37... | ||
38 | 37 | ||
Line 72... | Line 71... | ||
72 | mov cr4, ebx |
71 | mov cr4, ebx |
73 | sub [pg_data.kernel_tables-OS_BASE], 2 |
72 | sub [pg_data.kernel_tables-OS_BASE], 2 |
74 | 73 | ||
Line 75... | Line 74... | ||
75 | mov [edx], eax |
74 | mov [edx], eax |
76 | mov [edx+16], eax |
75 | mov [edx+(OS_BASE shr 20)], eax |
77 | add eax, 0x00400000 |
76 | add eax, 0x00400000 |
Line 78... | Line 77... | ||
78 | 77 | ||
79 | mov [edx+4], eax |
78 | mov [edx+4], eax |
80 | mov [edx+20], eax |
79 | mov [edx+(OS_BASE shr 20)+4], eax |
Line 81... | Line 80... | ||
81 | add eax, 0x00400000 |
80 | add eax, 0x00400000 |
82 | 81 | ||
83 | mov [edx+8], eax |
82 | mov [edx+8], eax |
Line 84... | Line 83... | ||
84 | mov [edx+24], eax |
83 | mov [edx+(OS_BASE shr 20)+8], eax |
85 | add eax, 0x00400000 |
84 | add eax, 0x00400000 |
86 | 85 | ||
87 | mov [edx+12], eax |
86 | mov [edx+12], eax |
Line 88... | Line 87... | ||
88 | mov [edx+28], eax |
87 | mov [edx+(OS_BASE shr 20)+12], eax |
89 | add edx, 32 |
88 | add edx, (OS_BASE shr 20)+16 |
90 | add eax, 0x00400000 |
89 | add eax, 0x00400000 |
Line 126... | Line 125... | ||
126 | align 4 |
125 | align 4 |
127 | proc init_page_map |
126 | proc init_page_map |
Line 128... | Line 127... | ||
128 | 127 | ||
129 | mov edi, sys_pgmap-OS_BASE |
128 | mov edi, sys_pgmap-OS_BASE |
130 | mov ecx, (HEAP_BASE/4096)/32 ;384/4 |
129 | mov ecx, ((HEAP_BASE-OS_BASE)/4096)/32 ;384/4 |
131 | mov ebx, ecx |
130 | mov ebx, ecx |
132 | xor eax,eax |
131 | xor eax,eax |
133 | cld |
132 | cld |
Line 141... | Line 140... | ||
141 | 140 | ||
Line 142... | Line 141... | ||
142 | lea edi, [sys_pgmap-OS_BASE+ebx*4] ;+384 |
141 | lea edi, [sys_pgmap-OS_BASE+ebx*4] ;+384 |
143 | mov edx, [pg_data.pages_count-OS_BASE] |
142 | mov edx, [pg_data.pages_count-OS_BASE] |
144 | mov ecx, [pg_data.kernel_tables-OS_BASE] |
143 | mov ecx, [pg_data.kernel_tables-OS_BASE] |
145 | add ecx, (HEAP_BASE/4096) and 31 |
144 | add ecx, ((HEAP_BASE-OS_BASE)/4096) and 31 |
146 | sub edx, HEAP_BASE/4096 |
145 | sub edx, (HEAP_BASE-OS_BASE)/4096 |
147 | sub edx, ecx |
146 | sub edx, ecx |
148 | mov [pg_data.pages_free-OS_BASE], edx |
147 | mov [pg_data.pages_free-OS_BASE], edx |
Line 149... | Line 148... | ||
149 | 148 | ||
150 | xor eax, eax |
149 | xor eax, eax |