Revision 36ecd7c0
b/pc-bios/optionrom/linuxboot.S | ||
---|---|---|
79 | 79 |
mode, so let's get into 32 bit mode, write the kernel and jump |
80 | 80 |
back again. */ |
81 | 81 |
|
82 |
/* Set DS to SS+SP - 0x10, so we can write our GDT descriptor there */ |
|
83 |
mov %ss, %eax |
|
84 |
shl $4, %eax |
|
85 |
add %esp, %eax |
|
86 |
sub $0x10, %eax |
|
87 |
shr $4, %eax |
|
82 |
/* Reserve space on the stack for our GDT descriptor. */ |
|
83 |
mov %esp, %ebp |
|
84 |
sub $16, %esp |
|
88 | 85 |
|
89 | 86 |
/* Now create the GDT descriptor */ |
87 |
movw $((3 * 8) - 1), -16(%bp) |
|
90 | 88 |
mov %cs, %eax |
91 | 89 |
shl $4, %eax |
92 |
movw $((3 * 8) - 1), %bx |
|
93 |
movw %bx, %gs:0 |
|
94 |
movl $gdt, %ebx |
|
95 |
add %eax, %ebx |
|
96 |
movl %ebx, %gs:2 |
|
90 |
addl $gdt, %ebx |
|
91 |
movl %ebx, -14(%bp) |
|
97 | 92 |
|
98 | 93 |
/* And load the GDT */ |
99 |
data32 lgdt %gs:0 |
|
94 |
data32 lgdt -16(%bp) |
|
95 |
mov %ebp, %esp |
|
100 | 96 |
|
101 | 97 |
/* Get us to protected mode now */ |
102 | 98 |
mov $1, %eax |
Also available in: Unified diff