On Thu, May 31, 2007 at 01:43:43AM +0200, Stefan Reinauer wrote:
> > Index: Makefile
> > ===================================================================
> > --- Makefile        (Revision 338)
> > +++ Makefile        (Arbeitskopie)
> >  doxygen:
> >     $(Q)$(DOXYGEN) util/doxygen/Doxyfile.LinuxBIOS
> >  
> > +payload:
> > +   $(Q)printf "Not yet implemented. This will invoke a helper tool.\n"
> > +
> 
> I'd wait checking this stuff in until we really do something here.

OK, it's commented now.

 
> > -   $(Q)cp $(CONFIG_PAYLOAD) $(obj)/lar.tmp/normal/payload
> > +   $(Q)# TODO: Copy no payload or empty payload if CONFIG_PAYLOAD_NONE.
> > +   $(Q)cp $(CONFIG_PAYLOAD_FILE) $(obj)/lar.tmp/normal/payload
> 
> maybe something like 
> if [ -r $(CONFIG_PAYLOAD_FILE) ]; then cp .... ; fi

Yep, done.


> > -STAGE2_LIB_OBJ       = stage2.o clog2.o mem.o malloc.o tables.o delay.o 
> > compute_ip_checksum.o
> > +STAGE2_LIB_OBJ       = stage2.o clog2.o mem.o malloc.o tables.o delay.o \
> > +                  compute_ip_checksum.o
>  
> Uh oh, lots of unrelated whitespace stuff in this patch.

True, it's gone now. I made an extra commit out of that.


Updated patch attached.


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
Rework payload handling to only provide two options:

 - Payload file

 - No payload

Document the current procedure in the README.

Signed-off-by: Uwe Hermann <[EMAIL PROTECTED]>

Index: Kconfig
===================================================================
--- Kconfig	(Revision 341)
+++ Kconfig	(Arbeitskopie)
@@ -78,69 +78,30 @@
         prompt "Payload type"
         default PAYLOAD_ELF
 
-config PAYLOAD_FILO
-	bool "FILO"
+config PAYLOAD_ELF
+	bool "An ELF executable payload file"
 	help
-	  TODO
+	  Select this option if you have a payload image (an ELF file)
+	  which LinuxBIOS should run as soon as the basic hardware
+	  initialization is completed.
 
-config PAYLOAD_ETHERBOOT
-	bool "Etherboot"
-	help
-	  TODO
+	  You will be able to specify the location and file name of the
+	  payload image later.
 
-config PAYLOAD_MEMTEST86
-	bool "Memtest86"
+config PAYLOAD_NONE
+	bool "No payload"
 	help
-	  TODO
+	  Select this option if you want to create an "empty" LinuxBIOS
+	  ROM image for a certain mainboard, i.e. a LinuxBIOS ROM image
+	  which does not yet contain a payload.
 
-config PAYLOAD_LINUX
-	bool "Linux kernel"
-	help
-	  TODO
+	  For such an image to be useful, you have to use the 'lar' tool
+	  to add a payload to the ROM image later.
 
-config PAYLOAD_ELF
-	bool "Any ELF executable"
-	help
-	  TODO
-
-config PAYLOAD_DUMMY
-	bool "Dummy payload"
-	help
-	  For testing purposes only.
-
 endchoice
 
-config PAYLOAD_FILO_DIR
-	string "FILO source code directory"
-	depends PAYLOAD_FILO
-	default "/tmp/filo-0.5"
-	help
-	  The directory where the FILO source code is located.
-
-config PAYLOAD_FILO_CONFIGFILE
-	string "Filename of the FILO 'Config' file"
-	depends PAYLOAD_FILO
-	default "Config"
-	help
-	  The filename of the FILO 'Config' file to use. This file must reside
-	  in the directory specified via PAYLOAD_FILO_DIR.
-
-config PAYLOAD_LINUX_DIR
-	string "Linux kernel source code directory"
-	depends PAYLOAD_LINUX
-	default "/usr/src/linux"
-	help
-	  The directory where the Linux kernel source code is located.
-
-config PAYLOAD_LINUX_CONFIGFILE
-	string "Path and filename of the Linux .config file to use"
-	depends PAYLOAD_LINUX
-	default ".config" # FIXME!
-	help
-	  The path and filename of the Linux .config file to use.
-
-config PAYLOAD_ELF_FILE
-	string "Path and filename of the ELF file to use as payload"
+config PAYLOAD_FILE
+	string "Payload path and filename"
 	depends PAYLOAD_ELF
 	default "payload.elf"
 	help
Index: README
===================================================================
--- README	(Revision 341)
+++ README	(Arbeitskopie)
@@ -6,7 +6,7 @@
 BIOS you can find in most of today's computers.
 
 It performs just a little bit of hardware initialization and then executes
-one of many possible payloads, e.g. a Linux kernel.
+one of many possible payloads.
 
 
 Payloads
@@ -39,38 +39,89 @@
  * http://www.linuxbios.org/Supported_Chipsets_and_Devices
 
 
-Building and Installing
+Building And Installing
 -----------------------
 
 Note: Currently only the x86 QEMU target is supported in LinuxBIOSv3.
 
 1) Build a payload:
 
-  For example: FILO.
+  $ make payload
 
+  This step is optional. The 'make payload' command will execute a
+  helper tool which allows you to easily build and configure a wide
+  variety of payloads. The result of this step is usually a file
+  called 'payload.elf' in the top-level directory.
+
 2) Configure LinuxBIOS:
 
   $ make menuconfig
 
-  Select at least the desired mainboard vendor, the mainboard device,
-  the size of your ROM chip, and a payload.
+  Select at least the desired mainboard vendor, the mainboard device, and
+  the size of your ROM chip. Per default LinuxBIOS will look for a file
+  called 'payload.elf' in the current directory and use that as the payload.
 
+  If that's not what you want, you can change the path/filename of the
+  payload to use some other payload file. Or you can choose 'No payload'
+  in the configuration menu, in which case the resulting LinuxBIOS ROM image
+  will not contain any payload. You'll have to manually add a payload
+  later using the 'lar' utility for the LinuxBIOS ROM image to be useful.
+
 3) Build the LinuxBIOS ROM image:
 
   $ make
 
-  The generated ROM image is build/linuxbios.rom.
+  The generated ROM image is the file linuxbios.rom in the build/ directory.
 
-4) You can now test the LinuxBIOS image using:
+4) Flash the LinuxBIOS ROM image on a BIOS chip:
 
+  $ flashrom -wv linuxbios.rom
+
+  NOTE: This step will OVERWRITE the current BIOS located on the ROM chip!
+  Make sure you have adequate backup facilities before performing this
+  step, otherwise you might not be able to recover in case of problems.
+  If you have any questions, please contact us on the mailing list!
+
+  The 'flashrom' tool is located in util/flashrom where you can build it
+  from source code by typing 'make'. Alternatively, your favorite Linux
+  distribution might ship a 'flashrom' package which provides the 'flashrom'
+  program in (e.g.) /usr/bin. On Debian GNU/Linux systems you can get
+  the flashrom package via 'apt-get install flashrom'.
+
+
+Testing LinuxBIOS Without Modifying Your Hardware
+-------------------------------------------------
+
+If you want to test LinuxBIOS without any risks before you really decide
+to use it on your hardware, you can use the QEMU system emulator to run
+LinuxBIOS virtually in QEMU.
+
+The required steps are:
+
+  $ make menuconfig
+
+    Select 'Emulated systems' as mainboard vendor and 'QEMU x86' as
+    mainboard model.
+
+  $ make
+
   $ qemu -L build -hda /dev/zero -serial stdio
 
-  If you have a full QEMU image with a Linux distribution installed,
-  you can boot that Linux kernel by using a proper FILO payload and typing:
+  This will run LinuxBIOS in QEMU and output all debugging messages (which
+  are usually emitted to a serial console) on stdout. It will not do
+  anything useful beyond that, as you provided no virtual harddrive to
+  QEMU (-hda /dev/zero).
 
+  If you have a full QEMU hard drive image (say /tmp/qemu.img) with a Linux
+  distribution installed, you can boot that Linux kernel by using a proper
+  FILO payload with LinuxBIOS and typing:
+
   $ qemu -L build -hda /tmp/qemu.img -serial stdio
 
+  Installing a Linux distribution in QEMU and building the FILO payload is
+  beyond the scope of this document.
 
+
 Website and Mailing List
 ------------------------
 
@@ -92,10 +143,9 @@
 
 LinuxBIOS is licensed under the terms of the GNU General Public License (GPL).
 Some files are licensed under the "GPL (version 2, or any later version)",
-and some files (mostly those derived from the Linux kernel) are licensed under
-the "GPL, version 2". For some parts, which were derived from other projects,
-other (GPL-compatible) licenses may apply. Please check the individual
-source files for details.
+and some files are licensed under the "GPL, version 2". For some parts,
+which were derived from other Free Software projects, other (GPL-compatible)
+licenses may apply. Please check the individual source files for details.
 
 This makes the resulting LinuxBIOS images licensed under the GPL, version 2.
 
Index: lib/Makefile
===================================================================
--- lib/Makefile	(Revision 341)
+++ lib/Makefile	(Arbeitskopie)
@@ -33,7 +33,9 @@
 #
 
 lzma:
+ifeq ($(CONFIG_DEFAULT_COMPRESSION_LZMA),y)
 	$(Q)printf "  BUILD   LZMA (skipped)\n"
+endif
 
 $(obj)/lib/%.o: $(src)/lib/%.c
 	$(Q)mkdir -p $(obj)/lib
Index: arch/x86/Makefile
===================================================================
--- arch/x86/Makefile	(Revision 341)
+++ arch/x86/Makefile	(Arbeitskopie)
@@ -36,14 +36,25 @@
 
 ROM_SIZE := $(shell expr $(CONFIG_LINUXBIOS_ROMSIZE_KB) \* 1024)
 
-$(obj)/linuxbios.rom: $(obj)/linuxbios.bootblock $(obj)/util/lar/lar lzma $(obj)/linuxbios.initram $(obj)/linuxbios.stage2 $(obj)/option_table payload
+$(obj)/linuxbios.rom: $(obj)/linuxbios.bootblock $(obj)/util/lar/lar lzma $(obj)/linuxbios.initram $(obj)/linuxbios.stage2 $(obj)/option_table payload_compress
 	$(Q)rm -rf $(obj)/lar.tmp
 	$(Q)mkdir $(obj)/lar.tmp
 	$(Q)mkdir $(obj)/lar.tmp/normal
 	$(Q)cp $(obj)/linuxbios.initram $(obj)/lar.tmp/normal/initram
 	$(Q)cp $(obj)/linuxbios.stage2 $(obj)/lar.tmp/normal/stage2
 	$(Q)cp $(obj)/option_table $(obj)/lar.tmp/normal/option_table
-	$(Q)cp $(CONFIG_PAYLOAD) $(obj)/lar.tmp/normal/payload
+ifeq ($(CONFIG_PAYLOAD_NONE),y)
+	$(Q)printf "  PAYLOAD none (as specified by user)\n"
+else
+	$(Q)# TODO: Print sth. other than $(CONFIG_PAYLOAD_FILE) if compressed.
+	$(Q)if [ -r $(CONFIG_PAYLOAD_FILE) ]; then \
+		printf "  PAYLOAD $(CONFIG_PAYLOAD_FILE)\n"; \
+		cp $(CONFIG_PAYLOAD_FILE) $(obj)/lar.tmp/normal/payload; \
+	else \
+		printf "Error: payload file '$(CONFIG_PAYLOAD_FILE)' not found.\n"; \
+		exit 1; \
+	fi
+endif
 	$(Q)printf "  LAR     $(subst $(shell pwd)/,,$(@))\n"
 	$(Q)cd $(obj)/lar.tmp && ../util/lar/lar -c ../linuxbios.rom . \
 		-s $(ROM_SIZE) -b $(obj)/linuxbios.bootblock
@@ -147,15 +158,17 @@
 
 
 #
-# The payload as we love it. Get it from somewhere.
-# Is this a place to incorporate buildrom?
+# TODO: Compress the payload (CONFIG_PAYLOAD_FILE) with the default compressor.
 #
-# TODO: This is not implemented yet.
-# TODO: This needs to be compressed with the default compressor.
-#
 
-payload:
-	$(Q)printf "  BUILD   PAYLOAD (skipped)\n"
+payload_compress:
+ifeq ($(CONFIG_PAYLOAD_NONE),y)
+else
+ifeq ($(CONFIG_DEFAULT_COMPRESSION_NONE),y)
+else
+	$(Q)printf "  ZIP     $(CONFIG_PAYLOAD_FILE) (skipped)\n"
+endif
+endif
 
 
 #
Index: Makefile
===================================================================
--- Makefile	(Revision 341)
+++ Makefile	(Arbeitskopie)
@@ -124,6 +124,9 @@
 doxygen:
 	$(Q)$(DOXYGEN) util/doxygen/Doxyfile.LinuxBIOS
 
+# payload:
+#	$(Q)printf "Not yet implemented. This will invoke a helper tool.\n"
+
 prepare:
 	$(Q)mkdir -p $(obj)
 

Attachment: signature.asc
Description: Digital signature

-- 
linuxbios mailing list
linuxbios@linuxbios.org
http://www.linuxbios.org/mailman/listinfo/linuxbios

Reply via email to