blob: 632b3f4ffa6f6f82c2fc33c781324b5a6af70cda (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* SPDX-FileCopyrightText: Juergen Beisert, Pengutronix */
/* This code was inspired by the GRUB2 project. */
/**
* @file
* @brief Common boot sector main routine to be entered by the BIOS
*/
/**
* @fn void _start(void)
*
* @brief Fix segment:offset settings of some buggy BIOSs
*/
.file "boot_main.S"
.code16
.extern real_start
.section .boot_start, "ax"
.type _start, @function
/*
* The BIOS loads this code to address 0x00007c00.
* The code should be called with CS:IP 0:0x7c00 (hopefully).
*/
.globl _start
_start:
cli /* we're not safe here! */
/*
* It seems there are implementations in the wild which call this
* code with CS:IP 0x07C0:0000 instead. We fix it immediately.
*/
ljmp $0, $real_start
.size _start, .-_start
|