X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/32b9a6d76790c73d3d2d36d9081a2581cc65d184..28c176b668c841a3b7fb093faccf0efa39257603:/lunaix-os/arch/x86/boot/i386/boot32.S diff --git a/lunaix-os/arch/x86/boot/i386/boot32.S b/lunaix-os/arch/x86/boot/i386/boot32.S new file mode 100644 index 0000000..b969104 --- /dev/null +++ b/lunaix-os/arch/x86/boot/i386/boot32.S @@ -0,0 +1,33 @@ +#define __ASM__ + +#if defined(CONFIG_X86_BL_MB) || defined(CONFIG_X86_BL_MB2) +#include "sys/boot/multiboot.S.inc" +#endif + +.section .boot.bss + /* 根据System V ABI,栈地址必须16字节对齐 */ + /* 这里只是一个临时栈,在_hhk_init里面我们会初始化内核专用栈 */ + .align 16 + .skip 256, 0 + __boot_stack_top: + +.section .boot.text + .global start_ + .type start_, @function /* Optional, this just give the + * linker more knowledge about the label + */ + start_: + cld + # 确保屏蔽所有外中断,直到我们准备好PIC为止 + cli + movl $__boot_stack_top, %esp + + subl $16, %esp + + movl %ebx, (%esp) + call x86_init + + addl $16, %esp + + pushl $hhk_entry_ + ret \ No newline at end of file