Gujin linux.kgz boot format
PATCH 2/3 Gujin linux.kgz boot format
Attached second patch adds the two file realmode.c/realmode.h,
and how to compile them and insert then at the end of the ELF file. The resulting linux.kgz can be used with Gujin but the "root=" parameter has to be given manually.
Signed-off-by Etienne Lorrain <[email protected]>
Etienne.
arch/i386/kernel/Makefile +1 -1
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.ld obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ - doublefault.o quirks.o i8237.o + doublefault.o quirks.o i8237.o realmode.o obj-y += cpu/ obj-y += timers/
arch/i386/kernel/realmode.c +1411 -0
1,411 lines not on this page · raw message
arch/i386/kernel/setup.c +12 -0
@@ -706,6 +706,18 @@ static void __init parse_cmdline_early (/* Save unparsed command line copy for /proc/cmdline */ saved_command_line[COMMAND_LINE_SIZE -1 ] ='\0' ; +/* +* If the command line begin with '/', it is the filename of the +* kernel file - like a shell command line. That can be used to +* deduce where root was located when the kernel was compiled, +* inside a directory of root named /boot, inside a small partition +* mounted on a directory of root named /boot or in the root +* directory itself. +*/ +if (*from =='/' ) +while (*from !=' ' && *from !='\t' && *from !='\n' && *from !='\0' ) + from++; +for (;;) {if (c !=' ' ) goto next_char;
arch/i386/kernel/vmlinux.lds.S +30 -0
@@ -11,9 +11,39 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(phys_startup_32) +EXTERN(__ERROR) /* Force a link error if function __ERROR() is ever called */ +NOCROSSREFS(.realmode .text) +NOCROSSREFS(.realmode .data) +NOCROSSREFS(.realmode .rodata) jiffies = jiffies_64; SECTIONS { + /* realmode BIOS (initialisation only) boot code/data area. + * Here, segment .code16 is relocatable but .data16 is not. + * To see the assembler of compiled file realmode.c: + * objdump -D -m i8086 arch/i386/kernel/realmode.o + * objdump -d --section=.realmode -m i8086 vmlinux + */ + .realmode 0 : AT (_end - LOAD_OFFSET) { + *(.init.text16) + . = ALIGN(16); + _sdata16 = .; + *(.rodata16* .data16 .bss16) + . = ALIGN(16); + _edata16 = .; /* maximum 0x1000 i.e. 4 Kb limit */ + *(.text16) + . = ALIGN(16); + _end16 = .; + /* This may be used one day - keep a 16 bytes block at end of file: */ + LONG(0) + LONG(SIZEOF (.realmode)) + LONG(ADDR (.realmode)) + BYTE(0x42) /* 'B' */ + BYTE(0x49) /* 'I' */ + BYTE(0x4F) /* 'O' */ + BYTE(0x53) /* 'S' */ + } = 0x9090 + . = __KERNEL_START; phys_startup_32 = startup_32 - LOAD_OFFSET; /* read-only */
include/asm-i386/realmode.h +521 -0
521 lines not on this page · raw message
Makefile +65 -3
102 lines not on this page · raw message