Subversion Repositories HelenOS-historic

Rev

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

Rev 206 Rev 242
Line 31... Line 31...
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
 
34
 
35
#define START_STACK     0x7c00	
35
#define START_STACK     0x7c00	
36
#define START_STACK_64  $0xffffffff80007c00
36
#define START_STACK_64  0xffffffff80007c00
37
					
37
					
38
#
38
#
39
# This is where we require any SPARTAN-kernel-compatible boot loader
39
# This is where we require any SPARTAN-kernel-compatible boot loader
40
# to pass control in real mode.
40
# to pass control in real mode.
41
#
41
#
Line 49... Line 49...
49
kernel_image_start:
49
kernel_image_start:
50
	cli
50
	cli
51
	xorw %ax,%ax
51
	xorw %ax,%ax
52
	movw %ax,%ds
52
	movw %ax,%ds
53
	movw %ax,%ss            # initialize stack segment register
53
	movw %ax,%ss            # initialize stack segment register
54
	movl START_STACK,%esp	# initialize stack pointer
54
	movl $(START_STACK),%esp	# initialize stack pointer
55
	
55
	
56
#	call memmap_arch_init
56
	call memmap_arch_init
57
	
57
	
58
	movl $0x80000000, %eax  
58
	movl $0x80000000, %eax  
59
	cpuid
59
	cpuid
60
	cmp $0x80000000, %eax 	# any function > 80000000h?
60
	cmp $0x80000000, %eax 	# any function > 80000000h?
61
	jbe no_long_mode
61
	jbe no_long_mode
Line 114... Line 114...
114
	# At this point we are in compatibility mode
114
	# At this point we are in compatibility mode
115
	jmpl $gdtselector(KTEXT_DES), $start64
115
	jmpl $gdtselector(KTEXT_DES), $start64
116
 
116
 
117
.code64
117
.code64
118
start64:
118
start64:
119
	movq START_STACK_64, %rsp
119
	movq $(START_STACK_64), %rsp
120
	
120
	
121
	call main_bsp   # never returns
121
	call main_bsp   # never returns
122
1:
122
1:
123
	jmp 1b
123
	jmp 1b
124
				
124