Changeset 36650 in vbox for trunk/src/VBox/Devices/EFI/Thunk/EfiThunk.asm
- Timestamp:
- Apr 12, 2011 11:19:47 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Thunk/EfiThunk.asm
r28800 r36650 76 76 dw 0xffff, 0, 0x9300, 0x00cf ; 32 bit flat stack segment (0x30) 77 77 dw 0xffff, 0, 0x9a00, 0x00af ; 64 bit flat code segment (0x38) 78 dw 0 , 0, 0, 0 ; ditto78 dw 0xffff, 0, 0x8900, 0x0080 ; 64 bit TSS descriptor (0x40) 79 79 dw 0, 0, 0, 0 ; ditto 80 80 … … 92 92 db 0x0f ; base 23:16 93 93 db 0x00 ; unused 94 94 95 95 BITS 32 96 96 … … 224 224 %endmacro 225 225 226 %define base 0x800000;0xfffff000 226 %define base 0x800000;0xfffff000 227 227 mov ecx, 0x800 ; pde size 228 228 mov ebx, base - (6 << X86_PAGE_4K_SHIFT) 229 229 xor eax, eax 230 ;; or flags to eax 231 or eax, (X86_PDE_P|X86_PDE_A|X86_PDE_PS|X86_PDE_PCD|X86_PDE_RW|RT_BIT(6)) 230 ;; or flags to eax 231 or eax, (X86_PDE_P|X86_PDE_A|X86_PDE_PS|X86_PDE_PCD|X86_PDE_RW|RT_BIT(6)) 232 232 fill_pkt (1 << X86_PAGE_2M_SHIFT) 233 233 234 234 ;; pdpt (1st 4 entries describe 4Gb) 235 235 mov ebx, base - (2 << X86_PAGE_4K_SHIFT) 236 mov eax, base - (6 << X86_PAGE_4K_SHIFT) ;; 237 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 238 mov [ebx],eax 239 xor edx,edx 240 mov [ebx + 4], edx 241 add ebx, 8 242 243 mov eax, base - 5 * (1 << X86_PAGE_4K_SHIFT) ;; 244 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 245 mov [ebx],eax 246 xor edx,edx 247 mov [ebx + 4], edx 248 add ebx, 8 249 250 mov eax, base - 4 * (1 << X86_PAGE_4K_SHIFT) ;; 251 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 252 mov [ebx],eax 253 xor edx,edx 254 mov [ebx + 4], edx 255 add ebx, 8 256 257 mov eax, base - 3 * (1 << X86_PAGE_4K_SHIFT) ;; 236 mov eax, base - (6 << X86_PAGE_4K_SHIFT) ;; 237 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 238 mov [ebx],eax 239 xor edx,edx 240 mov [ebx + 4], edx 241 add ebx, 8 242 243 mov eax, base - 5 * (1 << X86_PAGE_4K_SHIFT) ;; 244 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 245 mov [ebx],eax 246 xor edx,edx 247 mov [ebx + 4], edx 248 add ebx, 8 249 250 mov eax, base - 4 * (1 << X86_PAGE_4K_SHIFT) ;; 251 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 252 mov [ebx],eax 253 xor edx,edx 254 mov [ebx + 4], edx 255 add ebx, 8 256 257 mov eax, base - 3 * (1 << X86_PAGE_4K_SHIFT) ;; 258 258 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 259 259 mov [ebx],eax … … 264 264 mov ecx, 0x1f7 ; pdte size 265 265 mov ebx, base - 2 * (1 << X86_PAGE_4K_SHIFT) + 4 * 8 266 mov eax, base - 6 * (1 << X86_PAGE_4K_SHIFT);; 267 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 268 ;; or flags to eax 266 mov eax, base - 6 * (1 << X86_PAGE_4K_SHIFT);; 267 or eax, (X86_PDPE_P|X86_PDPE_RW|X86_PDPE_A|X86_PDPE_PCD) 268 ;; or flags to eax 269 269 fill_pkt 3 * (1 << X86_PAGE_4K_SHIFT) 270 270 271 271 mov ecx, 0x200 ; pml4 size 272 272 mov ebx, base - (1 << X86_PAGE_4K_SHIFT) 273 mov eax, base - 2 * (1 << X86_PAGE_4K_SHIFT) ;; 273 mov eax, base - 2 * (1 << X86_PAGE_4K_SHIFT) ;; 274 274 or eax, (X86_PML4E_P|X86_PML4E_PCD|X86_PML4E_A|X86_PML4E_RW) 275 ;; or flags to eax 275 ;; or flags to eax 276 276 fill_pkt 0 277 277 … … 283 283 or eax, X86_CR4_PAE|X86_CR4_OSFSXR|X86_CR4_OSXMMEEXCPT 284 284 mov cr4,eax 285 285 286 286 mov ecx, MSR_K6_EFER 287 287 rdmsr 288 288 or eax, MSR_K6_EFER_LME 289 289 wrmsr 290 291 mov ax, 0x40 292 ltr ax 290 293 291 294 mov eax, cr0
Note:
See TracChangeset
for help on using the changeset viewer.