Skip to contentSkip to conversation

rm -rf linux/arch/i386/boot and Gujin bootloader

PATCH New Etienne Lorrain 1 participant 1 message Sep 1, 2005 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 rm -rf linux/arch/i386/boot and Gujin bootloader

Hello,

This is a list of patch which simplify the file structure of
the kernel residing in /boot . The file named with a KGZ extension ( for instance /boot/linux-2.6.13.kgz ) is simply the usual ELF file named linux-2.6.13/vmlinux tranformed to binary with objdump and gzip'ed.
This new file structure can be "natively" loaded by the Gujin GPL bootloader version 1.2 available on sourceforge:
http://sourceforge.net/projects/gujin
Gujin homepage with screenshoots:
http://gujin.org
Gujin FAQ and HOWTO:
http://sourceforge.net/docman/display_doc.php?docid=1989&group_id=15465

Gujin can also load files bzImage and the like but only in its "compatibility" mode where it replaces the real mode assembler by its own C code and uses the 32 bits protected mode entry point, for technical reasons.
To get this new file you apply at least the two first patch of this list and simply type:
make /boot/linux-2.6.13.kgz ROOT=auto
This list of patch does not change the old Makefile process, so you can still make the old target and load with LILO or GRUB.

Gujin bootloader will check some parameter of the kernel (for instance to forbid to run a kernel compiled with TSC on a i386) and for that purpose check the content of the comment part of the gzip KGZ file.

The real-mode ia32 assembler parts present in the kernel (files under linux-2.6.13/arch/i386/boot) are completely unused for the new KGZ file structure and that real mode probing is replaced by a function written in standard C (second patch of this list). I dropped some complex stuff like the recognition of ISA video card from the real-mode C source, because a bit of cleanning is needed from times to times (has to be done also for x86_64 - no ISA bus on those). The real mode C function produce exactly the same memory mapping for real mode parameters (file zero-page.txt), and is inserted at end of the ELF vmlinux file by the linker.
There isn't any more a limit for the size of the uncompressed kernel.

This first part just add two standalone programs, one to edit/display the comment field of a GZIP file, and one which display a line on stdout to describe the main configuration of the kernel being compiled, to be output on the comment line of the GZIP being produced.

Etienne.

Makefile +14 -0
diff -uprN -X linux-2.6.13/Documentation/dontdiff -x '*.orig' -x '*.cmd' -x '.tmp*' -x '*.o' -x '*.ko' -x '*.a' -x '*.so' -x '.config*' -x asm-offsets.s -x asm_offsets.h -x vmlinux.lds -x vsyscall.lds -x '*.mod.c' -x Module.symvers -x consolemap_deftbl.c -x defkeymap.c -x classlist.h -x devlist.h -x asm -x md -x scsi -x logo -x config -x .version -x zconf.tab.h -x elfconfig.h -x System.map -x zconf.tab.c -x lex.zconf.c -x compile.h -x config_data.h -x version.h -x crc32table.h -x autoconf.h -x gen-devlist -x initramfs_list linux-2.6.13/Makefile linux-2.6.13-new/Makefile
@@ -728,6 +728,19 @@ endif # ifdef CONFIG_KALLSYMS
 vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
 	$(call if_changed_rule,vmlinux__)
 
+# Utility to display the kernel compile time parameters
+quiet_cmd_gzparam = HOSTCC  $@
+      cmd_gzparam = $(HOSTCC) $(HOSTCFLAGS) -Wl,"-u __ERROR" -o $@ $<
+      # Need to rebuild this if "include/linux/autoconf.h" changed:
+scripts/gzparam: scripts/gzparam.c vmlinux FORCE
+	$(call cmd,gzparam)
+
+# Maybe move building this utility somewhere else?
+quiet_cmd_gzcopy = HOSTCC  $@
+      cmd_gzcopy = $(HOSTCC) $(HOSTCFLAGS) -s -o $@ $<
+scripts/gzcopy: scripts/gzcopy.c
+	$(call cmd,gzcopy)
+
 # The actual objects are generated when descending, 
 # make sure no implicit rule kicks in
 $(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
@@ -949,6 +962,7 @@ endef
 # Directories & files removed with 'make clean'
 CLEAN_DIRS  += $(MODVERDIR)
 CLEAN_FILES +=	vmlinux System.map \
+                scripts/gzparam scripts/gzcopy \
                 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
 
 # Directories & files removed with 'make mrproper'
scripts/gzcopy.c +1005 -0

1,005 lines not on this page · raw message

scripts/gzparam.c +209 -0

209 lines not on this page · raw message