xref: /openbmc/qemu/tests/multiboot/start.S (revision 09a274d8)
1/*
2 * Copyright (c) 2013 Kevin Wolf <kwolf@redhat.com>
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23.section multiboot
24
25#define MB_MAGIC 0x1badb002
26#define MB_FLAGS 0x0
27#define MB_CHECKSUM -(MB_MAGIC + MB_FLAGS)
28
29.align  4
30.int    MB_MAGIC
31.int    MB_FLAGS
32.int    MB_CHECKSUM
33
34.section .text
35.global _start
36_start:
37    mov     $stack, %esp
38    push    %ebx
39    push    %eax
40    call    test_main
41
42    /* Test device exit */
43    outl    %eax, $0xf4
44
45    cli
46    hlt
47    jmp .
48
49.section bss
50.space 8192
51stack:
52