Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3c1ca43f
Commit
3c1ca43f
authored
Jul 08, 2008
by
Ingo Molnar
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'x86/setup' into x86/devel
parents
6924d1ab
6bcb13b3
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
209 additions
and
147 deletions
+209
-147
Documentation/x86/i386/IO-APIC.txt
Documentation/x86/i386/IO-APIC.txt
+0
-0
Documentation/x86/i386/boot.txt
Documentation/x86/i386/boot.txt
+46
-33
Documentation/x86/i386/usb-legacy-support.txt
Documentation/x86/i386/usb-legacy-support.txt
+0
-0
Documentation/x86/i386/zero-page.txt
Documentation/x86/i386/zero-page.txt
+0
-0
Documentation/x86/x86_64/00-INDEX
Documentation/x86/x86_64/00-INDEX
+0
-0
Documentation/x86/x86_64/boot-options.txt
Documentation/x86/x86_64/boot-options.txt
+0
-0
Documentation/x86/x86_64/cpu-hotplug-spec
Documentation/x86/x86_64/cpu-hotplug-spec
+0
-0
Documentation/x86/x86_64/fake-numa-for-cpusets
Documentation/x86/x86_64/fake-numa-for-cpusets
+0
-0
Documentation/x86/x86_64/kernel-stacks
Documentation/x86/x86_64/kernel-stacks
+0
-0
Documentation/x86/x86_64/machinecheck
Documentation/x86/x86_64/machinecheck
+0
-0
Documentation/x86/x86_64/mm.txt
Documentation/x86/x86_64/mm.txt
+0
-0
Documentation/x86/x86_64/uefi.txt
Documentation/x86/x86_64/uefi.txt
+0
-0
arch/x86/Kconfig.debug
arch/x86/Kconfig.debug
+8
-0
arch/x86/boot/a20.c
arch/x86/boot/a20.c
+4
-1
arch/x86/boot/compressed/misc.c
arch/x86/boot/compressed/misc.c
+32
-23
arch/x86/boot/compressed/relocs.c
arch/x86/boot/compressed/relocs.c
+110
-88
arch/x86/boot/cpu.c
arch/x86/boot/cpu.c
+2
-0
arch/x86/boot/main.c
arch/x86/boot/main.c
+4
-0
arch/x86/boot/pmjump.S
arch/x86/boot/pmjump.S
+2
-2
include/asm-x86/bootparam.h
include/asm-x86/bootparam.h
+1
-0
No files found.
Documentation/i386/IO-APIC.txt
→
Documentation/
x86/
i386/IO-APIC.txt
View file @
3c1ca43f
File moved
Documentation/i386/boot.txt
→
Documentation/
x86/
i386/boot.txt
View file @
3c1ca43f
THE LINUX/
I3
86 BOOT PROTOCOL
---------------------------
-
THE LINUX/
x
86 BOOT PROTOCOL
---------------------------
H. Peter Anvin <hpa@zytor.com>
Last update 2007-05-23
On the i386 platform, the Linux kernel uses a rather complicated boot
On the x86 platform, the Linux kernel uses a rather complicated boot
convention. This has evolved partially due to historical aspects, as
well as the desire in the early days to have the kernel itself be a
bootable image, the complicated PC memory model and due to changed
expectations in the PC industry caused by the effective demise of
real-mode DOS as a mainstream operating system.
Currently, the following versions of the Linux/
i3
86 boot protocol exist.
Currently, the following versions of the Linux/
x
86 boot protocol exist.
Old kernels: zImage/Image support only. Some very early kernels
may not even support a command line.
...
...
@@ -372,10 +369,17 @@ Protocol: 2.00+
- If 0, the protected-mode code is loaded at 0x10000.
- If 1, the protected-mode code is loaded at 0x100000.
Bit 5 (write): QUIET_FLAG
- If 0, print early messages.
- If 1, suppress early messages.
This requests to the kernel (decompressor and early
kernel) to not write early messages that require
accessing the display hardware directly.
Bit 6 (write): KEEP_SEGMENTS
Protocol: 2.07+
-
i
f 0, reload the segment registers in the 32bit entry point.
-
i
f 1, do not reload the segment registers in the 32bit entry point.
-
I
f 0, reload the segment registers in the 32bit entry point.
-
I
f 1, do not reload the segment registers in the 32bit entry point.
Assume that %cs %ds %ss %es are all set to flat segments with
a base of 0 (or the equivalent for their environment).
...
...
@@ -504,7 +508,7 @@ Protocol: 2.06+
maximum size was 255.
Field name: hardware_subarch
Type: write
Type: write
(optional, defaults to x86/PC)
Offset/size: 0x23c/4
Protocol: 2.07+
...
...
@@ -520,11 +524,13 @@ Protocol: 2.07+
0x00000002 Xen
Field name: hardware_subarch_data
Type: write
Type: write
(subarch-dependent)
Offset/size: 0x240/8
Protocol: 2.07+
A pointer to data that is specific to hardware subarch
This field is currently unused for the default x86/PC environment,
do not modify.
Field name: payload_offset
Type: read
...
...
@@ -545,6 +551,34 @@ Protocol: 2.08+
The length of the payload.
Field name: setup_data
Type: write (special)
Offset/size: 0x250/8
Protocol: 2.09+
The 64-bit physical pointer to NULL terminated single linked list of
struct setup_data. This is used to define a more extensible boot
parameters passing mechanism. The definition of struct setup_data is
as follow:
struct setup_data {
u64 next;
u32 type;
u32 len;
u8 data[0];
};
Where, the next is a 64-bit physical pointer to the next node of
linked list, the next field of the last node is 0; the type is used
to identify the contents of data; the len is the length of data
field; the data holds the real payload.
This list may be modified at a number of points during the bootup
process. Therefore, when modifying this list one should always make
sure to consider the case where the linked list already contains
entries.
**** THE IMAGE CHECKSUM
From boot protocol version 2.08 onwards the CRC-32 is calculated over
...
...
@@ -553,6 +587,7 @@ initial remainder of 0xffffffff. The checksum is appended to the
file; therefore the CRC of the file up to the limit specified in the
syssize field of the header is always 0.
**** THE KERNEL COMMAND LINE
The kernel command line has become an important way for the boot
...
...
@@ -584,28 +619,6 @@ command line is entered using the following protocol:
covered by setup_move_size, so you may need to adjust this
field.
Field name: setup_data
Type: write (obligatory)
Offset/size: 0x250/8
Protocol: 2.09+
The 64-bit physical pointer to NULL terminated single linked list of
struct setup_data. This is used to define a more extensible boot
parameters passing mechanism. The definition of struct setup_data is
as follow:
struct setup_data {
u64 next;
u32 type;
u32 len;
u8 data[0];
};
Where, the next is a 64-bit physical pointer to the next node of
linked list, the next field of the last node is 0; the type is used
to identify the contents of data; the len is the length of data
field; the data holds the real payload.
**** MEMORY LAYOUT OF THE REAL-MODE CODE
...
...
Documentation/i386/usb-legacy-support.txt
→
Documentation/
x86/
i386/usb-legacy-support.txt
View file @
3c1ca43f
File moved
Documentation/i386/zero-page.txt
→
Documentation/
x86/
i386/zero-page.txt
View file @
3c1ca43f
File moved
Documentation/x86_64/00-INDEX
→
Documentation/x86
/x86
_64/00-INDEX
View file @
3c1ca43f
File moved
Documentation/x86_64/boot-options.txt
→
Documentation/x86
/x86
_64/boot-options.txt
View file @
3c1ca43f
File moved
Documentation/x86_64/cpu-hotplug-spec
→
Documentation/x86
/x86
_64/cpu-hotplug-spec
View file @
3c1ca43f
File moved
Documentation/x86_64/fake-numa-for-cpusets
→
Documentation/x86
/x86
_64/fake-numa-for-cpusets
View file @
3c1ca43f
File moved
Documentation/x86_64/kernel-stacks
→
Documentation/x86
/x86
_64/kernel-stacks
View file @
3c1ca43f
File moved
Documentation/x86_64/machinecheck
→
Documentation/x86
/x86
_64/machinecheck
View file @
3c1ca43f
File moved
Documentation/x86_64/mm.txt
→
Documentation/x86
/x86
_64/mm.txt
View file @
3c1ca43f
File moved
Documentation/x86_64/uefi.txt
→
Documentation/x86
/x86
_64/uefi.txt
View file @
3c1ca43f
File moved
arch/x86/Kconfig.debug
View file @
3c1ca43f
...
...
@@ -20,6 +20,14 @@ config NONPROMISC_DEVMEM
If in doubt, say Y.
config X86_VERBOSE_BOOTUP
bool "Enable verbose x86 bootup info messages"
default y
help
Enables the informational output from the decompression stage
(e.g. bzImage) of the boot. If you disable this you will still
see errors. Disable this if you want silent bootup.
config EARLY_PRINTK
bool "Early printk" if EMBEDDED
default y
...
...
arch/x86/boot/a20.c
View file @
3c1ca43f
/* -*- linux-c -*- ------------------------------------------------------- *
*
* Copyright (C) 1991, 1992 Linus Torvalds
* Copyright 2007 rPath, Inc. - All Rights Reserved
* Copyright 2007
-2008
rPath, Inc. - All Rights Reserved
*
* This file is part of the Linux kernel, and is made available under
* the terms of the GNU General Public License version 2.
...
...
@@ -95,6 +95,9 @@ static void enable_a20_kbc(void)
outb
(
0xdf
,
0x60
);
/* A20 on */
empty_8042
();
outb
(
0xff
,
0x64
);
/* Null command, but UHCI wants it */
empty_8042
();
}
static
void
enable_a20_fast
(
void
)
...
...
arch/x86/boot/compressed/misc.c
View file @
3c1ca43f
...
...
@@ -30,6 +30,7 @@
#include <asm/io.h>
#include <asm/page.h>
#include <asm/boot.h>
#include <asm/bootparam.h>
/* WARNING!!
* This code is compiled with -fPIC and it is relocated dynamically
...
...
@@ -187,13 +188,8 @@ static void gzip_release(void **);
/*
* This is set up by the setup-routine at boot-time
*/
static
unsigned
char
*
real_mode
;
/* Pointer to real-mode data */
#define RM_EXT_MEM_K (*(unsigned short *)(real_mode + 0x2))
#ifndef STANDARD_MEMORY_BIOS_CALL
#define RM_ALT_MEM_K (*(unsigned long *)(real_mode + 0x1e0))
#endif
#define RM_SCREEN_INFO (*(struct screen_info *)(real_mode+0))
static
struct
boot_params
*
real_mode
;
/* Pointer to real-mode data */
static
int
quiet
;
extern
unsigned
char
input_data
[];
extern
int
input_len
;
...
...
@@ -206,7 +202,8 @@ static void free(void *where);
static
void
*
memset
(
void
*
s
,
int
c
,
unsigned
n
);
static
void
*
memcpy
(
void
*
dest
,
const
void
*
src
,
unsigned
n
);
static
void
putstr
(
const
char
*
);
static
void
__putstr
(
int
,
const
char
*
);
#define putstr(__x) __putstr(0, __x)
#ifdef CONFIG_X86_64
#define memptr long
...
...
@@ -270,18 +267,24 @@ static void scroll(void)
vidmem
[
i
]
=
' '
;
}
static
void
putstr
(
const
char
*
s
)
static
void
__putstr
(
int
error
,
const
char
*
s
)
{
int
x
,
y
,
pos
;
char
c
;
#ifndef CONFIG_X86_VERBOSE_BOOTUP
if
(
!
error
)
return
;
#endif
#ifdef CONFIG_X86_32
if
(
RM_SCREEN_INFO
.
orig_video_mode
==
0
&&
lines
==
0
&&
cols
==
0
)
if
(
real_mode
->
screen_info
.
orig_video_mode
==
0
&&
lines
==
0
&&
cols
==
0
)
return
;
#endif
x
=
RM_SCREEN_INFO
.
orig_x
;
y
=
RM_SCREEN_INFO
.
orig_y
;
x
=
real_mode
->
screen_info
.
orig_x
;
y
=
real_mode
->
screen_info
.
orig_y
;
while
((
c
=
*
s
++
)
!=
'\0'
)
{
if
(
c
==
'\n'
)
{
...
...
@@ -302,8 +305,8 @@ static void putstr(const char *s)
}
}
RM_SCREEN_INFO
.
orig_x
=
x
;
RM_SCREEN_INFO
.
orig_y
=
y
;
real_mode
->
screen_info
.
orig_x
=
x
;
real_mode
->
screen_info
.
orig_y
=
y
;
pos
=
(
x
+
cols
*
y
)
*
2
;
/* Update cursor position */
outb
(
14
,
vidport
);
...
...
@@ -366,9 +369,9 @@ static void flush_window(void)
static
void
error
(
char
*
x
)
{
putstr
(
"
\n\n
"
);
putstr
(
x
);
putstr
(
"
\n\n
-- System halted"
);
__putstr
(
1
,
"
\n\n
"
);
__putstr
(
1
,
x
);
__putstr
(
1
,
"
\n\n
-- System halted"
);
while
(
1
)
asm
(
"hlt"
);
...
...
@@ -395,7 +398,8 @@ static void parse_elf(void *output)
return
;
}
putstr
(
"Parsing ELF... "
);
if
(
!
quiet
)
putstr
(
"Parsing ELF... "
);
phdrs
=
malloc
(
sizeof
(
*
phdrs
)
*
ehdr
.
e_phnum
);
if
(
!
phdrs
)
...
...
@@ -430,7 +434,10 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
{
real_mode
=
rmode
;
if
(
RM_SCREEN_INFO
.
orig_video_mode
==
7
)
{
if
(
real_mode
->
hdr
.
loadflags
&
QUIET_FLAG
)
quiet
=
1
;
if
(
real_mode
->
screen_info
.
orig_video_mode
==
7
)
{
vidmem
=
(
char
*
)
0xb0000
;
vidport
=
0x3b4
;
}
else
{
...
...
@@ -438,8 +445,8 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
vidport
=
0x3d4
;
}
lines
=
RM_SCREEN_INFO
.
orig_video_lines
;
cols
=
RM_SCREEN_INFO
.
orig_video_cols
;
lines
=
real_mode
->
screen_info
.
orig_video_lines
;
cols
=
real_mode
->
screen_info
.
orig_video_cols
;
window
=
output
;
/* Output buffer (Normally at 1M) */
free_mem_ptr
=
heap
;
/* Heap */
...
...
@@ -465,9 +472,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
#endif
makecrc
();
putstr
(
"
\n
Decompressing Linux... "
);
if
(
!
quiet
)
putstr
(
"
\n
Decompressing Linux... "
);
gunzip
();
parse_elf
(
output
);
putstr
(
"done.
\n
Booting the kernel.
\n
"
);
if
(
!
quiet
)
putstr
(
"done.
\n
Booting the kernel.
\n
"
);
return
;
}
arch/x86/boot/compressed/relocs.c
View file @
3c1ca43f
This diff is collapsed.
Click to expand it.
arch/x86/boot/cpu.c
View file @
3c1ca43f
...
...
@@ -28,6 +28,8 @@ static char *cpu_name(int level)
if
(
level
==
64
)
{
return
"x86-64"
;
}
else
{
if
(
level
==
15
)
level
=
6
;
sprintf
(
buf
,
"i%d86"
,
level
);
return
buf
;
}
...
...
arch/x86/boot/main.c
View file @
3c1ca43f
...
...
@@ -165,6 +165,10 @@ void main(void)
/* Set the video mode */
set_video
();
/* Parse command line for 'quiet' and pass it to decompressor. */
if
(
cmdline_find_option_bool
(
"quiet"
))
boot_params
.
hdr
.
loadflags
|=
QUIET_FLAG
;
/* Do the last things and invoke protected mode */
go_to_protected_mode
();
}
arch/x86/boot/pmjump.S
View file @
3c1ca43f
...
...
@@ -33,6 +33,8 @@ protected_mode_jump:
movw
%
cs
,
%
bx
shll
$
4
,
%
ebx
addl
%
ebx
,
2
f
jmp
1
f
#
Short
jump
to
serialize
on
386
/
486
1
:
movw
$
__BOOT_DS
,
%
cx
movw
$
__BOOT_TSS
,
%
di
...
...
@@ -40,8 +42,6 @@ protected_mode_jump:
movl
%
cr0
,
%
edx
orb
$X86_CR0_PE
,
%
dl
#
Protected
mode
movl
%
edx
,
%
cr0
jmp
1
f
#
Short
jump
to
serialize
on
386
/
486
1
:
#
Transition
to
32
-
bit
mode
.
byte
0x66
,
0xea
#
ljmpl
opcode
...
...
include/asm-x86/bootparam.h
View file @
3c1ca43f
...
...
@@ -40,6 +40,7 @@ struct setup_header {
__u8
type_of_loader
;
__u8
loadflags
;
#define LOADED_HIGH (1<<0)
#define QUIET_FLAG (1<<5)
#define KEEP_SEGMENTS (1<<6)
#define CAN_USE_HEAP (1<<7)
__u16
setup_move_size
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment