1 | /* |
---|
2 | * __boot.S - kernel multiboot header |
---|
3 | * |
---|
4 | * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless |
---|
5 | * Copyright (c) 2011,2012 UPMC Sorbonne Universites |
---|
6 | * |
---|
7 | * This file is part of ALMOS-kernel. |
---|
8 | * |
---|
9 | * ALMOS-kernel is free software; you can redistribute it and/or modify it |
---|
10 | * under the terms of the GNU General Public License as published by |
---|
11 | * the Free Software Foundation; version 2.0 of the License. |
---|
12 | * |
---|
13 | * ALMOS-kernel is distributed in the hope that it will be useful, but |
---|
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
16 | * General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with ALMOS-kernel; if not, write to the Free Software Foundation, |
---|
20 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
21 | */ |
---|
22 | |
---|
23 | .section .boot,"ax",@progbits |
---|
24 | .global _start, start |
---|
25 | .extern kboot_entry |
---|
26 | |
---|
27 | #define MULTIBOOT_HEADER_MAGIC 0x1BADB002 |
---|
28 | #define MULTIBOOT_HEADER_FLAGS 0x00000003 |
---|
29 | #define CHECKSUM -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) |
---|
30 | |
---|
31 | _start: |
---|
32 | jmp start |
---|
33 | |
---|
34 | /* -------- The Multiboot header -------- */ |
---|
35 | .align 4 |
---|
36 | multiboot_header: |
---|
37 | .int MULTIBOOT_HEADER_MAGIC |
---|
38 | .int MULTIBOOT_HEADER_FLAGS |
---|
39 | .int CHECKSUM |
---|
40 | /* ----- Multiboot Header Ends Here ----- */ |
---|
41 | .extern tempGdt |
---|
42 | .extern sys_stack |
---|
43 | start: |
---|
44 | pushl %ebx |
---|
45 | call kboot_entry |
---|
46 | cli |
---|
47 | hlt |
---|
48 | |
---|
49 | |
---|
50 | .section .bss |
---|
51 | .global __boot_stack |
---|
52 | .space 4096 |
---|
53 | __boot_stack: |
---|