Phoenix
Object-oriented orthogonally persistent operating system
boot.h
Go to the documentation of this file.
00001 /*
00002  * /phoenix/kernel/sys/boot.h
00003  *
00004  * This file is a part of Phoenix operating system.
00005  * Copyright (c) 2011-2012, Artyom Lebedev <artyom.lebedev@gmail.com>
00006  * All rights reserved.
00007  * See COPYING file for copyright details.
00008  */
00009 
00010 #ifndef BOOT_H_
00011 #define BOOT_H_
00012 
00020 #ifdef __cplusplus
00021 
00022 #ifdef AUTONOMOUS_LINKING
00023 namespace {
00024 #endif /* AUTONOMOUS_LINKING */
00025 
00027 namespace boot {
00028 
00029 #endif /* __cplusplus */
00030 
00031 enum {
00035     BOOT_STACK_SIZE =       0x8000,
00036 };
00037 
00039 typedef struct {
00040     paddr_t efiSystemTable; 
00041     u32 cmdLineSize; 
00042     char *cmdLine; 
00043     void *memMap; 
00044     u32 memMapNumDesc; 
00045     u32 memMapDescSize; 
00046     u32 memMapDescVersion; 
00047 } BootParam;
00048 
00052 extern BootParam *kernBootParam;
00053 
00054 #ifdef __cplusplus
00055 
00057 struct BootstrapParam {
00058     BootParam *bootParam; 
00059     vaddr_t heap; 
00060     paddr_t defaultLatRoot; 
00061     vaddr_t quickMap; 
00062     void *quickMapPte[vm::NUM_QUICK_MAP]; 
00063 };
00064 
00066 static inline vm::Vaddr
00067 BootToMapped(vm::Vaddr va)
00068 {
00069     return va - LOAD_ADDRESS + vm::VMA_KERNEL_TEXT;
00070 }
00071 
00073 static inline vm::Vaddr
00074 MappedToBoot(vm::Vaddr va)
00075 {
00076     return va - KERNEL_ADDRESS + LOAD_ADDRESS;
00077 }
00078 
00079 } /* namespace boot */
00080 
00081 #ifdef AUTONOMOUS_LINKING
00082 }
00083 #endif /* AUTONOMOUS_LINKING */
00084 
00089 void Main(void *arg) __NORETURN;
00090 
00091 #endif /* __cplusplus */
00092 
00093 /* Symbols injected by linker script. */
00094 extern u8   kernBootBss, 
00095             kernBootEnd, 
00096             kernText, 
00097             kernTextEnd, 
00098             kernRodataEnd, 
00099             kernRamdisk, 
00100             kernRamdiskEnd, 
00101             kernDataEnd, 
00102             kernEnd; 
00105 extern u32  kernRamdiskSize;
00106 
00107 #endif /* BOOT_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines