Subversion Repositories HelenOS-historic

Rev

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

Rev 117 Rev 177
Line 48... Line 48...
48
.code16
48
.code16
49
	cli
49
	cli
50
	xorw %ax,%ax
50
	xorw %ax,%ax
51
	movw %ax,%ds
51
	movw %ax,%ds
52
 
52
 
-
 
53
	lgdt gdtr			# initialize Global Descriptor Table register
-
 
54
	lidt idtr			# initialize Interrupt Descriptor Table register
53
	lgdt gdtr
55
	
54
	movl %cr0,%eax
56
	movl %cr0,%eax
55
	orl $1,%eax
57
	orl $1,%eax
56
	movl %eax,%cr0
58
	movl %eax,%cr0			# switch to protected mode
57
	jmpl $KTEXT,$jump_to_kernel
59
	jmpl $KTEXT,$jump_to_kernel
58
jump_to_kernel:
60
jump_to_kernel:
59
.code32
61
.code32
60
	movw $KDATA,%ax
62
	movw $KDATA,%ax
61
	movw %ax,%ds
63
	movw %ax,%ds
Line 63... Line 65...
63
	movw %ax,%ss
65
	movw %ax,%ss
64
	movl $(ctx-0x80000000),%eax	# KA2PA((__address) &ctx)
66
	movl $(ctx-0x80000000),%eax	# KA2PA((__address) &ctx)
65
	movl (%eax),%esp
67
	movl (%eax),%esp
66
	subl $0x80000000,%esp		# KA2PA(ctx.sp)
68
	subl $0x80000000,%esp		# KA2PA(ctx.sp)
67
 
69
 
68
	lidt idtr
-
 
69
 
-
 
70
	call map_kernel
70
	call map_kernel			# map kernel and turn paging on
71
 
71
 
72
	jmpl $KTEXT,$main_ap
72
	jmpl $KTEXT,$main_ap
73
 
73
 
74
#endif /* __SMP__ */
74
#endif /* __SMP__ */