From: John Hodge Date: Thu, 8 Sep 2011 00:16:41 +0000 (+0800) Subject: Kernel/arm7 - Fiddling, still having issues with VMM X-Git-Tag: rel0.11~108 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=5255c9f07cb2e0e43cf283e256c964eaa7970c8e;p=tpg%2Facess2.git Kernel/arm7 - Fiddling, still having issues with VMM --- diff --git a/Kernel/arch/arm7/link.ld b/Kernel/arch/arm7/link.ld index b17677bb..329bc9bd 100644 --- a/Kernel/arch/arm7/link.ld +++ b/Kernel/arch/arm7/link.ld @@ -5,13 +5,17 @@ _kernel_base = 0x80000000; SECTIONS { . = 0; + .init : + { + *(.init) + } . += _kernel_base; .text : AT( ADDR(.text) - _kernel_base ) { *(.text*) *(.rodata*) } - .data ALIGN(0x1000) : AT( ADDR(.data) - _kernel_base ) + .data ALIGN(0x4000) : AT( ADDR(.data) - _kernel_base ) { *(.padata) *(.data*) diff --git a/Kernel/arch/arm7/start.s b/Kernel/arch/arm7/start.s index d1a55daf..fb28d33b 100644 --- a/Kernel/arch/arm7/start.s +++ b/Kernel/arch/arm7/start.s @@ -1,7 +1,8 @@ KERNEL_BASE = 0x80000000 +.section .init interrupt_vector_table: - b . @ Reset + b _start @ Reset b . b SyscallHandler @ SWI instruction b . @@ -10,31 +11,37 @@ interrupt_vector_table: b . b . -.comm stack, 0x10000 @ ; 64KiB Stack - .globl _start _start: - ldr r0, _ptr_kerneltable0 + ldr r0, =kernel_table0-KERNEL_BASE mcr p15, 0, r0, c2, c0, 1 @ Set TTBR1 to r0 - mov r0, #1 - mcr p15, 0, r0, c2, c0, 2 @ Set TTCR to 1 (50/50 split) + mcr p15, 0, r0, c2, c0, 0 @ Set TTBR0 to r0 too (for identity) + +@ mov r0, #1 +@ mcr p15, 0, r0, c2, c0, 2 @ Set TTCR to 1 (50/50 split) - mrc p15, 0, r0, c1, c0, 0 +@ mrc p15, 0, r0, c1, c0, 0 orr r0, r0, #1 - mcr p15, 0, r0, c1, c0, 0 +@ orr r0, r0, #1 << 23 +@ mcr p15, 0, r0, c1, c0, 0 ldr sp, =stack+0x10000 @ Set up stack - bl kmain + ldr r0, =kmain + mov pc, r0 1: b 1b @ Infinite loop -_ptr_kerneltable0: - .long kernel_table0-0x80000000 +_ptr_kmain: + .long kmain + +.comm stack, 0x10000 @ ; 64KiB Stack SyscallHandler: - + b . .section .padata .globl kernel_table0 + kernel_table0: - .rept 0x800 + .long 0x00000002 @ Identity map the first 4 MiB + .rept 0x801 .long 0 .endr .long 0x00000002 @ Identity map the first 4 MiB