Subversion Repositories HelenOS

Rev

Rev 242 | Rev 273 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 242 Rev 251
Line 29... Line 29...
29
#define __ASM__
29
#define __ASM__
30
 
30
 
31
#include <arch/mm/page.h>	
31
#include <arch/mm/page.h>	
32
#include <arch/mm/ptl.h>
32
#include <arch/mm/ptl.h>
33
#include <arch/pm.h>
33
#include <arch/pm.h>
-
 
34
#include <arch/cpu.h>
34
 
35
 
35
#define START_STACK     0x7c00	
36
#define START_STACK     0x7c00	
36
#define START_STACK_64  0xffffffff80007c00
37
#define START_STACK_64  0xffffffff80007c00
37
					
38
					
38
#
39
#
Line 99... Line 100...
99
	# Set up paging tables
100
	# Set up paging tables
100
	leal ptl_0, %eax
101
	leal ptl_0, %eax
101
	movl %eax, %cr3
102
	movl %eax, %cr3
102
		
103
		
103
	# Enable long mode
104
	# Enable long mode
104
	movl $0xc0000080, %ecx   # EFER MSR number
105
	movl $EFER_MSR_NUM, %ecx   # EFER MSR number
105
	rdmsr                   # Read EFER
106
	rdmsr                   # Read EFER
106
	btsl $8, %eax            # Set LME=1
107
	btsl $AMD_LME_FLAG, %eax            # Set LME=1
107
	wrmsr                   # Write EFER
108
	wrmsr                   # Write EFER
108
	
109
	
109
	# Enable paging to activate long mode (set CR0.PG=1)
110
	# Enable paging to activate long mode (set CR0.PG=1)
110
	movl %cr0, %eax
111
	movl %cr0, %eax
111
	btsl $31, %eax
112
	btsl $31, %eax