Loading arch/x86/Kconfig +7 −1 Original line number Diff line number Diff line Loading @@ -933,6 +933,12 @@ config X86_CPUID with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to /dev/cpu/31/cpuid. config X86_CPU_DEBUG tristate "/sys/kernel/debug/x86/cpu/* - CPU Debug support" ---help--- If you select this option, this will provide various x86 CPUs information through debugfs. choice prompt "High Memory Support" default HIGHMEM4G if !X86_NUMAQ Loading Loading @@ -1433,7 +1439,7 @@ config CRASH_DUMP config KEXEC_JUMP bool "kexec jump (EXPERIMENTAL)" depends on EXPERIMENTAL depends on KEXEC && HIBERNATION && X86_32 depends on KEXEC && HIBERNATION ---help--- Jump between original kernel and kexeced kernel and invoke code in physical address mode via KEXEC Loading arch/x86/boot/Makefile +8 −15 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ # for more details. # # Copyright (C) 1994 by Linus Torvalds # Changed by many, many contributors over the years. # # ROOT_DEV specifies the default root-device when making the image. Loading @@ -21,11 +22,7 @@ ROOT_DEV := CURRENT SVGA_MODE := -DSVGA_MODE=NORMAL_VGA # If you want the RAM disk device, define this to be the size in blocks. #RAMDISK := -DRAMDISK=512 targets := vmlinux.bin setup.bin setup.elf zImage bzImage targets := vmlinux.bin setup.bin setup.elf bzImage subdir- := compressed setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o Loading Loading @@ -71,17 +68,13 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ KBUILD_CFLAGS += $(call cc-option,-m32) KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ $(obj)/zImage: asflags-y := $(SVGA_MODE) $(RAMDISK) $(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__ $(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ $(obj)/bzImage: BUILDFLAGS := -b $(obj)/bzImage: asflags-y := $(SVGA_MODE) quiet_cmd_image = BUILD $@ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \ $(obj)/vmlinux.bin $(ROOT_DEV) > $@ cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ $(ROOT_DEV) > $@ $(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \ $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(call if_changed,image) @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' Loading arch/x86/boot/header.S +9 −20 Original line number Diff line number Diff line Loading @@ -24,12 +24,8 @@ #include "boot.h" #include "offsets.h" SETUPSECTS = 4 /* default nr of setup-sectors */ BOOTSEG = 0x07C0 /* original address of boot-sector */ SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */ SYSSIZE = DEF_SYSSIZE /* system size: # of 16-byte clicks */ /* to be loaded */ ROOT_DEV = 0 /* ROOT_DEV is now written by "build" */ SYSSEG = 0x1000 /* historical load address >> 4 */ #ifndef SVGA_MODE #define SVGA_MODE ASK_VGA Loading Loading @@ -97,12 +93,12 @@ bugger_off_msg: .section ".header", "a" .globl hdr hdr: setup_sects: .byte SETUPSECTS setup_sects: .byte 0 /* Filled in by build.c */ root_flags: .word ROOT_RDONLY syssize: .long SYSSIZE ram_size: .word RAMDISK syssize: .long 0 /* Filled in by build.c */ ram_size: .word 0 /* Obsolete */ vid_mode: .word SVGA_MODE root_dev: .word ROOT_DEV root_dev: .word 0 /* Filled in by build.c */ boot_flag: .word 0xAA55 # offset 512, entry point Loading @@ -123,14 +119,15 @@ _start: # or else old loadlin-1.5 will fail) .globl realmode_swtch realmode_swtch: .word 0, 0 # default_switch, SETUPSEG start_sys_seg: .word SYSSEG start_sys_seg: .word SYSSEG # obsolete and meaningless, but just # in case something decided to "use" it .word kernel_version-512 # pointing to kernel version string # above section of header is compatible # with loadlin-1.5 (header v1.5). Don't # change it. type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin, # Bootlin, SYSLX, bootsect...) type_of_loader: .byte 0 # 0 means ancient bootloader, newer # bootloaders know to change this. # See Documentation/i386/boot.txt for # assigned ids Loading @@ -142,11 +139,7 @@ CAN_USE_HEAP = 0x80 # If set, the loader also has set # space behind setup.S can be used for # heap purposes. # Only the loader knows what is free #ifndef __BIG_KERNEL__ .byte 0 #else .byte LOADED_HIGH #endif setup_move_size: .word 0x8000 # size to move, when setup is not # loaded at 0x90000. We will move setup Loading @@ -157,11 +150,7 @@ setup_move_size: .word 0x8000 # size to move, when setup is not code32_start: # here loaders can put a different # start address for 32-bit code. #ifndef __BIG_KERNEL__ .long 0x1000 # 0x1000 = default for zImage #else .long 0x100000 # 0x100000 = default for big kernel #endif ramdisk_image: .long 0 # address of loaded ramdisk image # Here the loader puts the 32-bit Loading arch/x86/boot/pm.c +0 −44 Original line number Diff line number Diff line Loading @@ -32,47 +32,6 @@ static void realmode_switch_hook(void) } } /* * A zImage kernel is loaded at 0x10000 but wants to run at 0x1000. * A bzImage kernel is loaded and runs at 0x100000. */ static void move_kernel_around(void) { /* Note: rely on the compile-time option here rather than the LOADED_HIGH flag. The Qemu kernel loader unconditionally sets the loadflags to zero. */ #ifndef __BIG_KERNEL__ u16 dst_seg, src_seg; u32 syssize; dst_seg = 0x1000 >> 4; src_seg = 0x10000 >> 4; syssize = boot_params.hdr.syssize; /* Size in 16-byte paragraphs */ while (syssize) { int paras = (syssize >= 0x1000) ? 0x1000 : syssize; int dwords = paras << 2; asm volatile("pushw %%es ; " "pushw %%ds ; " "movw %1,%%es ; " "movw %2,%%ds ; " "xorw %%di,%%di ; " "xorw %%si,%%si ; " "rep;movsl ; " "popw %%ds ; " "popw %%es" : "+c" (dwords) : "r" (dst_seg), "r" (src_seg) : "esi", "edi"); syssize -= paras; dst_seg += paras; src_seg += paras; } #endif } /* * Disable all interrupts at the legacy PIC. */ Loading Loading @@ -147,9 +106,6 @@ void go_to_protected_mode(void) /* Hook before leaving real mode, also disables interrupts */ realmode_switch_hook(); /* Move the kernel/setup to their final resting places */ move_kernel_around(); /* Enable the A20 gate */ if (enable_a20()) { puts("A20 gate not responding, unable to boot...\n"); Loading arch/x86/boot/tools/build.c +1 −8 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ static void die(const char * str, ...) static void usage(void) { die("Usage: build [-b] setup system [rootdev] [> image]"); die("Usage: build setup system [rootdev] [> image]"); } int main(int argc, char ** argv) Loading @@ -145,11 +145,6 @@ int main(int argc, char ** argv) void *kernel; u32 crc = 0xffffffffUL; if (argc > 2 && !strcmp(argv[1], "-b")) { is_big_kernel = 1; argc--, argv++; } if ((argc < 3) || (argc > 4)) usage(); if (argc > 3) { Loading Loading @@ -216,8 +211,6 @@ int main(int argc, char ** argv) die("Unable to mmap '%s': %m", argv[2]); /* Number of 16-byte paragraphs, including space for a 4-byte CRC */ sys_size = (sz + 15 + 4) / 16; if (!is_big_kernel && sys_size > DEF_SYSSIZE) die("System is too big. Try using bzImage or modules."); /* Patch the setup code with the appropriate size parameters */ buf[0x1f1] = setup_sectors-1; Loading Loading
arch/x86/Kconfig +7 −1 Original line number Diff line number Diff line Loading @@ -933,6 +933,12 @@ config X86_CPUID with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to /dev/cpu/31/cpuid. config X86_CPU_DEBUG tristate "/sys/kernel/debug/x86/cpu/* - CPU Debug support" ---help--- If you select this option, this will provide various x86 CPUs information through debugfs. choice prompt "High Memory Support" default HIGHMEM4G if !X86_NUMAQ Loading Loading @@ -1433,7 +1439,7 @@ config CRASH_DUMP config KEXEC_JUMP bool "kexec jump (EXPERIMENTAL)" depends on EXPERIMENTAL depends on KEXEC && HIBERNATION && X86_32 depends on KEXEC && HIBERNATION ---help--- Jump between original kernel and kexeced kernel and invoke code in physical address mode via KEXEC Loading
arch/x86/boot/Makefile +8 −15 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ # for more details. # # Copyright (C) 1994 by Linus Torvalds # Changed by many, many contributors over the years. # # ROOT_DEV specifies the default root-device when making the image. Loading @@ -21,11 +22,7 @@ ROOT_DEV := CURRENT SVGA_MODE := -DSVGA_MODE=NORMAL_VGA # If you want the RAM disk device, define this to be the size in blocks. #RAMDISK := -DRAMDISK=512 targets := vmlinux.bin setup.bin setup.elf zImage bzImage targets := vmlinux.bin setup.bin setup.elf bzImage subdir- := compressed setup-y += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o Loading Loading @@ -71,17 +68,13 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ KBUILD_CFLAGS += $(call cc-option,-m32) KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ $(obj)/zImage: asflags-y := $(SVGA_MODE) $(RAMDISK) $(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__ $(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ $(obj)/bzImage: BUILDFLAGS := -b $(obj)/bzImage: asflags-y := $(SVGA_MODE) quiet_cmd_image = BUILD $@ cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \ $(obj)/vmlinux.bin $(ROOT_DEV) > $@ cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \ $(ROOT_DEV) > $@ $(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \ $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(call if_changed,image) @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' Loading
arch/x86/boot/header.S +9 −20 Original line number Diff line number Diff line Loading @@ -24,12 +24,8 @@ #include "boot.h" #include "offsets.h" SETUPSECTS = 4 /* default nr of setup-sectors */ BOOTSEG = 0x07C0 /* original address of boot-sector */ SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */ SYSSIZE = DEF_SYSSIZE /* system size: # of 16-byte clicks */ /* to be loaded */ ROOT_DEV = 0 /* ROOT_DEV is now written by "build" */ SYSSEG = 0x1000 /* historical load address >> 4 */ #ifndef SVGA_MODE #define SVGA_MODE ASK_VGA Loading Loading @@ -97,12 +93,12 @@ bugger_off_msg: .section ".header", "a" .globl hdr hdr: setup_sects: .byte SETUPSECTS setup_sects: .byte 0 /* Filled in by build.c */ root_flags: .word ROOT_RDONLY syssize: .long SYSSIZE ram_size: .word RAMDISK syssize: .long 0 /* Filled in by build.c */ ram_size: .word 0 /* Obsolete */ vid_mode: .word SVGA_MODE root_dev: .word ROOT_DEV root_dev: .word 0 /* Filled in by build.c */ boot_flag: .word 0xAA55 # offset 512, entry point Loading @@ -123,14 +119,15 @@ _start: # or else old loadlin-1.5 will fail) .globl realmode_swtch realmode_swtch: .word 0, 0 # default_switch, SETUPSEG start_sys_seg: .word SYSSEG start_sys_seg: .word SYSSEG # obsolete and meaningless, but just # in case something decided to "use" it .word kernel_version-512 # pointing to kernel version string # above section of header is compatible # with loadlin-1.5 (header v1.5). Don't # change it. type_of_loader: .byte 0 # = 0, old one (LILO, Loadlin, # Bootlin, SYSLX, bootsect...) type_of_loader: .byte 0 # 0 means ancient bootloader, newer # bootloaders know to change this. # See Documentation/i386/boot.txt for # assigned ids Loading @@ -142,11 +139,7 @@ CAN_USE_HEAP = 0x80 # If set, the loader also has set # space behind setup.S can be used for # heap purposes. # Only the loader knows what is free #ifndef __BIG_KERNEL__ .byte 0 #else .byte LOADED_HIGH #endif setup_move_size: .word 0x8000 # size to move, when setup is not # loaded at 0x90000. We will move setup Loading @@ -157,11 +150,7 @@ setup_move_size: .word 0x8000 # size to move, when setup is not code32_start: # here loaders can put a different # start address for 32-bit code. #ifndef __BIG_KERNEL__ .long 0x1000 # 0x1000 = default for zImage #else .long 0x100000 # 0x100000 = default for big kernel #endif ramdisk_image: .long 0 # address of loaded ramdisk image # Here the loader puts the 32-bit Loading
arch/x86/boot/pm.c +0 −44 Original line number Diff line number Diff line Loading @@ -32,47 +32,6 @@ static void realmode_switch_hook(void) } } /* * A zImage kernel is loaded at 0x10000 but wants to run at 0x1000. * A bzImage kernel is loaded and runs at 0x100000. */ static void move_kernel_around(void) { /* Note: rely on the compile-time option here rather than the LOADED_HIGH flag. The Qemu kernel loader unconditionally sets the loadflags to zero. */ #ifndef __BIG_KERNEL__ u16 dst_seg, src_seg; u32 syssize; dst_seg = 0x1000 >> 4; src_seg = 0x10000 >> 4; syssize = boot_params.hdr.syssize; /* Size in 16-byte paragraphs */ while (syssize) { int paras = (syssize >= 0x1000) ? 0x1000 : syssize; int dwords = paras << 2; asm volatile("pushw %%es ; " "pushw %%ds ; " "movw %1,%%es ; " "movw %2,%%ds ; " "xorw %%di,%%di ; " "xorw %%si,%%si ; " "rep;movsl ; " "popw %%ds ; " "popw %%es" : "+c" (dwords) : "r" (dst_seg), "r" (src_seg) : "esi", "edi"); syssize -= paras; dst_seg += paras; src_seg += paras; } #endif } /* * Disable all interrupts at the legacy PIC. */ Loading Loading @@ -147,9 +106,6 @@ void go_to_protected_mode(void) /* Hook before leaving real mode, also disables interrupts */ realmode_switch_hook(); /* Move the kernel/setup to their final resting places */ move_kernel_around(); /* Enable the A20 gate */ if (enable_a20()) { puts("A20 gate not responding, unable to boot...\n"); Loading
arch/x86/boot/tools/build.c +1 −8 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ static void die(const char * str, ...) static void usage(void) { die("Usage: build [-b] setup system [rootdev] [> image]"); die("Usage: build setup system [rootdev] [> image]"); } int main(int argc, char ** argv) Loading @@ -145,11 +145,6 @@ int main(int argc, char ** argv) void *kernel; u32 crc = 0xffffffffUL; if (argc > 2 && !strcmp(argv[1], "-b")) { is_big_kernel = 1; argc--, argv++; } if ((argc < 3) || (argc > 4)) usage(); if (argc > 3) { Loading Loading @@ -216,8 +211,6 @@ int main(int argc, char ** argv) die("Unable to mmap '%s': %m", argv[2]); /* Number of 16-byte paragraphs, including space for a 4-byte CRC */ sys_size = (sz + 15 + 4) / 16; if (!is_big_kernel && sys_size > DEF_SYSSIZE) die("System is too big. Try using bzImage or modules."); /* Patch the setup code with the appropriate size parameters */ buf[0x1f1] = setup_sectors-1; Loading