Rev 1787 | Rev 2071 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 1811 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | 34 | ||
35 | #define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE) |
35 | #define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE) |
36 | 36 | ||
37 | .section K_TEXT_START, "ax" |
37 | .section K_TEXT_START, "ax" |
38 | 38 | ||
39 | KTEXT=8 |
- | |
40 | KDATA=16 |
- | |
41 | - | ||
42 | .code32 |
39 | .code32 |
43 | .align 4 |
40 | .align 4 |
44 | .global multiboot_image_start |
41 | .global multiboot_image_start |
45 | multiboot_header: |
42 | multiboot_header: |
46 | .long MULTIBOOT_HEADER_MAGIC |
43 | .long MULTIBOOT_HEADER_MAGIC |
Line 54... | Line 51... | ||
54 | 51 | ||
55 | multiboot_image_start: |
52 | multiboot_image_start: |
56 | movl $START_STACK, %esp # initialize stack pointer |
53 | movl $START_STACK, %esp # initialize stack pointer |
57 | lgdt KA2PA(bootstrap_gdtr) # initialize Global Descriptor Table register |
54 | lgdt KA2PA(bootstrap_gdtr) # initialize Global Descriptor Table register |
58 | 55 | ||
59 | movw $KDATA, %cx |
56 | movw $selector(KDATA_DES), %cx |
60 | movw %cx, %es |
57 | movw %cx, %es |
61 | movw %cx, %fs |
58 | movw %cx, %fs |
62 | movw %cx, %gs |
59 | movw %cx, %gs |
63 | movw %cx, %ds # kernel data + stack |
60 | movw %cx, %ds # kernel data + stack |
64 | movw %cx, %ss |
61 | movw %cx, %ss |
65 | 62 | ||
66 | jmpl $KTEXT, $multiboot_meeting_point |
63 | jmpl $selector(KTEXT_DES), $multiboot_meeting_point |
67 | multiboot_meeting_point: |
64 | multiboot_meeting_point: |
68 | 65 | ||
69 | pushl %ebx # save parameters from GRUB |
66 | pushl %ebx # save parameters from GRUB |
70 | pushl %eax |
67 | pushl %eax |
71 | 68 | ||
Line 382... | Line 379... | ||
382 | mov %eax, %cr0 |
379 | mov %eax, %cr0 |
383 | 380 | ||
384 | jmp 9f |
381 | jmp 9f |
385 | 9: |
382 | 9: |
386 | 383 | ||
387 | ljmpl $KTEXT, $(vesa_init_protect - vesa_init + VESA_INIT_SEGMENT << 4) |
384 | ljmpl $selector(KTEXT_DES), $(vesa_init_protect - vesa_init + VESA_INIT_SEGMENT << 4) |
388 | 385 | ||
389 | 0:# No prefered mode found |
386 | 0:# No prefered mode found |
390 | mov $0x111, %cx |
387 | mov $0x111, %cx |
391 | push %di |
388 | push %di |
392 | push %cx |
389 | push %cx |
Line 409... | Line 406... | ||
409 | 406 | ||
410 | .code32 |
407 | .code32 |
411 | vesa_init_protect: |
408 | vesa_init_protect: |
412 | popl %esp |
409 | popl %esp |
413 | 410 | ||
414 | movw $KDATA, %cx |
411 | movw $selector(KDATA_DES), %cx |
415 | movw %cx, %es |
412 | movw %cx, %es |
416 | movw %cx, %fs |
413 | movw %cx, %fs |
417 | movw %cx, %gs |
414 | movw %cx, %gs |
418 | movw %cx, %ds # kernel data + stack |
415 | movw %cx, %ds # kernel data + stack |
419 | movw %cx, %ss |
416 | movw %cx, %ss |
420 | 417 | ||
421 | jmpl $KTEXT, $vesa_meeting_point |
418 | jmpl $selector(KTEXT_DES), $vesa_meeting_point |
422 | 419 | ||
423 | .align 4 |
420 | .align 4 |
424 | e_vesa_init: |
421 | e_vesa_init: |
425 | #endif |
422 | #endif |
426 | 423 |