mtd/docboot Makefile,1.1,1.2 README,1.1,1.2

dbrown at infradead.org dbrown at infradead.org
Mon Aug 2 15:27:17 EDT 2004


Update of /home/cvs/mtd/docboot
In directory phoenix.infradead.org:/tmp/cvs-serv7643

Modified Files:
	Makefile README 
Log Message:
Add make target for BIOS extension support.  Document everything in README.


Index: Makefile
===================================================================
RCS file: /home/cvs/mtd/docboot/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile	9 Jul 2004 16:28:02 -0000	1.1
+++ Makefile	2 Aug 2004 19:27:15 -0000	1.2
@@ -12,5 +12,8 @@
 doc_bootstub: doc_bootstub.elf
 	objcopy -O binary doc_bootstub.elf doc_bootstub
 
+bios: doc_bootstub makespl bzImage cmdline
+	cat cmdline | ./makespl doc_bootstub bzImage doc_spl bios_ext
+
 clean:
 	rm -f doc_spl *.o *.elf doc_bootstub makespl

Index: README
===================================================================
RCS file: /home/cvs/mtd/docboot/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- README	9 Jul 2004 16:28:02 -0000	1.1
+++ README	2 Aug 2004 19:27:15 -0000	1.2
@@ -1,8 +1,13 @@
 	$Id$
 
 DOCBoot -- A simple Linux bootloader for DiskOnChip
-		Dan Brown <dan_brown at ieee.org>
----------------------------------------------------
+
+Author:
+  Dan Brown <dan_brown at ieee.org>
+DiskOnChip Millennium Plus and BIOS extension support:
+  Kalev Lember <kalev at smartlink.ee>
+
+-----------------------------------------------------------------------------
 
 DOCBoot replaces the M-Systems BIOS driver on your DOC with a small boot stub
 and your Linux kernel image.  It allows you to boot Linux directly without the
@@ -23,11 +28,11 @@
 happen if you try it with an earlier version.
 
 At the moment, DOCBoot supports only the new INFTL-based DiskOnChip 2000 parts,
-sometimes known as Alon or 2000TSOP.  It might work on DOC Millenium, but I
-haven't tested this.
+sometimes known as Alon or 2000TSOP, and DOC Millennium Plus 16 MB devices.
+It might work on DOC Millenium, but I haven't tested this.
 
-Support for the older (NFTL) DiskOnChip 2000 parts is planned.  It would be
-nice to add support for Millenium+ devices as well.
+Support for the older (NFTL) DiskOnChip 2000 parts and DOC Millennium Plus 32 MB
+is planned.
 
 initrd support would be easy, though I imagine most people will simply use
 jffs2 as their root filesystem.  Some minimal keyboard interaction
@@ -37,12 +42,17 @@
 Quick Start
 -----------
 
+For DOC 2000TSOP/Alon parts, no configuration is needed and the steps below
+should work.  Otherwise, see the Configuration section.
+
  1. Get the diskonchip driver loaded.  (perhaps via "modprobe diskonchip")
  2. Ensure that your first BDK partition is large enough to hold your bzImage
     plus 1k.  If it currently holds the M-Systems BIOS code, it probably isn't.
     To resize that partition, and for the definition of a BDK partition, please
     refer to M-Systems' DOS-based utilities and associated documentation.
     (Hint: dformat /win:xxxx /bdkl0:x)
+    You can also resize partitions with the docfdisk utility from the mtd util
+    directory.
  2. Copy a kernel bzImage or vmlinuz into this directory.  Name it 'bzImage'.
  3. Edit the file 'cmdline' to taste.
  4. Generate the doc_spl image:
@@ -55,7 +65,7 @@
     bootable.
 
 
-HOW IT WORKS
+How it works
 ------------
 
 The DiskOnChip has a piece of code called the IPL stored in the first
@@ -80,14 +90,20 @@
 INT 13h (Disk BIOS) handler to emulate disk access.
 
 We change this. Instead of installing an INT 13h handler, we install an
-INT 18h (diskless boot) handler. This is very small, and is held entirely
-within the first 1024 bytes of the SPL with the code which installs it. 
+INT 18h (diskless boot) or INT 19h (bootstrap loader) handler. This is very
+small, and is held entirely within the first 1024 bytes of the SPL with the
+code which installs it. 
 
 The INT 18h handler is called when no bootable device can be found by the BIOS.
 The default handler (built into the BIOS) normally prints an error message and
 prompts you to insert a bootable disk.
 
-When executed, our replacement INT 18h handler loads the Linux kernel into
+Using the INT 18h handler, DOCBoot will be called by the BIOS if all other boot
+devices fail.  If you would rather have DOCBoot be the first (rather than last)
+device to boot, configure DOCBoot as an INT 19h handler instead.  (See the
+Configuration section).
+
+When executed, our replacement interrupt handler loads the Linux kernel into
 memory.  Adopting the same technique as the IPL, it finds your kernel by
 scanning the DOC for a special signature in the OOB area.  This code marks
 every block containing the kernel (this is very important, as it allows us to
@@ -98,3 +114,52 @@
 into high memory.  It then sets up some variables to let the kernel find the
 commandline (and a few other things), and jumps to the kernel setup code it just
 loaded.  The rest is up to Linux.
+
+
+Configuration
+-------------
+
+You can alter DOCB behaviour by uncommenting or modifying special #defines
+at the end of doc_bootstub.h:
+
+#define MILPLUS:        Uncomment this to enable DiskOnChip Millennium Plus
+                        support and disable DOC 2000 / Millennium.
+
+#define DOC_BIOS_HOOK:  Change this to either 0x18 to hook the Diskless Boot
+                        Interrupt or to 0x19 the hook the Bootstrap Loader
+                        Interrupt.
+
+#define DOC_ADDRESS:    This is used to specify the memory address at which
+                        the Diskonchip is located.  If this is undefined,
+                        DOCBoot relies on the standard IPL to pass this
+                        information in the DS register.  If your IPL doesn't
+                        do this, or for some other reason you want to hard-
+                        code the address, define this.
+
+#define BIOS_EXTENSION: Uncomment this to make a standard PC BIOS extension
+                        instead of the SPL image.  This is explained in more
+                        detail below.
+
+
+BIOS Extension Support
+----------------------
+
+Normally, the makefile uses the program 'makespl' to combine the DOCBoot
+executable, your commandline information, and your kernel into a single file
+which you can then write to your device.  This is appropriate when using the
+standard M-Systems IPL.
+
+In applications which use a custom BIOS, you may instead want to use DOCBoot as
+a BIOS extension (loaded with your BIOS), rather than as a SPL (loaded by the
+M-Systems IPL).
+
+To do this you must (1) #define BIOS_EXTENSION in doc_bootstub.h, and
+(2) run 'make bios' rather than 'make'.  This will produce two files:
+
+'doc_spl' contains your kernel image in a form suitable for writing to your
+device with nandwrite -o.  Unlike in the normal build method, this does not
+contain DOCBoot itself.
+
+'bios_ext' is a 1024-byte file containing DOCBoot and your commandline info,
+formatted as a standard PC BIOS extension.  Merging this into your BIOS is up
+to you.





More information about the linux-mtd-cvs mailing list