fix dependency check logic cause config always disabled
[lunaix-os.git] / lunaix-os / arch / x86 / includes / sys / boot / multiboot.S.inc
1 #define __ASM__ 
2
3 #include <linking/base_defs.ld.inc>
4 #include "multiboot.h"
5
6 .section .multiboot
7 __mb_start:
8     .4byte MULTIBOOT_MAGIC
9
10 /*
11     One may wondering why we set the address header part.
12
13     This is due to some weirdo's patch to QEMU that prohibit loading
14     ELF64 using -kernel option. The only way to get around is to
15     fool multiboot loader by pretend ourselves a non-elf kernel.
16
17     Although one may think this "trick" is some-how not portable,
18     the fact is actually the other-way around. It allow us to relax
19     the assumption that grub (or other multiboot compliances) made on
20     our executable.
21  */
22
23 #ifdef CONFIG_X86_BL_MB
24     #define MB_FLAGS    ( MULTIBOOT_MEMORY_INFO |\
25                           MULTIBOOT_PAGE_ALIGN  |\
26                           MULTIBOOT_AOUT_KLUDGE    )
27     .4byte MB_FLAGS
28     .4byte -(MULTIBOOT_MAGIC + MB_FLAGS)
29     .4byte __mb_start
30     .4byte __kload_start
31     .4byte __kload_end
32     .4byte __kbss_end
33     .4byte ENTRY_POINT
34
35 #elif  CONFIG_X86_BL_MB2
36     #define HDR_LEN     (__mb_end - __mb_start)
37     
38     .4byte   0
39     .4byte   HDR_LEN
40     .4byte   -(MULTIBOOT_MAGIC + HDR_LEN)
41
42     .align  MULTIBOOT_TAG_ALIGN
43     __mbir_tag_start:
44     .2byte   MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST
45     .2byte   0
46     .4byte   __mbir_tag_end - __mbir_tag_start
47     .4byte   MULTIBOOT_TAG_TYPE_CMDLINE
48     .4byte   MULTIBOOT_TAG_TYPE_MMAP
49     .4byte   MULTIBOOT_TAG_TYPE_BASIC_MEMINFO
50     .4byte   MULTIBOOT_TAG_TYPE_MODULE
51     __mbir_tag_end:
52
53     __maddr_tag_start:
54     .2byte   MULTIBOOT_HEADER_TAG_ADDRESS
55     .2byte   0
56     .4byte   __maddr_tag_end - __maddr_tag_start
57     .4byte   __mb_start
58     .4byte   __kload_start
59     .4byte   __kload_end
60     .4byte   __kbss_end
61     __maddr_tag_end:
62
63     __ment_tag_start:
64     .2byte   MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS
65     .2byte   0
66     .4byte   __ment_tag_end - __ment_tag_start
67     .4byte ENTRY_POINT
68     __ment_tag_end:
69
70     .align  MULTIBOOT_TAG_ALIGN
71     .2byte  MULTIBOOT_HEADER_TAG_END
72     .2byte  0
73     .4byte  8
74
75 #endif
76
77 __mb_end: