Rev 298 | Rev 314 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 298 | Rev 300 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | # |
27 | # |
28 | 28 | ||
- | 29 | #define __ASM__ |
|
- | 30 | ||
29 | #include <arch/boot/boot.h> |
31 | #include <arch/boot/boot.h> |
30 | #include <arch/boot/memmapasm.h> |
32 | #include <arch/boot/memmapasm.h> |
- | 33 | #include <arch/mm/page.h> |
|
- | 34 | #include <arch/pm.h> |
|
31 | 35 | ||
32 | .section K_TEXT_START |
36 | .section K_TEXT_START |
33 | .global kernel_image_start |
37 | .global kernel_image_start |
34 | 38 | ||
35 | KTEXT=8 |
39 | KTEXT=8 |
Line 51... | Line 55... | ||
51 | movw %ax, %ss # initialize stack segment register |
55 | movw %ax, %ss # initialize stack segment register |
52 | movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer |
56 | movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer |
53 | 57 | ||
54 | call memmap_arch_init |
58 | call memmap_arch_init |
55 | 59 | ||
56 | lgdt real_bootstrap_gdtr # initialize Global Descriptor Table register |
60 | lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register |
57 | 61 | ||
58 | movl %cr0, %eax |
62 | movl %cr0, %eax |
59 | orl $0x1, %eax |
63 | orl $0x1, %eax |
60 | movl %eax, %cr0 # switch to protected mode |
64 | movl %eax, %cr0 # switch to protected mode |
61 | 65 | ||
Line 233... | Line 237... | ||
233 | .section K_DATA_START |
237 | .section K_DATA_START |
234 | 238 | ||
235 | .align 4096 |
239 | .align 4096 |
236 | page_directory: |
240 | page_directory: |
237 | .space 4096, 0 |
241 | .space 4096, 0 |
- | 242 | ||
- | 243 | .global real_bootstrap_gdtr_boot |
|
- | 244 | real_bootstrap_gdtr_boot: |
|
- | 245 | .word selector(GDT_ITEMS) |
|
- | 246 | .long KA2PA(gdt)-BOOT_OFFSET |
|
- | 247 | ||
238 | 248 |