/branches/arm/boot/arch/arm32/loader/mm.h |
---|
44,13 → 44,13 |
/** Frame width. */ |
#define FRAME_WIDTH 12 /* 4KB frames */ |
#define FRAME_WIDTH 20 /* 4KB frames */ |
/** Frame size. */ |
#define FRAME_SIZE (1 << FRAME_WIDTH) |
/** Page size in 2-level paging which is switched on later in the kernel initialization. */ |
#define PAGE_SIZE FRAME_SIZE |
#define PAGE_SIZE (1 << 12) |
#ifndef __ASM__ |
68,9 → 68,6 |
/** Size of an entry in PTL0. */ |
#define PTL0_ENTRY_SIZE 4 |
/** Number of frames per 1MB section. */ |
#define FRAMES_PER_SECTION ( ( 1 << 20 ) / FRAME_SIZE ) |
/** Returns number of frame the address belongs to. */ |
#define ADDR2PFN( addr ) ( ((uintptr_t)(addr)) >> FRAME_WIDTH ) |
/branches/arm/boot/arch/arm32/loader/main.c |
---|
42,7 → 42,7 |
#include "mm.h" |
/** Kernel entry point address. */ |
#define KERNEL_VIRTUAL_ADDRESS 0x80200000 |
#define KERNEL_VIRTUAL_ADDRESS 0x80150000 |
char *release = RELEASE; |
/branches/arm/boot/arch/arm32/loader/mm.c |
---|
47,7 → 47,7 |
* |
* @note If #frame is not 1MB aligned, first lower 1MB aligned frame will be used. |
*/ |
static void init_pte_level0_section(pte_level0_section_t* pte, unsigned frame) |
static void init_pte_level0_section(pte_level0_section_t* pte, unsigned int frame) |
{ |
pte->descriptor_type = PTE_DESCRIPTOR_SECTION; |
pte->bufferable = 0; |
57,7 → 57,7 |
pte->should_be_zero_1 = 0; |
pte->access_permission = PTE_AP_USER_NO_KERNEL_RW; |
pte->should_be_zero_2 = 0; |
pte->section_base_addr = (frame << FRAME_WIDTH) >> 20; |
pte->section_base_addr = frame; |
} |
65,17 → 65,17 |
static void init_page_table(void) |
{ |
int i; |
const unsigned int first_kernel_section = ADDR2PFN(PA2KA(0)) / FRAMES_PER_SECTION; |
const unsigned int first_kernel_page = ADDR2PFN(PA2KA(0)); |
// create 1:1 virtual-physical mapping (in lower 2GB) |
for (i = 0; i < first_kernel_section; i++) { |
init_pte_level0_section(&page_table[i], i * FRAMES_PER_SECTION); |
for (i = 0; i < first_kernel_page; i++) { |
init_pte_level0_section(&page_table[i], i); |
} |
// create 1:1 virtual-physical mapping in kernel space (upper 2GB), |
// physical addresses start from 0 |
for (i = first_kernel_section; i < PTL0_ENTRIES; i++) { |
init_pte_level0_section(&page_table[i], (i - first_kernel_section) * FRAMES_PER_SECTION); |
for (i = first_kernel_page; i < PTL0_ENTRIES; i++) { |
init_pte_level0_section(&page_table[i], i - first_kernel_page); |
} |
} |
/branches/arm/boot/arch/arm32/loader/Makefile |
---|
27,7 → 27,7 |
# |
include ../../../../version |
include ../../../Makefile.config |
include ../../../../Makefile.config |
## Toolchain configuration |
# |
78,14 → 78,14 |
COMPONENTS = \ |
$(KERNELDIR)/kernel.bin \ |
$(USPACEDIR)/init/init |
# $(USPACEDIR)/ns/ns \ |
$(USPACEDIR)/fb/fb \ |
$(USPACEDIR)/ns/ns \ |
$(USPACEDIR)/init/init \ |
$(USPACEDIR)/kbd/kbd \ |
$(USPACEDIR)/console/console \ |
$(USPACEDIR)/tetris/tetris \ |
$(USPACEDIR)/fb/fb \ |
$(USPACEDIR)/ipcc/ipcc \ |
$(USPACEDIR)/klog/klog |
$(USPACEDIR)/klog/klog \ |
$(USPACEDIR)/tetris/tetris |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
COMPONENT_OBJECTS := $(addsuffix .o,$(basename $(notdir $(COMPONENTS)))) |