Skip to content

Commit b72a92a

Browse files
Kangxu LiuKangxu Liu
authored andcommitted
fixup
1 parent 977e052 commit b72a92a

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

bottom/fixup.dat

6.33 KB
Binary file not shown.

os/boot/el2.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "uart.h"
2+
#include "pmap.h"
3+
#include "rpsio.h"
4+
#include "rpslib.h"
5+
6+
extern void jump_to_el1();
7+
extern u_long get_current_el();
8+
9+
void el2_main(void)
10+
{
11+
// initialize uart
12+
uart_init();
13+
14+
// create page dir and page map
15+
vm_init();
16+
17+
// fill page map
18+
page_init();
19+
20+
// jump to el1
21+
printf("Now in EL%lx. Jumping to EL1...\n", get_current_el());
22+
jump_to_el1();
23+
24+
panic("failed to jump");
25+
}

os/include/sysconfig.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifndef _SYSCONFIG_H_
2+
#define _SYSCONFIG_H_
3+
4+
#define MAXPA (512 * 1024 * 1024)
5+
#define KSTKSIZE (60 * 1024 * 1024)
6+
7+
#define EL2STACKTOP 0x04000000
8+
#define KSTACKTOP (EL3STACKTOP - 0x400000)
9+
#define UTOP (UPAGES + 0x300000)
10+
#define UPAGES (UVPT + 0x1000)
11+
#define UVPT 0x02000000
12+
#define KERNBASE 0x00080000
13+
14+
#endif // _SYSCONFIG_H_
15+

0 commit comments

Comments
 (0)