blob: ac108d1fe182a44abcd0da75f18aae5fde32e1c0 [file] [log] [blame]
Eric W. Biederman700efc12008-02-23 09:58:20 +01001/*
2 * linux/arch/i386/kernel/head32.c -- prepare to run common code
3 *
4 * Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
5 * Copyright (C) 2007 Eric Biederman <ebiederm@xmission.com>
6 */
7
8#include <linux/init.h>
9#include <linux/start_kernel.h>
10
Yinghai Lua4c81cf2008-05-18 01:18:57 -070011#include <asm/setup.h>
12#include <asm/sections.h>
13#include <asm/e820.h>
14#include <asm/bios_ebda.h>
Rafael J. Wysocki3e1e9002008-12-08 00:50:22 +010015#include <asm/trampoline.h>
Yinghai Lua4c81cf2008-05-18 01:18:57 -070016
Eric W. Biederman700efc12008-02-23 09:58:20 +010017void __init i386_start_kernel(void)
18{
Rafael J. Wysocki3e1e9002008-12-08 00:50:22 +010019 reserve_trampoline_memory();
20
Yinghai Lua4c81cf2008-05-18 01:18:57 -070021 reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
22
23#ifdef CONFIG_BLK_DEV_INITRD
24 /* Reserve INITRD */
25 if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
26 u64 ramdisk_image = boot_params.hdr.ramdisk_image;
27 u64 ramdisk_size = boot_params.hdr.ramdisk_size;
28 u64 ramdisk_end = ramdisk_image + ramdisk_size;
29 reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
30 }
31#endif
Yinghai Luf0d43102008-05-29 12:56:36 -070032 reserve_early(init_pg_tables_start, init_pg_tables_end,
33 "INIT_PG_TABLE");
Yinghai Lua4c81cf2008-05-18 01:18:57 -070034
35 reserve_ebda_region();
36
37 /*
38 * At this point everything still needed from the boot loader
39 * or BIOS or kernel text should be early reserved or marked not
40 * RAM in e820. All other memory is free game.
41 */
42
Eric W. Biederman700efc12008-02-23 09:58:20 +010043 start_kernel();
44}