Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2348 → Rev 2349

/branches/arm/boot/arch/arm32/loader/mm.h
30,7 → 30,12
/** @addtogroup arm32boot
* @{
*/
/** @file
/** @file
* @brief Memory management used while booting the kernel.
*
* So called "section" paging is used while booting the kernel. The term "section"
* comes from the ARM architecture specification and stands for the following:
* one-level paging, 1MB sized pages, 4096 entries in the page table.
*/
 
 
44,17 → 49,19
 
 
/** Frame width. */
#define FRAME_WIDTH 20 /* 4KB frames */
#define FRAME_WIDTH 20
 
/** 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 (1 << 12)
/** Page size in 2-level paging which is switched on later after the kernel initialization. */
#define KERNEL_PAGE_SIZE (1 << 12)
 
 
#ifndef __ASM__
/** Converts kernel address to physical address. */
# define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
/** Converts physical address to kernel address. */
# define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
#else
# define KA2PA(x) ((x) - 0x80000000)
82,7 → 89,8
 
 
/** Page table level 0 entry - "section" format is used (one-level paging, 1MB sized
* pages). Used only while booting the kernel. */
* pages). Used only while booting the kernel.
*/
typedef struct {
unsigned descriptor_type : 2;
unsigned bufferable : 1;
/branches/arm/boot/arch/arm32/loader/main.c
31,6 → 31,7
* @{
*/
/** @file
* @brief Bootstrap.
*/
 
 
93,7 → 94,7
bootinfo.cnt = 0;
for (i = 0; i < COMPONENTS; i++) {
printf(" %s...", components[i].name);
top = ALIGN_UP(top, PAGE_SIZE);
top = ALIGN_UP(top, KERNEL_PAGE_SIZE);
memcpy(((void *) KERNEL_VIRTUAL_ADDRESS) + top, components[i].start, components[i].size);
if (i > 0) {
bootinfo.tasks[bootinfo.cnt].addr = ((void *) KERNEL_VIRTUAL_ADDRESS) + top;
/branches/arm/boot/arch/arm32/loader/asm.h
31,6 → 31,7
* @{
*/
/** @file
* @brief Functions implemented in assembly.
*/
 
 
47,7 → 48,7
#define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt))
 
 
/** Jumps to the kernel.
/** Jumps to the kernel entry point.
*
* @param entry Kernel entry point address.
* @param bootinfo Structure holding information about loaded tasks.
/branches/arm/boot/arch/arm32/loader/main.h
31,6 → 31,7
* @{
*/
/** @file
* @brief Boot related declarations.
*/
 
 
67,7 → 68,10
} bootinfo_t;
 
 
/** Run when the CPU is switched on. */
/** Called when the CPU is switched on.
*
* Implemented in assembly. Jumps to the #bootstrap only.
*/
extern void start(void);
 
extern void bootstrap(void);
/branches/arm/boot/arch/arm32/loader/mm.c
30,7 → 30,8
/** @addtogroup arm32boot
* @{
*/
/** @file
/** @file
* @brief Memory management used while booting the kernel.
*/
 
 
/branches/arm/boot/arch/arm32/loader/types.h
30,7 → 30,8
/** @addtogroup arm32boot
* @{
*/
/** @file
/** @file
* @brief Definitions of basic types like #uintptr_t.
*/
 
 
/branches/arm/boot/arch/arm32/loader/pack
58,17 → 58,38
. = ALIGN(16384);
*(PT); /* page table */" > "$LINK"
 
echo '#ifndef ___COMPONENTS_H__
echo '
/** @addtogroup arm32boot
* @{
*/
/** @file
* @brief Components (kernel + tasks) related declarations.
*
* Generated by the <code>pack</code> script. This script packs all the
* components (kernel + tasks) into one image (image.boot) and generates
* a code that initializes an array of #component_t structs.
*/
 
#ifndef ___COMPONENTS_H__
#define ___COMPONENTS_H__
 
/** Holds information about components packed to one image (kernel + tasks). */
typedef struct {
/** Name. */
char *name;
/** Start address. */
void *start;
/** End address. */
void *end;
/** Size (in bytes). */
unsigned int size;
} component_t;' > "$HEADER"
} component_t;
 
/** @}
*/
 
' > "$HEADER"
 
COUNT="0"
DATA=""
 
113,4 → 134,5
}
 
#endif
 
" >> "$HEADER"