--- /dev/null
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
--- /dev/null
+Unless specifically noted, a file is under the GPL. GPLed files are in
+general either from Linux or have been explicitly put under GPL by the
+authors. A few files are inherited from FreeBSD netboot and therefore
+can be used under BSD or GPL.
+
+File Copyright status
+
+core/misc.c BSD
+drivers/net/3c509.c BSD
+drivers/net/3c509.h BSD
+drivers/net/3c595.c BSD
+drivers/net/3c595.h BSD
+drivers/net/3c90x.c Open Source
+drivers/net/epic100.c None
+drivers/net/epic100.h None
+drivers/net/ns8390.c BSD
+drivers/net/ns8390.h BSD
+drivers/net/tulip.c BSD
+arch/i386/include/bits/string.h None
+util/lzhuf.c Open Source
--- /dev/null
+If you don't want to install development tools, and have access to the
+Web, you can get ROM images made on demand from http://rom-o-matic.net/
+
+The documentation tarballs should be extracted in the top directory (the
+one you are reading this INSTALL document from). A top directory called
+doc will be populated. This way the links from index.html will work
+properly.
+
+More likely if you are unfamiliar with Etherboot you should read the
+documentation starting with index.html if you have a Web browser, or
+doc/text/userman.txt (after installing the documentation tarball) if you
+just have a plain text terminal.
+
+Also read RELNOTES for any additional recent information.
+
+Don't forget to check out the contrib/ directory which contains much
+contributed software and documentation. Please contact the authors of
+those packages directly for queries.
+
+If you are booting FreeBSD, enable -DELF_IMAGE (and optionally
+-DAOUT_IMAGE) in Config. This should happen automatically now.
+
+The index.html file is the same as the one on the Etherboot home page at
+the time the distribution was made. Therefore some of the local file:/
+links from the Distribution section may not work.
+
+Etherboot was built using gcc 3.3.3 and binutils 2.15.91 from SuSE 9.2 but
+earlier 3.x versions will generally work.
--- /dev/null
+Major changes from 1.0 to 1.1
+
++ Everywhere: Can compile two versions of the code, under gcc or bcc
+(Bruce Evan's cc), so that 16-bit boot PROMs can be made. See
+netboot-16/README.16 for more details.
+
++ Everywhere: Removed duplicate defines, e.g. everybody defined their
+own ID for ethernet address size (6). Put IDs for magic numbers in
+various places. Still some inconsistency, ETH_ and ETHER_ are used.
+
++ Everywhere: Added prototypes of functions to netboot.h. Removed
+unused variables.
+
++ Makefiles: Rewritten.
+
++ netboot.h: Added define for TFTP_MAX_PACKET = 512. Increased TIMEOUT
+for tftp packets to 180 (about 10 seconds) so that tftp servers would
+be able to retransmit blocks.
+
++ main.c: Rewrote tftp(). Original was intended to get only one block
+and the strain on the structure due to modifications was showing.
+Increased config_buffer size to TFTP_MAX_PACKET+1 to avoid special
+casing data length=512.
+
++ linuxloader.c: Cleaned up the code in some places, especially
+linux_tftp. Moved the bootp reply block into bss space instead of a
+fixed location such as 0x90000.
+
++ ns8390.c: Removed one bug regarding packet length. packetlen was
+wrongly shortened when packets wraparound the ring buffer.
+
++ 3c509.c: Changed some of the gotos to returns. Removed ARP code since
+that's already done elsewhere. Removed interrupt enable and Rx early
+notification (we can't do anything with the packet until it's complete
+anyway).
+
+Major changes from 1.1 to 1.2
+
++ Small bug in makerom.c. Extra semicolon shortened for loop and made
+double checking code invalid.
+
++ Added version identification to startup string.
+
++ Gathered external declarations into netboot.h.
+
++ New compile time option for netboot-32. If INT19H is not defined,
+then boot ROM takes control as soon as BIOS scans it. This may solve
+the problem of some BIOSes not calling the boot ROM at INT19H. This
+may be when disks are detected by the BIOS, i.e. the machine is not
+truly diskless.
+
++ Added a new program, test.c, for making test ROMs to verify that
+the BIOS recognises the ROM.
+
++ New directory contrib contains contributed code. Currently contains
+masq by Gerd Knorr: make a boot floppy without DOS
+comboot-1.0 by Adam J. Richter: also make a boot floppy without DOS.
+
++ New mknbi-1.4 from Gero Kuhlmann and Markus Gutschke. This one handles
+the new bzImage format.
+
+Bumped up version to 2.0 because we are so listed in the Linux 2.0
+distribution and this would avoid confusion.
+
+Major changes from 2.0 to 2.1
+
++ Added LSM for transname-patch to contrib.
+
++ Added patch for serial console from Claus Heine
+<claus AT momo PERIOD math PERIOD rwth-aachen PERIOD de>.
+
++ Claus Heine contributed patches to the 2.0.21/22 kernel sources to
+allow NFS swap.
+
++ Markus Gutschke provided fixes to start2.S so that main can return to
+the ROM code if user doesn't want to ROM boot.
+
++ Added code to main.c to timeout on the prompt and assume Y or N
+for the answer. Timeout and answer configurable.
+
++ Made NE1/2000 probe addresses configurable from Makefile. Fixed up
+autoscan code.
+
++ Made NFS_BOOT a configurable option. By undefining it, only tagged
+file load is supported but ROMs are under 8k.
+
++ ROMSIZE is not used by makerom now. -s flag controls size of ROM
+at runtime. So don't need to recompile makerom if ROMSIZE changes.
+
++ Updated netboot-16 for the latest dev tools from the Linux-MT
+project. Use the size.c from there.
+
++ Got rid of _main() in main.c, instead using #ifdef ELF in start2.S.
+ELF is preferred now anyway.
+
++ Changed bcompare to standard bcmp and reversed sense of result.
+Reason: to use standard library if available, e.g. Netboot-16.
+
++ Common Makefile for 32 bit and 16 versions, with differences in
+Config files.
+
+Major changes from 2.1 to 2.2
+
++ New device driver for the Crystal Semiconductor CS89x0 chipset family.
+ (because of legal problems, this code is currently in the "contrib"
+ directory.)
+
++ Added support for loading BOOTP extension files (c.f. RFC1533).
+
++ If we have to go thru a gateway, then use the one that has been used for
+ the BOOTP daemon. If the BOOTP daemon is directly accessible, then use
+ the first entry in the "gw" gateway list instead.
+
++ For all retries, back off according to RFC951 by randomizing the timeouts
+ and exponentially increasing them until an average of one minute is
+ reached.
+
++ Warn if code will not fit into chosen ROM size. Happens only if the
+ autosizing in the Makefile somehow fails.
+
++ Modified the code for enabling the A20 gate; this could increase
+ compatibility, but I still have to hear from users.
+
++ The copyright message will now reflect, which features have been
+ enabled at compile time.
+
++ Added support for selecting different boot images from a menu. As a side
+ effect, this can be used to upgrade the ROM without having to burn a new
+ image (c.f. README.VendorTags).
+
++ Display a "message of the day" that is provided by the BOOTP daemon.
+
++ The sanity check for detecting a Linux kernel was too strong to properly
+ recognize a 2.1.x kernel; this has been fixed.
+
++ Trys to negotiate for 1432 octect blocks, if the TFTP daemon knows
+ about RFC1783.
+
++ We can optionally boot from local disk, if the BOOTP server cannot
+ be contacted.
+
++ Restructured directories: got rid of netboot-freebsd to reduce confusion
+ with Gero Kuhlmann's netboot, moved documentation to doc and renamed
+ directories to be more in line with Unix conventions. Edited documentation.
+
++ Created a dispatch table for NIC routines so that we can include one
+ or more drivers in one binary. Renamed all entry points in the driver
+ sources. Created two new files, config.c, which holds the dispatch
+ table and can be conditionally compiled; and nic.c which contains the
+ extern variables referenced by the drivers.
+
++ Automatically decide what size ROM is needed by doing a size and then
+ choosing the correct startup object. Currently caters for 8k, 16k and
+ 32k ROMs.
+
++ Optionally include a simple interpreter for ANSI escape sequences. This
+ allows for fancier boot menus.
+
++ Remove patches directory which is mostly relevant to 1.x kernels only.
+ Everybody should use 2.x kernels now. If for some reason you need those
+ patches, get an older release of etherboot.
+
++ Fix Makefile to work even if . not on PATH.
+
++ Sadly, 32 bit ROMs are now > 8kb. We will try to reduce the size by
+ conditionals in a later release. For now, use version 2.1 if your NIC
+ won't take > 8kb ROMs.
+
++ Release as 3.0b1 because of the large amount of changes.
+
++ Fixed a few problems with the code for ANSI escape sequences and
+ added optional support for displaying graphics.
+
++ Optional support for password protected boot images.
+
++ Optional support for booting from block devices (floppy, hd).
+
++ The bootp server can pass additional parameters to the loaded kernel
+ image (currently, this only applies to Linux) and the user can be
+ allowed to edit a commandline; the latter is optionally protected by
+ a password scheme.
+
++ Set the warm-boot flag when the main routine is entered.
+
++ Release as 3.0b2
+
++ Added code for updating the FlashCard EPROM over the network
+ (contrib/flashimg).
+
++ Added very simple code for turning a ROM image into a network loadable image.
+ This is useful for debugging, but some users without flash EPROMs might
+ appreciate the possibility to load a fully fledged image from a very basic
+ configuration.
+
++ Optional support for compressing the ROM images. Please read
+ doc/COPYING.compressor before using this feature.
+
++ Sync'd our source tree with Gero's netboot-0.5; this means that you now need
+ the as86 from the ELKs project in order to recompile all of the files. This
+ should not affect normal usage, though.
+
++ Added "mknbi-blkdev" for booting from local block devices.
+
++ Fixed some bugs in ppmtoansi.c and bootmenu.c
+
++ Renamed reference compressor implementation to compressor.exp otherwise
+ make tries to use it and it should not be turned on by default.
+
++ Zero'ing BSS in 16-bit version has to be done to _end, not to A0000
+ because it's executing in a segment, not in flat address space in 16
+ bit mode.
+
++ Ken Yap contributed a quick and dirty Perl script for people who use
+ netboot to test ELKS. So far I'm the only one I know of; maybe the
+ others are silent. :-(
+
++ Release as 3.0
+
+Major changes from 3.0 to 3.1
+
++ 4 versions of etherboot can be built for a NIC: .com for testing and
+ .rom for burning into EPROM, and corresponding compressed versions:
+ .lzcom and .lzrom.
+
++ The loaders are now separate programs which are prepended to the
+ etherboot binary. This allows them (plain and uncompressing versions) to
+ be maintained separately and gives a bit more RAM to the etherboot code.
+
++ No need to define ROMSIZE in the build. makerom automatically discovers
+ the ROM size needed and fills in the size field in the ROM. This
+ simplifies the build procedure.
+
++ 16 bit versions use the same loaders as the 32 bit version. Also fixed
+ two bugs in the 16 bit versions: (1) a non-8086 instruction in zloader,
+ (2) setting warm-boot flag in main which zapped some code.
+
++ Fixed a documentation bug on the ANSI escape sequences.
+
++ Include netboot-0.5.3 distribution from Gero Kuhlmann.
+
++ Included some contributions from Dickon.Reed AT cl PERIOD cam PERIOD
+ac PERIOD uk: Running display of Kbytes loaded, line of delimiters after
+loading complete, a temporary hack to address timing problems with the
+3C509, and some Makefile cleanup. The first two changes need to be
+enabled in Config with defines.
+
++ mknbi-blkdev seems to have been left out by Gero Kuhlmann. Add to
+ contrib directory. You probably have to make a symlink to it from
+ the netboot-0.5.2 directory.
+
++ Release as 3.1
+
+Major changes from 3.1 to 3.2
+
++ 16 bit version now can load to extended memory, if it exists. On
+ a 8086/8 this will silently fail.
+
++ Cleaned up interface between main body of code and NIC drivers. No
+ global variables referenced in NIC driver, everything is passed
+ through a structure. Only the probe function is visible outside,
+ pointers to the others are returned in the structure.
+
++ Implemented autoprobe for 3c503. Also simplifies code at same time.
+
++ Removed ARP response code in ns8390.c. Don't think we need to respond
+ to ARP requests because other machines will do gratuituous ARP when
+ boot code sends out bootp request. Are there cases where this is not
+ true? Gateways?
+
++ Added 1 second timeout to routine that clears the keyboard buffer
+ in case there is no keyboard.
+
++ Added a skeleton driver that can be used as a template for new NIC
+ drivers.
+
++ ./lzhuf in Makefile so that it will run even if . is not on path.
+
++ Fixed comboot to work on 286s also. Won't work yet on 8086/8.
+
++ Fixed mknbi-blkdev to configure properly under netboot-0.7.
+
++ Added David Munro's PCI code adapted from Linux. Currently has entries
+ for PCI NE2000 clones. Generalised it to probe other PCI cards later on.
+
++ Moved twiddle() outside NIC driver except where used to provide a delay.
+
++ Fixed bug in Makefile spotted by Ton Biegstraaten. Should prepend
+ ZLOADER to make all.lzcom, not LOADER.
+
++ Charlie Brady donated a NE2100 (LANCE) card, so Ken Yap wrote a driver
+ for it. Should work for other LANCE (7990, etc) based cards with some
+ modifications.
+
++ Markus Gutschke wrote rom-scan, and it is in contrib/.
+
++ Hack rom-scan.c so that a DOS version can be compiled.
+
++ Removed all.* targets from Makefile. The NIC specific loaders should be
+ used in preference as the all.* loaders can run out of memory.
+
++ Added a disable routine to dispatch table so that cards can be turned
+ off before the loaded code is executed.
+
++ Make INT19H the default.
+
++ Rogier Wolff persuaded AW computer systems to contribute the Intel
+ EtherExpressPro 100 driver. The binary to hex converter in contrib/
+ is also from Rogier Wolff. Part of the work is sponsored by BitWizard
+ NL (www.bitwizard.nl).
+
++ Distribute with a subset of netboot-0.7.2 that doesn't have the bootrom
+ portion.
+
++ Release as 3.2.
+
+Major changes from 3.2 to 4.0
+
++ Merged in Vlad Lungu's patches for DHCP support, ifdef'ed by DHCP_SUPPORT.
+
++ XID matching fix also provided by Vlad Lungu.
+
++ Merged in William Arbaugh's patches to make eepro driver work properly.
+
++ Add to contrib/ better bin2intelhex from Jean Marc Lacroix.
+
++ Patches from Jim Hague (thanks!) for the following:
+
+* Added PIO mode for 3c503 to ns8390.c. Changed the card detection to
+ detect shared memory or PIO and use the selected one, and removed
+ a jumper check that failed on the Bull (no jumpers).
+
+* Added more #ifdefs to ns8390.c to include only code relevant to the
+ card being compiled, and removed unnecessary run-time card vendor
+ behaviour branches - it's all now #ifdefd.
+
+* Added a -3 parameter to makerom to set the last two bytes to 0x80.
+ These are the values they have in the 3Com Etherboot image that was
+ in the Bull. (Also on the 3c503 card I have - Ken.) Also altered the
+ Makefile to add this parameter when building a 3c503 image.
+
+* Modifies lzhuf.c, objdump86.c & size86.c to work on either-endian systems.
+
+* Adds a -DT503_AUI config paramter to let you choose AUI or BNC on
+ 3c503s. Previously it defaulted to AUI, and you had to change the
+ code to alter it.
+
+* Changed the BCC include directory to /usr/bcc/include. If you use the
+ BCC include files they don't define u_char, u_short etc. I've added
+ these into linuxdef.h, ifdef'd on BCC.
+
+* Adds a trivial Linux 3c503 driver patch to the contrib directory
+ to let it spot these 'ere Bull things.
+
++ Charlie Brady confirmed that the Lance driver works with PCI so there
+is a new lancepci driver now.
+
++ Removed support for NFS_BOOT; only TFTP booting supported now.
+
++ Removed support for linear images; only tagged images supported now.
+
++ Removed PRIORIZEBOOTPKERNEL and BOOTPKERNELONLY. Bootp reply must
+specify kernel name.
+
++ Bug fix for 16 bit version of 3c509 driver: sign bit propagation bug.
+
++ Revert to non-pausing versions of out[bw] and inb for NEx000 driver
+because of reports of timimg problems on some cards.
+
++ New driver for NI6510. Just a simple tweak of the lance driver for
+different ID bytes and different register offsets. According to the
+NI6510 driver in Linux, the NI6510 Etherblaster is more like the NE2100
+and would be detected by the NE2100 driver. So use that one instead.
+
++ New drivers for 3c507 and NI5210, both of which use the i82586 chip. It
+works properly for both now. I needed to have enough receive buffers to
+make sure i82586 never goes into an out of resources state. 3c507 driver
+has one quirk, it only responds after second bootp request. I seem to
+remember something about this problem of losing the first packet after
+initialisation in early Linux discussions. I am also now convinced
+that Intel designers have weird minds. BTW, NI5210 driver assumes 8k
+RAM because if you put the ROM on the NIC you can only have 8k RAM. If
+you are putting the ROM off-board and you want 16k, well, talk to me.
+
++ Call nic_disable routine just before jumping to loaded image. This
+does nothing in most drivers, but may have side effects as the nic_reset
+routine used to be called instead.
+
++ One of those "why I didn't think of it before" ideas: A modified version
+of comboot, called floppyload, that is prepended to the .rom image rather
+than the .com image and then both written raw to a floppy for testing the
+bootrom. All we have to do is jump to an entry point in (z)loader that
+skips the INT19H stuff. Relocation will happen automatically. Now the
+.com images and comboot are superfluous, unless one is masochistic enough
+to want to try to test under DOS.
+
+Added .fd0 targets to Makefile. Saying make <card>.fd0 will make
+floppyload.bin and <card>.rom, and cat both to /dev/fd0. Naturally the
+drive must be writable and you must have a floppy in the drive.
+
++ New driver for Tiara (Fujitsu EtherStar). This was one of the easiest
+drivers to write. But the chip apparently has some quirks; there is no
+Linux driver for it in the standard distribution and the email address
+of someone who wrote an alpha driver is invalid. Perhaps I'll bump into
+an AT1700 (which has a similar chip) one day and be able to reuse a lot
+of the code.
+
++ Updated contrib/mkelksnbi for ELKS 0.0.68.
+
++ Confirmed that the SMC8216 driver works. 8416 not tested, it's a PnP
+card. Can anybody confirm this?
+
++ New contributed software: p910nd, a tiny printer daemon suitable for
+diskless hosts.
+
++ Made ANSIESC work for Etherboot/16.
+
++ Fixed Makefile and Config.* so that it works with old binutils.
+
++ Included a subset of netboot-0.7.3.
+
++ Released as version 4.0.
+
+Changes between 4.0 and 4.1
+
++ Patches by Andrew Coulthurst for eepro100b.
+
++ Patches by Doug Ambrisko for booting Windows95 after answering N to
+the boot from network question. Added conditional code to cope with
+broken DHCP server and TAG 128.
+
++ Put version and driver identifier at end of ROM image if it fits,
+to help identify ROMs in future.
+
++ Capture ROM segment address and length to help choose between multiple
+NICs later.
+
++ Don't clear all of memory because it will destroy return address
+on stack.
+
++ Changes to comboot-1.2 (although obsolete) to run on 8088s.
+
++ New version 0.2 of p910nd, a non-spooling printer daemon.
+
++ Patches by Alex Harin to prepended loaders and makerom to generate PnP
+ready ROMs. Modified makerom to automatically detect PnP and PCI headers
+and do the right thing. Added option to change the vendor and device IDs.
+
++ Augmented documentation for 2.1 and above kernels. Kernel now wants to
+mount /tftpboot/<hostname in bootptab> rather than /tftpboot/<ip address>
+as the root FS.
+
++ Changed all the outb* and outw calls in drivers (except eepro) to be
+OUTB* and OUTW, then defined macros to translate to out[bp]* for both
+Etherboot/32 and Etherboot/16, instead of pasting macros from Linux
+include files because apparently they've changed in 2.1. At the same
+time reversed the arguments in start16.S for outb and outw to match the
+Linux convention. Unfortunately the out[bw] usage came that way from
+FreeBSD. Someday I'll reverse the arguments in the C files properly.
+For any new driver writers, you should use the Linux order now.
+
++ New contributed utility, disnbi for decoding and extracting network
+boot images.
+
++ Martin Atkins contributed mntnbi for mounting DOS NBIs.
+
++ Peter Dobcsanyi contributed vendor and device IDs for the Netvin
+NE2000/PCI clone.
+
++ adam AT mudlist PERIOD eorbit PERIOD net contributed RARP code as
+alternative to BOOTP/DHCP. Activated by RARP_NOT_BOOTP define.
+
++ Added link to Claus-Justus Heine's NFS swap Web page and updated the
+contrib directory.
+
++ Disabled max packet length check in ns8390.c. Caused spurious Bogus
+packet messages in some cases and doesn't seem that useful a sanity
+check anyway.
+
++ Daniel Engstrom contributed a SMC9000 driver.
+
++ Didier Poirot contributed an Etherpower II (EPIC 100) driver.
+
++ Added bug fix by Attila Bogár for bootmenu.c and patch to main.c to
+remove looping menus on failure. Also code for ARP replies and TFTP
+block retransmit (#ifdefed because controversial).
+
++ Code cleanup of tftp and tftpd also by Attila Bogár.
+
++ Nathan R. Neulinger fixed a bug with block being declared short instead
+of u_short in tftpd.c, which limited transfers to 32k blocks. Fixed
+problem with field tu_block being declared as signed short in many
+platforms by including fixed version of tftp.h. Fixed tftp also for
+good measure.
+
++ New mini-HOWTO on a "ssh terminal".
+
++ Andreas Mack pointed out that eepro100 doesn't compile on 2.1 and
+2.2 kernels. Removed unnecessary include of bios32.h and reliance on
+definition of virt_to_bus in kernel headers in eepro100.c, epic100.c
+and lance.c.
+
++ David Sharp contributed a Tulip driver written for FreeBSD netboot.
+Ken Yap ported to Etherboot. Not tested yet because no hardware.
+
++ Replaced references to arptable[ARP_CLIENT].node to nic->node_addr in
+eepro100.c and epic100.c as they should be.
+
++ Greg Beeley of LightSys Technology Services contributed a 3c905b
+driver. Be sure to read the release notes in 3c905b.txt.
+
++ Günter Knauf suggested making the prompt strings more generic and to
+put a newline after the answer. Beware, N now means Network boot and
+not No to network boot.
+
++ Alex Nemirovsky contributed some patches for BIOSes that use an extended
+space at the top of 640k. Also some code for BIOSes that don't implement
+BIOS32 correctly or at all.
+
++ Use PCI extension BIOS header only for PCI cards, all others use legacy
+extension BIOS header.
+
++ Klaus Espenlaub contributed various cleanup patches to the code. Also
+introduced Rainer Bawidamann's code, see next paragraph.
+
++ Rainer Bawidamann contributed a Realtek 8139 driver.
+
++ Simplified rules for building .bin files, use -b of as86 so we
+don't need ld86 or objdump86 now. But later found that a fixed as86 is
+required. So supply preassembled binaries. The keen hackers can get the
+fixed tools.
+
++ Georg Baum contributed a Schneider & Koch G16 driver. Only the
+32 bit version works at the moment; even though the 16 bit version
+compiles, it won't work because the current code assumes flat memory
+addressing. Anybody who needs the 16 bit version should feel free to
+fix it.
+
++ Reduce size of ROM image loaded by floppyboot.bin from 64kB to 32kB
+for a slight speedup in loading. None of the images are even 32kB anyway.
+
++ Updated some of the documents in doc/sgml.
+
++ Klaus Espenlaub sent in a totally revamped start32.S, using the code16
+and code32 directives in recent GNU as (so if this file won't assemble
+maybe your as version is not recent enough). Also patches to the menu
+handling code.
+
++ jluke AT deakin PERIOD edu PERIOD au sent in a fix for the WD/SMC8013
+long ago which I finally got around to verifying.
+
++ start16.o and start32.o are supplied for those people who have problems
+compiling start*.S with as/as86.
+
+Released as Etherboot-4.2.0
+
++ One line fix to 3c509b by Greg Beeley for Wake-On-LAN support.
+
++ Added patches by Klaus Espenlaub that I forgot.
+
++ Made AS_PSEUDOS not the default, assume that people have sufficiently
+up-to-date GNU as. If not they can uncomment that line.
+
+Released as Etherboot-4.2.1
+
++ Disable 3c509 after loading finished or port may be unusable.
+
++ Woops, forgot to up the version's last digit in the last release.
+
++ Stephan Bauer sent in a device ID for config.c for 21142 chip Tulips.
+
++ Ifdef out input overrun recovery code (it's really only needed for
+NE2000s) and use SHMEM by default for 3c503s to bring the ROM size down
+below 8kB.
+
++ Added code to start32.S to detect < 386 and exit so it doesn't hang
+the computer. Doesn't print a message yet.
+
++ Changed README.sgml to recommend that TFTP use a separate directory
+from NFS, /tftpdir. Added sample configuration file for DHCPD and caveat
+about the name of the root directory when using DHCPD.
+
++ Revamped atnetboot.sgml: use mtools most of the time, write about a
+few example applications.
+
++ Quick Perl script for converting bootptab to dhcpd.conf.
+
+Released as Etherboot-4.2.2
+
++ Forgot to put new version of src/start32.o. Not urgent though, the
+extra code only guards against Etherboot/32 being executed on < 386.
+
++ Supply version preassembled start32.o with ANSIESC and FLOPPY defined
+for those with a deficient as. Define dummy handleansi routine in
+ansiesc.c so that it will still link even if this start32.o is used.
+
++ Edited *.asm so that they can be assembled by either as86 (ELKS version)
+or nasm.
+
++ Changed Makefile so that one can choose between no as86, as86 or nasm.
+
++ Added Mark Burazin's conditional code for Compex RL2000 PCI NIC.
+
++ Increase delay during probe phase to 10ms as 1ms is too low for some
+3c509 boards. Donald Becker's Linux driver hints that > 2ms is needed
+to be safe. Also call t509_disable in case board was active.
+
++ Update README.sgml date and version.
+
+Released as Etherboot 4.2.3.
+
++ rtl8139.c: Reduce the number of transmit buffers to reduce footprint.
+Remove polling loop in *_loop(), caller already does the looping.
+
++ main.c: Fix code indentation in bootp().
+
++ Small corrections to documentation.
+
+Released as Etherboot 4.2.4.
+
++ Matthias Meixner found a longstanding bug in rtl8139.c where it was
+testing the wrong bit for the existence of a packet in the buffer.
+
++ Added paragraph to documentation about caveats for hosting NFS root
+on a different architecture.
+
+Released as Etherboot 4.2.5.
+
++ Updated mklnim for RH6.0 which uses a different floppy image and
+requires 'network' to be appended to kernel parameters.
+
++ Reversed sense of #ifdef DHCP_SUPPORT to #ifndef NO_DHCP_SUPPORT and
+so forth, i.e. the default is with DHCP support.
+
++ Suggest reducing options for rtl8139 driver to minimise footprint in
+release notes.
+
++ Jim McQuillan provided changes to support the SMC1211, which uses the
+RTL8139 chip.
+
++ Changed lret in start32.S to int $0x19 so that it doesn't depend on
+the return location being there.
+
+Released as Etherboot 4.2.6
+
++ Succeeded in booting FreeDOS with the kernel in the tagged image rather
+than on the ramdisk, i.e. the boot process jumps directly to the kernel
+in memory. The utility is mkfreedosnbi in contrib/.
+
++ Additions to the documentation.
+
+Released as Etherboot 4.2.7
+
++ Matt Hortman pointed out that the BIOS clock value returned by INT1AH
+rolls over at midnight, causing delay loops that cross midnight to
+fail. Fix was to keep track of midnight crossings in currticks so that
+currticks' return value is monotonically increasing.
+
++ Added paragraph to documentation about editing PCI vendor and device
+IDs in Makefile if needed.
+
++ Merged in FreeBSD support code supplied by Doug Ambrisko. Thanks!
+
+Released as Etherboot 4.2.8
+
++ Cleaned up the FreeBSD support in osloader.c. Symbols to use in Config
+are to select image type, not FreeBSD specific now.
+
++ Added simple signature checking code in floppyload.asm in case somebody
+forgets to append a ROM image or tries to load a non-ROM image.
+
++ Merged in 3c90x and multiple PCI bus support by Steve Smith. Thanks!
+
++ Included NT-Diskless-Terminal HOWTO by Pavel Tkatchouk.
+
++ Included snapshot of H. Peter Anvin's rewrite of tftp.
+
++ Combined tftp and tftpd directories, and touched up Makefile to reflect
+normal Linux install directories.
+
+Released as Etherboot 4.2.9
+
++ NT-Diskless-Terminal HOWTO renamed to Diskless-From-NT.
+
++ One line fix to mknbi-dos to recognise FAT16 filesystems as legal.
+Updated first.S in mknbi-dos so that it can be assembled by nasm and is
+also suitable for FreeDOS with the right define. Still backward compatible
+with as86. Bug fix at line starting getnm3:.
+
++ Updated first.S in mknbi-linux so that it can be assembled by nasm also.
+
++ Locate bootp data block at 0x93C00-0x93FFF to free up 1024+ bytes in
+[0x98000-0x9FFFF]. Etherboot/32 only, business as usual for Etherboot/16.
+
++ Patch from Attila Bogár to make CONGESTED a compile option for
+TFTP_TIMEOUT. Also corrected spelling of his name in README.
+
++ Fixed start32.S to assemble correctly with gas version 2.95. Must
+define GAS295 in CFLAGS.
+
++ Add contrib/3c90xutil containing a utility for handling 3c90x EEPROMs
+in situ.
+
++ Update p910nd to 0.3. client.pl now checks if hostname is known and
+uses more convenient routines from Socket module.
+
++ Moved the Flashcard directory into a separate package as it's of
+limited interest.
+
+Released as Etherboot 4.2.10
+
++ Fixed bug introduced in 4.2.10 in code for handling bootp extension
+files.
+
++ Change in 3c90x.c so that it can compile under FreeBSD.
+
++ Patch to tulip.c from Nick Lopez to handle Macronix 98715 (Tulip clone).
+
+Released as Etherboot 4.2.11
+
++ Prefer RFC1533_GATEWAY to giaddr for routing tftp packets.
+
++ Print out both relay address and gateway address.
+
++ Stored arptable ipaddrs in network byte order. Makes everything simpler
+and we can get rid of convert_ipaddr. Now %I in printf and inet_ntoa
+have to deal with NBO. We reduce the footprint by ~100 bytes.
+
++ Renamed setip to more standard inet_ntoa and change argument type to
+suit, using in_addr.
+
++ Replaced bcmp by memcmp, bzero by memset, and bcopy by memcpy. Allows
+us to use optimised versions in inline assembler.
+
++ Replaced OUTB and OUTW by outb and outw with arguments reversed.
+Finally all the out macros are the same form as for Linux.
+
++ Replaced \r\n and \n\r in output strings with \n since putchar
+now prints \r before \n. Then changed printf("\n") to putchar('\n').
+Like Unix convention for strings now.
+
++ Got rid of test.c and Makefile rules connected with it.
+
++ Added patch to eepro100.c by Matt Hortman to correct PCI latency.
+
++ Merged in Marty Connor's ntulip.c. Now supports Macronix 98715 and
+Linksys LNE100TX.
+
+Released as Etherboot 4.2.12
+
++ Anders Larsen contributed mkQNXnbi, for generating tagged images from
+QNX kernels.
+
++ Bernd Wiebelt contributed code to request vendor tags in DHCP.
+
++ Fixed more bugs introduced in 4.2.10 in code for handling bootp
+extension files.
+
+Released as Etherboot 4.2.13
+
++ Marty Connor reduced RTL8139 footprint by using only one transmit
+buffer instead of 4. Now RTL8139 is reliable.
+
++ Moved initialised data declaration from ns8390.h to ns8390.c.
+
++ Contributed utilities for wake-on-LAN: wol.c (Bob Edwards) and wake.pl.
+
++ Makefile for 3c90xutil/romutil.c. -O is essential when compiling.
+
++ Happy year 2000!
+
+Released as Etherboot 4.4.0
+
++ VIA-Rhine driver contributed by Paolo Marini. Footprint reduced by
+Marty Connor.
+
++ Netgear FA310TX (Tulip clone, LC82C168 chip) support added by Marty
+Connor.
+
++ Support for 3C905C added by Marty Connor.
+
++ mklnim updated to support SuSE 6.x also.
+
+Released as Etherboot 4.4.1
+
++ New configuration file scheme to specify what ROMs are built.
+
++ Adam Fritzler contributed 3c529 (MCA version of 3c509) support in
+driver.
+
++ Marty Connor wrote a version of 3c90xutil/romutil for 905C NICs.
+
++ Günter Knauf contributed a wake on LAN CGI script.
+
++ Notes in contrib/eepro100notes on how to flash the EEPROM.
+
++ Happy Australia Day, 2000-01-26.
+
+Released as Etherboot 4.4.2
+
++ hwilmer AT gmx PERIOD de found a probe error in 3c507.c, shouldn't
+mask memory size with 0xffffL, this fails with 64kB memory. Also
+changed to use real-time-clock to timeout on initialisation of i82586
+rather than relying on decrementing a variable (which is CPU speed
+dependent).
+
++ James Pearson pointed out that ~ should be escaped as ˜ in
+vendortags.sgml. Also cleaned up the 8-bit characters while I was at it.
+
++ Günter Knauf pointed out that if ASK_BOOT is defined, then key input
+echos twice. Also, CR doesn't select the default. Problem was that getchar
+converts all \r to \n then main.c was testing against \r instead of \n,
+and also that getchar() was echoing when it should leave it to the caller.
+Deleted code from getchar() and made it a function with no arguments.
+Also sent me a new version of mp-form.pl with mp-form.txt. Also suggested
+the good idea that the gateway and relay fields not be displayed if they
+are not used.
+
++ Bob Edwards sent in patches to ntulip.c to autodetect 100 Mb media
+for 21142/3 NICs.
+
++ Okuji Yoshinori found a small bug in main.c: for (retry1 = 0; retry < ..
+Don't know what effect it had.
+
++ Klaus Espenlaub sent patches which make the RTL8139 driver more
+reliable, see notes in rtl8139.c.
+
++ Russ Nelson gave permission to release cs89x0 driver with Etherboot.
+It's normally under GPL. Moved cs89x0 driver to src directory, removed
+cs89x0.sgml.
+
++ Clarified copyrights of files in distribution.
+
+Released as Etherboot 4.4.3
+
++ Klaus Espenlaub sent in some patches to overcome the 64K block rollover
+problem in tftp.
+
++ Bob Edwards, Paul Mackerras and Marty Connor worked out fixes to
+ntulip.c to handle 21142/3 Tulips properly.
+
++ Karsten Tinnefeld sent in a Makefile fragment for doc/sgml/Makefile
+to generate DVI and PS files using sgml2latex.
+
++ tulip.* renamed to otulip.*, ntulip.* renamed to tulip.*
+
++ Added FAQ and Writing an Etherboot Driver sections to README.
+
++ Woops, if and of swapped in dd command in atnetboot.sgml.
+
+Released as Etherboot 4.4.4
+
++ FUKUHARA Makoto supplied a patch for 4.4.4 for FreeBSD ELF booting
+with large tftp blocks which I missed putting in.
+
++ Small patch by Marty Connor to tulip.c to handle fast Tulips better.
+
++ Wrote small loader to load images from .com files.
+
++ Shusuke Nisiyama contributed a 3c595 (and may work for 3c590) driver.
+
+Released as Etherboot 4.4.5
+
+A major reorganisation by Klaus Espenlaub. Here are his notes, verbatim:
+
+The biggest change is the almost rewritten Makefiles (both in src and in
+doc - the one in doc is still reasonably simple). If you want to get
+an overview - basically one Makefile now builds both /16 and /32 ROMs.
+This involves quite a few make variables (similarly in Config), but it
+should be mostly self-explaining. I also converted the suffix rules to
+pattern rules, because it is the only way to keep the build directories
+for /16 and /32 apart.
+
+Generally all /32 code is compiled in bin32, all /16 code is compiled
+in bin16, and the code that works for both is in bin.
+
+The names (object files, images, but NOT the final ROMs) used during
+the build process for some PCI cards have changed (especially lancepci
+and nepci).
+
+I eliminated the driver.a file by adding yet more ugly code to genrules.pl
+(no, I'm not very proud of the code I added there - I hate perl, but
+at least it works), which now generates all sorts of make rules and
+dependency information. This eliminates the redundant recompile of all
+other drivers if you specified a specific target at the make command line.
+
+There are now automatic checks for the generated ROM size (3K safety
+margin are used to allow for 1K BIOS EBDA and 2K stack). This should
+avoid most of the cases in which the stack overwrites code and/or data,
+causing strange crashes.
+
+On to the real code - I rewrote both the ELF and a.out loading (the
+blocksize is now properly handled for all formats), and now most of the
+code is identical. Someone might want to merge the two. I verified that
+both a.out and ELF FreeBSD loading still works by booting the FreeBSD
+2.2.8 and 3.4 install kernels (the ELF kernel you gave me didn't work
+for whatever reason). Actually I tested everything except NBI, but that
+code is completely unchanged.
+
+I eliminated config.h and created cards.h - just have a look and you
+should get the idea. The PCI/ISA prototype matching hack is now buried
+in there. All PCI drivers (and skel.c) have been converted to the new
+include file.
+
+The only file that is really new is nfs.c, which contains the code where
+I started my journey.
+
+The loader code is now merged into one file for both the normal and
+compressed case. Some bugs have been fixed along the way (the normal
+loader copied too much data, potentially crashing the machine). BTW: I
+removed the block copy from comboot, because the first thing the loader
+code does is - to copy the code to the right place. Also copying it to
+0x80000 prevents compressed ROMs (though there is no way in the Makefile
+to create such a beast). Also the stack changing code was wrong -
+the overflow handling is missing: 0x9fxxxx-0x800000 is truncated to
+fit in the 16 bit register, which is not quite what one would expect.
+The stack pointer must be in the same segment, so for overflows just
+load 0. Anyway, we don't need a new stack for 4 bytes (the return
+address). Also the shifts won't work on an 8086/8088. The ROM segment
+and length code is also done once more in loader.S. Finally the org
+0x100 didn't work with my version of as86 - it prepended 256 null bytes.
+Don't get me wrong - I see that comboot was just a quick and dirty hack.
+It's now working...
+
+I also fixed floppyload to read exactly the right amount of data (not
+up to 65520 bytes more like the Linux code did) and ripped out some
+unused code.
+
+3c509.c: includes fixed, const added, static added, removed redundant code
+
+3c90x.c: includes fixed, const added, shortened messages to save space,
+made the transceiver selection bootrom fix optional (default: off),
+updated 3c90x.txt
+
+ansiesc.c: de-tftpified (now uses "download")
+
+config.c: moved the driver prototypes to separate file, added a few const
+
+cs89x0.c: ansified, const added, fixed timeout handling
+
+eepro100.c: includes fixed, const added, static added, USE_INTERNAL_BUFFER
+hack, passing globals as a parameter removed, timeout handling fixed,
+comments fixed
+
+epic100.c: comments fixed, const added, static added, USE_INTERNAL_BUFFER
+hack, removed unused variables, changed debug code to use macro instead
+of variable, allow broadcasts to be received (after all how did it
+work before???)
+
+etherboot.h: dual/serial console "cleanups", added NFS support, fixed
+INTERNAL_BOOTP_DATA for pathologic cases, removed prototype within comment
+(how did that end up there?), moved prototypes for config.c code here,
+added consts all over the place
+
+floppy.c: added static, changed cleanup code
+
+floppyload.S: renamed from .asm
+
+genrules.pl: I didn't write this :)
+
+i82586.c: fixed includes, added const
+
+lance.c: fixed DMA for PCI cards, removed leftovers from Linux driver,
+USE_INTERNAL_BUFFER hack
+
+linux-asm-io.h: added prototypes
+
+linux-asm-string.h: added prototypes
+
+loader.S: renamed from loader.asm, more comments see elsewhere in
+this mail
+
+loader.inc: removed
+
+main.c: includes fixed, static and const added, Etherboot/32 now prints
+relocaddr, hooks for NFS support, drain the Rx queue in some strategic
+places (after sleep), changed interface to await_reply: timeout handling,
+new cleanup code
+
+misc.c: ansified, twiddle code changed, strcasecmp enabled for
+Etherboot/16 (smaller than the 16 bit libc version), clear A20 before
+kernel is started (only for NBI), dual console fixes, removed bogus
+comment about interrupt enabling using iskey()
+
+nic.h: include guard added, added const
+
+ns8390.c: fixed includes for PCI version, added const, ansified, renamed
+internal functions
+
+osdep.h: removed #include <asm/byteorder.h> - probably all #ifdef
+__linux__ and __FreeBSD__ may be removed now.
+
+osloader.c: see elsewhere in this mail. removed loads of debugging code.
+
+otulip.c: removed unused variables, USE_INTERNAL_BUFFER hack, ansified,
+added const
+
+otultip.h: added const
+
+pci.c: fixed signed comparison
+
+pci.h: include guard added, const added
+
+rtl8139.c: static added, const added, globals are no longer passes as
+parameters, fixed probe loop
+
+serial.S: removed the Makefile hack to calculate the divisor and replace
+it by a CPP hack
+
+sk_g16.c: added static/const
+
+skel.c: updated
+
+smc9000.c: fixed includes, added const, fixed timeout, removed unused
+variables
+
+start16.S: changed stack pointer reloading
+
+start32.S: cleaned up GAS295 support, fixed CPU detection, fixed memsize
+for > 64MB, added basememsize()
+
+tiara.c: fixed includes, added const, removed unused variable
+
+tulip.c: fixed includes, added const, decreased oversized frame tolerance,
+USE_INTERNAL_BUFFER hack, converted to C comments, fixed prototypes,
+removed unused variable
+
+via-rhine.c: fixed includes, converted to C comments, removed unused
+functions, fixed timeout, USE_INTERNAL_BUFFER hack, removed unused
+variable, const added
+
+lzhuf.c was modified not to output ':' characters, because I find it
+useful to search for them in a make log to spot all error messages.
+
+Finally all symlinks have gone
+
+I fixed sgml/vendortags.sgml (maybe it's more a workaround): sgml2txt
+didn't like the ~~' sequence and ignored a whole line, making the .txt
+file incomplete. Also freebsd.txt was converted to sgml.
+
+My standard patch to netboot-0.8.1/configure (to remove the "unknown") is
+again in place - how is this file created? By hand? I added serial/dual
+console support to mknbi-linux.
+
+Oh, and something I almost forgot: Etherboot now works under VMware.
+VMware has a rather large EBDA (3K instead of 1K like most other
+BIOS versions), so one might have to sacrifice a few nifty options.
+Note that the Makefile check cannot detect this - maybe we should add a
+runtime check, too? One thing that doesn't work with VMware is the "Boot
+Local" stuff - it's not terribly useful if you have to boot from disk,
+but it shouldn't crash the machine (I've seen several triple faults,
+depending on RELOCADDR and the stack usage). I tracked it down to the
+fact that VMware crashes on int 0x19 if the memory area 0x98000-0x9f3ff
+is overwritten. If one changes RELOCADDR to 0x8f000, everything works
+nicely. Someone should report the bug to VMware. Also proper boot ROM
+support should be added to VMware and they should upgrade the virtual
+card to 100Mbps (don't laugh - they limit the bandwidth to 10Mbps even
+if you have a real 100Mbps card!). Maybe one could even use the flash
+utility for the recent AMD PCnet cards...
+
+Released as Etherboot 4.5.5
+
++ More fixes from Klaus Espenlaub, based on bug reports by Doug Ambrisko
+and others. Small cleanups in tulip.c. He also added a BACKOFF_LIMIT
+parameter to the exponential backoff for retry intervals.
+
++ Christoph Willing sent in a fix for PCI NE2000s which forces 16-bit
+transfer mode for PCI. This might make it work on some PCI NE2000s that
+failed before, please test if you can.
+
++ Moved commercial links off main web page into web page of its own.
+
++ Merged in TRY_FLOPPY_FIRST code from <as AT bart PERIOD nl>.
+
+Released as Etherboot 4.5.6
+
++ Frank Mehnert spotted a bug in tulip.c where the sole transmit buffer
+was not tagged as the last one in the chain.
+
++ Hacked serial.S to check if a serial interface is present and to disable
+the routines if not, so that Etherboot does not hang on a machine without
+a serial interface, even if the option has been compiled in.
+
++ Wrote mkromnbi for making a network bootable image from a ROM image
+(for using Etherboot to test another Etherboot driver).
+
++ Krzysztof Halasa found a small bug in nfs.c in the handling of BOOTP
+extension files.
+
++ Some instructions on adding Etherboot to a main BIOS were contributed
+by Dirk von Suchodoletz.
+
++ Some commentary on cbrom.exe versions posted by Rapp Informatik Systeme
+GmbH to the Netboot mailing list included.
+
+Released as Etherboot 4.5.7
+
++ Patrick Auge pointed out that -DT503_SHMEM option should be not used
+by default, as the comments say.
+
++ Heinrich Rebehn pointed out that the documentation needed to be updated
+for the new bin32 and bin16 prefixes for targets.
+
++ Christoph Plattner found that node_addr in struct nic should be unsigned
+char * or problems occur in the handling of the MAC address in cs89x0.c.
+
++ Greg Hudson pointed out that inet_ntoa is misnamed, it should be
+inet_aton.
+
++ Vsevolod Sipakoff suggested that the probe address list for NE2000
+should match that of Linux. Done, with the deletion of 0x360 which often
+conflicts with the parallel port at 0x378.
+
++ Created mknbi, a Perl utility that replaces mknbi-dos, mknbi-linux,
+mkfreedosnbi, and mkromnbi. Removed mk{freedos,rom,elks}nbi/ from
+contrib/. (ELKS has its own tagged image creation method now.)
+
++ Removed obsolete/ from contrib/.
+
+Released as Etherboot 4.5.8
+
++ Some small enhancements to mknbi. Merged in disnbi and mklnim. Changed
+version to 1.0.
+
++ netboot-0.8.1 directories distributed separately now.
+
+Released as Etherboot 4.6.0
+
++ Nick Lopez discovered that the Davicom 9102 is Yet Another Tulip Clone
+and a few appropriate initialisations will make it work.
+
++ Matthew Reimer sent in patches for contrib/3c90xutil.c/bromutil.c to
+compile and run under FreeBSD.
+
++ Krzysztof Halasa found that the number of buffers in epic100.c needed
+to be raised to 2 each for operation at 10 Mb for the PCI EtherPower
+9432B-TX using the SMC 83C171.
+
++ Klaus Espenlaub fixed the root path handling in main.c, it wasn't
+requesting option 17 in DHCP. Also removed one prototype warning in
+tftp().
+
++ Daniel Shane sent in code for for adding identifiers to a DHCP request,
+using a user specified DHCP option. The patch is in contrib/dhcpid.
+
++ Bug fix in mknbi-1.0 for the ipaddrs=rom option, warnings about badly
+formed specification to ipaddrs= or unresolvable names.
+
+Released as Etherboot 4.6.1
+
++ Stuart Lynne sent in patches to allow - to mean reuse kernel filename
+in menu specifications. Also fixed DHCP request to ask for tags 129 and
+130 (Ken added this), as the mknbi man page promised.
+
++ Fixed URL for Richard Ferri's LUI.
+
++ Added URL for Gregory R. Warnes' ClusterNFS.
+
++ Changed RFC2132_MAX_SIZE option in main.c to allow maximum size DHCP
+replies.
+
++ Matthias Schniedermeyer submitted an optional feature to use numbers
+instead of letters for bootmenu entries.
+
++ Brought some FAQs up to date with mknbi-1.0.
+
++ Wrote perl script mklrpnb for making netboot image from Linux Router
+Project floppy. Tested on Coyote Linux (based on LRP).
+
+Released as Etherboot 4.6.2
+
++ Re-enabled tulip.c:tulip_disable() code.
+
++ Minor fix to SHOW_NUMERIC code in bootmenu.c.
+
++ Minor spelling corrections to vendortags.sgml.
+
++ andreas.kabel AT slac PERIOD stanford PERIOD edu pointed out that to
+be RFC951 compliant, the broadcast BOOTP request near line 705 of main.c
+should use port BOOTP_CLIENT and thus stand a better chance of going
+through firewalls.
+
++ Christoph Plattner found that the 16 bit bus width fix for NEPCI cards
+introduced in 4.5.6 breaks operation for other NEPCI cards. So now the
+#define symbol is NS8390_FORCE_16BIT, to be used when the NIC requires
+16 bit bus width but Etherboot guesses wrong. This needs to be fixed
+later to autodetect adapter bus width.
+
++ Shusuke Nisiyama sent me the PCI IDs for 3C595 NICs so that ROM images
+could be generated for them.
+
++ Jim McQuillan sent in modifications to tulip.c to reject bad packets.
+
++ Klaus Espenlaub suggested changing the filename substition macro in the
+IDENT16 and IDENT32 strings to $(@F) so that only the filename portion of
+the pathname is inserted. Otherwise the contributed romid program breaks.
+
++ Added author ident and copyright status to contrib/bin2intelhex.c.simple
+at Rogier Wolff's request.
+
++ Günter Knauff sent updates to romid and mp-form.
+
+Released as Etherboot 4.6.3
+
++ Marty Connor contributed patches to tulip.c to support the LinkSys
+LNE100TX v4 NICs.
+
++ Added rmrd.com to mknbi-1.0 directory.
+
++ Added experimental changes to allow RELOCADDR to be changed to 0x88000
+to avoid Disk On Chip drivers. See RELNOTES and Makefile for details.
+
+Released as Etherboot 4.6.4
+
++ Chris Johns found a long-standing bug in first-linux.S. ES would
+sometimes != CS, making the ramdisk moving fail.
+
++ Made --harddisk work for mknbi-fdos.
+
+Released as Etherboot 4.6.5
+
++ Bug in mknbi-dos, last sector omitted in ramdisk image.
+
++ Use ceil() for computing number of rootdir sectors.
+
++ --harddisk now works for mknbi-dos also.
+
++ Should work on FAT16 partitions now.
+
++ New driver for Winbond W89C840 by Igor V. Kovalenko.
+
++ Modification to loader.S by Steve Smith for some PCI BIOSes that don't
+handle INT19H well.
+
++ Small bug in osloader.c, j not defined in two places if DELIMITERLINES
+defined.
+
+Released as Etherboot 4.7.6 (developmental)
+
++ All the changes from 4.6.5 to 4.6.6 back propagated except for the
+loader.S change.
+
++ Removed -nostdlib from ld flags. Seems to be a vestige from when we
+were calling gcc as it's not an ld option.
+
+Released as Etherboot 4.6.6
+
++ Contributed one-line patch to allow booting from SCSI disks also (sd).
+
++ Grzegorz Jablonski sent in a fix for long-standing bug in loader.S that
+prevented booting on some BIOSes.
+
++ More updates to documentation.
+
+Released as Etherboot 4.6.7
+
++ Rick Kennell pointed out that there is another place in main.c where
+the DHCP request is sent with a source port of 0, which may not elicit
+replies from some DHCP servers or pass gateways. Changed to
+BOOTP_CLIENT.
+
++ Depca driver finally works.
+
++ Changed unsigned int len; to int len; in 3c595.c transmit routine
+which was generating a warning from gcc.
+
++ Removed warning about ljmp indirect without * in start32.S by putting
+in the *. Checked that generated code has not changed by comparing
+binaries. Later: But only for gas 2.9.5 and above, gas 2.9.1 doesn't
+like *.
+
++ Wanted to do the same for the lcall's in pci.c but discovered that
+gas 2.9.1 chokes on *, and as I don't want to introduce more #ifdefs
+into pci.c, we'll just live with the warnings until gas 2.9.1 is dead
+or the incorrect syntax is rejected by a current gas release.
+
++ Reversed #define so that GAS291 indicates gas 2.9.1. Rationale: gas
+2.10 probably behaves like gas 2.9.5 so the default should be the new
+behaviour.
+
++ NI5010 driver finally works. Weird NIC, has only 2kB memory on board
+so if you don't switch to the receiver immediately after transmitting
+you will lose the reply packet. (This is a very ancient board, I was
+doing the driver for kicks.)
+
++ Implemented a low-overhead timer routine for implementing timeouts in
+drivers. This timer should be used instead of hacks with integer loops
+(which are CPU speed dependent) or calling currticks(), which has
+relatively high overhead because it reads the BIOS timer, and has a
+resolution of only 1/18th of a second. Timer 2 of the 8254 timer chip
+can be loaded with an unsigned 16-bit value that will be decremented at
+about 1193 counts per ms (constant TICKS_PER_MS in timer.h). So the
+maximum timeout that can be implemented with a single call is about 54
+ms. Call load_timer(u16) to load and start the timer (0 == 65536). Call
+int timer2_running() to check if it is still active. timer2_running can
+be interleaved with other tests, e.g. on the NIC hardware registers.
+When the timer runs down to 0, it will return 0. If you just need to
+delay a short time, call waiton_timer2(u16) to load and delay that many
+ticks.
+
++ Removed slowdownio() from sources. It's called in only one place and
+is followed by a call to currticks() which will result in a large delay
+anyway. It's also not clear if the strategy in slowdownio (a couple of
+local jumps) will even work on fast CPUs with instruction caches.
+
++ Removed support for %i (alias for %d) in printf. Nobody uses it, if
+they do they should just edit the format string to use %d, and removing
+it means one less non-standard format in printf; we have %X, %b and %I
+as it is.
+
++ Simplified currticks() by accessing BIOS variables directly instead of
+calling timeofday BIOS interrupt.
+
+Released as Etherboot 4.6.8
+
++ I'm pissed off with the inconsistency between gas 2.9.1 and gas 2.9.5
+re ljmp * (indirect jump). Some assemblers claiming to be 2.9.5 dislike
+the * (RH6.2's is one). I'm going to just make it ljmp and live with the
+warning message until the gas 2.9.1 syntax is totally dead.
+
++ Various fixes from Klaus Espenlaub: Fix for NFS booting from *BSD
+platforms, fix for Lance driver, interrupt was being turned on, fix for
+serial.S and code cleanups.
+
++ Paul Robertson of Locsoft found that if the top half of %esp contains
+garbage just before the first call to real_to_prot in start32.S, it can
+affect booting on some BIOSes. Inserted andl to clear top half.
+
++ Sleep for 2 seconds after failure to load file to avoid pounding the
+server if the file does not exist and thus shutting down the tftp
+service (inetd has rather poor rate controls).
+
++ Shredda of gmx.de reported a discrepancy between the Macronix MX98715
+device IDs used in pci.h and NIC. Marty Connor has ruled that the id in
+NIC is a typo. If booting works from floppy but not from ROM, this may
+be the reason.
+
+Released as Etherboot 4.6.9
+
++ Oops, a brown paper bag bug in start32.S. Forgot that the currticks()
+needs interrupts enabled to work. Calling the BIOS allowed interrupts to
+happen by going into real mode (interrupts are disabled in protected
+mode). So inserted prot_to_real and real_to_prot pair inside
+currticks().
+
+Released as Etherboot 4.6.10
+
++ Marty Connor and Gary Byers of thinguin.org contributed a LILO prefix
+file that makes the Etherboot image look like a Linux kernel to LILO and
+thus bootable from the LILO prompt.
+
++ Ifdefed out code in mknbi that falls back to the tftp directory for
+root-path. The result is that the options passed to the kernel specifies
+the tftp directory as nfsroot even if there is no root-path option in
+the DHCP or BOOT server configuration. This interacts badly with recent
+Linux kernels which actually pay attention to the root-path handed down
+and use that as nfsroot. People who were expecting the diskless kernel
+to use the default /tftpboot/<name of client> as nfsroot would have been
+surprised to find it trying to use the tftp directory (which often
+happens to be /tftpboot, although I recommend that it be different, to
+improve security).
+
++ Eric Biederman found an off-by-one bug in the ELF loader.
+
++ Christoph Plattner pointed out that the comments for COMCONSOLE in
+Config are wrong, the serial port is at 3F8, not 378.
+
++ A couple of updates to wol.c and wake.pl by Günter Knauff.
+
++ The Davicom 9009 and 9102 driver was contributed by Sten Wang of
+Davicom. It will be merged into tulip.c later.
+
++ Implement eepro100_disable. There have been reports of memory
+corruption after Etherboot has handed over to the booted image due to
+the live controller.
+
++ Matt Hortman reported a new Intel NIC, 82559ER, with different IDs.
+Added to file NIC.
+
++ Ranjan Parthasarathy reported another Tulip clone from ST Micro with
+different IDs. Added to file NIC.
+
+Released as Etherboot 4.6.11
+
++ Stefan Lesicnik sent in a report from Intel which explains what is
+probably wrong with the PnP header. BEV should point to the mainline
+vector, not to the part that installs the INT19H vector.
+
++ Hopefully finally fixed DHCP option limit problem. It was requesting
+large packets but not parsing them fully due to the length limit passed
+into decode_rfc1533(). Thanks to shredda for testing this.
+
++ Added the # modifier to printf, it prefixes 0x to %x and %X making
+printf formats shorter throughout. 0x%[xX] changed to %#[xX] in lots of
+files. Now if only I could make b,x,X the standard hhx,hx,x and get rid
+of I.
+
++ Andreas Neuhaus provided patches for multiple rx buffers for lance.c
+which made it work again with VMware.
+
++ Perl script to convert floppyfw floppies to netbootable images.
+
++ Marty Connor made some small changes to liloprefix and Makefile to
+make the LILO images SYSLINUX bootable also.
+
++ Make the default return value for _poll in skel.c 0 so that when
+driver writers implement _transmit first, it will not hang on garbage
+return values from _poll when it's called to flush the input queue
+before the first transmit.
+
++ EEPRO/10 driver now works. µs timer routines came in useful.
+
++ Anders Larsen sent in a patch to 3c90x.txt which makes it clearer.
+
++ Added more stuff to the documentation.
+
++ Fixed bug in mknbi that always did the equivalent of --ipaddrs=rom
+no matter what. Also removed undef from my variable list in TruncFD.pm
+so that it won't have problems with Perl interpreters.
+
+Released as Etherboot 4.6.12
+
++ Jim McQuillan sent in a patch for first-linux.S where it was assuming
+the argument in tag 129 (additional parameters) is a null terminated
+string, when it's a length counted string. A new routine, addkarg was
+created to handle this.
+
++ eepro100 should handle newer NICs with 256 byte EEPROMs now. This
+includes the onboard NICs on some motherboards, see file NIC. Thanks to
+Stephan Lauffer for helping with the fixes. WARNING: This code may have
+a bug that causes the onboard EEPROM to be corrupted. We believe we have
+found and removed the bug but please proceed with care.
+
++ DHCPDISCOVER was sending out one byte too many for PARAM_LIST.
+
++ In DHCPDISCOVER send "Etherboot" in VENDOR_CLASS_ID option (60). Will
+add code later to check for "Etherboot" in vendor encapsulated options.
+
++ Used µs timer routines in 3c509 for more accurate timing and hence
+better hardware detection. Use COMMAND_IN_PROGRESS bit to detect
+transmit complete instead of waiting for a fixed amount of time. Get rid
+of eth_vendor and associated tests, it doesn't serve any useful purpose
+since the driver was modularised long ago and the 3c509 detection status
+is stored outside of the driver now. Got rid of some unused global
+statics in 3c509.c, leftovers when the drivers were monolithic. Wait 2
+seconds after enabling TP interface to give it time to come up. This
+allows us to get rid of T509HACK in main.c.
+
++ Get rid of eth_vendor and associated tests in cs89x0.c, same reasons
+as for 3c509.c.
+
++ Moved the rest of the VENDOR_ and FLAG_ defines into ns8390.h, as
+ns8390.c is the only file that uses them now.
+
++ Use lower 32 bits of node address + current time for xid (network byte
+order). More likely to be distinct from other clients than just the
+current time, which is similar for all clients booted at about the same
+time.
+
++ Support for 16-bit code has been removed. XTs and ATs are pretty much
+dead now and in fact many Etherboot/16 drivers have been broken for a
+while but nobody noticed. This should make some of the code easier to
+maintain. If you really wanted 16 bit support, use an older version of
+Etherboot, maybe 4.4 or something like that, not sure when things
+started breaking for 16 bit mode.
+
++ Should not store IP and UDP headers at BOOTP_DATA_ADDRESS. Redefined
+bootp_t without IP and UDP headers. Now requested size of bootp packet
+matches storage available. Do not add sizeof(iphdr) + sizeof(udphdr) to
+bootp pointer in start32.S:xstart now. start16.S:xstart was broken
+because it did not do this addition but nobody noticed.
+
++ Removed array kernel_buf, saving 128 bytes and replaced with
+KERNEL_BUF, a pointer into the bp_file of the bootp_reply structure at
+BOOTP_DATA_ADDR. Note: this depends on the server not sending Option
+Overload which would use the sname and file fields for options, but we
+don't request this option so it shouldn't. Removed char *kernel,
+instead check KERNEL_BUF[0] just before booting and if null, use
+fallback filename. (This is needed for future extensions to booting
+protocol.)
+
++ Define a shorter tftpreq_t type for making requests instead of using a
+full sized tftp_t packet to reduce stack usage.
+
++ Defined macros for htonl/htons/ntohl/ntohs for cases where the operand
+is a constant, saving a function call.
+
++ Started on first32.c, a protected mode 32-bit version of
+first-linux.S, which should be far easier to read and maintain. Will
+boot basic Linux kernels correctly but doesn't handle ramdisk or
+kernel arguments yet.
+
++ Updated nfs-swap documentation in contrib/nfs-swap to point to
+Claus-Justus Heine's new web page.
+
+Released as Etherboot 4.7.13 (development)
+
++ Added more IDs for eepro100 variants taken from the Linux 2.2.18
+source. Should handle the EEPROM properly now, a few defines were wrong
+in 4.7.13. Loop counter timeouts in eepro100.c replaced with hardware
+timeouts. Don't loop waiting for packet in _poll, return 0 immediately.
+
++ first32.linux works. Does kernel arguments and ramdisk but doesn't do
+appended parameters from menu selections, which should be replaced by a
+more elegant menu scheme anyway. Needed gateA20 routines in
+mknbi-1.1/first32.c otherwise cannot access extended memory.
+first32.linux should be able to handle memory > 64 MB, which the old one
+couldn't. Support for first32pm call protocol added.
+
++ 3c595.c changed to use hardware timer for delays. Transmit routine
+waits for a fixed period after transmitting. Changed to check
+S_COMMAND_IN_PROGRESS bit. It also contains some of the same unused
+variables as 3c509.c and mentions 3c509 in some comments. Cleaned up.
+
++ Hmm, how come this wasn't fixed long ago? Should discard BOOTP/DHCP
+replies that are not to broadcast or own MAC address. I guess xid caught
+practically all of the non-matching packets. (Later: Actually the NIC
+should filter out packets we don't want, but leave test in anyway, it's
+the last test.)
+
++ Removed last vestiges of ETHERBOOT32 and ETHERBOOT16.
+
++ ETHER_ADDR_SIZE => ETH_ALEN, ETHER_HDR_SIZE => ETH_HLEN,
+ETHER_MIN_PACKET => ETH_ZLEN, ETHER_MAX_PACKET => ETH_FRAME_LEN. More
+Linuxy and therefore more familiar to programmers.
+
++ Cleared up confusion with 60/64 and 1514/1518 for minimum and maximum
+frame sizes. Practically always the right numbers are 60/1514, except
+that some chips count the FCS in the receive length, then we have to use
+64/1518.
+
++ Make __swap32 and __swap16 inline routines available globally as
+swap32 and swap16. eepro.c can use swap16 instead of making up one.
+
++ Make aui field in nic.h an int since it will be padded to a longword
+boundary anyway and call it flags so that other drivers can use it for
+their own purposes. Currently only 3c503 uses it to indicate AUI xcvr.
+
++ Make sprintf return number of characters written instead of a pointer
+to the last char written to be more consistent with standard C.
+
+Released as Etherboot 4.7.14 (development)
+
++ Thanks to Mark VandeWettering for the start of HomePNA (networking
+over phone lines) support for the AMD 79C978.
+
++ Bug fixed in first32.c handling of (ip|nfsroot)=X where X is not rom.
+
++ first32pm.linux works. No need to go into real mode to call first32pm
+and then it goes back to protected mode. Paves the way for extension
+routines to Etherboot. Implement program returns to loader flag in
+header field. Added option to mknbi to specify this.
+
++ first32*.linux: Check tag 128 present and correct before appending tag
+129. Also tag 129 should be appended to parameters before substitutions.
+
++ Merged cleanup_net into cleanup since they are always called together.
+
++ Floppy booting doesn't need to be passed BOOTP_DATA_ADDR.
+
++ Clean up variables associated with tagged image loading in osloader.c.
+
+Released as Etherboot 4.7.15 (development)
+
++ Duplicated 3c900 PCI IDs under 3c595 as some NICs apparently detect
+and work with the 3c595 driver but not the 3c90x driver, according to a
+report from Dirk Pfau. (The 3c90x series has two modes of operation,
+programmed I/O mode descended from the 3c509, good only for 10 Mb
+operation, and bus mastering mode, essential for 100 Mb operation. For
+network booting, either mode is acceptable.)
+
++ Removed auto from kernel parameters; it's the default already.
+
++ Use hardware timer instead of loop counter for transmit timeout in
+3c90x.c.
+
++ Define a jmpbuf type for setjmp and longjmp. Trim size to 7 longs,
+that's all that's needed. Standardise the return values from longjmp:
+-2: loader error, -1: timeout or ESC, 0...: various meanings to
+Etherboot main loader.
+
++ Ansify function headers in bootmenu.c.
+
++ Make _int10 return ax | (bx << 16) as result so that these can be
+accessed more efficiently in the following statements.
+
++ Make handleansi take unsigned int instead of unsigned char as
+argument, otherwise extra code will be generated to handle this
+according to ANSI rules. (Quite significant saving of 55 bytes.) Rename
+it ansi_putc for clarity.
+
++ Prefix getc, putc and ischar with console_ to make things clearer and
+to avoid confusion with the Unix getc, putc.
+
++ Add menu as a target to mknbi. Started source code for menu extension.
+Successfully transferred control to menu at 0x10000 and back. ANSI
+colour controls work, at least. Return end needs more work.
+
++ Started on ELF support in mknbi.
+
+Released as Etherboot 4.7.16 (development)
+
++ Added atftp 0.2 (ftp://ftp.mamalinux.com/pub/atftp/) to contrib/.
+Supposedly contains a tftpd that runs multithreaded, which may help
+people having problems with *inetd shutting down tftpds that spawn too
+fast.
+
++ Added a few more Tulip entries to config.c and NIC, not all of them
+have been confirmed working.
+
++ Got ELF format creation in mkelf-linux working now. At least one empty
+section header is required to make a valid ELF file.
+
++ Added code to support non-MULTIBOOT ELF when IMAGE_ELF is selected but
+IMAGE_MULTIBOOT is not. Booting from images created by mkelf-linux
+now works!
+
++ TAGGED_IMAGE is now not always selected. It's just the fallback if
+none of TAGGED_IMAGE, AOUT_IMAGE or ELF_IMAGE is selected. Therefore you
+must explicitly select TAGGED_IMAGE if you want it, and you have
+selected AOUT_IMAGE or ELF_IMAGE. Startup banner line displays all
+image formats accepted.
+
++ exit() in mknbi/start32.S should copy argument to %eax first.
+
++ Images with 0xAA55 in bytes 510-511 are no longer accepted, which
+should reject invalid formats now, e.g. Linux kernel images, which have
+a boot sector in the first block. Strictly this does not conform to the
+original netboot spec by Jamie Honan, which specifies that non-tagged,
+linear images starting from 0x10000 are allowed, but that format is
+pretty useless now. Any decent loading scheme needs a roadmap to the
+blocks in the downloaded file, which is what tagged, a.out, or ELF
+images provide in the header. Q: What is config_buffer in main.c for?
+Nothing else seems to use it. Is it a relic of non-tagged images?
+
++ Clean up lots of obsolete prototypes in etherboot.h. Ansify lots of
+function headers in main.c. Make lots of functions and variables in
+main.c static. Make bootmenu.c:getoptvalue() static.
+
++ Simple external menu program works!
+
++ More documentation cleanup, notably editing the compile options to
+match what has been done.
+
+Released as Etherboot 4.7.17 (development)
+
++ Marty Connor did it again! He found a long standing bug in the PnP ROM
+header which caused it not to be recognised by BIOSes. Now Etherboot ROM
+images are PnP compliant. I hacked makerom.c to fill in the offset of
+the ident string for the device string so that the BIOS can even print
+out "Etherboot" and the device ident on boot up.
+
++ Made demo menu program a bit more elaborate with timeout.
+
++ Igor V. Kovalenko fixed the Winbond W89C840 driver to use the hardware
+timer instead of CPU counter loops. Now none of the Etherboot drivers
+rely on CPU speed dependent loops.
+
++ Small fix to contrib/p910nd.c to not use getprotobyname which requires
+libnss_files.so, which may not be installed in all environments.
+
++ Small change to contrib/mkffwnb to allow the user to choose ELF format
+(by editing one line) instead of tagged format.
+
++ Patch to atftp-0.2 to make it accept a filename if the directory is a
+prefix of the filename. This is needed so that valid absolute pathnames
+will work. Patch sent to atftp authors.
+
++ Added support for filtering out replies which do not include a Vendor
+Class Identifier of "Etherboot" in the Vendor Encapsulated Options. This
+can be used to select only the DHCP servers which we want to get
+addresses from and reject the rest. Select the compile option
+-DREQUIRE_VCI_ETHERBOOT. This requires ISC DHCPD 2 or 3 AFAIK. (It's
+not documented in DHCPD 2, but it works.) Other DHCP servers may support
+VEO. (It's a RFC2132 option.)
+
++ Jim Thomas suggested a way, other than creating /fastboot, of
+preventing fsck from running on NFS root, ln -s /bin/true
+/sbin/fsck.nfs. Not verified but should work. Added to documentation.
+
+Released as Etherboot 4.7.18 (development)
+
++ Pavel Tkatchouk verifies that lance.c can handle PCnet-FAST III
+79c973. Added a new entry to lance.c and NIC. NIC entry not verified
+yet.
+
++ Enhanced disnbi to decode ELF images too.
+
++ Arrgh! There are old BIOSes that rely on the wrong order of the bytes
+in the device identifier in the PCIR and PnP structures. Wrote a Perl
+program swapdevids.pl to swap these bytes. Apply this to image file just
+before programming the EPROM.
+
++ Marty Connor suggested that the specs state that for PnP ROMs the
+unsuccessful return from boot should be int 0x18 rather than int 0x19.
+Using int 0x19, selecting L for local device doesn't work. Fixes needed
+in both loader.S and start32.S (get lret to work properly, instead of
+doing an int 0x19 directly, involved saving ss and sp in real mode
+instead of in protected mode).
+
++ Wrote a Perl program disrom.pl to display key structures of a ROM
+image.
+
++ Added call to binmode() in various Perl utilities so they should work
+under other OSes.
+
++ Added check in makerom.c to warn if 55 AA not found at start of image.
+It seems some people don't read the warning not to use the Linux
+supplied as86.
+
++ It seems Z is a recent addition to pack/unpack formats in Perl and
+even a Perl as recent as 5.004 doesn't implement it. Change Z5 in
+mknbi.pl and TruncFD.pm to a5 since we only need to compare it against
+'FAT12' and 'FAT16'.
+
++ Some errors found in osloader.c in the #ifdef IMAGE_MULTIBOOT
+sections. kernel should be KERNEL_BUF and union info should have
+unsigned short s[256];. Also kernel -> KERNEL_BUF for IMAGE_FREEBSD,
+obviously few FREEBSD users have tried compiling it.
+
++ Explain in docs that .com and .(lz)lilo images can be generated and
+touch briefly on how to use them.
+
++ Donald Christensen contributed translations of floppyload.S and
+loader.S to gas syntax. Currently they are in contrib/gassyntax/. They
+potentially allow us to throw away as86 and/or nasm and use GNU tools
+throughout, but I have to do some work on them: 1. I have to check what
+versions of gas accept the syntax, the 16-bit mode in gas was a recent
+enhancement; 2. I have to put back the #ifdef PCI_PNP_HEADER into
+loader.S and also bring it up to date to the recent patches.
+floppyload.S should be usable as is.
+
+Released as Etherboot 4.7.19 (development)
+
++ Donald Christensen completed the translation of loader.S and all the
+other .S files in the src directory that previously required as86 or
+nasm. No more futzing around with precompiled versions. Yipee!
+
++ Luigi Rizzo contributed a slightly hacked FreeBSD loader that works on
+floppy or hard disk. See boot1a.s for details. Makefile rules edited.
+Targets renamed .dsk and .lzdsk to indicate they're not floppy specific
+now. Documentation updated. I note that the loader is smart enough to
+figure out exactly how many sectors have to be read.
+
++ Renamed comload.S to comprefix.S which describes it better.
+
++ mknbi tools split out into separate package for independent
+development.
+
++ Use A32 instead of Z32 in unpack format in disrom.pl in case we
+encounter old Perl versions (< 5.005).
+
++ Vendor Class Identifier string that's sent out is now of the form
+Etherboot-x.y (13 bytes long).
+
++ Reduced size of ee_data in davicom.c to 32 bytes because we only need
+to access the MAC address in bytes 20:25.
+
++ Changed type of formal arguments to pci.[ch] routines to unsigned int
+except for the last argument, because in ANSI C parameter passing is
+like assignment and extra dummy variables and code may need to be
+generated if the formal argument type is not the the same size as the
+actual argument that gets pushed on the stack. Not insignificant
+overhead, reduction from 1853 to 1727 bytes due to change. Changed devfn
+and bus members of struct pci_device to unsigned char to enforce limit
+on type. Surprisingly this reduced the size further to 1667 bytes.
+Probably the compilier could do more optimisations after the last
+change.
+
++ Some drivers hardwired 0 for bus number in calls to pcibios_*
+functions. Changed to pci->bus, which is set in scan_bus. Only
+people with NICs not on bus 0 would have noticed.
+
++ Found a couple more old-style pre-ANSI C function declarations. Turned
+on -ansi and -pedantic for kicks and fixed some non-ANSIness, e.g.
+// comment in #define, text after #endif, casting memcpy arguments to
+void *, using void * instead of char *. Some char declarations changed
+to unsigned char.
+
+Released as Etherboot 4.7.20 (development)
+
++ I changed my mind. I think the format in disrom.pl should be Z32,
+otherwise it displays binary characters after the valid part of the
+string. For people with Perl < 5.005, please upgrade.
+
++ Moved RELOC down to 0x94000. Turned on USE_INTERNAL_BUFFER by default.
+Unless BOOTP_DATA_AT_0x93C00 is defined, use internal bootp strucutre.
+This gets Etherboot out of the area just below 0x10000 and the area from
+0x93C00-0x93FFF. DHCP packets can now be as large as the Ethernet
+payload. Later on, first32.c and the parameter area could expand a bit.
+In lance.c had to reduce RX_RING_SIZE (by reducing LANCE_LOG_RX_BUFFERS)
+from 16 to 4 to fit the driver. I'd like to hear feedback from lance
+users. Is 24kB of receive buffers really needed given that Etherboot
+uses stop-wait protocols?
+
++ Doug Ambrisko sent in some patches for FreeBSD: a correction for one
+typo I missed and changes to make compilation under FreeBSD easier.
+
++ Michael Sinz contributed patches to allow the FreeBSD loading code to
+load debugging symbols also.
+
++ Marty Connor contributed a SiS900 driver. Also pointed out that if
+ASK_BOOT <= 0, the prompt and read shouldn't even happen. Conditional
+code reworked.
+
++ Split documentation into user manual and developer manual. Added
+material.
+
+Released as Etherboot 4.7.21 (development)
+
++ Preston Wilson pointed out that ds.internic.net should be replaced by
+www.ietf.org in documentation URLs. Also RFC1090 should be RFC1094
+(NFS).
+
++ Marty Connor pointed out some broken links due to the split in
+documentation. Also comments don't match code in lance.c for change just
+above. Also passed on a bug found by a user of rom-o-matic.net where
+tftp was not defined when ANSIESC was defined. My mistake, I made it a
+static function when it needs to be exported to ansiesc.c.
+
++ Christoph Plattner found that the Etherboot startup messes up the
+flags while testing for a 386+. This doesn't affect Etherboot but it can
+cause the loaded operating system to crash. Fix: pushf before and popf
+after the CPU model testing.
+
++ Jean-Jacques Michel contributed patches to the via-rhine.c driver to
+make it work for the VT6102 model as used on some DFE530-TX Rev.A3 NICs.
+
++ Luigi Rizzo sent in a fixed boot1a.s that actually works on HDs now.
+
++ Stefan Furtmayr sent in a list of URLs to TFTP servers for NT. Added
+to directory contrib/Diskless-From-NT.
+
++ Paul Whittaker contributed a HOWTO in HTML format on booting with NT
+as the server. Added to directory contrib/Diskless-From-NT.
+
++ CJ pointed out that the advertised message size is > 1500 bytes.
+Define MAX_BOOTP_EXTLEN so that the size of the structure matches the
+Ethernet payload size.
+
+Released as Etherboot 4.7.22 (development)
+
++ Reintroduce the old Via-Rhine PCI IDs into file NIC and give the
+corresponding ROM images -old suffixes, in case some people are using
+the old chips.
+
++ Peter Kögel contributed patches to the SiS900 driver to make it work
+for the SiS630e and SiS730s.
+
++ Charles Dobson pointed out that when booting from a PnP BIOS, the code
+should not hook or restore the INT19H entry point. Put hooking code
+inside #ifndef PCI_PNP_HEADER and changed entry point in PnP structure
+from start19h to blockmove.
+
++ I have one report that gas 2.91 doesn't assemble loader.S because it
+can't handle all the 16-bit code. Since the benefits of using gas for
+all assembly code are great, and gas 2.95 has been out there for a long
+time, I regretfully say to affected users: upgrade your tools. Otherwise
+there may be a workaround by specifying the opcodes literally. I leave
+it to interested parties to try. If you do this, put in an #ifdef
+GAS291, naturally.
+
++ Updated contrib/tftp-hpa to 0.16 from ftp.kernel.org.
+
+Released as Etherboot 4.7.23 (development)
+
++ Rename nepci entry in file NIC to rtl8029 to avoid giving the
+impression that nepci will work for all PCI NE2000 clones. Make the
+issue of PCI IDs in ROMs clearer in documentation, both in the
+configuration and troubleshooting sections.
+
++ Tania Oka and Hyun-Joon Cha at about the same time found that
+implementing the rtl_disable() routine in rtl8139.c stopped random
+crashes in Linux later. It is important to disable the NIC after network
+loading.
+
++ Implemented _disable() routine in w89c840, 3c90x and via-rhine drivers
+too. Don't know how to do it for epic100.
+
++ p910nd-0.4 in contrib/ has -f device option now to specify other
+printer ports, e.g. USB.
+
++ Robb Main found a bug with the #ifdef logic in loader.S. This may fix
+problems with BIOS detection.
+
+Released as Etherboot 4.7.24 (development)
+
++ Paolo Marini sent in some code to make it work on his bare metal (no
+standard BIOS or peripherals) platform. This may be a useful starting
+point for some applications. See contrib/baremetal/.
+
++ Eric W. Biederman contributed a Perl script in
+contrib/award_plugin_roms/ to list flash BIOS plugin components.
+
++ Marty Connor rewrote the Tulip driver to handle many more variants.
+
++ For PCI ROMs loader.S can now detect if it's being called from a PnP
+BIOS and choose to hook INT19H if not.
+
++ Pass struct *rom_info in priv_data to probe routine. This is to allow
+drivers to decide, based on the ROM address, which one of multiple
+instances of identical network adaptors to activate. Started on 3c509
+code to use this but need to understand 3c509 contention resolution
+mechanism first.
+
++ Link src/lzhuf.c to contrib/compressor/lzhuf.c so that we don't need
+to refer to contrib/compressor/lzhuf.c anymore in Makefile.
+
+Released as Etherboot 4.7.25 (development)
+
++ Minor documentation edits, merged in NIC entries for newly supported
+Tulip variants from Marty Connor.
+
++ One last minute change, Robb Main suggested calling cs89x0_reset()
+from cs89x0_disable() to shutdown the hardware cleanly.
+
++ Updated tftp-hpa to 0.17.
+
++ Slight mod to lzhuf.c to make compression statistics report shorter.
+
+Released as Etherboot 5.0.0 (production)
+
++ Donald Christensen found a small bug in osloader.c. Not all context
+was cleared on tftp restart which caused restarted tftp loads to fail.
+
++ Correct a small error in setting %sp when not running at 0x9xxxx.
+Now relocation to 0x84000 works.
+
++ Marty Connor added a generic Tulip entry and renamed the Macronix
+entries because PHP doesn't like strings starting with digits (for
+rom-o-matic.net).
+
++ In loader.S, move code to save ROM segment and length to before jump
+to new segment, otherwise if MOVEROM is defined, then the ROM segment is
+always 0x8000. In etherboot.h, define an inline function to say if a ROM
+address is ok to boot from. Allow if < 0xC0000 or matches assigned ROM
+address of NIC.
+
++ Thomas Kessler found a bug in vendortags.sgml re option-NNN tags in
+dhcpd.conf, the wrong syntax was presented. However on trying the
+option-NNN syntax documented in the dhcp-options man page, it was
+discovered that option option-NNN is no longer supported in the old way
+in recent versions of ISC dhcpd v3; a new syntax should be used. Added
+note to vendortags.sgml to warn users.
+
++ Incorporated changes suggested by Hannu Martikka to #define
+DEFAULT_KERNELPATH in etherboot.h for rarp(), and display the TFTP
+server address before filename in Loading: message.
+
++ Split off documentation into separate package in anticipation of
+production/development series split. Moved previous LOG to top level.
+Moved distribution section of index.html into separate web page so that
+index.html will be less ephemeral.
+
+Released as Etherboot 5.0.1 (production)
+
++ Arkadiusz Miskiewicz pointed out that --oformat should be used instead
+of -oformat as old ld accepts both while new ld requires --oformat.
+
++ contrib/{tftp-hpa,atftp} are distributed separately from the
+distribution page to make them easy to update.
+
++ Eric Biederman contributed many small changes in the code to improve
+the behaviour in exceptions and generally improve the code structure:
+
+1) Cleanup etherboot restarting. There is now only one place that needs
+to test for EMERGENCYBOOTDISK.
+
+2) Change pci.c as I have suggested. It is setup to scan every possible
+pci bus until it finds an etherboot card.
+
+3) Change osloader.c so that if an image that can return, but isn't
+supposed to it restarts etherboot with -2 instead of the returned value.
+
+4) Rewrites the delay logic so that we compute how long we should sleep,
+and then sleep the whole time in await_reply so in a congested networks
+we don't miss slow packets.
+
+5) divides load into load & load_configuration. This removes the need
+for the weird bootp_completed variable. And makes it a little more
+explicit what we are doing.
+
+6) add an interruptible_sleep function so that we can sleep and still
+process keystrokes.
+
+7) rewrites the restart logic:
+ - renames jmp_bootmenu to restart_etherboot.
+ - removes bootmenu (The function isn't)
+ - It explicitly does an eth_reset & eth_probe pair to reinitialize
+ the interface. This should help if someone has plugged the
+interface into a different switch since booting started.
+ - moves ASK_BOOT and TRY_FLOPPY_FIRST into their own functions.
+ - On every restart calls ask_boot and try_floppy_first. Allowing you
+ to change your mind on how you want to boot after network booting
+starts.
+
+8) In cleanup calls both eth_disable (to disable the interface) &
+eth_reset to make certain the interface can be initialized from linux.
+(If nothing else this should cause more hidden bugs to show up).
+
+9) Restart etherboot when downloading a bootfile fails, instead of just
+looping trying to get that file. Allowing typos in dhcpd.conf to be
+corrected without having to reboot the client machine running etherboot.
+
+Released as Etherboot 5.1.0 (development)
+
++ All the changes from 5.1.0 carried over except calling eth_reset()
+from cleanup().
+
++ Marty Connor, funded by Sicom System (http://www.sicompos.com/), wrote
+a driver for NICs based on the National Semiconductor DP83815, e.g.
+Netgear FA311/FA312. Also independently created by Jason McMullan just
+at the time Marty released his driver. Thanks for the effort Jason;
+great minds think alike. Both are based on Donald Becker's Linux driver,
+of course.
+
++ Doug Ambrisko contributed a patch to take environment bindings for
+FreeBSD kernels from a BOOTP/DHCP option or config variable.
+
++ Dax Kelson contributed an example of an ISC DHCP config file that uses
+Vendor Class Identifier to tailor the response to Etherboot clients.
+Also discovered that the Etherboot VCI should also be sent in the
+DHCPREQUEST message, in addition to the DHCPDISCOVER message. Note that
+the DHCP server must be set to non authorititative if you have an
+authoritative server running already or it will interfere with that
+one's operation.
+
++ Peter Lister and Vasil Vasilev contributed changes to generate .pxe
+images bootable via PXE.
+
++ Eric Biederman added code to 3c90x.c to enable the NIC: set up
+busmastering and set the latency timer in case the NIC is not already
+set correctly, and fixed a couple of related bugs in eepro100.c.
+Verified that the 3c90x driver works for the 3c980.
+
++ Moved strncmp from osdep.h to linux-asm-string.h. Use the general
+version using string ops, not the deprecated 486 version (what was I
+thinking). Also added strlen, needed for FreeBSD patch above.
+
++ Thanks to gcc 3.0, found and corrected a couple of C constructs of
+undefined semantics in rtl8139.c and lance.c of the form: i = ++i &
+MASK;
+
++ In Config/CFLAGS32: changed -m386 to prefered form, -mcpu=i386,
+changed -O2 to -Os, and added -ffreestanding. These changes allow
+warning-free compilation under gcc 3.0. Only mimimal testing has been
+done with gcc 3.0 compiled binaries, we hope there are no problems but
+don't throw away your gcc 2.9.5 yet.
+
++ Added an .org 0 to loader.S just before _start. May or may not fix
+alleged assembly problem with gas 2.11.
+
++ Cosmetic change: in boot1a.s replaced "loaded" with "done\r\n" so that
+Etherboot messages start at beginning of line.
+
++ More improvements to contrib/mkffwnb.
+
+Released as Etherboot 5.0.2 (production)
+
++ Added missing rules in genrules.pl for .pxe and .lzpxe images.
+
++ Peter Lister unified pxeloader.S into loader.S. pxeloader.S not
+required now. Also fixed .lzpxe.
+
++ Added missing int i; declaration in try_floppy_first().
+
++ Load %edx with dev just before calling xstart in floppy.c:bootdisk()
+so that %dl will have device number, just like entry from BIOS.
+
++ Merged in Eric Biederman's patches to build .ebi images that run under
+LinuxBIOS. To make an image, edit Config to enable the EBI options (and
+disable TAGGED_IMAGE), then make bin32/driver.ebi, where driver is the
+name of a supported PCI NIC.
+
+Released as Etherboot 5.1.1 (development)
+
++ The rotating bar progress display has been replaced by a sequence of
+dots, one for each transmitted packet. This is kinder to dumb displays,
+e.g. serial terminals, and gives a better feel for how the loading is
+going. If you want the rotating bar, use -DBAR_PROGRESS.
+
++ In loader.S change .fill 0x18-(.-_start) to .org 0x18. Might help
+people having errors assembling it.
+
++ Do Jong Gwan found a 3Com 980 with PCI ID 0x9805. Added to config.c
+and NIC. Added for good measure 0x7646 which is listed as 3CSOHO100-TX
+in Linux kernel 3c59x.c.
+
++ Add a rule to the Makefile to check for gcc 2.96, which is buggy, and
+tell the user to use kgcc instead if found.
+
++ Till Straumann added long-needed code to warn when fragmented packets
+seen (encountered on a wireless link) and to do UDP packet checksumming.
+
++ A trio of patches from Klaus Espenlaub, to fix a lance ring pointer
+error in lance.c, to fix a format error in the multiboot call in
+osloader.c and a patch to enable powersaving while waiting (good for
+compute clusters and VMware), this one requiring the new option
+-DPOWERSAVE in compiles.
+
++ While we are adding compile options, -DFLOPPY has been renamed to
+-DCAN_BOOT_DISK as FLOPPY has been a misnomer ever since the ability to
+boot /dev/hdX and /dev/sdX was added.
+
++ Spurred by correspondence from Till Straumann and Klaus Espenlaub,
+hacked printf to not require a buffer. Now printf output can be
+arbitrarily long as it no longer needs a buffer to assemble the
+characters before sending to putchar; it outputs on the spot for
+non-format chars and %s items, and at the end of the item for non-%s
+items.
+
++ DRIVER AND EXTENSION WRITERS NOTE! (s)printf formats have been changed
+to be a subset of those in glibc to reduce confusion. The changes are %x
+-> %hX, %b -> %hhX, and %I -> %@. Lower case x formats are also
+available now. The only variances from glibc are %@ for dotted quad IP
+addresses (formerly %I; %I is now used), %! for 6 byte Ethernet
+addresses, and that printf returns void. Thanks to Klaus Espenlaub for
+assistance on this, after adding the %! format, he cleaned up all of the
+Ethernet address display code in the drivers.
+
++ More cleanup patches from Klaus Espenlaub (he's better than lint;
+people who have used Bell Labs Unix will know what lint is). Changes
+noted here for posterity.
+
+3c509.c: consistent non-use of # modifier for debugging output
+3c595.c: consistent non-use of # modifier for debugging output
+3c90x.c: use optimal %x variant, PCI bus/function numbers are always small
+Config: Replace a TAB by two spaces inside the descriptions
+eepro100.c: 6->ETH_ALEN, PCI bus/function numbers are always small
+floppy.c: optimal %x variant
+genrules.pl: consistent use of TAB characters
+i82586.c: the ENET address printing patch for the EXOS205 got lost somehow....
+main.c: cleanup of the UDP_CHECKSUM comment some editor messed up, make the
+ assembly fragment use the normal formatting, fix the register assignment
+ specification for the %bx register to use the "b" constraint instead of
+ "bx" - the x makes no sense...
+natsemi.c: %X case fix...
+ns8390.c: optimal %x variant
+pci.c: fix bad Linux port (most messages truncated the hex values)
+sis900.c: a value read with inl() should probably(!) be printed with %X
+start32.S: move around the #endifs a little
+timer.c: fix space/tab characters
+via-rhine.c: all values "printed" inside the comments are 32 bit integers
+wd89c840.c: PCI bus/function numbers are always small
+
+Released as Etherboot 5.0.3 (production)
+
++ New version of contrib/Diskless-From-NT/furtmayer.html. I mangled the
+previous version by forgetting to extract with metamail so it was still
+quotable-printable encoded.
+
++ Renamed do_printf to vsprintf because that's the standard function it
+has the same signature as.
+
++ More patches from Klaus Espenlaub. In his own words:
+
+The patch to add UDP checksums for transmitted packets is attached.
+Just don't be surprised if some packet sniffer tells you that the
+checksum for the NFS_LOOKUP packets are wrong and that the filename is
+truncated. It's a bug in the sniffer, not in Etherboot.
+
+Oh, and the small change in udpchksum() almost makes up for the
+increased code size.
+
+I also rewrote the NFS code to use pointers instead of array accesses.
+This reduced the code size by 124 bytes. Patch attached.
+
+The last patch in this mail fixes misc things: a typo in misc.c
+(DOT_PROGRESS instead of BAR_PROGRESS), and twiddle() is only called if
+the packet type is IP. This makes the output nicer - the dots are also
+printed in some non-approriate places for ARP reply packets. The
+important packets are IP anyway.
+
++ The option BOOTP_DATA_AT_0x93C00 is deprecated, in preparation for
+expanding the parameter area and the first32.c area.
+
++ Marty Connor found a typo in index.html, should be: Etherboot can work
+with..., not Ethernet can work with... Ooops.
+
++ Eric Biederman tried a patch of Preston Wilson's and discovered that
+DI should be prefixed by ES in the test for a PnP BIOS in loader.S to be
+sure. Furthermore some BIOSes are not fully compliant and we need an
+#ifndef PNP_BUT_NOT_BBS_COMPLIANT to work around that.
+
++ Oops, there's no entry in config.c for the DFE530TX+ even though
+there's one in NIC.
+
+Released as Etherboot 5.0.4 (production)
+
++ Fixed a struct alignment (8-byte constraint) problem in lance.c caused
+by the introduction of the rx_idx field by moving rx_idx to the end of
+the struct. Found by Rizsanyi Zsolt. Klaus Espenlaub also suggested
+increasing all the Rx buffers by 4 bytes because of the checksum stored
+at the end.
+
++ Fred Gray contributed changes in tulip.c to check for a duplex
+connection and to modify the controller register if so. Marty fixed an
+unassigned to "negotiated" variable.
+
++ Mark G of Inprimis Technologies contributed another FA311 (National
+Semiconductor DP83815) driver, also based on the Donald Becker Linux
+driver.
+
++ Armin Schindler contributed a patch to allow booting LynxOS KDI
+images.
+
++ Moved code to set PCI busmastering and reasonable latency to a routine
+in pci.c and added calls to this routine from all PCI drivers.
+
++ New files for contrib/mkffwnb for version 1.9.11 and 1.9.16.
+
++ Removed BOOTP_DATA_AT_0x93Cxx option.
+
++ Convert epic100 driver to use hardware timer for transmit timeout and
+remove polling loop from receive routine.
+
++ Steve Tilden pointed out that BOOT_INT18H is a LCONFIG option, not a
+CFLAGS32 option. Put note under option documentation and also added a
+commented-out example in Config. Steve also contributed a patch¸ in
+contrib/auto-default, which autoboots from the next device if a disk is
+detected.
+
++ PNP_BUT_NOT_BBS_COMPLIANT option renamed to BBS_BUT_NOT_PNP_COMPLIANT.
+
++ Merged in Vasil Vasilev's changes to loader.S to release memory taken
+by PXE properly.
+
++ E820 memory detection routines added by Eric Biederman. May increase
+size of bss segment and push large drivers, e.g. Tulip, nearer to limit,
+please report.
+
++ Default to -DCONGESTED in Config, may help on busy networks.
+
++ Add Holtek HT80232 to list of NE2000 PCI clones.
+
++ Remove prohibition on loading < 0x10000 in ELF images since by default
+drivers don't use memory < 0x10000 any more, with 48kB to run in.
+
++ Put define of ETH_MAX_MTU in etherboot.h inside #ifndef so that it can
+be overriden from Makefile.
+
++ Gustavo Junior Alves added .cvsignore files for src/bin and src/bin32.
+
++ Short note on how to make tomsrtbt netbootable in contrib/tomsrtbt.
+
+This release is dedicated to the memory of my mother (July 1917 -
+November 2001) [Ken Yap].
+
+Released as Etherboot 5.0.5 (production)
+
++ Changes to enable fa311too driver which were overlooked in 5.0.5.
+
++ Chien-Yu Chen sent in patches to support the SiS630ET. Independently,
+Doug Ambrisko made the same changes. Marty Connor tidied the patches.
+
++ In misc.c, when enabling/disabling Gate A20, call int 0x15 with
+ax=0x240x to do handling first, and if that is not supported, fall back
+to using the keyboard controller. Hopefully this will solve Gate A20
+problems for recent BIOSes.
+
++ Add missing entry to config.c for the Macronix 98713 (device ID
+0x512). But latest report is that it doesn't transmit. Anybody wanna
+debug?
+
++ Omit test for pointer to $PnP string for ISA NIC images, it may
+trigger false recognition of a PnP ROM. Just use legacy mode.
+
++ Merged in Christopher Li's Intel E1000 gigabit Ethernet driver.
+
++ RISKO Gergely found that the ADMTek Comet 983 works with the tulip
+driver if you provide the right PCI IDs.
+
++ Rohit Jalan contributed patches to support FreeBSD booting via PXE.
+(genrules.pl needed hacking to make it ignore the system includes in
+osdep.h.) Anybody want to see if it can be made to support pxelinux?
+[Glanced at it and I think general PXE support may be hard, you may need
+an Etherboot specific secondary loader. - Ken]
+
++ Merged in Eric Biederman's patches to allow trying all PCI devices.
+
++ From Eric Biederman: A small patch to allow the serial port parameters
+to be unchanged at activation. Major changes to start32.S to merge
+LinuxBIOS support. New files for LinuxBIOS support. PCBIOS specific
+functions split out into pcbios.S. Massive clean up of PCI subsystem
+logic.
+
++ Jean-Jacques Michel sent in a fix for via-rhine.c to make sure the
+transmit is finished before returning from the _transmit routine.
+Also found a bug in gcc 3.0.3 that affected rtl8139.c. Moving the
+assignment to nstype in _transmit two lines up avoids it.
+
++ Based on the experience of Yedidyah Bar-David, in eepro100.c,
+increased udelay around line 533 after getting MAC address to
+udelay(10000).
+
++ Added PCI IDs for RTL8129, which can use the rtl8139 driver.
+
++ Added PCI IDs for 3Com905 with device ID 0x9058. Confirmed working by
+Fabio Papa.
+
++ Added PCI IDs for D-Link 528, which is a PCI NE2000 clone.
+
++ Philip R. Auld found a block number rollover bug due to promotion to
+signed in main.c.
+
++ Luigi Rizzo sent in a patch to nfs.c to implement an adaptive timeout.
+
++ New config files for floppyfw-1.9.19 in contrib/mkffwnb/.
+
++ Glenn McKechnie contributed a Perl script for making a netbootable
+image from the Dachstein LRP firewall distribution floppy. It's in
+contrib/mklrpnb/
+
++ At the request of Greg Beeley, who got irate mail from kernel NIC
+developers, put in a warning in the Makefile about the 3c90x XCVR
+options which may affect later operation with the Linux driver. For you
+tinkerers out there, if you don't know what you're doing, please read
+3c90x.txt over and over again until you understand what those options
+do. If you don't understand, please ask on the Etherboot mailing list.
+And don't complain to the kernel developers, it's nothing to do with
+them. If you must change the XCVR options on a board, please document it
+prominently on the board so that those who come after you won't
+encounter strange behaviour and complain to the kernel developers.
+Greg also supplied a patch to 3c90x.c to print a warning message.
+
+Released as Etherboot 5.0.6 (production)
+
++ Andrew Bettison sent in a patch and the explanation: Here's a patch
+for some changes I made to Etherboot-5.0.6 because it didn't work with a
+SMC EtherEZ in an old PCI/ISA bybrid bus system. The ISA shared memory
+isn't accessible on many such systems, so the only way to do I/O to the
+card is in Programmed I/O mode. I studied the Linux 2.2.19 driver
+(drivers/net/smc-ultra.c) and hacked what I figured was equivalent code
+into src/ns8390.c, and it eventually worked. All my new code is enabled
+with -DWD-790_PIO.
+
++ Small error in the ADMTEK Comet 983 IDs fixed.
+
++ Michael Rendell sent in patches for 3c90x.c to get the MAC address
+from location 10 of the EEPROM onwards, like the Linux driver does. Some
+905s have the MAC address at both 0 and 10 which is why it worked for
+some boards.
+
++ Michael Brown sent in drivers for 3 wireless NICs based in the prism2
+chipset, and a small patch to rtl8139.c to abort detection on no link.
+
++ Rewrote makerom.c in Perl to give makerom.pl.
+
++ Rewrite genrules.pl to parse a new NIC format.
+
++ Timothy Legge contributed a 3c515 driver. Requires a ISA PnP BIOS.
+
++ Modified call to int15h/e801 in pcbios.S to check for return values in
+CX, DX in case BIOS doesn't return them in AX, BX.
+
++ Richard Chan sent in PCI IDs for another Intel EEPRO100 product.
+Omigawd will they ever run out of EEPRO100 model numbers. :-)
+
++ Changed location of setup header from 0x97e000 to 0x93e000 in
+mkQNXnbi.c for recent Etherboot versions.
+
++ Renamed membase to addr1 to reflect its lack of predefined meaning in
+PCI config space. Should do similar to ioaddr, but too much work.
+
++ Samuel Clememts found another Intel EEPRO100 device ID, 0x1039.
+
++ Updated instructions in contrib/tomsrtbt for latest 2.0.103 release.
+
++ Folded in changes by Michael Brown to send PCI and ISA IDs to the
+server and to encapsulate Etherboot specific options. Changed scheme to
+send fixed binary structure instead of variable length string.
+
++ Bug in sis900.c, wrongly classifies revisions 0x81 and 0x82 because
+first test catches too many revisions. Changed to match the Linux
+driver.
+
++ Fotis Andritsopoulos found a small bug in cs89x0.h, TX_AFTER_ALL
+should be 0x0C0.
+
++ Great idea by Eric Biederman. Ignore DHCP offers with zero server
+IP, or null filename unless DEFAULT_BOOTFILE is defined. This will
+ignore most Windows DHCP servers.
+
++ Patrik Weiskircher sent in a patch for rtl8139.c to bring it up to
+date with the Linux driver.
+
+Released as Etherboot 5.0.7 (production)
+
++ Multicast support and LOTS of other changes by Eric Biederman.
+
++ Builtin menuing has been removed.
+
++ Patches for FreeBSD by Doug Ambrisko.
+
+Released as Etherboot 5.1.2 (development)
+
++ Fix syntax errors in nfs.c.
+
++ Patch for tagged image loading by Miles Nordin.
+
++ Patches for new eepr100 variant by Georg Baum.
+
++ Fixes for typos by Adam Sulmicki.
+
++ Fixes by Eric.
+
+Released as Etherboot 5.1.3 (development)
+
++ Eric rearranged files for multiple platforms, including Itanium.
+
+Released as Etherboot 5.1.4 (development)
+
++ Lots of fixes to drivers, see CVS for details.
+
+Released as Etherboot 5.1.5 (development)
+
++ Eric added support for the AMD Hammer.
+
++ Geert Stappers found a VIA6105 (via-rhine.c) with id 0x3106.
+
+Released as Etherboot 5.1.6 (development)
+
++ Broadcomm TG3 support by Eric Biederman.
+
++ Georg Baum found that the start16.S prefix was missing from the LILO
+and PXE images, those formats were broken. He also migrated the PCI IDs
+into the driver files. Those formats should work again.
+
++ Reworked genrules.pl. Family declarations now in here document inside
+genrules.pl. NIC is now an output file, for use by rom-o-matic.
+
+Released as Etherboot 5.1.7 (development)
+
++ Fixed various syntax errors that made the source not compile with some
+configurations.
+
++ Hacked boot1a.s to take count of number of blocks to boot from book
+block itself in new scheme.
+
++ Dave Airlie found a patch for an old bug in eepro100 driver on Linux
+that applies to Etherboot driver too.
+
++ Add use bytes; pragma to Perl scripts to avoid problems with UTF-8
+handling of input data.
+
++ Replace boot1a.s with floppyload.S which has no problems loading large
+binaries. Lose the ability to boot from disk partition. Use LILO or
+something similar.
+
++ Morten Kristiansen sent in a patch to handle another variant of the
+SiS 900.
+
++ Fix for eepro100 timing problem by Georg Baum.
+
++ Add use bytes; to Eric's Perl scripts too.
+
++ Additional fix to mask interrupts after PortPartialReset by Georg
+Baum that might help with booting DOS.
+
++ Sundance driver contributed by Timothy Legge.
+
+Released as Etherboot 5.1.8 (development)
+
++ Fix for correct SMC8416 detection.
+
++ Alignment bug fix for the 3c90x driver contributed by Neil Newell.
+
++ Robb Main found a bug in appending the MACHINE_INFO to the DHCP request.
+
++ SONE Takeshi fixed the Multiboot structure.
+
++ Patch from Axel Dittrich to allow timeout to be changed to a fixed
+value for peer-to-peer setups where the exponential backoff is not
+suitable.
+
++ Tlan driver contributed by Timothy Legge.
+
++ Support for symlinks on NFS mounts by Anselm Martin Hoffmeister.
+
++ Experimental safe booting code by Anselm Martin Hoffmeister.
+
++ Run Etherboot in an even megabyte so that unsetting A20 won't kill it.
+Experimental UNDI driver by Michael Brown.
+
+Released as Etherboot 5.1.9 (5.2 release candidate 1)
+
++ 82562EZ ID provided by Samuel Clements.
+
++ Rename Local option as Quit, because that's what it really is.
+
++ Should prepend start16.bin to .com images, they didn't work and nobody
+noticed.
+
++ PM stack was getting clobbered by zeroing of BSS, move to own segment
+in etherboot.lds. Move %ss out of the way of Etherboot in comprefix.S.
+Now Q works from .zrom and sort of from .com (DOS is odd after return).
+
++ Make ASK_PROMPT reflect the device options available.
+
++ Removed many outdated comments and updated others.
+
+Released as Etherboot 5.1.10 (5.2 release candidate 2)
+
++ Make floppyload.S and liloprefix.S call instead of jmp to the image so
+that the return calls int 0x19, which is somewhat better than
+hyperspace.
+
++ Put http://etherboot.org in prompt and ID string.
+
+Released as Etherboot 5.2.0 (production)
+
++ Print F? if no filename in DHCP offer.
+
++ Make lance.c throw a compile error if -DRELOCATE is used.
+
++ pcnet32 driver ported by Timothy Legge.
+
++ Reinstate boot1a.s in arch/i386/prefix. The binary may have some uses;
+it boots with vmware although the image fails later in the emulation.
+
+Released as Etherboot 5.2.1 (production)
+
+CVSed as Etherboot 5.3 (development)
+
++ Break out etherboot.h into multiple files along protocol lines.
+
++ Georg Baum's conversion of a more recent version of the Linux e1000
+driver.
+
++ Add mini-slamd to contrib/, it was missed during 5.2 release.
+
++ Timothy Legge enabled multicast for a bunch of drivers. Tested with
+mini-slamd.
+
+Released as Etherboot 5.3.0 (development)
+
++ Timothy Legge rewrite proto_tftm.c, got multicast working with atftp
+and enabled multicast for the Tulip.
+
+Released as Etherboot 5.3.1 (development)
+
++ Günter Knauf sent in a new version of romid that handles the new
+and old IDENT format.
+
++ Cai Qiang fixed the WINCE loader. It needs to handle > 512 byte packets
+and also the buffer has to be static. Also submitted a driver for VGA
+which can be activated by CONSOLE_DIRECT_VGA.
+
++ Improved tg3 driver by Eric Biederman. New define in etherboot.h:
+VALID_LINK_TIMEOUT.
+
++ Timothy Legge and I fixed up various ISA drivers to be less noisy
+when probing, from information provided by Paolo Salvan, so that the
+super etherboot image is more useful.
+
++ Proof of concept of a TFTP to HTTP proxy in contrib/t2hproxy/.
+
+Released as Etherboot 5.3.2 (development)
+
++ Multicast support for the ns8390 (NE, WD, etc) added by Timothy Legge.
+
++ Provide config access to alternate DHCP/BOOTP ports. The macro
+ALTERNATE_DHCP_PORTS_1067_1068 switches to ports 1067 and 1068.
+
++ UNDI driver by Michael Brown.
+
+Released as Etherboot 5.3.3 (development)
+
++ More UNDI improvements by Michael Brown.
+
++ Michael Brown pointed out error in ASK_BOOT behaviour. Make it match
+documentation. < 0 or undefined means no prompt, = 0 means wait
+forever, > 0 means wait that many seconds.
+
++ Start of PCMCIA subsystem by Anselm Martin Hoffmeister.
+
++ Port to Hyperstone architecture (big-endian) by Yannis Mitsos and
+George Thanos at NTUA, Greece.
+
++ Timothy Legge got the epic100 driver working again, was not working
+when 5.2 released. Also implemented multicasting. Also tentatively
+fixed the tg3 driver.
+
++ Use Perl script to make .z?lilo images.
+
++ Added an .iso Makefile rule. This requires newer BIOSes as it
+uses no floppy emulation mode.
+
++ Guard Kuo sent in a patch for the via-rhine driver not being
+reset properly, Timothy Legge improved it based in the Linux driver.
+
+Released as Etherboot 5.3.4 (development)
+
++ David D. Smith, with help from Georg Baum, sent in a patch for the
+eepro100 driver which might help unjam the NIC when the receiver has
+suspended reception.
+
++ Timothy Legge and Eric Biederman fixed a bug in the tg3 driver which
+caused some models to not receive DHCP replies.
+
+Released as Etherboot 5.3.5 (development)
+
++ Timothy Legge ported the Linux Realtek 8169 driver.
+
++ Michael Brown removed irritating A20 status change messages.
+
++ Sis900, w89c840 and tg3 drivers fixed by Timothy Legge. R8169 driver
+needs family entry in genrules.pl.
+
++ Revert to normal way of assigning string to DEFAULT_BOOTFILE as
+tricky stringify macro falls foul of C++ // comments in gcc 3.x.
+
+Released as Etherboot 5.3.6 (development)
+
++ Don't include ISA .o files for etherboot-pci.
+
++ Doug Ambrisko fixed bugs in the FreeBSD loader.
+
++ Anders Nystrom provided a tiny via-rhine patch
+
++ Introduce new define DEFAULT_PROTO_NFS for those who were used to
+using DOWNLOAD_PROTO_NFS in 5.0 for NFS booting.
+
++ Reverse sort PCI drivers so that 3c90x is tried ahead of 3c595.
+
++ Updated e1000 driver by Georg Baum.
+
++ New PCI IDs for 3c90x and tulip drivers. Typos in 3c90x and tg3
+drivers corrected.
+
++ Georg Baum fixed the 3c503
+
++ Fixed Typos which caused compiling with RARP_NOT_BOOTP to fail
+
++ Fixed IMAGE_FREEBSD bugs
+
++ Cleanup of driver output (pcnet32, r8169, sundance, tlan)
+
++ Minor updates to the Config file comments
+
++ arch/i386/prefix/boot1a.S is no longer maintained
+
++ Added make rule for a floppy emulation ISO boot image
+
++ Timothy Legge updated proto_tftm to make it easier to maintain and
+ fix some issues
+
++ Timothy Legge contributed a forcedeth driver for the NVidia Force
+ NIC.
+
++ Timothy Legge contributed a ns83820 driver for National
+ Semiconductor 83820 based NICS
+
++ Ken Yap added support for creating .liso output type which is an iso
+ image with legacy floppy support
+
++ Michael Brown improved memory allocation, 16/32 mode swapping, and
+ did various code cleanups
+
++ Michael Brown added High-Level PXE API support (pxelinux) to Etherboot
+
+Released as Etherboot 5.3.7 (development)
+
++ Timothy Legge Fixed an issue in the e1000 driver with 82544 and
+ newer devices that support port I/O. Enabled port io for the reset.
+ Without the patch the e1000 could not reliably boot Linux on some
+ cards. Thanks to James Pearson, Georg Baum and Marty Connor for
+ help resolving this issue.
+
++ Michael Brown added lots of PXE code to complete implementation. He
+ also did a warnings purge of the core.
+
++ Marty Connor did warnings purge of the network drivers.
+
++ Anselm Martin Hoffmeister contributed DNS resolution code.
+
++ Lots of driver PXEifications and cleanups from Timothy Legge and
+ Marty Connor
+
++ Makefile and genrules fixes from Michael Brown and Marty Connor
+
++ BPBATCH workaround from Timothy Legge and Michael Brown
+
++ Timothy Legge improved image format detection logic.
+
+Released as Etherboot 5.3.8 (development)
+
++ Update to lance.c chip_table from Helge Wagner
+
++ Fixes to attributes to prevent gcc from optimising away seemingly
+unused functions and variables that are actually referenced from asm
+or in the linking stage. (Ken Yap)
+
++ Removed non-relocation support, relocation is now always active.
+Removed lance.c driver as this will not work with relocation. 32-bit
+Lance NIC users should use pcnet32. (Ken Yap)
+
++ Migrated SAFEBOOT to a patch set. This proof-of-concept code is
+incomplete and needs more work before becoming mainstream. (Ken Yap)
+
+Released as Etherboot 5.3.9 (development)
+
++ Patch from Tim Fletcher for another eepro100 model.
+
++ Patch from Jeremy Jackson to make DNS query recursive and fix sign and
+casting issues in dns_resover.c.
+
++ Paolo Salvan experimented with using isolinux for non-emulation
+images and contributed the first cut at the code for geniso.
+
++ Fix for relocation issue with prism2_pci driver
+
++ Small patch to support 3Com tulip version from Jacek Kalinski
+
++ Dag Lem provided a new pci_id for the eepro100 Intel "82801EB/ER
+(ICH5/ICH5R)"
+
++ Small patch to support 3Com tulip version from Jacek Kalinski
+
++ Yinghai Lu contributed a large patch to add filo, bText and usb
+support:
+ btext console: In LinuxBIOS, for the VGA, we only can
+ enable display chipframe buffer and write char to framebuffer
+ to get output in CRT.
+
+ FILO: originally it is standalone boot program and
+ author is TakeshiSone.
+
+ Boot from SATA disk.
+
+ Boot from USB disk (OHCI and UHCI). USB boot is from Steven
+ James 's baremetal in LinuxBIOS, moved to FILO and added the
+ OHCI support to it
+
++ armnommu arch support by Tobias Lorenz.
+
++ Driver updates/cleanup: rtl8139, sis900, tlan
+
++ Updates to via-rhine based on input from Guard Kuo from Via Networking
+Technologies, Inc
+
++ Update p910nd (port 9100+n printer daemon) to latest version
+
++ Fixed some bugs to enable compilation for gcc 3.4.x.
+
+Released as Etherboot 5.3.10 aka 5.4RC1 (development)
+
++ Changes to segment scheme to make large compressed images work.
+
++ .zelf images can be built now but still don't run properly. .zrom
+images may be broken.
+
++ Start of a .exe prefix which should allow payloads > 64kB.
+
+Released as Etherboot 5.3.11 aka 5.4RC2 (development)
+
++ Left out in last release's LOG: accepted patch from Jan Kiszka
+fixing default TFTP blocksize.
+
++ Fixed .z?rom image generation, they work now.
+
++ Patch from Jan Kiszka for for multiple receive buffers in eepro100
+driver.
+
++ Fixed 961507 Not so nice 'F?' message when no file name received
+
++ Small fixes to e1000 and via-rhine drivers.
+
++ New mtd80x.c driver contributed by Erdem Guven
+
++ New dmfe.c driver for Davicom based cards contributed by Timothy Legge
+
++ Added new definitions of site DHCP options in preparation for 5.4.
+
++ Removed etherboot(-pci)?.* rule because there are too many drivers and
+the image will no longer fit in memory. I don't want to choose a subset
+of drivers as everybody will have different preferences. So I'm going to
+piss off everybody equally by deleting the rule. Use the multiple driver
+rule (driver1--driver2--...) and select your own subset of drivers.
+
+Released as Etherboot 5.3.12 aka 5.4RC3 (development)
+
++ Changes to Makefile.main and Config to collect FILO objects in
+filolib.a. This allows FILO to be excluded from compilation and linking
+with one Makefile define.
+
++ Reverse site DHCP option changes, should apply for official
+assignment.
+
++ RIS filename patch which seems to work for many people.
+
++ Thanks to the help of Daniel Nilsson, tracked down and fixed a bug
+where the tftp code did not fall back to 512 byte blocks when an OACK
+was NOT received.
+
++ Removed dead code related to CAN_BOOT_DISK.
+
++ Clarified that BOOT_DISK and BOOT_FLOPPY options only work with
+LinuxBIOS and are not replacements for PCBIOS functions.
+
++ Renamed EMERGENCYDISKBOOT to EXIT_IF_NO_OFFER.
+
++ Builtin menuing DHCP options are gone.
+
++ Paolo Salvan submitted changes to arch/i386/Makefile to make .com
+images compressed.
+
++ Eric Biedermann made .*elf images work again and cleaned up the build
+procedure in the process. The hardwired virtual RELOCADDR is no more,
+the virtual base is 0. He also added code to display which protocols are
+compiled into the image.
+
+Released as Etherboot 5.3.13 aka 5.4RC4 (development)
+
++ Lots of fixes by Eric Biederman. Symbols for protected mode segment
+and prefix segments separated. Multiple ASM statements combined to
+ensure compiler keeps them intact. Allocate real mode stack if none in
+use. Protect low memory interrupt vectors. Makefile rules for various
+prefixes factored. Dynamic relocatable image support.
+
++ Fixes by Michael Brown. Cleanup of PXE and UNDI code.
+
++ Patch to Tulip driver for missing PCI ID.
+
++ Fixes to genrules.pl by Kenneth Sumrall.
+
+Released as Etherboot 5.3.14 aka 5.4RC5 (development)
+
++ Small ARMNOMMU architecture fixes by Toby Lorenz.
+
++ Patch to Tulip driver for additional PCI ID by Ramesh Chander.
+
++ Proxy DHCP support, catrom.pl script, flat real mode support, and
+e1000 fixes by Michael Brown.
+
++ New PHY support for tg3.c by Timothy Legge.
+
++ FS Protocol support by Radim Kolar.
+
++ FILO config changes by YHLu.
+
++ Support for compilation on AMD64 for i386. makerom.pl fixed not to
+change product string pointer if one already exists.
+
+Released as Etherboot 5.3.15 aka 5.4RC6 (development)
+
++ Minor additions and amendments to acknowledgements.
+
++ Added Doug Ambrisko's FreeBSD patch to freebsd_loader.c. Doesn't
+hurt FreeBSD 4 and seems to help FreeBSD 5 get further in booting.
+Should not affect other image types since it modifies only one file.
+The part of the patch relating to osloader.c was already present.
+
+Released as Etherboot 5.4.0 (production)
+
++ Added PCI ID for Fujistu Siemens Futro C200 by Martin Vogt
+
++ Liu Tao contributed a driver for the AMD8111 based on the Linux
+driver
+
++ Till Straumann patch for Sporadic eepro(10) RX problems after reboot
+
++ Hermann Gausterer sent a patch to support additional Broadcom PHYs
+
--- /dev/null
+Etherboot 5.4.0
+
+PXE is now supported. You will also need to configure your server to
+provide a pxelinux.0 loader file, kernel and initrd images, and a
+pxelinux.cfg directory with a appropriate configuration spec files.
+
+See the PXELINUX home page at:
+
+ http://syslinux.zytor.com/pxe.php
+
+for more information.
+
+There is no longer a default target for make. You must specify an
+argument to make. Help text is now provided to indicate possible make
+targets.
+
+It should be possible to compile Etherboot with gcc >= 3.3.3, including
+gcc 3.4.x now that a couple of bugs have been tracked down. Please mail
+reports of success or failure to the etherboot-users list, together with
+the versions of gcc and binutils used.
+
+gcc 2.x is not supported anymore. You need at least gcc 3.x to compile
+etherboot due to C99 constructs.
+
+Removed etherboot(-pci)?.* rule because there are too many drivers and
+the image will no longer fit in memory. I don't want to choose a subset
+of drivers as everybody will have different preferences. So I'm going to
+piss off everybody equally by deleting the rule. Use the multiple driver
+rule (driver1--driver2--...) and select your own subset of drivers.
+
+In order to create .iso and .liso images you will need to have the
+packages mtools-3.9.9 or later, and syslinux-2.08 or later installed on
+your system. These packages are available in various locations and
+formats. .liso images are like .iso but use floppy emulation. If you
+have a very old BIOS and .liso images don't work you may wish to try
+adding the -s option of syslinux as a last resort.
+
+EMERGENCYDISKBOOT has been renamed EXIT_IF_NO_OFFER, which describes it
+better.
+
+Menuing using DHCP options (mknbi/menu.c) has been removed.
+
+.exe format can be generated by doesn't work so not publicised.
--- /dev/null
+5.4.0 2005-04-01
--- /dev/null
+FILES = cromutil bromutil
+
+INCLUDEDIR = /usr/include
+CFLAGS = -O2 -fomit-frame-pointer -Wall -I$(INCLUDEDIR)
+
+all: $(FILES)
+
+clean:
+ rm -f $(FILES) *~ core
--- /dev/null
+This utility was apparently writen by John Finlay and came to me
+via Richard Schroeder who got it from Greg Beeley. John, if you want
+to be credited with your full address or whatever in the Etherboot
+documentation, please contact me (Etherboot maintainer).
+
+1/18/2000 Marty Connor (mdc@thinguin.org) added code for the 3C905C
+with AT49BV512 Flash memory, and created cromutil and bromutil to
+differentiate the versions. cromutil is for 3C905C and bromutil is
+for 3C905B.
+
+Be careful. You can easily erase your Flash memory using these
+utilities. Make *sure* to back them up first using the "read"
+command. You must "erase" before using "prog" to program the chip with
+Etherboot code. This code comes with NO WARRANTY, and you take sole
+responsibility and liability for whatever it does. Read the
+"romutil.txt" file for more information on commands.
+
+That being said, if you are programming a 3C905C-TXM (for example)
+you would do something like this:
+
+ $ cd etherboot-x.x.x/contrib
+ $ tar -zxvf n3c905xutil.tar.gz
+ $ cd n3c905xutil
+ $ make
+ # replace 0x6600 with whatever the IO Addr for your card is!!!!
+ $ ./cromutil 0x6600 read > 905cbackup.bin
+ $ ./cromutil 0x6600 erase
+ $ ./cromutil 0x6600 prog < 3c90x.lzrom
+
+You should now have an Etherboot-enabled 3c905C-TXM.
+
--- /dev/null
+/*
+ * readutil.c - perform various control ops on the 3c509b bios rom
+ *
+ */
+
+#ifndef __i386__
+# error "This program can't compile or run on non-intel computers"
+#else
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifdef __FreeBSD__
+
+#include <fcntl.h>
+#include <machine/cpufunc.h>
+
+#define OUTB(data, port) outb(port, data)
+#define OUTW(data, port) outw(port, data)
+#define OUTL(data, port) outl(port, data)
+
+#else
+
+#include <sys/io.h>
+
+#define OUTB(data, port) outb(data, port)
+#define OUTW(data, port) outw(data, port)
+#define OUTL(data, port) outl(data, port)
+
+#endif
+
+int main(int argc, char **argv)
+{
+ unsigned int i, j, n;
+ unsigned int ioaddr;
+ unsigned long recvrstat;
+ unsigned char buf[128];
+ unsigned char b;
+
+ if (argc != 3) {
+ printf("Usage: romid ioaddr [erase|protect|unprotect|id|read >file|prog <file]\n");
+ exit(-1);
+ }
+
+#ifdef __FreeBSD__
+ /* get permissions for in/out{blw} */
+ open("/dev/io",O_RDONLY,0);
+#else
+ setuid(0); /* if we're setuid, do it really */
+ if (iopl(3)) {
+ perror("iopl()");
+ exit(1);
+ }
+#endif
+
+ sscanf(argv[1],"%x",&ioaddr);
+ /* Set the register window to 3 for the 3c905b */
+ OUTW(0x803, ioaddr+0xe);
+ recvrstat = inl(ioaddr); /* save the receiver status */
+ /* set the receiver type to MII so the full bios rom address space
+ can be accessed */
+ OUTL((recvrstat & 0xf00fffff)|0x00600000, ioaddr);
+
+ /* Set the register window to 0 for the 3c905b */
+ OUTW(0x800, ioaddr+0xe);
+
+ if (strcmp(argv[2], "erase") == 0) {
+ /* do the funky chicken to erase the rom contents */
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0x80, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0x10, ioaddr+0x8);
+ printf("Bios ROM at %04x has been erased\n", ioaddr);
+ } else if (strcmp(argv[2], "protect") == 0) {
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xa0, ioaddr+0x8);
+ printf("Software Data Protection for Bios ROM at %04x has been enabled\n",
+ ioaddr);
+ } else if (strcmp(argv[2], "unprotect") == 0) {
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0x80, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0x20, ioaddr+0x8);
+ printf("Software Data Protection for Bios ROM at %04x has been disabled\n",
+ ioaddr);
+ } else if (strcmp(argv[2], "id") == 0) {
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0x90, ioaddr+0x8);
+ /* 10ms delay needed */
+ printf("Manufacturer ID - ");
+ /* manuf. id */
+ OUTL(0x0000, ioaddr+0x4);
+ printf("%02x\n", inb(ioaddr+0x8));
+ /* device id */
+ OUTL(0x0001, ioaddr+0x4);
+ printf("Device ID - %02x\n", inb(ioaddr+0x8));
+ /* undo the funky chicken */
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xf0, ioaddr+0x8);
+ } else if (strcmp(argv[2], "read") == 0) {
+ for (i = 0; i < 65536; i++) {
+ OUTL(i, ioaddr+0x4);
+ b = inb(ioaddr+0x8);
+ write(1, &b, 1);
+ }
+ } else if (strcmp(argv[2], "prog") == 0) {
+ /* program the rom in 128 bute chunks */
+ for (i = 0, n = 0; i < 65536; i += n) {
+ n = read(0, buf, 128);
+ if (n == 0)
+ break;
+ if (n < 0) {
+ perror("File Error");
+ exit(-3);
+ }
+ /* disable SDP temporarily for programming a sector */
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xaa, ioaddr+0x8);
+ OUTL(0x2aaa, ioaddr+0x4);
+ OUTB(0x55, ioaddr+0x8);
+ OUTL(0x5555, ioaddr+0x4);
+ OUTB(0xa0, ioaddr+0x8);
+ for (j = 0; j < n; j++) {
+ OUTL(i+j, ioaddr+0x4);
+ OUTB(buf[j], ioaddr+0x8);
+ }
+ /* wait for the programming of this sector to coomplete */
+ while (inb(ioaddr+0x8) != buf[j-1])
+ ;
+ }
+ }
+
+ /* Set the register window to 3 for the 3c905b */
+ OUTW(0x803, ioaddr+0xe);
+ /* restore the receiver status */
+ OUTL(recvrstat, ioaddr);
+ return 0;
+}
+
+#endif /* __i386__ */
--- /dev/null
+/*
+ * 3c905cutil.c - perform various control ops on the 3C905C bios rom
+ * which we assume to be an AT49BV512
+ *
+ */
+
+#ifndef __i386__
+# error "This program can't compile or run on non-intel computers"
+#else
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/io.h>
+
+int main(int argc, char **argv)
+{
+ unsigned int ioaddr, i, n;
+ unsigned char b;
+
+ setuid(0); /* if we're setuid, do it really */
+ if (argc != 3) {
+ printf("Usage: romid ioaddr [erase|id|read >file|prog <file]\n");
+ exit(-1);
+ }
+ if (iopl(3)) {
+ perror("iopl()");
+ exit(1);
+ }
+ sscanf(argv[1],"%x",&ioaddr);
+
+ /* Set the register window to 0 for the 3C905C */
+ outw(0x800, ioaddr+0xe);
+
+ if (strcmp(argv[2], "erase") == 0) {
+ /* do the funky chicken to erase the rom contents */
+ outl(0x5555, ioaddr+0x4);
+ outb(0xaa, ioaddr+0x8);
+ outl(0x2aaa, ioaddr+0x4);
+ outb(0x55, ioaddr+0x8);
+ outl(0x5555, ioaddr+0x4);
+ outb(0x80, ioaddr+0x8);
+ outl(0x5555, ioaddr+0x4);
+ outb(0xaa, ioaddr+0x8);
+ outl(0x2aaa, ioaddr+0x4);
+ outb(0x55, ioaddr+0x8);
+ outl(0x5555, ioaddr+0x4);
+ outb(0x10, ioaddr+0x8);
+ sleep (1);
+ printf("Bios ROM at %04x has been erased\n", ioaddr);
+ } else if (strcmp(argv[2], "id") == 0) {
+ outl(0x5555, ioaddr+0x4);
+ outb(0xaa, ioaddr+0x8);
+ outl(0x2aaa, ioaddr+0x4);
+ outb(0x55, ioaddr+0x8);
+ outl(0x5555, ioaddr+0x4);
+ outb(0x90, ioaddr+0x8);
+ /* 10ms delay needed */
+ printf("Manufacturer ID - ");
+ /* manuf. id */
+ outl(0x0000, ioaddr+0x4);
+ printf("%02x\n", inb(ioaddr+0x8));
+ /* device id */
+ outl(0x0001, ioaddr+0x4);
+ printf("Device ID - %02x\n", inb(ioaddr+0x8));
+ /* undo the funky chicken */
+ outl(0x5555, ioaddr+0x4);
+ outb(0xaa, ioaddr+0x8);
+ outl(0x2aaa, ioaddr+0x4);
+ outb(0x55, ioaddr+0x8);
+ outl(0x5555, ioaddr+0x4);
+ outb(0xf0, ioaddr+0x8);
+ } else if (strcmp(argv[2], "read") == 0) {
+ for (i = 0; i < 65536; i++) {
+ outl(i, ioaddr+0x4);
+ b = inb(ioaddr+0x8);
+ write(1, &b, 1);
+ }
+ } else if (strcmp(argv[2], "prog") == 0) {
+ for (i = 0; i < 65536; i++) {
+ n = read(0, &b, 1);
+ if (n == 0)
+ break;
+ if (n < 0) {
+ perror("File Error");
+ exit(-3);
+ }
+ outl(0x5555, ioaddr+0x4);
+ outb(0xaa, ioaddr+0x8);
+ outl(0x2aaa, ioaddr+0x4);
+ outb(0x55, ioaddr+0x8);
+ outl(0x5555, ioaddr+0x4);
+ outb(0xA0, ioaddr+0x8);
+ outl(i, ioaddr+0x4);
+ outb(b, ioaddr+0x8);
+ while (inb(ioaddr+0x8) != b)
+ ;
+ }
+ }
+ return 0;
+}
+
+#endif /* __i386__ */
--- /dev/null
+I wrote the attached little util program to try out the basic approach
+and thought that you might find it useful as well as providing some
+simple testing. It isn't a final solution so the interface is rough. The
+program must be run as root on an Intel based machine.
+
+The key point is that the IO address needs to be entered - I grab it
+from the dmesg output:
+
+eth0: 3Com 3c905B Cyclone 100baseTx at 0xe400, 00:10:4b:d2:5e:0d, IRQ
+11
+
+or "cat /proc/pci" to find the "I/O at XXXXXX" for your 3Com Card.
+
+Some example commands are:
+
+romutil 0xe400 erase - erases the ROM contents
+romutil 0xe400 protect - enables the Software Data Protection
+on the ROM [3c905B only]
+romutil 0xe400 unprotect - disables the Software Data Protection
+on the ROM [3c905B only]
+romutil 0xe400 id - displays the manufacturer and
+device IDs
+romutil 0xe400 read >file - writes the contents of the ROM to stdout
+romutil 0xe400 prog <file - writes the contents of the stdin into the
+ROM (<64k)
+
+I tried reading and writing the ROM while doing large ftp transfers and
+experienced no problems. I didn't spend much time worrying about the
+possible race conditions. My system has lots of resources (450MHx P2,
+128MB RAM) so it might not provide the best test candidate.
+
+Let me know what results you get if you try it out.
+
+Thanks
+
+John
--- /dev/null
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_X86=y
+CONFIG_ISA=y
+# CONFIG_SBUS is not set
+CONFIG_UID16=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+# CONFIG_KMOD is not set
+
+#
+# Processor type and features
+#
+CONFIG_M386=y
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_M686FXSR is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_X86_CMPXCHG is not set
+CONFIG_X86_L1_CACHE_SHIFT=4
+# CONFIG_TOSHIBA is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+CONFIG_NOHIGHMEM=y
+# CONFIG_HIGHMEM4G is not set
+# CONFIG_HIGHMEM64G is not set
+CONFIG_MATH_EMULATION=y
+CONFIG_MTRR=y
+# CONFIG_SMP is not set
+# CONFIG_X86_UP_IOAPIC is not set
+
+#
+# General setup
+#
+CONFIG_NET=y
+# CONFIG_VISWS is not set
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+# CONFIG_PCI_GODIRECT is not set
+CONFIG_PCI_GOANY=y
+CONFIG_PCI_BIOS=y
+CONFIG_PCI_DIRECT=y
+# CONFIG_PCI_NAMES is not set
+CONFIG_EISA=y
+# CONFIG_MCA is not set
+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+# CONFIG_PCMCIA is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+# CONFIG_BINFMT_AOUT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=m
+CONFIG_PM=y
+# CONFIG_ACPI is not set
+# CONFIG_APM is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=y
+CONFIG_PARPORT_PC=y
+CONFIG_PARPORT_PC_FIFO=y
+# CONFIG_PARPORT_PC_SUPERIO is not set
+# CONFIG_PARPORT_AMIGA is not set
+# CONFIG_PARPORT_MFC3 is not set
+# CONFIG_PARPORT_ATARI is not set
+# CONFIG_PARPORT_SUNBPP is not set
+# CONFIG_PARPORT_OTHER is not set
+# CONFIG_PARPORT_1284 is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+
+#
+# Block devices
+#
+CONFIG_BLK_DEV_FD=m
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+# CONFIG_BLK_DEV_INITRD is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Networking options
+#
+# CONFIG_PACKET is not set
+# CONFIG_NETLINK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+
+#
+#
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+# CONFIG_IDE is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_NET_SB1000 is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_ISA=y
+# CONFIG_E2100 is not set
+# CONFIG_EEXPRESS is not set
+# CONFIG_EEXPRESS_PRO is not set
+# CONFIG_HPLAN_PLUS is not set
+# CONFIG_HPLAN is not set
+# CONFIG_ETH16I is not set
+CONFIG_NE2000=y
+# CONFIG_SK_G16 is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_SERIAL=y
+# CONFIG_SERIAL_CONSOLE is not set
+# CONFIG_SERIAL_EXTENDED is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+CONFIG_PRINTER=m
+# CONFIG_LP_CONSOLE is not set
+# CONFIG_PPDEV is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+CONFIG_MOUSE=y
+CONFIG_PSMOUSE=y
+# CONFIG_82C710_MOUSE is not set
+# CONFIG_PC110_PAD is not set
+
+#
+# Joysticks
+#
+
+#
+# Game port support
+#
+
+#
+# Gameport joysticks
+#
+
+#
+# Serial port support
+#
+
+#
+# Serial port joysticks
+#
+
+#
+# Parallel port joysticks
+#
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+CONFIG_AGP=m
+CONFIG_AGP_INTEL=y
+CONFIG_AGP_I810=y
+CONFIG_AGP_VIA=y
+# CONFIG_AGP_AMD is not set
+# CONFIG_AGP_SIS is not set
+# CONFIG_AGP_ALI is not set
+# CONFIG_DRM is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+# CONFIG_UMSDOS_FS is not set
+CONFIG_VFAT_FS=m
+# CONFIG_EFS_FS is not set
+CONFIG_JFFS_FS_VERBOSE=0
+# CONFIG_CRAMFS is not set
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_ROOT_NFS=y
+# CONFIG_NFSD is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+# CONFIG_SMB_FS is not set
+# CONFIG_NCP_FS is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_SMB_NLS is not set
+CONFIG_NLS=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+CONFIG_NLS_ISO8859_1=m
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Console drivers
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VIDEO_SELECT is not set
+# CONFIG_MDA_CONSOLE is not set
+
+#
+# Frame-buffer support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=m
+# CONFIG_SOUND_CMPCI is not set
+# CONFIG_SOUND_EMU10K1 is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_CS4281 is not set
+# CONFIG_SOUND_ES1370 is not set
+CONFIG_SOUND_ES1371=m
+# CONFIG_SOUND_ESSSOLO1 is not set
+# CONFIG_SOUND_MAESTRO is not set
+# CONFIG_SOUND_SONICVIBES is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_SOUND_VIA82CXXX=m
+CONFIG_SOUND_OSS=m
+# CONFIG_SOUND_TRACEINIT is not set
+# CONFIG_SOUND_DMAP is not set
+# CONFIG_SOUND_AD1816 is not set
+# CONFIG_SOUND_SGALAXY is not set
+# CONFIG_SOUND_ADLIB is not set
+# CONFIG_SOUND_ACI_MIXER is not set
+# CONFIG_SOUND_CS4232 is not set
+# CONFIG_SOUND_SSCAPE is not set
+# CONFIG_SOUND_GUS is not set
+# CONFIG_SOUND_ICH is not set
+# CONFIG_SOUND_VMIDI is not set
+# CONFIG_SOUND_TRIX is not set
+# CONFIG_SOUND_MSS is not set
+# CONFIG_SOUND_MPU401 is not set
+# CONFIG_SOUND_NM256 is not set
+# CONFIG_SOUND_MAD16 is not set
+# CONFIG_SOUND_PAS is not set
+# CONFIG_SOUND_PSS is not set
+CONFIG_SOUND_SB=m
+# CONFIG_SOUND_AWE32_SYNTH is not set
+# CONFIG_SOUND_WAVEFRONT is not set
+# CONFIG_SOUND_MAUI is not set
+CONFIG_SOUND_YM3812=m
+# CONFIG_SOUND_OPL3SA1 is not set
+# CONFIG_SOUND_OPL3SA2 is not set
+# CONFIG_SOUND_YMPCI is not set
+# CONFIG_SOUND_YMFPCI is not set
+# CONFIG_SOUND_UART6850 is not set
+# CONFIG_SOUND_AEDSP16 is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_MAGIC_SYSRQ is not set
--- /dev/null
+
+
+The Diskless Terminal running from NT server Mini-HOWTO
+Pavel Tkatchouk, ptkatcho@portal.ca
+v0.1, June 19th 1999
+
+Table of Contents
+
+1. Introduction.
+
+ 1.1 What is it for?
+ 1.2 Do we need this HOWTO?
+ 1.3 A bit of History.
+
+2. Project description.
+
+ 2.1 Packaging.
+ 2.2 Image.
+ 2.2.1 Kernel.
+ 2.2.2 MRFS.
+ 2.2.3 Building MRFS.
+ 2.3 Remotefs.
+ 2.4 Booting sequence.
+ 2.4.1 BOOTP, TFTP.
+ 2.5 Bootprom.
+
+3. Resources.
+
+4. Copyright.
+
+5. Feedback and credits.
+
+
+1. Introduction.
+
+
+1.1. What is it for?
+
+This document describes how to build software distribution to run Java client on diskless
+terminal booted from Microsoft Windows 95/98/NT workstation. Package can also be easily
+modified to be used as Linux terminal or X Windows terminal's software. I found it also
+convenient for setup over the Ethernet of floppyless PS's, hard disk of which for some
+reason can not be accessed (sealed case under warranty, etc.).
+
+
+1.2. Do we need this HOWTO?
+
+To be honest, I'm not sure. There are few excellent HOWTO's (see 3. Recources) that up until
+recently I considered quite sufficient to build what I've done two years ago. But since my
+project uses MS Windows as a file server vs. traditional NFS there were some know-how's
+involved which number of people wanted to see in some formal document.
+
+
+1.3. A bit of history.
+
+My project at that time (1996) was to find OS/JVM that will allow to run Java application
+on hardware we manufacture. Hardware is practically generic x86 PC except it has no keyboard,
+hard drive, floppy drive, mouse, but touchscreen over LCD, plus some POS specific peripherals
+(badge reader, credit card reader, etc.). Due to cost consideration it had no any significant
+storage, so OS and Java client along with support binaries, libraries etc. had to be loaded
+remotely. Because our clients are exclusively Windows shops, Server had to be Windows as well.
+During evaluation of different commercial OS'es along with JVM's available it become apparent
+to my surprise that most promising solution was GPL one - Linux.
+
+
+2. Project description.
+
+2.1. Packaging.
+
+The whole distribution consists of remote file system (RemoteFS) residing on MS Windows
+server (NT Workstation, NT Server or Windows9x) and tagged bootable image.
+
+
+2.2. Image.
+
+Image (~1.5MB) is generated by mknbi utility that comes with Etherboot package
+<http://etherboot.sourceforge.net>. It can include minimal root file system (MRFS)
+like in my case (since I had to boot client from MS Windows server and Linux kernel doesn't
+support SMBFS-Root, only NFS-Root. So I had to keep rootfs in the ramdisk). To generate
+image the following script can be used.
+
+#!/bin/sh
+# mkrootnet: makes tagged netbootable image
+# This image includes kernel and minimal root filesystem
+# to do initial boot.
+#
+# Copyright (c) Pavel Tkatchouk 1996. All rights reserved.
+# Permission is granted for this material to be freely
+# used and distributed, provided the source is acknowledged.
+# No warranty of any kind is provided. You use this material
+# at your own risk.
+#
+DEVICEFILENAME="/tmp/file" # temporary file to be used as device
+FSBLOCKS=4096 # uncompressed filesystem size in K
+BOOTDISKDIR="/usr/BOOT/ROOTFS" # root filesystem model
+MOUNT="/mnt2" # temporary mount point
+ROOTFS="/tmp/rootfs" # root filesystem image
+ROOTFSGZ="/tmp/rootfs.gz" # compressed root filesystem image
+KERNEL="/usr/KERNELS/vmlinuz-nt" # kernel image
+KERNELTMP="/tmp/vmlinuz" # temporary copy of kernel image
+BOOTIMAGE="/tmp/img" # tagged image to be booted by client
+# if you want ramisk more than default 4096 set CMDLINE, don't forget to
+# adjust $FSBLOCKS
+# CMDLINE="ramdisk_size=8192" # parameters to pass to the kernel
+#
+echo "check:"
+echo "- if tftp server's download dir mounted to /mnt"
+echo "- loopback device is built-in or loaded"
+echo "\n press Enter when done"
+read tmp
+UPLOAD="/mnt/tmp" # tftp server's dir to upload bootimage
+echo -e "\nZeroing $DEVICEFILENAME of $FSBLOCKS k"
+echo "to be used as device for root filesystem model"
+dd if=/dev/zero of=$DEVICEFILENAME bs=1k count=$FSBLOCKS
+echo -e "\nMaking file system on $DEVICEFILENAME"
+mke2fs -m 0 $DEVICEFILENAME
+echo "Mounting $DEVICEFILENAME as a loopback device"
+mount -o loop -t ext2 $DEVICEFILENAME $MOUNT
+curdir=`pwd`
+cd $BOOTDISKDIR
+echo -e "Copying files from $BOOTDISKDIR to $DEVICEFILENAME, please wait"
+find . -print|cpio -pmd $MOUNT
+echo "Unmounting $MOUNT"
+umount $MOUNT
+cd $curdir
+echo "Copying $DEVICEFILENAME to $ROOTFS"
+dd if=$DEVICEFILENAME of=$ROOTFS bs=1k
+echo "Compressing $ROOTFS, it may take a while"
+echo "Please wait..."
+if [ -f $ROOTFSGZ ];then
+ rm -f $ROOTFSGZ
+fi
+gzip -c $ROOTFS>$ROOTFSGZ
+rm -f $ROOTFS
+echo -e "\nCreating netbootable image"
+cp $KERNEL $KERNELTMP
+mknbi -d ram -i rom -r $ROOTFSGZ -k $KERNELTMP -a $CMDLINE -o $BOOTIMAGE
+echo "Uploading $BOOTIMAGE to $UPLOAD"
+cp $BOOTIMAGE $UPLOAD
+echo "Cleaning after ourselves"
+rm -f $KERNELTMP $DEVICEFILENAME $BOOTIMAGE
+echo "All done"
+
+
+In the above script actual image is generated by the following comand
+
+#mknbi -d ram -i rom -r rootfs.gz -k vmlinuz-nt -o img
+
+where:
+ rootfs.gz - minimal root file system (MRFS);
+ vmlinuz-nt - kernel;
+ img - resulting image.
+
+
+Note:
+Default ramdisk size is 4096. It was enough for RedHat4.1 based minimal file system, but
+apparently not enough for 5.2 based. When this happens "end request:I/O error, dev 01:00 ..."
+error shows up. To fix that either use "mknbi -a ramdisk_size=8192" to pass parameter to the
+kernel (doesn't require kernel recompilation), or change /usr/src/linux/drivers/block/rd.c:
+int rd_size= from 4096 to 8192 or whatever and rebuild the kernel.
+
+
+2.2.1. Kernel.
+
+Kernels 2.0.30 and 2.0.36 have been used by author, although nothing is preventing you from
+experimenting with others. Kernel should include ramdisk support. The following
+<link to .config> configuration has been used to build <link to binary (kernel 2.0.30)>.
+You may find some components unnecessary, just exclude them and rebuild.
+
+Don't forget to change root device after you built the kernel (rdev vmlinuz /dev/rd).
+
+Gotcha's: apparently smbfs is broken in 2.2.x kernels. Symptoms: remote share is mounted
+just fine but after a while fails with "smb_request: result = -32" errmsg. I've heard
+SuSe has fix for that.
+
+2.2.2. MRFS.
+
+Minimal root file system is required to get Linux up and running along with networking until
+it can mount remote file system to run X/Java from there. After image gets loaded from the
+server MRFS is decompressed into ramdisk. If you can afford a lot of ram on your terminal the
+entire remote file system can be moved to rootfs.gz. That will make your terminal more
+responsive.
+
+
+2.2.3. Building MRFS.
+
+Some folks found it easier to start from scratch, others use known "minimal" Linux distributions
+(Linux Router, tomsrtbt, etc.), yet others prefer to start from "big" Linuces like I did. Every
+path has it's pro and contras.
+
+Pruning standard distribution (RedHat, Debian, etc.) to your needs might be very time consuming.
+To ease that painful process I have used remotely booted diskless client with NFS-Root (see
+Etherboot's Readme, NFS-Root and NFS-Root-Client mini-HOWTO's, Diskless-HOWTO):
+
+- setup minimal RedHat4.1 install (networked workstation, X, no development, mail, etc., ~117MB);
+- find . -print|cpio -pmd /usr/NFS/ROOTFS - copy entire fs tree to NFS exported dir;
+- mknod /usr/NFS/ROOTFS/dev/nfsroot b 0 255;
+- build vmlinuz-nfs kernel according to NFS-Howto (built-in bootp,rarp,NFS,NFS root,NIC
+ driver,RAM disk);
+- rdev vmlinuz-nfs /dev/nfsroot - to set NFS root device;
+- build image for NFS-Root fs:
+ #mknbi -d rom -i rom -k vmlinuz-nfs -o nfsImage;
+- boot client while monitoring NFS file requests (by Solaris snoop);
+- copy files from /usr/NFS/ROOTFS to /usr/BOOT/ROOTFS (MRFS model) according to snoop's
+ filelist;
+- generate image by mkrootnet script (don't forget to point to the right kernel vmlinuz-nt).
+
+The above trick not only allows to determine the sought files set but also debug boot process
+analyzing NFS messages. I found it convenient to put "read tmp" statements into init scripts
+for debugging. Tracking files up until issuing login gives you <link to rootfs.gz> MRFS (~1MB)
+that can be used to boot Linux from ROM (flash, eprom, DiskOnChip, SanDisk, etc.) as well. All
+the other files requested by client (during starting X, Java, Java client) were put into (link
+to remotefs.zip, ~9MB).
+
+
+To restore MRFS model on your PC from the above rootfs.gz:
+- #cd /tmp
+- #gunzip rootfs.gz
+- #mount -o loop -t ext2 /tmp/rootfs /mnt
+- #cd /mnt
+- #find . -print|cpio -pmd /usr/BOOT/ROOTFS
+- #umount /mnt
+
+Note:
+
+You will have to change attributes of some dirs, files (/etc/mtab, /etc/mtab~, /var/lock/subsys/*,
+/var/run/*, /dev/tty*, etc.) against standard. This is because with standard attribs diskless
+client refused to work. For example I had to change /dev/tty* ownerships to 99:99 from original
+0:0 or 0:5, to get rid of errmsg "INIT: Id "1" respawning too fast: disabled for 5 minutes".
+Being admin illiterate I just chmod them to 777 and chown to 99:99 to make life easier.
+THIS IS SERIOUS SECURITY VIOLATION!!! Using keyboardless terminal with no daemons running in
+my case reduces the risk, yet I would appreciate very much those more experienced who will help
+to restore the right attribs while keeping the distribution working.
+
+Some "gotcha's" to watch for during MRFS building:
+- standard attributes/ownership of some files don't work;
+- rdev must be set (non-tagged image didn't work, so couldn't use config file to pass parrs
+ to the kernel);
+- diskless client writes 99:99 ownership on generated files;
+- "password incorrect" for root, but any other OK and su OK too.
+
+
+2.3. RemoteFS.
+
+Remotefs.zip file includes everything required by the system that can be located on
+remote file system, i.e after booting has been complete and remote file system mounted.
+In my case it is X Windows System and Java binaries, libraries etc. To use that file on
+MS Windows NT:
+- unzip remotefs.zip to some directory;
+- share this directory read-only as "usr" (or share as some other name and pass this name to
+ the client through bootptab configuration file for BOOTP server;
+- create an account username=root, password=linux on NT (can be set in bootptab).
+
+Note:
+There's no symbolic links on NTFS, so UNIX links must be replaced by copies on NTFS.
+To determine potential troublmakers one could use the following:
+- first copy required subset (according to snoop's intercept) from /usr/NFS/ROOTFS to
+ /usr/BOOT/REMOTEFS;
+- mount some share from NTFS to /mnt;
+- /usr/BOOT/REMOTEFS#find . -print|cpio -pmd /mnt 2>links;
+In the links file you will find names to work with.
+
+
+2.4. Booting sequence.
+
+Boot occurs in the following sequence:
+- bootprom sends bootp request,
+- bootp server responds with subnet mask, client's name, client's IP, TFTP server's IP,
+ bootfile name and some optional parameters (like NT's username/password to use it's share,
+ you could pass some other share name here as say T104="somedir");
+- bootprom downloads image from TFTP server;
+- kernel starts;
+- kernel decompresses MRFS in RAM;
+- system starts init using ramdisk root,
+- mounts remote file system from NT via SMBFS;
+- automatically logins;
+- starts xstart script located on remotefs (/usr/sbin) where you can start any of your
+ programs, change parameters, etc. without rebuilding the image.
+
+Below are some config/init sample files from <rootfs.gz>, <remotefs.zip>:
+
+<bootptab, change to link>
+t1:sm=255.255.255.0:sa=192.168.33.150:bf=img:T100="pavelnt4":T101="root":T102="linux"
+touch1:hn=touch1:tc=t1:ha=00A0F00035CD:ip=192.168.33.127
+
+</etc/fstab, change to link>:
+/dev/ram / ext2 defaults 1 1
+/proc /proc proc defaults 0 0
+
+</etc/rc.d/rc.bootp, change to link later>:
+#!/bin/sh
+# Written to simply set the IP stuff up from the
+# bootpc data.
+# Last updated : Mon Mar 10 15:17:01 1997
+#
+# Variables
+
+BOOTPC=/sbin/bootpc
+IFCONFIG=/sbin/ifconfig
+ROUTE=/sbin/route
+BINHOST=/bin/hostname
+DEV=eth0
+ASKSERVER="255.255.255.255"
+TW="--timeoutwait 320"
+RIF="--returniffail"
+RIFMESSAGE="Bootp failed -- disabling network."
+RCONF=/etc/resolv.conf
+EHOSTS=/etc/hosts
+LHOSTS=/etc/hosts.local
+TMPFILE=/tmp/bootp
+# Functions
+# Remove the networking by taking down the interface
+netdown() {
+ ${ROUTE} del default
+ ${IFCONFIG} ${DEV} down
+}
+## End of the functions
+
+## Start of the actual work
+# Bring up minimal networking use 0.0.0.0 as our address as we don't
+# know it yet (Means "Me but I don't know my address or network")
+${IFCONFIG} ${DEV} up 0.0.0.0
+${ROUTE} add default dev ${DEV}
+
+# Perform the bootp -- doesn't return unless it gets an answer
+if ${BOOTPC} --dev ${DEV} --server ${ASKSERVER} ${RIF} ${TW} > ${TMPFILE}
+then
+# Take down networking (use the 0.0.0.0 for as short a time as possible)
+ netdown
+# Read in the values
+ . ${TMPFILE}
+
+# To use in mountsmb script later
+SMBSERVER=${T100}
+# And delete the temporary file
+# rm ${TMPFILE}
+else
+# Take down networking (use the 0.0.0.0 for as short a time as possible)
+ netdown
+# give message and quit
+ echo ${RIFMESSAGE}
+ exit 1
+fi
+
+# Start the loopback interface and add a route to it
+# It's already set by standard init?
+${IFCONFIG} lo 127.0.0.1
+${ROUTE} add -net 127.0.0.0
+
+# Setup of IP stuff needs doing first
+#
+if [ -z "${NETMASK}" ] ; then
+# No netmask info, all this is guessed from the IP number
+# If this is wrong for your network FIX the bootpd to know
+# what it should send in the RFC1497 cookie! 11/02/94 JSP
+#
+ ${IFCONFIG} ${DEV} up ${IPADDR} broadcast ${BROADCAST}
+ ${ROUTE} -n add -net ${NETWORK} dev ${DEV}
+else
+# We will have NETMASK, BROADCAST, and NETWORK defined
+ ${IFCONFIG} ${DEV} up ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
+ ${ROUTE} -n add -net ${NETWORK} dev ${DEV}
+fi
+
+# Set the hostname from what we got via bootp or reverse lookup
+
+echo "127.0.0.1 loopback localhost">${EHOSTS}
+${BINHOST} "${HOSTNAME}"
+echo "${IPADDR} ${HOSTNAME}" >>${EHOSTS}
+echo "${SERVER} ${SMBSERVER}" >>${EHOSTS}
+
+
+</etc/rc.d/rc.local, change to link>:
+#!/bin/sh
+# This script will be executed *after* all the other init scripts.
+# You can put your own initialization stuff in here if you don't
+# want to do the full Sys V style init stuff.
+#
+# 07/02/97 Pavel Tkatchouk
+#
+echo "Start networking"
+insmod /lib/8390.o
+insmod /lib/ne.o io=0x300 irq=9
+echo "Install serial"
+insmod /lib/serial.o
+echo "Install touch"
+insmod /lib/touch.o
+echo "Install smbfs"
+insmod /lib/smbfs.o
+echo "Getting TCP/IP parameters from bootp server"
+echo "and start networking"
+/etc/rc.d/rc.bootp
+if [ -f /etc/squirrel-release ]; then
+ R=$(cat /etc/squirrel-release)
+else
+ R="release 0.02"
+fi
+echo "Mounting remote fs"
+/sbin/mountsmb
+echo "XYZ Inc. Diskless Linux $R"
+echo "Starting X and Java client without login"
+su -c /sbin/xstart root
+
+
+</usr/sbin/xstart, change to link>:
+#!/bin/bash
+#
+# Script to start X and Java client
+# 08/07/97 Pavel Tkatchouk
+#
+# Read bootps response first
+. /tmp/bootp
+# -s 0 to disable screen-saver
+/usr/X11R6/bin/X -s 0 &
+export DISPLAY=:0.0
+# /usr is share mounted from Windows workstation
+cd /usr/program/
+java SomeJavaApp
+
+
+</sbin/mountsmb, change to link>:
+#!/bin/bash
+# mountsmb: mounts remote filesystems from NT workstation
+# using Microsoft's SMB protocol
+#
+# Copyright (c) Pavel Tkatchouk 1997. All rights reserved.
+# Permission is granted for this material to be freely
+# used and distributed, provided the source is acknowledged.
+# No warranty of any kind is provided. You use this material
+# at your own risk.
+#
+# Last edit June 29 8:30 1997
+#
+MOUNTDIR="usr"
+SHRDIR="usr"
+BOOTPRES="/tmp/bootp"
+# Read botpc response
+. ${BOOTPRES}
+# Sharename from NT server, uncomment if you want to use
+# non-hardcoded "usr" but from bootptab
+#SHRDIR=${T104}
+SMBSRV="//${T100}"
+CLIENT="${HOSTNAME}"
+USER="${T101}"
+PASSWORD="${T102}"
+echo -e "\nMounting $SMBSRV/$SHRDIR to /$MOUNTDIR"
+smbmount $SMBSRV/$SHRDIR $MOUNTDIR -c $CLIENT -U $USER -P $PASSWORD
+echo -e "\nDone"
+
+Gotcha's:
+Looks like smbmount client from smbfs package used to mount remote Windows shares to local
+Linux dirs in pre 2.2.x era isn't maintained anymore so you should use one coming with
+Samba package. Also binary smbmount won't work with 2.2.x, so you have to recompile with
+2.2.x headers following Samba's readme. Yet even that won't guarantee reliable work until
+somebody fixes kernel's smbfs module.
+
+2.4.1. BOOTP, TFTP.
+
+There are number of BOOTP, TFTP servers for Windows on the market. You could find them
+here:
+
+- www.walusoft.co.uk (Walusoft's tftp);
+- ftp.coast.net/simtel/nt/internet/tftpds12.zip (Millwood AB's tftp);
+- ftp.cabletron.com/pub/snmp/bootftp/boottft2.zip (Cabletron's bootp/tftp combo);
+- www.tellurian.au.com (Tellurian's bootp, tftp, dhcp servers).
+- www.metainfo.com (Metainfo's DHCP server)
+- www.nts.com (Network Telesystems's DHCP server in IPserver package)
+
+My choice was Tellurian's products - very reliable, simple to install, attractively priced
+(fully capable evaluation versions are available).
+
+2.5. Bootprom.
+
+Ken Yap's Etherboot <etherboot.sourceforge.net> will tell you everything about bootprom.
+Here I just want to mention that normally you would have to put bootprom's code into network
+adapter's PROM. But if your hardware like mine has BIOS programmed in flash you could
+re-program it to add bootprom (some BIOS requires special programmer to do that, others don't)
+as BIOS extension.
+
+This is what I did to add ne.rom (bootprom generated by Etherboot's makerom for NE2000 clone)
+to AMI BIOS on my flash:
+
+- read flash content by programmer into bios.bin binary file;
+- use one of available binary editors (say www.simtel.net/Win95/editors/hxp3005.zip to add
+ ne.rom to bios.bin (and to edit ne.rom if necessary);
+- write new bios.bin back to flash.
+
+Notes:
+- makerom generates bootprom for standard EPROM sizes (8k, 16k, 32k, etc.), so if you tight on
+ space use -s flag to adjust size (or cut it manually to multiple of 512 bytes blocks, just
+ don't forget to adjust extension's length which is coded in Byte 2 and checksum to 8 bits
+ of zero;
+- valid absolute addresses for BIOS extensions are from 0xC8000 to 0xF4000 (check with
+ motherboard's manufacturer how flash is mapped onto system memory space);
+- Byte 0 must be 0x55, Byte 1 must be 0xAA, Byte 2 must be extension's length in 512 bytes
+ blocks;
+- extension BIOS has to start at a 2k boundary;
+
+
+3. Resources.
+
+FAQ's:
+- tomsrtbt.FAQ (www.toms.net);
+
+HOWTO's:
+- Paul Moody's miniHOWTO (www.linuxembedded.com/pmhowto.html)
+- Diskless;
+- Diskless-HOWTO;
+- NFS-Root;
+- NFS-Root-Client;
+- Bootdisk-HOWTO;
+- BootPrompt-HOWTO;
+- NCD-X-Terminal;
+- Remote-Boot;
+- Remote-X-Apps;
+
+Web:
+- etherboot.sourceforge.net/
+- www.waste.org/~zanshin
+- www.tellurian.com.au.
+- www.toms.net
+- www.trinux.org
+- www.linux.org.uk/ELKS-Home
+- www.embedded.com
+- www.linuxembedded.com
+- www.thinlinux.org
+- www.linuxrouter.org
+- linux-mandrake.com
+- www.disklessworkstations.com
+
+Newsgroups:
+- comp.arch.embedded
+
+Lists:
+- netboot-owner@baghira.han.de
+- linux-embedded@waste.org
+
+Magazines:
+- Circuit Cellar #100 - 105
+
+
+4. Copyright.
+
+Copyright (c) Pavel Tkatchouk 1999.
+Permission is granted for this material to be freely used and distributed, provided the source
+is acknowledged. Copyright policy is GPL as published by the Free Software Foundation.
+
+No warranty of any kind is provided. You use this material at your own risk.
+
+
+
+5. Feedback and credits.
+
+Since I am neither have a lot of Linux experience nor native English speaker, there would be
+errors in this document. I would accept any help with gratitude whether in form of proof-reading,
+techical corrections or otherwise. Please send your comments, suggestions and questions to Pavel
+Tkatchouk (ptkatcho@portal.ca)
+
+I wish to thank Pierre Mondie who convinced me to start this document. I'm also very much in
+debt to all those who's work made this project possible:
+
+Ken Yap <ken_yap@users.sourceforge.net> (Etherboot)
+David Newall <www.tellurian.com.au> (Bootpdnt/Ftpdnt)
+(to be continued)
+
--- /dev/null
+<html>
+
+<head>
+<title>Free TFTP / Syslog / NFS Servers for Windows</title>
+</head>
+
+<body>
+
+<h3 align="center">Free TFTP / Syslog / NFS Servers for Windows</h3>
+<div align="center"><center>
+
+<address>
+ Stefan Furtmayr (<a href="mailto:sf@paf.net">sf@paf.net</a>)
+</address>
+</center></div>
+
+<p>Feel free to send me your comments about these programs or some additions.</p>
+
+<p>Also have a look at the <a
+href="http://www.ltsp.org/contrib/diskless-windows-howto.htm">"Diskless Windows
+Cookbook "</a> in the <a href="http://www.ltsp.org/contrib/">LTSP Contrib Area</a>.</p>
+
+<p><small>From this list I have only used the W2K-TFTP once for a customer with the <a
+href="http://support.3com.com/infodeli/tools/nic/mba.htm">3Com MBA Utility Disk</a>, while
+it can be used as well with <a href="http://etherboot.sourceforge.net">Etherboot</a>
+tagged images for other NIC brands.</small><br>
+<small>The solution used a netbooted DOS with MS Client 3.0 to easily restore disk images
+with <a href="http://www.ghost.com/">Symantec Ghost</a> (see <a
+href="http://appdeploy.com/tools/imaging.shtml">appdeploy.com</a> for similar tools).</small><br>
+<small>Sure there are several possibilities to do this with Linux but for cloning NT4/W2K
+the NTFS support is rather experimental and automatically changing the SID is another
+issue.</small></p>
+
+<h4>TFTP Servers:</h4>
+
+<p>In Autumn 2000 i tested some different TFTP servers and found out that most of them do
+not install/run as a service, especially under W2K.
+
+<ul>
+ <li>TFTP server included with Windows 2000 (remote installation services need to be
+ installed)<br>
+ The path for the images has to be specified via registry:<br>
+ Q232115 - Changing the Drive or Volume on Which Remote Installation Images Reside:<br>
+ <a href="http://support.microsoft.com/support/kb/articles/Q232/1/15.ASP">http://support.microsoft.com/support/kb/articles/Q232/1/15.ASP</a></li>
+ <li>3CDaemon version 2.0 revision 10. Freeware. Integrated TFTP/FTP/Syslog Daemon for
+ Windows 95/98/NT<br>
+ <a href="ftp://ftp.3com.com/pub/utilbin/win32/3cdv2r10.zip">ftp://ftp.3com.com/pub/utilbin/win32/3cdv2r10.zip</a><br>
+ - Windows 2000 Server: does not run as service!<br>
+ - Windows NT Server 4.0: not tested</li>
+ <li>The TFTP Server portion of 3CServer, altered to run as a system Service under Windows NT<br>
+ <a href="ftp://ftp.3com.com/pub/utilbin/win32/3CTftpSvc.zip">ftp://ftp.3com.com/pub/utilbin/win32/3CTftpSvc.zip</a><br>
+ - Windows 2000 Server: only working in debug mode, does not run as service!<br>
+ - Windows NT Server 4.0: not tested</li>
+ <li>Cisco TFTP Server v.1.1<br>
+ <a href="http://www.cisco.com/pcgi-bin/tablebuild.pl/tftp">http://www.cisco.com/pcgi-bin/tablebuild.pl/tftp</a><br>
+ Does not provide an option itself to install as service.</li>
+ <li><a href="http://solarwinds.net/Tools/Free_Tools/TFTP_Server/">http://solarwinds.net/Tools/Free_Tools/TFTP_Server/</a><br>
+ Does not provide an option itself to install as service.</li>
+</ul>
+
+<p><em>Untested:</em></p>
+
+<p>found on <a href="http://www.nonags.com/nonags/servd32.html">http://www.nonags.com/nonags/servd32.html</a><br>
+- <a href="http://www.klever.net/kin/pumpkin.html">http://www.klever.net/kin/pumpkin.html</a><br>
+- <a href="http://membres.tripod.fr/phjounin//P_tftpd32.htm">http://membres.tripod.fr/phjounin//P_tftpd32.htm</a></p>
+
+<h4>Syslog Servers:</h4>
+
+<ul>
+ <li>3Com Software Library - Utilities for 32 bit Windows<br>
+ <a href="http://support.3com.com/software/utilities_for_windows_32_bit.htm">http://support.3com.com/software/utilities_for_windows_32_bit.htm</a></li>
+ <li><a href="http://www.netal.com/download.htm#SL4NT03">http://www.netal.com/download.htm#SL4NT03</a>
+ (works as service) </li>
+</ul>
+
+<h4>NFS Servers:</h4>
+
+<ul>
+ <li>War NFS Daemon: <a href="http://www.jgaa.com">http://www.jgaa.com</a> (untested)</li>
+</ul>
+</body>
+</html>
--- /dev/null
+Date: 11/9/2001 3:56 PM
+Received: 11/9/2001 4:05 PM
+From: Steve Tilden, stilden@sicom-sys.com
+
+...
+
+2) I have added conditional code to main.c from Etherboot 5.0.4 to add
+a new default boot option and I have included the modified main.c as an
+attachment to this message.
+
+As I received Etherboot 5.0.4, in the Config file, if you select
+ASK_BOOT with a non zero time-out option, then you also get to set
+ANS_DEFAULT = ANS_NETWORK or ANS_DEFAULT = ANS_LOCAL to determine what
+will happen if the operator does not respond to the prompt. I have now
+added conditional code in main.c such that if you set ANS_DEFAULT =
+ANS_AUTO, the default answer will be set according to whether or not
+there is a hard disk in the system (as detected by the BIOS). If a hard
+disk is present, then if the operator does nothing, the system will boot
+from it. If a hard disk does not exist, then again if the operator does
+nothing, the system will boot via the network. Either way, for our
+particular environment, the operator has to do nothing to get it to boot
+correctly. Yet the operator can still override the default selection
+to, for example, allow a unit without a hard disk, to boot directly from
+a floppy rather than the network, or to allow a unit with a hard disk,
+to boot from the network.
+
+I don't know it the code I have added might be correct for a future
+production version of Etherboot, but I thought I'd send it to you and
+let you get it into the system if you feel it might be appropriate.
+
+Thanks,
+
+Steve Tilden
+Sicom Systems Inc.
+stilden@sicom-sys.com
+
+[Ed: On a compliant BIOS, it will actually boot the next device in the
+BIOS list if local is selected, either explicitly or by timeout, which
+may or may not be the hard disk, which is why it's less than general and
+not included in the distribution by default.]
--- /dev/null
+--- main.c Mon Nov 5 18:58:30 2001
++++ main.c.new Thu Nov 15 01:45:12 2001
+@@ -149,21 +151,49 @@
+ static unsigned short ipchksum(unsigned short *ip, int len);
+ static unsigned short udpchksum(struct iphdr *packet);
+
++
++#if defined(ASK_BOOT) && ASK_BOOT > 0 && (ANS_DEFAULT == ANS_AUTO)
++/*
++ * Read Installed Hard Disk Count from BIOS memory at 0:0475
++ */
++static int hdsk_cnt(void)
++{
++ int retv;
++ __asm__ __volatile__(
++ "xorw %%ax,%%ax\n\t"
++ "movb 0x475,%%al\n"
++ : "=a" (retv)
++ : /* no inputs */
++ : "ax", "cc", "memory"
++ );
++ return(retv);
++}
++#endif /* ASK_BOOT && ANS_AUTO */
++
++
+ static inline void ask_boot(void)
+ {
+ #if defined(ASK_BOOT) && ASK_BOOT > 0
+ while(1) {
+- int c;
++ int c, deflt;
+ unsigned long time;
++#if defined(ASK_BOOT) && ASK_BOOT > 0 && (ANS_DEFAULT == ANS_AUTO)
++ if (hdsk_cnt() != 0)
++ deflt = ANS_LOCAL;
++ else
++ deflt = ANS_NETWORK;
++#else
++ deflt = ANS_DEFAULT;
++#endif
+ printf(ASK_PROMPT);
+ for (time = currticks() + ASK_BOOT*TICKS_PER_SEC; !iskey(); )
+ if (currticks() > time) {
+- c = ANS_DEFAULT;
++ c = deflt;
+ goto done;
+ }
+ c = getchar();
+ if ((c >= 'a') && (c <= 'z')) c &= 0x5F;
+- if (c == '\n') c = ANS_DEFAULT;
++ if (c == '\n') c = deflt;
+ done:
+ if ((c >= ' ') && (c <= '~')) putchar(c);
+ putchar('\n');
--- /dev/null
+An Award BIOS ROM lister in Perl contributed by Eric W. Biederman
+<ebiederman@lnxi.com>.
--- /dev/null
+#!/usr/bin/perl -w
+use strict;
+use FileHandle;
+use integer;
+
+sub unsigned_little_endian_to_value
+{
+ # Assumes the data is initially little endian
+ my ($buffer) = @_;
+ my $bytes = length($buffer);
+ my $value = 0;
+ my $i;
+ for($i = $bytes -1; $i >= 0; $i--) {
+ my $byte = unpack('C', substr($buffer, $i, 1));
+ $value = ($value * 256) + $byte;
+ }
+ return $value;
+}
+
+sub decode_fixed_string
+{
+ my ($data, $bytes) = @_;
+ return $data;
+}
+
+sub decode_pstring
+{
+ my ($buf_ref, $offset_ref) = @_;
+ # Decode a pascal string
+ my $offset = ${$offset_ref};
+ my $len = unpack('C',substr(${$buf_ref}, $offset, 1));
+ my $data = substr(${$buf_ref}, $offset +1, $len);
+ ${$offset_ref} = $offset + $len +1;
+ return $data;
+}
+
+sub decode_cstring
+{
+ # Decode a c string
+ my ($buf_ref, $offset_ref) = @_;
+ my ($data, $byte);
+ my $index = ${$offset_ref};
+ while(1) {
+ $byte = substr(${$buf_ref}, $index, 1);
+ if (!defined($byte) || ($byte eq "\0")) {
+ last;
+ }
+ $data .= $byte;
+ $index++;
+ }
+ ${$offset_ref} = $index;
+ return $data;
+}
+
+sub type_size
+{
+ my ($entry) = @_;
+ my %type_length = (
+ byte => 1,
+ half => 2,
+ word => 4,
+ xword => 8,
+ 'fixed-string' => $entry->[2],
+ pstring => 0,
+ cstring => 0,
+ );
+ my $type = $entry->[0];
+ if (!exists($type_length{$type})) {
+ die "unknown type $type";
+ }
+ my $length = $type_length{$type};
+ return $length;
+}
+
+sub decode_fixed_type
+{
+ my ($type, $data, $bytes) = @_;
+ my %decoders = (
+ 'byte' => \&unsigned_little_endian_to_value,
+ 'half' => \&unsigned_little_endian_to_value,
+ 'word' => \&unsigned_little_endian_to_value,
+ 'xword' => \&unsigned_little_endian_to_value,
+ 'fixed-string' => \&decode_fixed_string,
+ );
+ my $decoder = $decoders{$type} or die "unknow fixed type $type";
+ return $decoder->($data, $bytes);
+}
+
+sub decode_variable_type
+{
+ my ($type, $buf_ref, $offset_ref) = @_;
+ my %decoders = (
+ 'pstring' => \&decode_pstring,
+ 'cstring' => \&decode_cstring,
+ );
+ my $decoder = $decoders{$type} or die "unknow variable type $type";
+ return $decoder->($buf_ref, $offset_ref);
+}
+
+sub decode_struct
+{
+ my ($buf_ref, $offset, $layout) = @_;
+ my $initial_offset = $offset;
+ my ($entry, %results);
+ foreach $entry (@$layout) {
+ my ($type, $name) = @$entry;
+ my $bytes = type_size($entry);
+ if ($bytes > 0) {
+ my $data = substr(${$buf_ref}, $offset, $bytes);
+ $results{$name} = decode_fixed_type($type, $data, $bytes);
+ $offset += $bytes;
+ } else {
+ $results{$name} = decode_variable_type($type, $buf_ref, \$offset);
+ }
+ }
+ return (\%results, $offset - $initial_offset);
+}
+
+sub print_big_hex
+{
+ my ($min_digits, $value) = @_;
+ my @digits;
+ while($min_digits > 0 || ($value > 0)) {
+ my $digit = $value%16;
+ $value /= 16;
+ unshift(@digits, $digit);
+ $min_digits--;
+ }
+ my $digit;
+ foreach $digit (@digits) {
+ printf("%01x", $digit);
+ }
+}
+
+
+
+my %lha_signatures = (
+ '-com-' => 1,
+ '-lhd-' => 1,
+ '-lh0-' => 1,
+ '-lh1-' => 1,
+ '-lh2-' => 1,
+ '-lh3-' => 1,
+ '-lh4-' => 1,
+ '-lh5-' => 1,
+ '-lzs-' => 1,
+ '-lz4-' => 1,
+ '-lz5-' => 1,
+ '-afx-' => 1,
+ '-lzf-' => 1,
+);
+
+my %lha_os = (
+ 'M' => 'MS-DOS',
+ '2' => 'OS/2',
+ '9' => 'OS9',
+ 'K' => 'OS/68K',
+ '3' => 'OS/386',
+ 'H' => 'HUMAN',
+ 'U' => 'UNIX',
+ 'C' => 'CP/M',
+ 'F' => 'FLEX',
+ 'm' => 'Mac',
+ 'R' => 'Runser',
+ 'T' => 'TownOS',
+ 'X' => 'XOSK',
+ 'A' => 'Amiga',
+ 'a' => 'atari',
+ ' ' => 'Award ROM',
+);
+
+
+my @lha_level_1_header = (
+ [ 'byte', 'header_size' ], # 1
+ [ 'byte', 'header_sum', ], # 2
+ [ 'fixed-string', 'method_id', 5 ], # 7
+ [ 'word', 'skip_size', ], # 11
+ [ 'word', 'original_size' ], # 15
+ [ 'half', 'dos_time' ], # 17
+ [ 'half', 'dos_date' ], # 19
+ [ 'byte', 'fixed' ], # 20
+ [ 'byte', 'level' ], # 21
+ [ 'pstring', 'filename' ], # 22
+ [ 'half', 'crc' ],
+ [ 'fixed-string', 'os_id', 1 ],
+ [ 'half', 'ext_size' ],
+);
+
+# General lha_header
+my @lha_header = (
+ [ 'byte', 'header_size' ],
+ [ 'byte', 'header_sum', ],
+ [ 'fixed-string', 'method_id', 5 ],
+ [ 'word', 'skip_size', ],
+ [ 'word', 'original_size' ],
+ [ 'half', 'dos_time' ],
+ [ 'half', 'dos_date' ],
+ [ 'half', 'rom_addr' ],
+ [ 'half', 'rom_flags' ],
+ [ 'byte', 'fixed' ],
+ [ 'byte', 'level' ],
+ [ 'pstring', 'filename' ],
+ [ 'half', 'crc' ],
+ [ 'lha_os', 'os_id', 1 ],
+ [ 'half', 'ext_size' ],
+ [ 'byte', 'zero' ],
+ [ 'byte', 'total_checksum' ],
+ [ 'half', 'total_size' ],
+);
+
+sub print_struct
+{
+ my ($layout, $self) = @_;
+ my $entry;
+ my $width = 0;
+ foreach $entry(@$layout) {
+ my ($type, $name) = @$entry;
+ if (length($name) > $width) {
+ $width = length($name);
+ }
+ }
+ foreach $entry (@$layout) {
+ my ($type, $name) = @$entry;
+ printf("%*s = ", $width, $name);
+ my $value = $self->{$name};
+ if (!defined($value)) {
+ print "undefined";
+ }
+ elsif ($type eq "lha_os") {
+ print "$lha_os{$value}";
+ }
+ elsif ($type =~ m/string/) {
+ print "$value";
+ }
+ else {
+ my $len = type_size($entry);
+ print "0x";
+ print_big_hex($len *2, $value);
+ }
+ print "\n";
+ }
+}
+
+sub checksum
+{
+ my ($buf_ref, $offset, $length) = @_;
+ my ($i, $sum);
+ $sum = 0;
+ for($i = 0; $i < $length; $i++) {
+ my $byte = unpack('C', substr($$buf_ref, $offset + $i, 1));
+ $sum = ($sum + $byte) %256;
+ }
+ return $sum;
+}
+
+sub decode_lha_header
+{
+ my ($buf_ref, $offset) = @_;
+ my $level = unpack('C',substr(${$buf_ref}, $offset + 20, 1));
+
+ my %self;
+ my ($struct, $bytes);
+ if ($level == 1) {
+ ($struct, $bytes)
+ = decode_struct($buf_ref, $offset, \@lha_level_1_header);
+ %self = %$struct;
+ if ($self{fixed} != 0x20) {
+ die "bad fixed value";
+ }
+ $self{total_size} = $self{header_size} + 2 + $self{skip_size};
+ if ($bytes != $self{header_size} +2) {
+ die "$bytes != $self{header_size} +2";
+ }
+ my $checksum = checksum($buf_ref, $offset +2, $self{header_size});
+ if ($checksum != $self{header_sum}) {
+ printf("WARN: Header bytes checksum to %02lx\n",
+ $checksum);
+ }
+ # If we are an award rom...
+ if ($self{os_id} eq ' ') {
+ @self{qw(zero total_checksum)} =
+ unpack('CC', substr($$buf_ref,
+ $offset + $self{total_size}, 2));
+ if ($self{zero} != 0) {
+ warn "Award ROM without trailing zero";
+ }
+ else {
+ $self{total_size}++;
+ }
+ my $checksum =
+ checksum($buf_ref, $offset, $self{total_size});
+ if ($self{total_checksum} != $checksum) {
+ printf("WARN: Image bytes checksum to %02lx\n",
+ $checksum);
+ }
+ else {
+ $self{total_size}++;
+ }
+ $self{rom_addr} = $self{dos_time};
+ $self{rom_flags} = $self{dos_date};
+ delete @self{qw(dos_time dos_date)};
+ }
+ }
+ else {
+ die "Unknown header type";
+ }
+ return \%self;
+}
+
+sub main
+{
+ my ($filename, $rom_length) = @_;
+ my $fd = new FileHandle;
+ if (!defined($rom_length)) {
+ my ($dev, $ino, $mode, $nlink, $uid, $gid,$rdev,$size,
+ $atime, $mtime, $ctime, $blksize, $blocks)
+ = stat($filename);
+ $rom_length = $size;
+ }
+ $fd->open("<$filename") or die "Cannot ope $filename";
+ my $data;
+ $fd->read($data, $rom_length);
+ $fd->close();
+
+ my $i;
+ for($i = 0; $i < $rom_length; $i++) {
+ my $sig = substr($data, $i, 5);
+ if (exists($lha_signatures{$sig})) {
+ my $start = $i -2;
+ my $header = decode_lha_header(\$data, $start);
+
+ my $length = $header->{total_size};
+ print "AT: $start - @{[$start + $length -1]}, $length bytes\n";
+ print_struct(\@lha_header, $header);
+ print "\n";
+
+ }
+ }
+}
+
+main(@ARGV);
--- /dev/null
+#
+# Makefile for Etherboot
+#
+# Most of the time you should edit Config
+#
+# Common options:
+# VERSION=v - Set the version string
+#
+# NS8390 options:
+# -DINCLUDE_NE - Include NE1000/NE2000 support
+# -DNE_SCAN=list - Probe for NE base address using list of
+# comma separated hex addresses
+# -DINCLUDE_3C503 - Include 3c503 support
+# -DT503_SHMEM - Use 3c503 shared memory mode (off by default)
+# -DINCLUDE_WD - Include Western Digital/SMC support
+# -DWD_DEFAULT_MEM- Default memory location for WD/SMC cards
+# -DCOMPEX_RL2000_FIX
+#
+# If you have a Compex RL2000 PCI 32-bit (11F6:1401),
+# and the bootrom hangs in "Probing...[NE*000/PCI]",
+# try enabling this fix... it worked for me :).
+# In the first packet write somehow it somehow doesn't
+# get back the expected data so it is stuck in a loop.
+# I didn't bother to investigate what or why because it works
+# when I interrupt the loop if it takes more then COMPEX_RL2000_TRIES.
+# The code will notify if it does a abort.
+# SomniOne - somnione@gmx.net
+#
+# 3C509 option:
+# -DINCLUDE_3C509 - Include 3c509 support
+#
+# 3C90X options:
+# -DINCLUDE_3C90X - Include 3c90x support
+# -DCFG_3C90X_PRESERVE_XCVR - Reset the transceiver type to the value it
+# had initially just before the loaded code is started.
+# -DCFG_3C90X_XCVR - Hardcode the tranceiver type Etherboot uses.
+# -DCFG_3C90X_BOOTROM_FIX - If you have a 3c905B with buggy ROM
+# interface, setting this option might "fix" it. Use
+# with caution and read the docs in 3c90x.txt!
+#
+# See the documentation file 3c90x.txt for more details.
+#
+# CS89X0 (optional) options:
+# -DINCLUDE_CS89X0- Include CS89x0 support
+# -DCS_SCAN=list - Probe for CS89x0 base address using list of
+# comma separated hex addresses; increasing the
+# address by one (0x300 -> 0x301) will force a
+# more aggressive probing algorithm. This might
+# be neccessary after a soft-reset of the NIC.
+#
+# LANCE options:
+# -DINCLUDE_NE2100- Include NE2100 support
+# -DINCLUDE_NI6510- Include NI6510 support
+#
+# SK_G16 options:
+# -DINCLUDE_SK_G16- Include SK_G16 support
+#
+# I82586 options:
+# -DINCLUDE_3C507 - Include 3c507 support
+# -DINCLUDE_NI5210- Include NI5210 support
+# -DINCLUDE_EXOS205-Include EXOS205 support
+#
+# SMC9000 options:
+# -DINCLUDE_SMC9000 - Include SMC9000 driver
+# -DSMC9000_SCAN=list - List of I/O addresses to probe
+#
+# TIARA (Fujitsu Etherstar) options:
+# -DINCLUDE_TIARA - Include Tiara support
+#
+# NI5010 options:
+# -DINCLUDE_NI5010 - Include NI5010 support
+#
+# TULIP options:
+# -DINCLUDE_TULIP - Include Tulip support
+# -DUSE_INTERNAL_BUFFER - receuve and transmit buffers within program
+# space, not below 0x10000, in case that region is used
+#
+# RTL8139 options:
+# -DINCLUDE_RTL8139 - Include RTL8139 support
+# -DUSE_INTERNAL_BUFFER - 8 kB receive buffer within program space,
+# not at 0x10000 - 8kB, in case that region is used
+#
+
+include Config
+
+GCC= gcc
+CPP= gcc -E
+VERSION= 4.6.12
+CFLAGS16+= -DVERSION=\"$(VERSION)\" -DRELOC=$(RELOCADDR)
+CFLAGS32+= -DVERSION=\"$(VERSION)\" -DRELOC=$(RELOCADDR) $(OLDGAS)
+LCONFIG+= -DRELOC=$(RELOCADDR)
+
+IDENT16= 'Etherboot/16 $(VERSION) (GPL) $(@F)'
+IDENT32= 'Etherboot/32 $(VERSION) (GPL) $(@F)'
+
+# Find out if we're using binutils 2.9.1 which uses a different syntax in some
+# places (most prominently in the opcode prefix area).
+OLDGAS:= $(shell $(AS) --version | grep -q '2\.9\.1' && echo -DGAS291)
+
+# Check the requested type of build (32, 16 or both families)
+ifeq ($(ETHERBOOT),16)
+BUILD_LIBS= $(BLIB16)
+BUILD_BINS= $(BINS16)
+endif
+ifeq ($(ETHERBOOT),32)
+BUILD_LIBS= $(BLIB32)
+BUILD_BINS= $(BINS32)
+endif
+ifeq ($(ETHERBOOT),both)
+BUILD_LIBS= $(BLIB16) $(BLIB32)
+BUILD_BINS= $(BINS16) $(BINS32)
+endif
+
+3C503FLAGS= -DINCLUDE_3C503 # -DT503_SHMEM
+# Note that the suffix to MAKEROM_ is the (mixed case) basename of the ROM file
+MAKEROM_3c503= -3
+3C507FLAGS= -DINCLUDE_3C507
+3C509FLAGS= -DINCLUDE_3C509
+3C529FLAGS= -DINCLUDE_3C529
+3C595FLAGS= -DINCLUDE_3C595
+3C90XFLAGS= -DINCLUDE_3C90X
+CS89X0FLAGS= -DINCLUDE_CS89X0
+EEPROFLAGS= -DINCLUDE_EEPRO
+EEPRO100FLAGS= -DINCLUDE_EEPRO100
+EPIC100FLAGS= -DINCLUDE_EPIC100
+EXOS205FLAGS= -DINCLUDE_EXOS205
+LANCEFLAGS= -DINCLUDE_LANCE # Lance/PCI!
+NE2100FLAGS= -DINCLUDE_NE2100
+NEFLAGS= -DINCLUDE_NE -DNE_SCAN=0x300,0x280,0x320,0x340,0x380
+NS8390FLAGS= -DINCLUDE_NS8390 # NE2000/PCI!
+NI5010FLAGS= -DINCLUDE_NI5010
+NI5210FLAGS= -DINCLUDE_NI5210
+NI6510FLAGS= -DINCLUDE_NI6510
+RTL8139FLAGS= -DINCLUDE_RTL8139
+SK_G16FLAGS= -DINCLUDE_SK_G16
+SMC9000FLAGS= -DINCLUDE_SMC9000
+TIARAFLAGS= -DINCLUDE_TIARA
+DEPCAFLAGS= -DINCLUDE_DEPCA # -DDEPCA_MODEL=DEPCA -DDEPCA_RAM_BASE=0xd0000
+TULIPFLAGS= -DINCLUDE_TULIP
+OTULIPFLAGS= -DINCLUDE_OTULIP
+VIA_RHINEFLAGS= -DINCLUDE_VIA_RHINE
+WDFLAGS= -DINCLUDE_WD -DWD_DEFAULT_MEM=0xCC000
+W89C840FLAGS= -DINCLUDE_W89C840
+
+# If you have not made any changes to the *.S files, AS86 need not be set.
+# (most people)
+# If you have made changes to the *.S files and you want to rebuild *loader.bin
+# and {floppy,com}load.bin and you have as86 from the ELKS Dev86 package (not
+# the one that normally comes with Linux) (not most people)
+#AS86= as86
+# If you have made changes to the *.S files and you want to rebuild *loader.bin
+# and {floppy,com}load.bin and you have nasm (not most people)
+#AS86= nasm
+
+# if your as has trouble with the data32 directive, uncomment this
+# but note that the premade start*.o will be larger than necessary because it
+# contains some routines which may not be used
+#AS_PSEUDOS= n
+
+SRCS= floppyload.S comload.S liloprefix.S loader.S start16.S start32.S serial.S startmpcc.S
+SRCS+= main.c pci.c osloader.c nfs.c misc.c ansiesc.c bootmenu.c config.c
+SRCS+= md5.c floppy.c
+
+# ROM loaders: LZ version (prefix Z), PCI header version (prefix P)
+ifndef AS86
+RLOADER= rloader.bin.pre
+PRLOADER= prloader.bin.pre
+RZLOADER= rzloader.bin.pre
+PRZLOADER= przloader.bin.pre
+FLOPPYLOAD= floppyload.bin.pre
+COMLOAD= comload.bin.pre
+LILOPREFIX= liloprefix.bin.pre
+else
+RLOADER= bin/rloader.bin
+PRLOADER= bin/prloader.bin
+RZLOADER= bin/rzloader.bin
+PRZLOADER= bin/przloader.bin
+FLOPPYLOAD= bin/floppyload.bin
+COMLOAD= bin/comload.bin
+LILOPREFIX= bin/liloprefix.bin
+endif
+
+ifeq ($(AS86),as86)
+LCPPFLAGS+= -DUSE_AS86
+LASFLAGS+= $(AS86FLAGS) -0
+LASBINARY:= -b
+endif
+ifeq ($(AS86),nasm)
+LCPPFLAGS+= -DUSE_NASM
+LASFLAGS+= $(NASMFLAGS) -fbin
+LASBINARY:= -o
+endif
+
+ifeq ($(AS_PSEUDOS),n)
+START16= start16.o.pre
+START32= start32.o.pre
+else
+START16= bin16/start16.o
+START32= bin32/startmpcc.o
+endif
+
+BOBJS16= bin16/main.o bin16/osloader.o bin16/misc.o bin16/bootmenu.o
+BOBJS16+= bin16/floppy.o bin16/timer.o
+BOBJS32= bin32/main.o bin32/osloader.o bin32/nfs.o bin32/misc.o
+BOBJS32+= bin32/ansiesc.o bin32/bootmenu.o bin32/md5.o bin32/floppy.o
+BOBJS32+= bin32/serial.o bin32/timer.o
+BLIB16= bin16/bootlib.a
+BLIB32= bin32/bootlib.a
+LIBS16= $(BLIB16) $(LIBC16)
+LIBS32= $(BLIB32) $(LIBC32) /usr/lib/gcc-lib/i386-redhat-linux/2.96/libgcc.a
+UTIL_LZHUF:= $(shell if [ -d ../contrib/compressor ]; then echo bin/lzhuf; fi)
+UTILS+= bin/makerom $(UTIL_LZHUF) bin/organon
+STDDEPS16= $(START16) $(BLIB16) $(UTILS)
+STDDEPS32= $(START32) $(BLIB32) $(UTILS)
+MAKEDEPS= Makefile Config Roms
+
+CHECKSIZE= { read d1; read d1 d2 d3 size d4; [ $$size -gt $(ROMLIMIT) ] &&\
+ { $(RM) $@; echo "ERROR: code size exceeds limit!"; exit 1; }; exit 0; }
+
+# Make sure that the relocation address is acceptable for all ROM sizes.
+# Setting it to 0x98000 leaves about 29kB of space for the Etherboot program.
+# The check is done based running 'size' on the binary, not ROM size, but
+# roughly this means a ROM of 16kB or a partially used ROM of 32kB,
+# remembering to compressed ROM images into account.
+# You may also set RELOCADDR to 0x88000 to avoid using 0x98000
+# because of other drivers (e.g. Disk On Chip). In that case, you may
+# only load 512kB of OS, or load in memory above 1MB.
+# Don't forget to choose an assembler because the loaders have to be rebuilt.
+ifndef RELOCADDR
+RELOCADDR=0x98000
+#RELOCADDR=0xe0000
+endif
+
+# Evaluate ROMLIMIT only once - it is constant during the make run.
+# Note that the 3K safety margin below is for the 1K extended BIOS data area
+# and for the Etherboot runtime stack. Under normal situations, 2K of stack
+# are rarely needed. If you experience strange behaviour in functions that use
+# many local variables or that call functions that do, check for stack overrun!
+# Make sure that the normal case needs no perl interpreter - if someone uses a
+# different RELOCADDR, then he has perl installed anyways (the shell cannot
+# deal with hex numbers, as test/eval don't support non-decimal integers).
+ifeq ($(RELOCADDR),0x98000)
+ROMLIMIT=29696
+else
+ROMLIMIT:=$(shell perl -e 'print 0x10000 - 3072 - ($(RELOCADDR) & 0xFFFF), "\n";')
+endif
+
+# Start of targets
+
+all: $(UTILS) $(BUILD_LIBS) allbins
+
+include Roms
+
+# We need allbins because $(BINS16) and $(BINS32) are not defined until
+# the Makefile fragment "Roms" is read.
+
+allbins: $(BUILD_BINS)
+
+# Common files
+
+$(BLIB16): $(BOBJS16)
+ $(AR16) rv $@ $(BOBJS16)
+ $(RANLIB16) $@
+
+$(BLIB32): $(BOBJS32)
+ $(AR32) rv $@ $(BOBJS32)
+ $(RANLIB32) $@
+
+bin16/main.o: main.c etherboot.h osdep.h nic.h
+bin32/main.o: main.c etherboot.h osdep.h nic.h
+
+bin16/osloader.o: osloader.c etherboot.h osdep.h
+bin32/osloader.o: osloader.c etherboot.h osdep.h
+
+# NFS currently makes no sense for Etherboot/16
+bin32/nfs.o: nfs.c etherboot.h osdep.h nic.h
+
+bin16/misc.o: misc.c etherboot.h osdep.h
+bin32/misc.o: misc.c etherboot.h osdep.h
+
+# ANSIESC is not supported for Etherboot/16
+bin32/ansiesc.o: ansiesc.c etherboot.h osdep.h
+
+bin16/bootmenu.o: bootmenu.c etherboot.h osdep.h
+bin32/bootmenu.o: bootmenu.c etherboot.h osdep.h
+
+# Password support is not available for Etherboot/16
+bin32/md5.o: md5.c etherboot.h osdep.h
+
+bin16/floppy.o: floppy.c etherboot.h osdep.h
+bin32/floppy.o: floppy.c etherboot.h osdep.h
+
+bin16/timer.o: timer.c timer.h etherboot.h osdep.h
+bin32/timer.o: timer.c timer.h etherboot.h osdep.h
+
+bin32/inthw.o: inthw.c
+
+# PCI support code (common to all PCI drivers)
+
+bin32/pci.o: pci.c pci.h
+
+# Do not add driver specific dependencies here unless it's something the
+# genrules.pl script *can't* deal with, i.e. if it is not C code.
+
+# Prepended loaders
+
+#ifndef AS86
+#$(RLOADER) $(RZLOADER) $(PRLOADER) $(PRZLOADER): $(MAKEDEPS)
+# @if [ $(RELOCADDR) != 0x98000 ]; then echo Non-standard RELOCADDR, must assemble $@; exit 1; fi
+# $(TOUCH) $@
+#else
+#bin/rloader.s: loader.S $(MAKEDEPS)
+# $(CPP) $(LCPPFLAGS) $(LCONFIG) -o $@ $<
+#
+#bin/rzloader.s: loader.S $(MAKEDEPS)
+# $(CPP) $(LCPPFLAGS) $(LCONFIG) -DZLOADER -o $@ $<
+#
+#bin/prloader.s: loader.S $(MAKEDEPS)
+# $(CPP) $(LCPPFLAGS) $(LCONFIG) -DPCI_PNP_HEADER -o $@ $<
+#
+#bin/przloader.s: loader.S $(MAKEDEPS)
+# $(CPP) $(LCPPFLAGS) $(LCONFIG) -DPCI_PNP_HEADER -DZLOADER -o $@ $<
+#endif
+
+# Floppy loader
+
+ifdef AS86
+bin/floppyload.s: floppyload.S $(MAKEDEPS)
+ $(CPP) $(LCPPFLAGS) -o $@ $<
+endif
+
+# COM loader
+
+ifdef AS86
+bin/comload.s: comload.S $(MAKEDEPS)
+ $(CPP) $(LCPPFLAGS) -o $@ $<
+endif
+
+# LILO prefix:
+
+ifdef AS86
+bin/liloprefix.s: liloprefix.S $(MAKEDEPS)
+ $(CPP) $(LCPPFLAGS) -o $@ $<
+endif
+
+# Utilities
+
+bin/makerom: makerom.c
+ $(GCC) -O2 -o $@ makerom.c
+
+bin/organon: organon.c
+ $(GCC) -o $@ organon.c
+
+bin/lzhuf: ../contrib/compressor/lzhuf.c
+ $(GCC) -O2 -DENCODE -DDECODE -DMAIN -DVERBOSE -o $@ $<
+
+# Roms file
+
+Roms: NIC genrules.pl
+ @chmod +x genrules.pl
+ ./genrules.pl NIC > $@
+
+# Pattern Rules
+
+# general rules for compiling/assembling source files
+bin16/%.o: %.c $(MAKEDEPS)
+ $(CC16) $(CFLAGS16) -o $@ -c $<
+
+bin32/%.o: %.c $(MAKEDEPS)
+ $(CC32) $(CFLAGS32) -o $@ -c $<
+
+bin16/%.o: %.S $(MAKEDEPS)
+ $(CC16) $(CFLAGS16) $(ASFLAGS16) -c -o $@ $<
+
+bin32/%.o: %.S $(MAKEDEPS)
+ $(CPP) $(CFLAGS32) $< | $(AS) $(ASFLAGS32) -o $@
+
+# general rule for .bin (plain binary loader code), may be overridden
+ifdef AS86
+bin/%.bin: bin/%.s
+ $(AS86) $(LASFLAGS) $(LASBINARY) $@ $<
+endif
+
+# general rule for .huf (compressed binary code), may be overridden
+%.huf: %.img
+ bin/lzhuf e $< $@
+
+# general rules for normal/compressed ROM images, may be overridden
+bin16/%.rom: bin16/%.img $(RLOADER)
+ cat $(RLOADER) $< > $@
+ bin/makerom $(MAKEROM_$*) -i$(IDENT16) $@
+
+bin32/%.rom: bin32/%.img $(RLOADER)
+ cat $(RLOADER) $< > $@
+ bin/makerom $(MAKEROM_$*) -i$(IDENT32) $@
+
+bin16/%.lzrom: bin16/%.huf $(RZLOADER)
+ cat $(RZLOADER) $< > $@
+ bin/makerom $(MAKEROM_$*) -i$(IDENT16) $@
+
+bin32/%.lzrom: bin32/%.huf $(RZLOADER)
+ cat $(RZLOADER) $< > $@
+ bin/makerom $(MAKEROM_$*) -i$(IDENT32) $@
+
+# rules to write the .rom/.lzrom image onto a blank floppy
+# You must give the directory name, e.g. use bin32/rtl8139.lzfd0 as the target.
+%.fd0: %.rom $(FLOPPYLOAD)
+ cat $(FLOPPYLOAD) $< > /dev/fd0
+
+%.lzfd0: %.lzrom $(FLOPPYLOAD)
+ cat $(FLOPPYLOAD) $< > /dev/fd0
+
+# rules to generate a .com executable
+# You must give the directory name, e.g. use bin32/rtl8139.com as the target.
+%.com: %.lzrom $(COMLOAD)
+ cat $(COMLOAD) $< > $@
+
+# rules to make a floppy image (padding to fill an even number of cylinders).
+# VMware reports floppy image read errors if it cannot read ahead 36 sectors,
+# probably because the floppyload.S code reads up to that number of sectors in
+# a single request. Not that 18k matters much these days...
+# You must give the directory name, e.g. use bin32/rtl8139.fdimg as the target.
+%.fdimg: %.rom $(FLOPPYLOAD)
+ cat $(FLOPPYLOAD) $< > $@.x
+ dd if=$@.x of=$@ bs=36k conv=sync 2> /dev/null
+ $(RM) $@.x
+
+%.lzfdimg: %.lzrom $(FLOPPYLOAD)
+ cat $(FLOPPYLOAD) $< > $@.x
+ dd if=$@.x of=$@ bs=36k conv=sync 2> /dev/null
+ $(RM) $@.x
+
+# rules to make a LILO-bootable image
+%.lilo: %.rom $(LILOPREFIX)
+ cat $(LILOPREFIX) $< /dev/zero | head -c 64k > $@
+
+%.lzlilo: %.lzrom $(LILOPREFIX)
+ cat $(LILOPREFIX) $< /dev/zero | head -c 64k > $@
+
+# Housekeeping
+
+# To make sure that this actually builds a start32.o.pre with all options set,
+# you have to make sure that -DFLOPPY -DANSIESC -DCONSOLE_DUAL are in CFLAGS32.
+precompiled: bin/rloader.bin bin/rzloader.bin bin/prloader.bin bin/przloader.bin bin/floppyload.bin bin/comload.bin bin16/start16.o bin32/start32.o bin/liloprefix.bin
+ cp -p bin/rloader.bin rloader.bin.pre
+ cp -p bin/rzloader.bin rzloader.bin.pre
+ cp -p bin/prloader.bin prloader.bin.pre
+ cp -p bin/przloader.bin przloader.bin.pre
+ cp -p bin/floppyload.bin floppyload.bin.pre
+ cp -p bin/comload.bin comload.bin.pre
+ cp -p bin16/start16.o start16.o.pre
+ cp -p bin32/start32.o start32.o.pre
+ cp -p bin/liloprefix.bin liloprefix.bin.pre
+
+clean:
+ $(RM) $(UTILS) bin/*.s bin/*.bin
+ $(RM) $(BLIB16) $(BLIB32)
+ $(RM) bin16/*.o bin32/*.o bin16/*.tmp bin32/*.tmp
+ $(RM) bin16/*.img bin32/*.img bin16/*.huf bin32/*.huf
+ $(RM) bin16/*.rom bin32/*.rom bin16/*.lzrom bin32/*.lzrom
+ $(RM) bin16/*.com bin32/*.com
+ $(RM) bin16/*.fdimg bin32/*.fdimg bin16/*.lzfdimg bin32/*.lzfdimg
+ $(RM) bin16/*.lilo bin32/*.lilo bin16/*.lzlilo bin32/*.lzlilo
+ $(RM) bin32/*.hex
+ $(RM) bin32/*.asm
+ $(RM) bin32/*.map
+
+tarball:
+ (echo -n $(VERSION) ''; date -u +'%Y-%m-%d') > ../VERSION
+ (cd ..; tar cf /tmp/mpccboot-$(VERSION).tar --exclude CVS mpccboot)
+ bzip2 -9 < /tmp/mpccboot-$(VERSION).tar > /tmp/mpccboot-$(VERSION).tar.bz2
+ gzip -9 < /tmp/mpccboot-$(VERSION).tar > /tmp/mpccboot-$(VERSION).tar.gz
+
+version:
+ @echo $(VERSION)
--- /dev/null
+/**************************************************************************
+ETHERBOOT - BOOTP/TFTP Bootstrap Program
+
+Author: Martin Renters
+ Date: Dec/93
+
+Literature dealing with the network protocols:
+ ARP - RFC826
+ RARP - RFC903
+ UDP - RFC768
+ BOOTP - RFC951, RFC2132 (vendor extensions)
+ DHCP - RFC2131, RFC2132 (options)
+ TFTP - RFC1350, RFC2347 (options), RFC2348 (blocksize), RFC2349 (tsize)
+ RPC - RFC1831, RFC1832 (XDR), RFC1833 (rpcbind/portmapper)
+ NFS - RFC1094, RFC1813 (v3, useful for clarifications, not implemented)
+
+**************************************************************************/
+
+/* #define MDEBUG */
+
+#include "etherboot.h"
+#include "nic.h"
+
+int jmp_bootmenu[10];
+
+struct arptable_t arptable[MAX_ARP];
+
+const char *kernel;
+char kernel_buf[128];
+struct rom_info rom;
+
+#ifdef IMAGE_MENU
+static char *imagelist[RFC1533_VENDOR_NUMOFIMG];
+static int useimagemenu;
+int menutmo,menudefault;
+unsigned char *defparams = NULL;
+int defparams_max = 0;
+#endif
+#ifdef MOTD
+char *motd[RFC1533_VENDOR_NUMOFMOTD];
+#endif
+#ifdef IMAGE_FREEBSD
+int freebsd_howto = 0;
+#endif
+int vendorext_isvalid;
+char config_buffer[TFTP_MAX_PACKET+1]; /* +1 for null byte */
+unsigned long netmask;
+char *hostname = "";
+int hostnamelen = 0;
+#if defined(ETHERBOOT16) || defined(INTERNAL_BOOTP_DATA)
+struct bootpd_t bootp_data;
+#endif
+unsigned long xid;
+unsigned char *end_of_rfc1533 = NULL;
+#ifndef NO_DHCP_SUPPORT
+int dhcp_reply;
+in_addr dhcp_server = { 0L };
+in_addr dhcp_addr = { 0L };
+#endif /* NO_DHCP_SUPPORT */
+
+unsigned char vendorext_magic[] = {0xE4,0x45,0x74,0x68}; /* äEth */
+#ifdef NO_DHCP_SUPPORT
+char rfc1533_cookie[5] = { RFC1533_COOKIE, RFC1533_END };
+#else
+char rfc1533_cookie[] = { RFC1533_COOKIE};
+char rfc1533_end[]={RFC1533_END };
+static const char dhcpdiscover[]={
+ RFC2132_MSG_TYPE,1,DHCPDISCOVER,
+ RFC2132_MAX_SIZE,2, /* request as much as we can */
+ sizeof(struct bootpd_t) / 256, sizeof(struct bootpd_t) % 256,
+ RFC2132_PARAM_LIST,4,RFC1533_NETMASK,RFC1533_GATEWAY,
+ RFC1533_HOSTNAME
+ };
+static const char dhcprequest []={
+ RFC2132_MSG_TYPE,1,DHCPREQUEST,
+ RFC2132_SRV_ID,4,0,0,0,0,
+ RFC2132_REQ_ADDR,4,0,0,0,0,
+ RFC2132_MAX_SIZE,2, /* request as much as we can */
+ sizeof(struct bootpd_t) / 256, sizeof(struct bootpd_t) % 256,
+ /* request parameters */
+ RFC2132_PARAM_LIST,
+#ifdef IMAGE_FREEBSD
+ /* 4 standard + 6 vendortags + 8 motd + 16 menu items */
+ 4 + 6 + 8 + 16,
+#else
+ /* 4 standard + 5 vendortags + 8 motd + 16 menu items */
+ 4 + 5 + 8 + 16,
+#endif
+ /* Standard parameters */
+ RFC1533_NETMASK, RFC1533_GATEWAY,
+ RFC1533_HOSTNAME,
+ RFC1533_ROOTPATH, /* only passed to the booted image */
+ /* Etherboot vendortags */
+ RFC1533_VENDOR_MAGIC,
+ RFC1533_VENDOR_ADDPARM,
+ RFC1533_VENDOR_ETHDEV,
+#ifdef IMAGE_FREEBSD
+ RFC1533_VENDOR_HOWTO,
+#endif
+ RFC1533_VENDOR_MNUOPTS, RFC1533_VENDOR_SELECTION,
+ /* 8 MOTD entries */
+ RFC1533_VENDOR_MOTD,
+ RFC1533_VENDOR_MOTD+1,
+ RFC1533_VENDOR_MOTD+2,
+ RFC1533_VENDOR_MOTD+3,
+ RFC1533_VENDOR_MOTD+4,
+ RFC1533_VENDOR_MOTD+5,
+ RFC1533_VENDOR_MOTD+6,
+ RFC1533_VENDOR_MOTD+7,
+ /* 16 image entries */
+ RFC1533_VENDOR_IMG,
+ RFC1533_VENDOR_IMG+1,
+ RFC1533_VENDOR_IMG+2,
+ RFC1533_VENDOR_IMG+3,
+ RFC1533_VENDOR_IMG+4,
+ RFC1533_VENDOR_IMG+5,
+ RFC1533_VENDOR_IMG+6,
+ RFC1533_VENDOR_IMG+7,
+ RFC1533_VENDOR_IMG+8,
+ RFC1533_VENDOR_IMG+9,
+ RFC1533_VENDOR_IMG+10,
+ RFC1533_VENDOR_IMG+11,
+ RFC1533_VENDOR_IMG+12,
+ RFC1533_VENDOR_IMG+13,
+ RFC1533_VENDOR_IMG+14,
+ RFC1533_VENDOR_IMG+15,
+ };
+
+#endif /* NO_DHCP_SUPPORT */
+static const char broadcast[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+
+/**************************************************************************
+MAIN - Kick off routine
+**************************************************************************/
+int main(void)
+{
+ char *p;
+ static int card_retries = 0;
+ int i;
+
+ for (p=_edata; p<_end; p++)
+ *p = 0; /* Zero BSS */
+
+#ifdef CONSOLE_SERIAL
+ (void)serial_init();
+#endif
+
+#ifdef DELIMITERLINES
+ for (i=0; i<80; i++) putchar('=');
+#endif
+
+#ifdef ETHERBOOT32
+ rom = *(struct rom_info *)ROM_INFO_LOCATION;
+ printf("ROM segment %#x length %#x reloc %#x\n", rom.rom_segment,
+ rom.rom_length << 1, ((unsigned long)_start) >> 4);
+#endif
+#ifdef ETHERBOOT16
+ fmemcpy(&rom, (Address)ROM_INFO_LOCATION, sizeof(rom));
+ printf("ROM segment %#x length %#x\n", rom.rom_segment,
+ rom.rom_length << 1);
+#endif
+#ifdef ASK_BOOT
+ while (1) {
+ int c;
+ unsigned long time;
+ printf(ASK_PROMPT);
+#if ASK_BOOT > 0
+ for (time = currticks() + ASK_BOOT*TICKS_PER_SEC; !iskey(); )
+ if (currticks() > time) {
+ c = ANS_DEFAULT;
+ goto done;
+ }
+#endif
+ c = getchar();
+ if ((c >= 'a') && (c <= 'z')) c &= 0x5F;
+ if (c == '\n') c = ANS_DEFAULT;
+done:
+ if ((c >= ' ') && (c <= '~')) putchar(c);
+ putchar('\n');
+ if (c == ANS_LOCAL)
+ exit(0);
+ if (c == ANS_NETWORK)
+ break;
+ }
+#endif
+#if (TRY_FLOPPY_FIRST > 0) && defined(FLOPPY)
+ disk_init();
+ printf("Trying floppy");
+ for (i = TRY_FLOPPY_FIRST; i-- > 0; ) {
+ putchar('.');
+ if (disk_read(0, 0, 0, 0, ((char *) FLOPPY_BOOT_LOCATION)) != 0x8000) {
+ printf("using floppy\n");
+ exit(0);
+ }
+ }
+ printf("no floppy\n");
+#endif /* TRY_FLOPPY_FIRST && FLOPPY */
+ print_config();
+ gateA20_set();
+#ifdef EMERGENCYDISKBOOT
+ if (!eth_probe()) {
+ printf("No adapter found\n");
+ exit(0);
+ }
+#else
+ while (!eth_probe()) {
+ printf("No adapter found");
+ if (!setjmp(jmp_bootmenu))
+ rfc951_sleep(++card_retries);
+ }
+#endif
+ kernel = DEFAULT_BOOTFILE;
+ while (1) {
+ if ((i = setjmp(jmp_bootmenu)) != 0) {
+#if defined(ANSIESC) && defined(CONSOLE_CRT)
+ ansi_reset();
+#endif
+ bootmenu(--i);
+ } else {
+ load();
+ }
+#if defined(ANSIESC) && defined(CONSOLE_CRT)
+ ansi_reset();
+#endif
+ }
+}
+
+/**************************************************************************
+LOADKERNEL - Try to load kernel image
+**************************************************************************/
+#ifndef FLOPPY
+#define loadkernel(s) download((s),downloadkernel)
+#else
+static int loadkernel(const char *fname)
+{
+ if (!memcmp(fname,"/dev/",5) && fname[6] == 'd') {
+ int dev, part = 0;
+ if (fname[5] == 'f') {
+ if ((dev = fname[7] - '0') < 0 || dev > 3)
+ goto nodisk; }
+ else if (fname[5] == 'h' || fname[5] == 's') {
+ if ((dev = 0x80 + fname[7] - 'a') < 0x80 || dev > 0x83)
+ goto nodisk;
+ if (fname[8]) {
+ part = fname[8] - '0';
+ if (fname[9])
+ part = 10*part + fname[9] - '0'; }
+ /* bootdisk cannot cope with more than eight partitions */
+ if (part < 0 || part > 8)
+ goto nodisk; }
+ else
+ goto nodisk;
+ return(bootdisk(dev,part)); }
+nodisk:
+ return download(fname, downloadkernel);
+}
+#endif
+
+/**************************************************************************
+LOAD - Try to get booted
+**************************************************************************/
+void load()
+{
+ static int bootp_completed = 0;
+
+ /* Find a server to get BOOTP reply from */
+ if (!bootp_completed ||
+ !arptable[ARP_CLIENT].ipaddr.s_addr || !arptable[ARP_SERVER].ipaddr.s_addr) {
+retry:
+ bootp_completed = 0;
+#ifdef RARP_NOT_BOOTP
+ printf("Searching for server (RARP)...\n");
+#else
+#ifndef NO_DHCP_SUPPORT
+ printf("Searching for server (DHCP)...\n");
+#else
+ printf("Searching for server (BOOTP)...\n");
+#endif
+#endif
+
+#ifdef RARP_NOT_BOOTP
+ if (!rarp()) {
+#else
+ if (!bootp()) {
+#endif
+ printf("No Server found\n");
+#ifdef EMERGENCYDISKBOOT
+ exit(0);
+#else
+ goto retry;
+#endif
+ }
+ bootp_completed++;
+ }
+ printf("Me: %I, Server: %I",
+ arptable[ARP_CLIENT].ipaddr.s_addr,
+ arptable[ARP_SERVER].ipaddr.s_addr);
+ if (BOOTP_DATA_ADDR->bootp_reply.bp_giaddr.s_addr)
+ printf(", Relay: %I",
+ BOOTP_DATA_ADDR->bootp_reply.bp_giaddr.s_addr);
+ if (arptable[ARP_GATEWAY].ipaddr.s_addr)
+ printf(", Gateway %I", arptable[ARP_GATEWAY].ipaddr.s_addr);
+ putchar('\n');
+
+#ifdef MDEBUG
+ printf("\n=>>"); getchar();
+#endif
+
+#ifdef MOTD
+ if (vendorext_isvalid)
+ show_motd();
+#endif
+ /* Now use TFTP to load file */
+#ifdef IMAGE_MENU
+ if (vendorext_isvalid && useimagemenu) {
+ selectImage(imagelist);
+ bootp_completed = 0;
+ }
+#endif
+#ifdef DOWNLOAD_PROTO_NFS
+ rpc_init();
+#endif
+ for (;;) {
+ printf("Loading %s ",kernel);
+ while (!loadkernel(kernel)) {
+ printf("Unable to load file.\n");
+ sleep(2); /* lay off server for a while */
+ }
+ }
+}
+
+/**************************************************************************
+DEFAULT_NETMASK - Return default netmask for IP address
+**************************************************************************/
+static inline unsigned long default_netmask(void)
+{
+ int net = ntohl(arptable[ARP_CLIENT].ipaddr.s_addr) >> 24;
+ if (net <= 127)
+ return(htonl(0xff000000));
+ else if (net < 192)
+ return(htonl(0xffff0000));
+ else
+ return(htonl(0xffffff00));
+}
+
+/**************************************************************************
+UDP_TRANSMIT - Send a UDP datagram
+**************************************************************************/
+int udp_transmit(unsigned long destip, unsigned int srcsock,
+ unsigned int destsock, int len, const void *buf)
+{
+ struct iphdr *ip;
+ struct udphdr *udp;
+ struct arprequest arpreq;
+ int arpentry, i;
+ int retry;
+
+ ip = (struct iphdr *)buf;
+ udp = (struct udphdr *)((long)buf + sizeof(struct iphdr));
+ ip->verhdrlen = 0x45;
+ ip->service = 0;
+ ip->len = htons(len);
+ ip->ident = 0;
+ ip->frags = 0;
+ ip->ttl = 60;
+ ip->protocol = IP_UDP;
+ ip->chksum = 0;
+ ip->src.s_addr = arptable[ARP_CLIENT].ipaddr.s_addr;
+ ip->dest.s_addr = destip;
+ ip->chksum = ipchksum((unsigned short *)buf, sizeof(struct iphdr));
+ udp->src = htons(srcsock);
+ udp->dest = htons(destsock);
+ udp->len = htons(len - sizeof(struct iphdr));
+ udp->chksum = 0;
+ if (destip == IP_BROADCAST) {
+ eth_transmit(broadcast, IP, len, buf);
+ } else {
+ if (((destip & netmask) !=
+ (arptable[ARP_CLIENT].ipaddr.s_addr & netmask)) &&
+ arptable[ARP_GATEWAY].ipaddr.s_addr)
+ destip = arptable[ARP_GATEWAY].ipaddr.s_addr;
+ for(arpentry = 0; arpentry<MAX_ARP; arpentry++)
+ if (arptable[arpentry].ipaddr.s_addr == destip) break;
+ if (arpentry == MAX_ARP) {
+ printf("%I is not in my arp table!\n", destip);
+ return(0);
+ }
+ for (i = 0; i<ETHER_ADDR_SIZE; i++)
+ if (arptable[arpentry].node[i]) break;
+ if (i == ETHER_ADDR_SIZE) { /* Need to do arp request */
+ arpreq.hwtype = htons(1);
+ arpreq.protocol = htons(IP);
+ arpreq.hwlen = ETHER_ADDR_SIZE;
+ arpreq.protolen = 4;
+ arpreq.opcode = htons(ARP_REQUEST);
+ memcpy(arpreq.shwaddr, arptable[ARP_CLIENT].node, ETHER_ADDR_SIZE);
+ memcpy(arpreq.sipaddr, &arptable[ARP_CLIENT].ipaddr, sizeof(in_addr));
+ memset(arpreq.thwaddr, 0, ETHER_ADDR_SIZE);
+ memcpy(arpreq.tipaddr, &destip, sizeof(in_addr));
+ for (retry = 1; retry <= MAX_ARP_RETRIES; retry++) {
+ eth_transmit(broadcast, ARP, sizeof(arpreq),
+ &arpreq);
+ if (await_reply(AWAIT_ARP, arpentry,
+ arpreq.tipaddr, TIMEOUT)) goto xmit;
+ rfc951_sleep(retry);
+ /* We have slept for a while - the packet may
+ * have arrived by now. If not, we have at
+ * least some room in the Rx buffer for the
+ * next reply. */
+ if (await_reply(AWAIT_ARP, arpentry,
+ arpreq.tipaddr, 0)) goto xmit;
+ }
+ return(0);
+ }
+xmit:
+ eth_transmit(arptable[arpentry].node, IP, len, buf);
+ }
+ return(1);
+}
+
+/**************************************************************************
+DOWNLOADKERNEL - Try to load file
+**************************************************************************/
+int downloadkernel(data, block, len, eof)
+ unsigned char *data;
+ int block, len, eof;
+{
+#ifdef SIZEINDICATOR
+ static int rlen = 0;
+
+ if (!(block % 4) || eof) {
+ int size;
+ size = ((block-1) * rlen + len) / 1024;
+
+ putchar('\b');
+ putchar('\b');
+ putchar('\b');
+ putchar('\b');
+
+ putchar('0' + (size/1000)%10);
+ putchar('0' + (size/100)%10);
+ putchar('0' + (size/10)%10);
+ putchar('0' + (size/1)%10);
+ }
+#endif
+ if (block == 1)
+ {
+#ifdef SIZEINDICATOR
+ rlen=len;
+#endif
+ if (!eof && (
+#ifdef TAGGED_IMAGE
+ *((unsigned long *)data) == 0x1B031336L ||
+#endif
+#ifdef ELF_IMAGE
+ *((unsigned long *)data) == 0x464C457FL ||
+#endif
+#ifdef AOUT_IMAGE
+ *((unsigned short *)data) == 0x010BL ||
+#endif
+ ((unsigned short *)data)[255] == 0xAA55))
+ {
+ ;
+ }
+ else if (eof)
+ {
+ memcpy(config_buffer, data, len);
+ config_buffer[len] = 0;
+ return (1); /* done */
+ }
+ else
+ {
+ printf("error: not a tagged image\n");
+ return(0); /* error */
+ }
+ }
+ if (len != 0) {
+ if (!os_download(block, data, len))
+ return(0); /* error */
+ }
+ if (eof) {
+ os_download(block+1, data, 0); /* does not return */
+ return(0); /* error */
+ }
+ return(-1); /* there is more data */
+}
+
+#ifdef DOWNLOAD_PROTO_TFTP
+/**************************************************************************
+TFTP - Download extended BOOTP data, or kernel image
+**************************************************************************/
+int tftp(const char *name, int (*fnc)(unsigned char *, int, int, int))
+{
+ int retry = 0;
+ static unsigned short iport = 2000;
+ unsigned short oport;
+ unsigned short len, block = 0, prevblock = 0;
+ int bcounter = 0;
+ struct tftp_t *tr;
+ struct tftp_t tp;
+ int rc;
+ int packetsize = TFTP_DEFAULTSIZE_PACKET;
+
+ /* Clear out the Rx queue first. It contains nothing of interest,
+ * except possibly ARP requests from the DHCP/TFTP server. We use
+ * polling throughout Etherboot, so some time may have passed since we
+ * last polled the receive queue, which may now be filled with
+ * broadcast packets. This will cause the reply to the packets we are
+ * about to send to be lost immediately. Not very clever. */
+ await_reply(AWAIT_QDRAIN, 0, NULL, 0);
+
+ tp.opcode = htons(TFTP_RRQ);
+ len = (sprintf((char *)tp.u.rrq, "%s%coctet%cblksize%c%d",
+ name, 0, 0, 0, TFTP_MAX_PACKET) - ((char *)&tp)) + 1;
+ if (!udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr, ++iport,
+ TFTP_PORT, len, &tp))
+ return (0);
+ for (;;)
+ {
+#ifdef CONGESTED
+ if (!await_reply(AWAIT_TFTP, iport, NULL, (block ? TFTP_REXMT : TIMEOUT)))
+#else
+ if (!await_reply(AWAIT_TFTP, iport, NULL, TIMEOUT))
+#endif
+ {
+ if (!block && retry++ < MAX_TFTP_RETRIES)
+ { /* maybe initial request was lost */
+ rfc951_sleep(retry);
+ if (!udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr,
+ ++iport, TFTP_PORT, len, &tp))
+ return (0);
+ continue;
+ }
+#ifdef CONGESTED
+ if (block && ((retry += TFTP_REXMT) < TFTP_TIMEOUT))
+ { /* we resend our last ack */
+#ifdef MDEBUG
+ printf("<REXMT>\n");
+#endif
+ udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr,
+ iport, oport,
+ TFTP_MIN_PACKET, &tp);
+ continue;
+ }
+#endif
+ break; /* timeout */
+ }
+ tr = (struct tftp_t *)&nic.packet[ETHER_HDR_SIZE];
+ if (tr->opcode == ntohs(TFTP_ERROR))
+ {
+ printf("TFTP error %d (%s)\n",
+ ntohs(tr->u.err.errcode),
+ tr->u.err.errmsg);
+ break;
+ }
+
+ if (tr->opcode == ntohs(TFTP_OACK)) {
+ char *p = tr->u.oack.data, *e;
+
+ if (prevblock) /* shouldn't happen */
+ continue; /* ignore it */
+ len = ntohs(tr->udp.len) - sizeof(struct udphdr) - 2;
+ if (len > TFTP_MAX_PACKET)
+ goto noak;
+ e = p + len;
+ while (*p != '\000' && p < e) {
+ if (!strcasecmp("blksize", p)) {
+ p += 8;
+ if ((packetsize = getdec(&p)) <
+ TFTP_DEFAULTSIZE_PACKET)
+ goto noak;
+ while (p < e && *p) p++;
+ if (p < e)
+ p++;
+ }
+ else {
+ noak:
+ tp.opcode = htons(TFTP_ERROR);
+ tp.u.err.errcode = 8;
+ len = (sprintf((char *)tp.u.err.errmsg,
+ "RFC1782 error")
+ - ((char *)&tp)) + 1;
+ udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr,
+ iport, ntohs(tr->udp.src),
+ len, &tp);
+ return (0);
+ }
+ }
+ if (p > e)
+ goto noak;
+ block = tp.u.ack.block = 0; /* this ensures, that */
+ /* the packet does not get */
+ /* processed as data! */
+ }
+ else if (tr->opcode == ntohs(TFTP_DATA)) {
+ len = ntohs(tr->udp.len) - sizeof(struct udphdr) - 4;
+ if (len > packetsize) /* shouldn't happen */
+ continue; /* ignore it */
+ block = ntohs(tp.u.ack.block = tr->u.data.block); }
+ else /* neither TFTP_OACK nor TFTP_DATA */
+ break;
+
+ if ((block || bcounter) && (block != prevblock+1)) {
+ /* Block order should be continuous */
+ tp.u.ack.block = htons(block = prevblock);
+ }
+ tp.opcode = htons(TFTP_ACK);
+ oport = ntohs(tr->udp.src);
+ udp_transmit(arptable[ARP_SERVER].ipaddr.s_addr, iport,
+ oport, TFTP_MIN_PACKET, &tp); /* ack */
+ if ((unsigned short)(block-prevblock) != 1) {
+ /* Retransmission or OACK, don't process via callback
+ * and don't change the value of prevblock. */
+ continue;
+ }
+ prevblock = block;
+ retry = 0; /* It's the right place to zero the timer? */
+ if ((rc = fnc(tr->u.data.download,
+ ++bcounter, len, len < packetsize)) >= 0)
+ return(rc);
+ if (len < packetsize) /* End of data */
+ return (1);
+ }
+ return (0);
+}
+#endif /* DOWNLOAD_PROTO_TFTP */
+
+#ifdef RARP_NOT_BOOTP
+/**************************************************************************
+RARP - Get my IP address and load information
+**************************************************************************/
+int rarp()
+{
+ int retry;
+
+ /* arp and rarp requests share the same packet structure. */
+ struct arprequest rarpreq;
+
+ memset(&rarpreq, 0, sizeof(rarpreq));
+
+ rarpreq.hwtype = htons(1);
+ rarpreq.protocol = htons(IP);
+ rarpreq.hwlen = ETHER_ADDR_SIZE;
+ rarpreq.protolen = 4;
+ rarpreq.opcode = htons(RARP_REQUEST);
+ memcpy(&rarpreq.shwaddr, arptable[ARP_CLIENT].node, ETHER_ADDR_SIZE);
+ /* sipaddr is already zeroed out */
+ memcpy(&rarpreq.thwaddr, arptable[ARP_CLIENT].node, ETHER_ADDR_SIZE);
+ /* tipaddr is already zeroed out */
+
+ for (retry = 0; retry < MAX_ARP_RETRIES; rfc951_sleep(++retry)) {
+ eth_transmit(broadcast, RARP, sizeof(rarpreq), &rarpreq);
+
+ if (await_reply(AWAIT_RARP, 0, rarpreq.shwaddr, TIMEOUT))
+ break;
+ }
+
+ if (retry < MAX_ARP_RETRIES) {
+ sprintf(kernel = kernel_buf, "/tftpboot/kernel.%I", arptable[ARP_CLIENT].ipaddr);
+
+ return (1);
+ }
+ return (0);
+}
+
+#else
+
+/**************************************************************************
+BOOTP - Get my IP address and load information
+**************************************************************************/
+int bootp()
+{
+ int retry;
+#ifndef NO_DHCP_SUPPORT
+ int retry1;
+#endif /* NO_DHCP_SUPPORT */
+ struct bootp_t bp;
+ unsigned long starttime;
+#ifdef T509HACK
+ int flag;
+
+ flag = 1;
+#endif
+ memset(&bp, 0, sizeof(struct bootp_t));
+ bp.bp_op = BOOTP_REQUEST;
+ bp.bp_htype = 1;
+ bp.bp_hlen = ETHER_ADDR_SIZE;
+ bp.bp_xid = xid = starttime = currticks();
+ memcpy(bp.bp_hwaddr, arptable[ARP_CLIENT].node, ETHER_ADDR_SIZE);
+#ifdef NO_DHCP_SUPPORT
+ memcpy(bp.bp_vend, rfc1533_cookie, 5); /* request RFC-style options */
+#else
+ memcpy(bp.bp_vend, rfc1533_cookie, sizeof rfc1533_cookie); /* request RFC-style options */
+ memcpy(bp.bp_vend+sizeof rfc1533_cookie, dhcpdiscover, sizeof dhcpdiscover);
+ memcpy(bp.bp_vend+sizeof rfc1533_cookie +sizeof dhcpdiscover, rfc1533_end, sizeof rfc1533_end);
+#endif /* NO_DHCP_SUPPORT */
+
+ for (retry = 0; retry < MAX_BOOTP_RETRIES; ) {
+
+ /* Clear out the Rx queue first. It contains nothing of
+ * interest, except possibly ARP requests from the DHCP/TFTP
+ * server. We use polling throughout Etherboot, so some time
+ * may have passed since we last polled the receive queue,
+ * which may now be filled with broadcast packets. This will
+ * cause the reply to the packets we are about to send to be
+ * lost immediately. Not very clever. */
+ await_reply(AWAIT_QDRAIN, 0, NULL, 0);
+
+ udp_transmit(IP_BROADCAST, BOOTP_CLIENT, BOOTP_SERVER,
+ sizeof(struct bootp_t), &bp);
+#ifdef T509HACK
+ if (flag) {
+ flag--;
+ } else {
+ if (await_reply(AWAIT_BOOTP, 0, NULL, TIMEOUT))
+ return(1);
+ rfc951_sleep(++retry);
+
+ }
+#else
+#ifdef NO_DHCP_SUPPORT
+ if (await_reply(AWAIT_BOOTP, 0, NULL, TIMEOUT))
+#else
+ if (await_reply(AWAIT_BOOTP, 0, NULL, TIMEOUT)){
+ if (dhcp_reply==DHCPOFFER){
+ dhcp_reply=0;
+ memcpy(bp.bp_vend, rfc1533_cookie, sizeof rfc1533_cookie);
+ memcpy(bp.bp_vend+sizeof rfc1533_cookie, dhcprequest, sizeof dhcprequest);
+ memcpy(bp.bp_vend+sizeof rfc1533_cookie +sizeof dhcprequest, rfc1533_end, sizeof rfc1533_end);
+ memcpy(bp.bp_vend+9, &dhcp_server, sizeof(in_addr));
+ memcpy(bp.bp_vend+15, &dhcp_addr, sizeof(in_addr));
+ for (retry1 = 0; retry1 < MAX_BOOTP_RETRIES;) {
+ udp_transmit(IP_BROADCAST, BOOTP_CLIENT, BOOTP_SERVER,
+ sizeof(struct bootp_t), &bp);
+ dhcp_reply=0;
+ if (await_reply(AWAIT_BOOTP, 0, NULL, TIMEOUT))
+ if (dhcp_reply==DHCPACK)
+ return(1);
+ rfc951_sleep(++retry1);
+ }
+ } else
+#endif /* NO_DHCP_SUPPORT */
+ return(1);
+#ifndef NO_DHCP_SUPPORT
+ }
+ rfc951_sleep(++retry);
+
+#endif /* NO_DHCP_SUPPORT */
+#endif
+ bp.bp_secs = htons((currticks()-starttime)/20);
+ }
+ return(0);
+}
+#endif /* RARP_NOT_BOOTP */
+
+/**************************************************************************
+AWAIT_REPLY - Wait until we get a response for our request
+**************************************************************************/
+int await_reply(int type, int ival, void *ptr, int timeout)
+{
+ unsigned long time;
+ struct iphdr *ip;
+ struct udphdr *udp;
+ struct arprequest *arpreply;
+ struct bootp_t *bootpreply;
+ struct rpc_t *rpc;
+ unsigned short ptype;
+
+ unsigned int protohdrlen = ETHER_HDR_SIZE + sizeof(struct iphdr) +
+ sizeof(struct udphdr);
+ time = timeout + currticks();
+ /* The timeout check is done below. The timeout is only checked if
+ * there is no packet in the Rx queue. This assumes that eth_poll()
+ * needs a negligible amount of time. */
+ for (;;) {
+ if (eth_poll()) { /* We have something! */
+ /* Check for ARP - No IP hdr */
+ if (nic.packetlen >= ETHER_HDR_SIZE) {
+ ptype = ((unsigned short) nic.packet[12]) << 8
+ | ((unsigned short) nic.packet[13]);
+ } else continue; /* what else could we do with it? */
+ if ((nic.packetlen >= ETHER_HDR_SIZE +
+ sizeof(struct arprequest)) &&
+ (ptype == ARP) ) {
+ unsigned long tmp;
+
+ arpreply = (struct arprequest *)
+ &nic.packet[ETHER_HDR_SIZE];
+ if ((arpreply->opcode == ntohs(ARP_REPLY)) &&
+ !memcmp(arpreply->sipaddr, ptr, sizeof(in_addr)) &&
+ (type == AWAIT_ARP)) {
+ memcpy(arptable[ival].node, arpreply->shwaddr, ETHER_ADDR_SIZE);
+ return(1);
+ }
+ memcpy(&tmp, arpreply->tipaddr, sizeof(in_addr));
+ if ((arpreply->opcode == ntohs(ARP_REQUEST)) &&
+ (tmp == arptable[ARP_CLIENT].ipaddr.s_addr)) {
+ arpreply->opcode = htons(ARP_REPLY);
+ memcpy(arpreply->tipaddr, arpreply->sipaddr, sizeof(in_addr));
+ memcpy(arpreply->thwaddr, arpreply->shwaddr, ETHER_ADDR_SIZE);
+ memcpy(arpreply->sipaddr, &arptable[ARP_CLIENT].ipaddr, sizeof(in_addr));
+ memcpy(arpreply->shwaddr, arptable[ARP_CLIENT].node, ETHER_ADDR_SIZE);
+ eth_transmit(arpreply->thwaddr, ARP,
+ sizeof(struct arprequest),
+ arpreply);
+#ifdef MDEBUG
+ memcpy(&tmp, arpreply->tipaddr, sizeof(in_addr));
+ printf("Sent ARP reply to: %I\n",tmp);
+#endif MDEBUG
+ }
+ continue;
+ }
+
+ if (type == AWAIT_QDRAIN) {
+ continue;
+ }
+
+ /* Check for RARP - No IP hdr */
+ if ((type == AWAIT_RARP) &&
+ (nic.packetlen >= ETHER_HDR_SIZE +
+ sizeof(struct arprequest)) &&
+ (ptype == RARP)) {
+ arpreply = (struct arprequest *)
+ &nic.packet[ETHER_HDR_SIZE];
+ if ((arpreply->opcode == ntohs(RARP_REPLY)) &&
+ !memcmp(arpreply->thwaddr, ptr, ETHER_ADDR_SIZE)) {
+ memcpy(arptable[ARP_SERVER].node, arpreply->shwaddr, ETHER_ADDR_SIZE);
+ memcpy(& arptable[ARP_SERVER].ipaddr, arpreply->sipaddr, sizeof(in_addr));
+ memcpy(& arptable[ARP_CLIENT].ipaddr, arpreply->tipaddr, sizeof(in_addr));
+ return(1);
+ }
+ continue;
+ }
+
+ /* Anything else has IP header */
+ if ((nic.packetlen < protohdrlen) ||
+ (ptype != IP) ) continue;
+ ip = (struct iphdr *)&nic.packet[ETHER_HDR_SIZE];
+ if ((ip->verhdrlen != 0x45) ||
+ ipchksum((unsigned short *)ip, sizeof(struct iphdr)) ||
+ (ip->protocol != IP_UDP)) continue;
+ udp = (struct udphdr *)&nic.packet[ETHER_HDR_SIZE +
+ sizeof(struct iphdr)];
+
+ /* BOOTP ? */
+ bootpreply = (struct bootp_t *)&nic.packet[ETHER_HDR_SIZE];
+ if ((type == AWAIT_BOOTP) &&
+ (nic.packetlen >= (ETHER_HDR_SIZE +
+#ifdef NO_DHCP_SUPPORT
+ sizeof(struct bootp_t))) &&
+#else
+ sizeof(struct bootp_t))-DHCP_OPT_LEN) &&
+#endif /* NO_DHCP_SUPPORT */
+ (ntohs(udp->dest) == BOOTP_CLIENT) &&
+ (bootpreply->bp_op == BOOTP_REPLY) &&
+ (bootpreply->bp_xid == xid)) {
+ arptable[ARP_CLIENT].ipaddr.s_addr =
+ bootpreply->bp_yiaddr.s_addr;
+#ifndef NO_DHCP_SUPPORT
+ dhcp_addr.s_addr = bootpreply->bp_yiaddr.s_addr;
+#endif /* NO_DHCP_SUPPORT */
+ netmask = default_netmask();
+ arptable[ARP_SERVER].ipaddr.s_addr =
+ bootpreply->bp_siaddr.s_addr;
+ memset(arptable[ARP_SERVER].node, 0, ETHER_ADDR_SIZE); /* Kill arp */
+ arptable[ARP_GATEWAY].ipaddr.s_addr =
+ bootpreply->bp_giaddr.s_addr;
+ memset(arptable[ARP_GATEWAY].node, 0, ETHER_ADDR_SIZE); /* Kill arp */
+ if (bootpreply->bp_file[0]) {
+ memcpy(kernel_buf, bootpreply->bp_file, 128);
+ kernel = kernel_buf;
+ }
+ memcpy((char *)BOOTP_DATA_ADDR, (char *)bootpreply, sizeof(struct bootpd_t));
+ decode_rfc1533(BOOTP_DATA_ADDR->bootp_reply.bp_vend,
+#ifdef NO_DHCP_SUPPORT
+ 0, BOOTP_VENDOR_LEN + MAX_BOOTP_EXTLEN, 1);
+#else
+ 0, DHCP_OPT_LEN + MAX_BOOTP_EXTLEN, 1);
+#endif /* NO_DHCP_SUPPORT */
+ return(1);
+ }
+
+#ifdef DOWNLOAD_PROTO_TFTP
+ /* TFTP ? */
+ if ((type == AWAIT_TFTP) &&
+ (ntohs(udp->dest) == ival)) return(1);
+#endif /* DOWNLOAD_PROTO_TFTP */
+
+#ifdef DOWNLOAD_PROTO_NFS
+ /* RPC ? */
+ rpc = (struct rpc_t *)&nic.packet[ETHER_HDR_SIZE];
+ if ((type == AWAIT_RPC) &&
+ (ntohs(udp->dest) == ival) &&
+ (*(unsigned long *)ptr == ntohl(rpc->u.reply.id)) &&
+ (ntohl(rpc->u.reply.type) == MSG_REPLY)) {
+ return (1);
+ }
+#endif /* DOWNLOAD_PROTO_NFS */
+
+ } else {
+ /* Check for abort key only if the Rx queue is empty -
+ * as long as we have something to process, don't
+ * assume that something failed. It is unlikely that
+ * we have no processing time left between packets. */
+ if (iskey() && (getchar() == ESC))
+#ifdef EMERGENCYDISKBOOT
+ exit(0);
+#else
+ longjmp(jmp_bootmenu,1);
+#endif
+ /* Do the timeout after at least a full queue walk. */
+ if ((timeout == 0) || (currticks() > time)) {
+ break;
+ }
+ }
+ }
+ return(0);
+}
+
+/**************************************************************************
+DECODE_RFC1533 - Decodes RFC1533 header
+**************************************************************************/
+int decode_rfc1533(p, block, len, eof)
+ register unsigned char *p;
+ int block, len, eof;
+{
+ static unsigned char *extdata = NULL, *extend = NULL;
+ unsigned char *extpath = NULL;
+ unsigned char *endp;
+
+ if (block == 0) {
+#ifdef IMAGE_MENU
+ memset(imagelist, 0, sizeof(imagelist));
+ menudefault = useimagemenu = 0;
+ menutmo = -1;
+#endif
+#ifdef MOTD
+ memset(motd, 0, sizeof(motd));
+#endif
+ end_of_rfc1533 = NULL;
+ vendorext_isvalid = 0;
+ if (memcmp(p, rfc1533_cookie, 4))
+ return(0); /* no RFC 1533 header found */
+ p += 4;
+ endp = p + len; }
+ else {
+ if (block == 1) {
+ if (memcmp(p, rfc1533_cookie, 4))
+ return(0); /* no RFC 1533 header found */
+ p += 4;
+ len -= 4; }
+ if (extend + len <= (unsigned char *)&(BOOTP_DATA_ADDR->bootp_extension[MAX_BOOTP_EXTLEN])) {
+ memcpy(extend, p, len);
+ extend += len;
+ } else {
+ printf("Overflow in vendor data buffer! Aborting...\n");
+ *extdata = RFC1533_END;
+ return(0);
+ }
+ p = extdata; endp = extend;
+ }
+ if (eof) {
+ while(p < endp) {
+ unsigned char c = *p;
+ if (c == RFC1533_PAD) {p++; continue;}
+ else if (c == RFC1533_END) {
+ end_of_rfc1533 = endp = p; continue; }
+ else if (c == RFC1533_NETMASK) {memcpy(&netmask, p+2, sizeof(in_addr));}
+
+ else if (c == RFC1533_GATEWAY) {
+ /* This is a little simplistic, but it will
+ usually be sufficient.
+ Take only the first entry */
+ if (TAG_LEN(p) >= sizeof(in_addr))
+ memcpy(&arptable[ARP_GATEWAY].ipaddr, p+2, sizeof(in_addr));
+ }
+ else if (c == RFC1533_EXTENSIONPATH)
+ extpath = p;
+#ifndef NO_DHCP_SUPPORT
+ else if (c == RFC2132_MSG_TYPE)
+ { dhcp_reply=*(p+2);
+ }
+ else if (c == RFC2132_SRV_ID)
+ {
+ memcpy(&dhcp_server, p+2, sizeof(in_addr));
+ }
+#endif /* NO_DHCP_SUPPORT */
+ else if (c == RFC1533_HOSTNAME)
+ {
+ hostname = p + 2;
+ hostnamelen = *(p + 1);
+ }
+ else if (c == RFC1533_VENDOR_MAGIC
+#ifndef IMAGE_FREEBSD /* since FreeBSD uses tag 128 for swap definition */
+ && TAG_LEN(p) >= 6 &&
+ !memcmp(p+2,vendorext_magic,4) &&
+ p[6] == RFC1533_VENDOR_MAJOR
+#endif
+ )
+ vendorext_isvalid++;
+#ifdef IMAGE_FREEBSD
+ else if (c == RFC1533_VENDOR_HOWTO) {
+ freebsd_howto = ((p[2]*256+p[3])*256+p[4])*256+p[5];
+ }
+#endif
+#ifdef IMAGE_MENU
+ else if (c == RFC1533_VENDOR_MNUOPTS) {
+ parse_menuopts(p+2, TAG_LEN(p));
+ }
+ else if (c >= RFC1533_VENDOR_IMG &&
+ c<RFC1533_VENDOR_IMG+RFC1533_VENDOR_NUMOFIMG){
+ imagelist[c - RFC1533_VENDOR_IMG] = p;
+ useimagemenu++;
+ }
+#endif
+#ifdef MOTD
+ else if (c >= RFC1533_VENDOR_MOTD &&
+ c < RFC1533_VENDOR_MOTD +
+ RFC1533_VENDOR_NUMOFMOTD)
+ motd[c - RFC1533_VENDOR_MOTD] = p;
+#endif
+ else {
+#if 0
+ unsigned char *q;
+ printf("Unknown RFC1533-tag ");
+ for(q=p;q<p+2+TAG_LEN(p);q++)
+ printf("%x ",*q);
+ putchar('\n');
+#endif
+ }
+ p += TAG_LEN(p) + 2;
+ }
+ extdata = extend = endp;
+ if (block == 0 && extpath != NULL) {
+ char fname[64];
+ memcpy(fname, extpath+2, TAG_LEN(extpath));
+ fname[(int)TAG_LEN(extpath)] = '\000';
+ printf("Loading BOOTP-extension file: %s\n",fname);
+ download(fname,decode_rfc1533);
+ }
+ }
+ return(-1); /* proceed with next block */
+}
+
+/**************************************************************************
+IPCHKSUM - Checksum IP Header
+**************************************************************************/
+unsigned short ipchksum(ip, len)
+ register unsigned short *ip;
+ register int len;
+{
+ unsigned long sum = 0;
+ len >>= 1;
+ while (len--) {
+ sum += *(ip++);
+ if (sum > 0xFFFF)
+ sum -= 0xFFFF;
+ }
+ return((~sum) & 0x0000FFFF);
+}
+
+/**************************************************************************
+RFC951_SLEEP - sleep for expotentially longer times
+**************************************************************************/
+void rfc951_sleep(exp)
+ int exp;
+{
+ static long seed = 0;
+ long q;
+ unsigned long tmo;
+
+#ifdef BACKOFF_LIMIT
+ if (exp > BACKOFF_LIMIT)
+ exp = BACKOFF_LIMIT;
+#endif
+ if (!seed) /* Initialize linear congruential generator */
+ seed = currticks() + *(long *)&arptable[ARP_CLIENT].node
+ + ((short *)arptable[ARP_CLIENT].node)[2];
+ /* simplified version of the LCG given in Bruce Scheier's
+ "Applied Cryptography" */
+ q = seed/53668;
+ if ((seed = 40014*(seed-53668*q) - 12211*q) < 0) seed += 2147483563l;
+ /* compute mask */
+ for (tmo = 63; tmo <= 60*TICKS_PER_SEC && --exp > 0; tmo = 2*tmo+1);
+ /* sleep */
+ printf("<sleep>\n");
+
+ for (tmo = (tmo&seed)+currticks(); currticks() < tmo; )
+ if (iskey() && (getchar() == ESC)) longjmp(jmp_bootmenu,1);
+ return;
+}
+
+/**************************************************************************
+CLEANUP_NET - shut down networking
+**************************************************************************/
+void cleanup_net(void)
+{
+#ifdef DOWNLOAD_PROTO_NFS
+ nfs_umountall(ARP_SERVER);
+#endif
+ eth_disable();
+ eth_reset();
+}
+
+/**************************************************************************
+CLEANUP - shut down etherboot so that the OS may be called right away
+**************************************************************************/
+void cleanup(void)
+{
+#if defined(ANSIESC) && defined(CONSOLE_CRT)
+ ansi_reset();
+#endif
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
--- /dev/null
+From: "Paolo Marini" <paolom@prisma-eng.it>
+Subject: Etherboot on bare metal
+Date: Tue, 10 Apr 2001 23:19:19 +0200
+Organization: Prisma Engineering srl
+
+Hi Ken,
+I have ported Etherboot on an embedded, biosless platform and would like
+to contribute the code.
+
+Essentially, the hardware I was running Etherboot is a Pentium based
+embedded system, with an Intel Chipset, *but* without serial, VGA,
+keyboard etc., only an 82559 Intel (custom) Ethernet controller (I debug
+it with the etheral Ethernet packet analyser and an emulator).
+
+What I did was:
+
+ a.. integrate the init.s file within the firmware, with GDT
+(re)initialisation (a simple and single entry point taking control of
+the boot process)
+ b.. provide some stupid BIOS stubs in order to let the OS boot and
+still belive that an INT10 call goes to the BIOS
+ c.. provide some basic functions to Etherboot, like timer (I used the
+Pentium TSC internal counter)
+ d.. hardwire in the code information about the RAM size
+The BIOS stubs are enough to boot Linux, pSOS and QNX with bootp. QNX is
+somewhat difficult to load, because the i82559 driver tries to find the
+component using the BIOS32 calls, so I had to patch it.
+
+what i I got from the original firmware is the PCI initialisation and
+resource (I/O, interrupts, memory) allocation.
+
+I send you what I changed, that is, the initialisation code and the
+misc.c file containing the timer, and the makefile (I don't remember
+exactly the options I used to compile all).
+
+Of course, it is only a good starting point for anyone wanting to
+implement a bootp client on a biosless platform; some integration work
+still needs to be done.
+
+Ciao
+Paolo
+
+And in a subsequent email:
+
+I worked with version 4.6.12, but the real modifications involve the
+init.S file, which I think is quite sstable between releases. I forgot
+to say that my entry point (symbol _start in init.s) assumes the
+processor is already in protected mode.
+
+[The only difference between main.c and misc.c from those in Etherboot
+4.6.12 seems to be the deletion of eth_reset(). This may be of use to
+others trying to make these changes work on more recent releases. Ken]
--- /dev/null
+/**************************************************************************
+MISC Support Routines
+**************************************************************************/
+
+#include "etherboot.h"
+
+/**************************************************************************
+SLEEP
+**************************************************************************/
+void sleep(int secs)
+{
+ unsigned long tmo;
+
+ for (tmo = currticks()+secs*TICKS_PER_SEC; currticks() < tmo; )
+ /* Nothing */;
+}
+
+/**************************************************************************
+TWIDDLE
+**************************************************************************/
+void twiddle()
+{
+ static unsigned long lastticks = 0;
+ static int count=0;
+ static const char tiddles[]="-\\|/";
+ unsigned long ticks;
+ if ((ticks = currticks()) == lastticks)
+ return;
+ lastticks = ticks;
+ putchar(tiddles[(count++)&3]);
+ putchar('\b');
+}
+
+/**************************************************************************
+STRCASECMP (not entirely correct, but this will do for our purposes)
+**************************************************************************/
+int strcasecmp(a,b)
+ char *a, *b;
+{
+ while (*a && *b && (*a & ~0x20) == (*b & ~0x20)) {a++; b++; }
+ return((*a & ~0x20) - (*b & ~0x20));
+}
+
+/**************************************************************************
+PRINTF and friends
+
+ Formats:
+ %[#]X - 4 bytes long (8 hex digits)
+ %[#]x - 2 bytes int (4 hex digits)
+ - optional # prefixes 0x
+ %b - 1 byte int (2 hex digits)
+ %d - decimal int
+ %c - char
+ %s - string
+ %I - Internet address in x.x.x.x notation
+ Note: width specification not supported
+**************************************************************************/
+static char *do_printf(char *buf, const char *fmt, const int *dp)
+{
+ register char *p;
+ int alt;
+ char tmp[16];
+ static const char hex[]="0123456789ABCDEF";
+
+ while (*fmt) {
+ if (*fmt == '%') { /* switch() uses more space */
+ alt = 0;
+ fmt++;
+ if (*fmt == '#') {
+ alt = 1;
+ fmt++;
+ }
+ if (*fmt == 'X') {
+ const long *lp = (const long *)dp;
+ register long h = *lp++;
+ dp = (const int *)lp;
+ if (alt) {
+ *buf++ = '0';
+ *buf++ = 'x';
+ }
+ *(buf++) = hex[(h>>28)& 0x0F];
+ *(buf++) = hex[(h>>24)& 0x0F];
+ *(buf++) = hex[(h>>20)& 0x0F];
+ *(buf++) = hex[(h>>16)& 0x0F];
+ *(buf++) = hex[(h>>12)& 0x0F];
+ *(buf++) = hex[(h>>8)& 0x0F];
+ *(buf++) = hex[(h>>4)& 0x0F];
+ *(buf++) = hex[h& 0x0F];
+ }
+ if (*fmt == 'x') {
+ register int h = *(dp++);
+ if (alt) {
+ *buf++ = '0';
+ *buf++ = 'x';
+ }
+ *(buf++) = hex[(h>>12)& 0x0F];
+ *(buf++) = hex[(h>>8)& 0x0F];
+ *(buf++) = hex[(h>>4)& 0x0F];
+ *(buf++) = hex[h& 0x0F];
+ }
+ if (*fmt == 'b') {
+ register int h = *(dp++);
+ *(buf++) = hex[(h>>4)& 0x0F];
+ *(buf++) = hex[h& 0x0F];
+ }
+ if (*fmt == 'd') {
+ register int dec = *(dp++);
+ p = tmp;
+ if (dec < 0) {
+ *(buf++) = '-';
+ dec = -dec;
+ }
+ do {
+ *(p++) = '0' + (dec%10);
+ dec = dec/10;
+ } while(dec);
+ while ((--p) >= tmp) *(buf++) = *p;
+ }
+ if (*fmt == 'I') {
+ union {
+ long l;
+ unsigned char c[4];
+ } u;
+ const long *lp = (const long *)dp;
+ u.l = *lp++;
+ dp = (const int *)lp;
+ buf = sprintf(buf,"%d.%d.%d.%d",
+ u.c[0], u.c[1], u.c[2], u.c[3]);
+ }
+ if (*fmt == 'c')
+ *(buf++) = *(dp++);
+ if (*fmt == 's') {
+ p = (char *)*dp++;
+ while (*p) *(buf++) = *p++;
+ }
+ } else *(buf++) = *fmt;
+ fmt++;
+ }
+ *buf = '\0';
+ return(buf);
+}
+
+char *sprintf(char *buf, const char *fmt, ...)
+{
+ return do_printf(buf, fmt, ((const int *)&fmt)+1);
+}
+
+void printf(const char *fmt, ...)
+{
+ char buf[120], *p;
+
+ p = buf;
+ do_printf(buf, fmt, ((const int *)&fmt)+1);
+ while (*p) putchar(*p++);
+}
+
+#ifdef IMAGE_MENU
+/**************************************************************************
+INET_ATON - Convert an ascii x.x.x.x to binary form
+**************************************************************************/
+int inet_aton(char *p, in_addr *i)
+{
+ unsigned long ip = 0;
+ int val;
+ if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
+ if (*p != '.') return(0);
+ p++;
+ ip = val;
+ if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
+ if (*p != '.') return(0);
+ p++;
+ ip = (ip << 8) | val;
+ if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
+ if (*p != '.') return(0);
+ p++;
+ ip = (ip << 8) | val;
+ if (((val = getdec(&p)) < 0) || (val > 255)) return(0);
+ i->s_addr = htonl((ip << 8) | val);
+ return(1);
+}
+
+#endif /* IMAGE_MENU */
+
+int getdec(char **ptr)
+{
+ char *p = *ptr;
+ int ret=0;
+ if ((*p < '0') || (*p > '9')) return(-1);
+ while ((*p >= '0') && (*p <= '9')) {
+ ret = ret*10 + (*p - '0');
+ p++;
+ }
+ *ptr = p;
+ return(ret);
+}
+
+#define K_RDWR 0x60 /* keyboard data & cmds (read/write) */
+#define K_STATUS 0x64 /* keyboard status */
+#define K_CMD 0x64 /* keybd ctlr command (write-only) */
+
+#define K_OBUF_FUL 0x01 /* output buffer full */
+#define K_IBUF_FUL 0x02 /* input buffer full */
+
+#define KC_CMD_WIN 0xd0 /* read output port */
+#define KC_CMD_WOUT 0xd1 /* write output port */
+#define KB_SET_A20 0xdf /* enable A20,
+ enable output buffer full interrupt
+ enable data line
+ disable clock line */
+#define KB_UNSET_A20 0xdd /* enable A20,
+ enable output buffer full interrupt
+ enable data line
+ disable clock line */
+#ifndef IBM_L40
+static void empty_8042(void)
+{
+ unsigned long time;
+ char st;
+
+ time = currticks() + TICKS_PER_SEC; /* max wait of 1 second */
+ while ((((st = inb(K_CMD)) & K_OBUF_FUL) ||
+ (st & K_IBUF_FUL)) &&
+ currticks() < time)
+ inb(K_RDWR);
+}
+#endif IBM_L40
+
+/*
+ * Gate A20 for high memory
+ */
+void gateA20_set(void)
+{
+#ifdef IBM_L40
+ outb(0x2, 0x92);
+#else /* IBM_L40 */
+ empty_8042();
+ outb(KC_CMD_WOUT, K_CMD);
+ empty_8042();
+ outb(KB_SET_A20, K_RDWR);
+ empty_8042();
+#endif /* IBM_L40 */
+}
+
+#ifdef TAGGED_IMAGE
+/*
+ * Unset Gate A20 for high memory - some operating systems (mainly old 16 bit
+ * ones) don't expect it to be set by the boot loader.
+ */
+void gateA20_unset(void)
+{
+#ifdef IBM_L40
+ outb(0x0, 0x92);
+#else /* IBM_L40 */
+ empty_8042();
+ outb(KC_CMD_WOUT, K_CMD);
+ empty_8042();
+ outb(KB_UNSET_A20, K_RDWR);
+ empty_8042();
+#endif /* IBM_L40 */
+}
+#endif
+
+#ifdef ETHERBOOT32
+/* Serial console is only implemented in ETHERBOOT32 for now */
+void
+putchar(int c)
+{
+#ifndef ANSIESC
+ if (c == '\n')
+ putchar('\r');
+#endif
+
+#ifdef CONSOLE_CRT
+#ifdef ANSIESC
+ handleansi(c);
+#else
+ putc(c);
+#endif
+#endif
+#ifdef CONSOLE_SERIAL
+#ifdef ANSIESC
+ if (c == '\n')
+ serial_putc('\r');
+#endif
+ serial_putc(c);
+#endif
+}
+
+/**************************************************************************
+GETCHAR - Read the next character from the console WITHOUT ECHO
+**************************************************************************/
+int
+getchar(void)
+{
+ int c = 256;
+
+#if defined CONSOLE_CRT || defined CONSOLE_SERIAL
+ do {
+#ifdef CONSOLE_CRT
+ if (ischar())
+ c = getc();
+#endif
+#ifdef CONSOLE_SERIAL
+ if (serial_ischar())
+ c = serial_getc();
+#endif
+ } while (c==256);
+ if (c == '\r')
+ c = '\n';
+#endif
+ return c;
+}
+
+int
+iskey(void)
+{
+#ifdef CONSOLE_CRT
+ if (ischar())
+ return 1;
+#endif
+#ifdef CONSOLE_SERIAL
+ if (serial_ischar())
+ return 1;
+#endif
+ return 0;
+}
+#endif /* ETHERBOOT32 */
+
+/*
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
+
+#include <asm/msr.h>
+
+#define CPUCLOCK 166
+
+unsigned long currticks(void)
+{
+ register unsigned long l, h;
+ long long unsigned p;
+ long long unsigned hh,ll;
+
+ rdtsc(l, h);
+ ll = l, hh = h;
+
+ p = (ll + hh * 0x100000000LL) * 182 / (CPUCLOCK * 100000LL);
+ return (unsigned)p;
+}
+
--- /dev/null
+/* #defines because ljmp wants a number, probably gas bug */
+/* .equ KERN_CODE_SEG,_pmcs-_gdt */
+#define KERN_CODE_SEG 0x08
+ .equ KERN_DATA_SEG,_pmds-_gdt
+/* .equ REAL_CODE_SEG,_rmcs-_gdt */
+#define REAL_CODE_SEG 0x18
+ .equ REAL_DATA_SEG,_rmds-_gdt
+ .equ CR0_PE,1
+
+#ifdef GAS291
+#define DATA32 data32;
+#define ADDR32 addr32;
+#define LJMPI(x) ljmp x
+#else
+#define DATA32 data32
+#define ADDR32 addr32
+/* newer GAS295 require #define LJMPI(x) ljmp *x */
+#define LJMPI(x) ljmp x
+#endif
+
+#define PIC1_VBS 0x08 /* PIC1 interrupts start at vector 64 */
+#define PIC2_VBS 0x70 /* PIC1 interrupts start at vector 112 */
+
+/*
+ * NOTE: if you write a subroutine that is called from C code (gcc/egcs),
+ * then you only have to take care of %ebx, %esi, %edi and %ebp. These
+ * registers must not be altered under any circumstance. All other registers
+ * may be clobbered without any negative side effects. If you don't follow
+ * this rule then you'll run into strange effects that only occur on some
+ * gcc versions (because the register allocator may use different registers).
+ *
+ * All the data32 prefixes for the ljmp instructions are necessary, because
+ * the assembler emits code with a relocation address of 0. This means that
+ * all destinations are initially negative, which the assembler doesn't grok,
+ * because for some reason negative numbers don't fit into 16 bits. The addr32
+ * prefixes are there for the same reasons, because otherwise the memory
+ * references are only 16 bit wide. Theoretically they are all superfluous.
+ * One last note about prefixes: the data32 prefixes on all call _real_to_prot
+ * instructions could be removed if the _real_to_prot function is changed to
+ * deal correctly with 16 bit return addresses. I tried it, but failed.
+ */
+
+/**************************************************************************
+START - Where all the fun begins....
+**************************************************************************/
+/* this must be the first thing in the file because we enter from the top */
+ .global _start
+ .code32
+_start:
+ cli
+
+ /* load new IDT and GDT */
+ lgdt gdtarg
+ lidt Idt_Reg
+ /* flush prefetch queue, and reload %cs:%eip */
+ ljmp $KERN_CODE_SEG,$1f
+1:
+
+ /* reload other segment registers */
+ movl $KERN_DATA_SEG,%eax
+ movl %eax,%ds
+ movl %eax,%es
+ movl %eax,%ss
+ movl $stktop,%esp
+
+ /* program the PITs in order to stop them */
+ mov $0x30,%al
+ out %al,$0x43
+ out %al,$0x40
+ mov $0x70,%al
+ out %al,$0x43
+ out %al,$0x41
+ mov $0xf0,%al
+ out %al,$0x43
+ out %al,$0x42
+
+ call main
+ /* fall through */
+
+ .globl exit
+exit:
+2:
+ ljmp $KERN_CODE_SEG,$2b
+
+/**************************************************************************
+MEMSIZE - Determine size of extended memory
+**************************************************************************/
+ .globl memsize
+memsize:
+#if 0
+ pushl %ebx
+ pushl %esi
+ pushl %edi
+ call _prot_to_real
+ .code16
+ movw $0xe801,%ax
+ stc
+ int $0x15
+ jc 1f
+ andl $0xffff,%eax
+ andl $0xffff,%ebx
+ shll $6,%ebx
+ addl %ebx,%eax
+ jmp 2f
+1:
+ movw $0x8800,%ax
+ int $0x15
+ andl $0xffff,%eax
+2:
+ movl %eax,%esi
+ DATA32 call _real_to_prot
+ .code32
+ movl %esi,%eax
+ popl %edi
+ popl %esi
+ popl %ebx
+#else
+ mov $32768,%eax
+#endif
+ ret
+
+/**************************************************************************
+XSTART - Transfer control to the kernel just loaded
+**************************************************************************/
+ .code16
+
+ .globl _int08_handler
+_int08_handler:
+ movb $0x20, %al
+ outb %al, $0x20
+ iret
+
+ .globl _int10_handler
+_int10_handler:
+ cmp $0x3, %ah
+ jnz _int10_04
+ mov $0x0, %dx
+ mov $0x0, %cx
+ iret
+_int10_04:
+ cmp $0x4, %ah
+ jnz _int10_05
+ mov $0x0, %ah
+ iret
+_int10_05:
+ cmp $0x5, %ah
+ jnz _int10_08
+ mov $0x0, %al
+ iret
+_int10_08:
+ cmp $0x8, %ah
+ jnz _int10_0D
+ mov $0x20, %al
+ mov $0x7, %ah
+ iret
+_int10_0D:
+ cmp $0xD, %ah
+ jnz _int10_0F
+ mov $0x0, %al
+ iret
+_int10_0F:
+ cmp $0xF, %ah
+ jnz _int10_XX
+ mov $0xb, %al
+ mov $80, %ah
+ mov $0, %bh
+_int10_XX:
+ iret
+
+ .globl _int11_handler
+_int11_handler:
+ mov $0x22, %ax
+ iret
+
+ .globl _int12_handler
+_int12_handler:
+ mov $640, %ax
+ iret
+
+ .globl _int13_handler
+_int13_handler:
+ clc
+ mov $0, %ah
+ iret
+
+ .globl _int14_handler
+_int14_handler:
+ iret
+
+ .globl _int15_handler
+_int15_handler:
+ cmp $0xe801,%ax
+ jz _int15_008
+ cmp $0x0, %ah
+ jz _int15_000
+ cmp $0x1, %ah
+ jz _int15_000
+ cmp $0x2, %ah
+ jz _int15_000
+ cmp $0x3, %ah
+ jz _int15_000
+ cmp $0xf, %ah
+ jz _int15_000
+ cmp $0x21, %ah
+ jz _int15_000
+ cmp $0x40, %ah
+ jz _int15_000
+ cmp $0x41, %ah
+ jz _int15_000
+ cmp $0x42, %ah
+ jz _int15_000
+ cmp $0x43, %ah
+ jz _int15_000
+ cmp $0x44, %ah
+ jz _int15_000
+ cmp $0x80, %ah
+ jz _int15_001
+ cmp $0x81, %ah
+ jz _int15_001
+ cmp $0x82, %ah
+ jz _int15_002
+ cmp $0x83, %ah
+ jz _int15_003
+ cmp $0x84, %ah
+ jz _int15_000
+ cmp $0x85, %ah
+ jz _int15_004
+ cmp $0x86, %ah
+ jz _int15_003
+ cmp $0x87, %ah
+ jz _int15_005
+ cmp $0x88, %ah
+ jz _int15_006
+ cmp $0x89, %ah
+ jz _int15_005
+ cmp $0x90, %ah
+ jz _int15_007
+ cmp $0xc0, %ah
+ jz _int15_000
+ cmp $0xc1, %ah
+ jz _int15_000
+ cmp $0xc2, %ah
+ jz _int15_000
+ cmp $0xc3, %ah
+ jz _int15_000
+ cmp $0xc4, %ah
+ jz _int15_000
+ iret
+
+_int15_000:
+ mov $0x86, %ah
+ stc
+ iret
+
+_int15_001:
+ mov $0, %bx
+ mov $0, %cx
+ iret
+
+_int15_002:
+ mov $0, %bx
+ iret
+
+_int15_003:
+ clc
+ iret
+
+_int15_004:
+ mov $0, %al
+ iret
+
+_int15_005:
+ mov $0, %ah
+ clc
+ cmp $0, %ah
+ iret
+
+_int15_006:
+ mov $0xf000, %ax
+ iret
+
+_int15_007:
+ stc
+ iret
+
+_int15_008:
+ clc
+ mov $1024, %dx /* dx -> extended memory size (in 64K chuncks) */
+ mov $640, %cx /* cx -> conventional memory size (in 1 Kbytes chuncks) */
+ iret
+
+ .globl _int16_handler
+_int16_handler:
+ cmp $0x0, %ah
+ jnz _int16_01
+ mov $0x20, %al
+ mov $0x39, %ah
+ iret
+_int16_01:
+ cmp $0x1, %ah
+ jnz _int16_02
+ iret
+_int16_02:
+ cmp $0x2, %ah
+ jnz _int16_05
+ mov $0, %al
+ iret
+_int16_05:
+ cmp $0x5, %ah
+ jnz _int16_10
+ mov $0, %al
+ iret
+_int16_10:
+ cmp $0x10, %ah
+ jnz _int16_11
+ mov $0x20, %al
+ mov $0x39, %ah
+ iret
+_int16_11:
+ cmp $0x11, %ah
+ jnz _int16_12
+ iret
+_int16_12:
+ cmp $0x12, %ah
+ jnz _int16_XX
+ mov $0, %ax
+ iret
+_int16_XX:
+ iret
+
+ .globl _int17_handler
+_int17_handler:
+ mov $0xd0, %ah
+ iret
+
+ .globl _int19_handler
+_int19_handler:
+ hlt
+ iret
+
+ .globl _int1A_handler
+_int1A_handler:
+ stc
+ iret
+
+ .code32
+ .globl xstart
+xstart:
+ /* reprogram the PICs so that interrupt are masked */
+ movb $0x11,%al /* ICW1 [ICW4 NEEDED, EDGE TRIGGERED]*/
+ outb %al,$0x20
+ movb $PIC1_VBS, %al
+ outb %al,$0x21
+ movb $0x4,%al
+ outb %al,$0x21
+ movb $0x1,%al
+ outb %al,$0x21
+ movb $0xff,%al
+ outb %al,$0x21
+
+ movb $0x11,%al /* ICW1 [ICW4 NEEDED, EDGE TRIGGERED]*/
+ outb %al,$0xa0
+ movb $PIC2_VBS, %al
+ outb %al,$0xa1
+ movb $0x2,%al
+ outb %al,$0xa1
+ movb $0x1,%al
+ outb %al,$0xa1
+ movb $0xff,%al
+ outb %al,$0xa1
+
+ pushl %ebp
+ movl %esp,%ebp
+ pushl %ebx
+ pushl %esi
+ pushl %edi
+ movl 8(%ebp),%eax
+ movl %eax,_execaddr
+ movl 12(%ebp),%ebx
+ movl 16(%ebp),%ecx /* bootp record (32bit pointer) */
+ addl $28,%ecx /* ip, udp header */
+ shll $12,%ecx
+ shrw $12,%cx
+ call _prot_to_real
+ .code16
+/* MP: add int10 handler */
+ push %eax
+ push %ebx
+ push %es
+ mov $0,%ax
+ mov %ax,%es
+ mov %cs,%ax
+ shl $16,%eax
+
+ ADDR32 mov $(_int08_handler-_start),%ax
+ mov $0x20,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int10_handler-_start),%ax
+ mov $0x40,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int11_handler-_start),%ax
+ mov $0x44,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int12_handler-_start),%ax
+ mov $0x48,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int13_handler-_start),%ax
+ mov $0x4c,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int14_handler-_start),%ax
+ mov $0x50,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int15_handler-_start),%ax
+ mov $0x54,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int16_handler-_start),%ax
+ mov $0x58,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int17_handler-_start),%ax
+ mov $0x5c,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int19_handler-_start),%ax
+ mov $0x64,%ebx
+ mov %eax,%es:(%bx)
+
+ ADDR32 mov $(_int1A_handler-_start),%ax
+ mov $0x68,%ebx
+ mov %eax,%es:(%bx)
+
+ pop %es
+ pop %ebx
+ pop %eax
+/* */
+ pushl %ecx /* bootp record */
+ pushl %ebx /* file header */
+ movl $((RELOC<<12)+(1f-RELOC)),%eax
+ pushl %eax
+ ADDR32 LJMPI(_execaddr-_start)
+1:
+ addw $8,%sp /* XXX or is this 10 in case of a 16bit "ret" */
+ DATA32 call _real_to_prot
+ .code32
+ popl %edi
+ popl %esi
+ popl %ebx
+ popl %ebp
+ ret
+
+_execaddr:
+ .long 0
+
+#ifdef IMAGE_MULTIBOOT
+/**************************************************************************
+XEND - Restart Etherboot from the beginning (from protected mode)
+**************************************************************************/
+
+ .globl xend
+xend:
+ cs
+ lidt idtarg_realmode-_start+RELOC
+ cs
+ lgdt gdtarg-_start+RELOC
+#ifdef GAS291
+ ljmp $REAL_CODE_SEG,$1f-RELOC /* jump to a 16 bit segment */
+#else
+ ljmp $REAL_CODE_SEG,$1f-_start /* jump to a 16 bit segment */
+#endif /* GAS291 */
+1:
+ .code16
+ movw $REAL_DATA_SEG,%ax
+ movw %ax,%ds
+ movw %ax,%ss
+ movw %ax,%es
+
+ /* clear the PE bit of CR0 */
+ movl %cr0,%eax
+ andl $0!CR0_PE,%eax
+ movl %eax,%cr0
+
+ /* make intersegment jmp to flush the processor pipeline
+ * and reload %cs:%eip (to clear upper 16 bits of %eip).
+ */
+ DATA32 ljmp $(RELOC)>>4,$2f-_start
+2:
+ /* we are in real mode now
+ * set up the real mode segment registers : %ds, %ss, %es
+ */
+ movw %cs,%ax
+ movw %ax,%ds
+ movw %ax,%es
+ movw %ax,%ss
+ xorl %esp,%esp
+ ADDR32 movw initsp-RELOC,%sp
+
+ movw $0,%ax
+ movw %ax,%fs
+ movw %ax,%gs
+
+ sti
+ jmp _start
+
+ .code32
+#endif /* IMAGE_MULTIBOOT */
+
+.global get_cs
+get_cs:
+ xorl %eax,%eax
+ movw %cs,%ax
+ ret
+
+.global get_ds
+get_ds:
+ xorl %eax,%eax
+ movw %ds,%ax
+ ret
+
+.global getsp
+getsp:
+ movl %esp,%eax /* GET STACK POINTER */
+ subl $4, %eax /* ACCOUNT FOR RETURN ADDRESS ON */
+ ret
+
+.global get_gdtbase
+get_gdtbase:
+ sub $8,%esp /* ALLOCATE ROOM ON THE STACK */
+ sgdt (%esp,1) /*STORE IGDT REGISTER ON STACK */
+ mov 2(%esp),%eax /* READ GDT BASE ADDRESS */
+ mov $KERN_DATA_SEG,%dx /* ASSUME UNIVERSAL DS. */
+ add $8,%esp /* RESTORE STACK */
+ ret /* DONE */
+
+.global get_gdtsize
+get_gdtsize:
+ sub $8,%esp /* ALLOCATE ROOM ON THE STACK */
+ sgdt (%esp,1) /*STORE IGDT REGISTER ON STACK */
+ xor %eax,%eax
+ mov 2(%esp),%eax /* READ GDT BASE ADDRESS */
+ mov (%ESP),%ax
+ shr $3,%ax
+ add $8,%esp /* RESTORE STACK */
+ ret /* DONE */
+
+.global get_idtbase
+get_idtbase:
+ sub $8,%esp
+ sidt (%esp,1) /* STORE IIDT REGISTER ON STACK */
+ mov 2(%esp),%eax
+ mov $KERN_DATA_SEG,%dx
+ add $8,%esp
+ ret
+
+.global get_lw
+get_lw:
+ xor %edx,%edx
+ mov 8(%esp),%eax
+ mov 4(%esp),%dx
+ ret
+
+/**************************************************************************
+SETJMP - Save stack context for non-local goto
+**************************************************************************/
+ .globl setjmp
+setjmp:
+ mov 4(%esp),%ecx
+ mov 0(%esp),%edx
+ mov %edx,0(%ecx)
+ mov %ebx,4(%ecx)
+ mov %esp,8(%ecx)
+ mov %ebp,12(%ecx)
+ mov %esi,16(%ecx)
+ mov %edi,20(%ecx)
+ mov %eax,24(%ecx)
+ mov $0,%eax
+ ret
+
+/**************************************************************************
+LONGJMP - Non-local jump to a saved stack context
+**************************************************************************/
+ .globl longjmp
+longjmp:
+ mov 4(%esp),%edx
+ mov 8(%esp),%eax
+ mov 0(%edx),%ecx
+ mov 4(%edx),%ebx
+ mov 8(%edx),%esp
+ mov 12(%edx),%ebp
+ mov 16(%edx),%esi
+ mov 20(%edx),%edi
+ cmp $0,%eax
+ jne 1f
+ mov $1,%eax
+1: mov %ecx,0(%esp)
+ ret
+
+/**************************************************************************
+_REAL_TO_PROT - Go from REAL mode to Protected Mode
+**************************************************************************/
+ .globl _real_to_prot
+_real_to_prot:
+ .code16
+ cli
+ cs
+ ADDR32 lgdt gdtarg-_start
+ movl %cr0,%eax
+ orl $CR0_PE,%eax
+ movl %eax,%cr0 /* turn on protected mode */
+
+ /* flush prefetch queue, and reload %cs:%eip */
+ DATA32 ljmp $KERN_CODE_SEG,$1f
+1:
+ .code32
+ /* reload other segment registers */
+ movl $KERN_DATA_SEG,%eax
+ movl %eax,%ds
+ movl %eax,%es
+ movl %eax,%ss
+ addl $RELOC,%esp /* Fix up stack pointer */
+ xorl %eax,%eax
+ movl %eax,%fs
+ movl %eax,%gs
+ popl %eax /* Fix up return address */
+ addl $RELOC,%eax
+ pushl %eax
+ ret
+
+/**************************************************************************
+_PROT_TO_REAL - Go from Protected Mode to REAL Mode
+**************************************************************************/
+ .globl _prot_to_real
+_prot_to_real:
+ .code32
+ popl %eax
+ subl $RELOC,%eax /* Adjust return address */
+ pushl %eax
+ subl $RELOC,%esp /* Adjust stack pointer */
+#ifdef GAS291
+ ljmp $REAL_CODE_SEG,$1f-RELOC /* jump to a 16 bit segment */
+#else
+ ljmp $REAL_CODE_SEG,$1f-_start /* jump to a 16 bit segment */
+#endif /* GAS291 */
+1:
+ .code16
+ movw $REAL_DATA_SEG,%ax
+ movw %ax,%ds
+ movw %ax,%ss
+ movw %ax,%es
+ movw %ax,%fs
+ movw %ax,%gs
+ cli
+
+ /* clear the PE bit of CR0 */
+ movl %cr0,%eax
+ andl $0!CR0_PE,%eax
+ movl %eax,%cr0
+
+ /* make intersegment jmp to flush the processor pipeline
+ * and reload %cs:%eip (to clear upper 16 bits of %eip).
+ */
+ DATA32 ljmp $(RELOC)>>4,$2f-_start
+2:
+ /* we are in real mode now
+ * set up the real mode segment registers : %ds, $ss, %es
+ */
+ movw %cs,%ax
+ movw %ax,%ds
+ movw %ax,%es
+ movw %ax,%ss
+#if 0
+ sti
+#endif
+ DATA32 ret /* There is a 32 bit return address on the stack */
+ .code32
+
+/**************************************************************************
+GLOBAL DESCRIPTOR TABLE
+**************************************************************************/
+ .align 4
+Idt_Reg:
+ .word 0x3ff
+ .long 0
+
+ .align 4
+_gdt:
+gdtarg:
+Gdt_Table:
+ .word 0x27 /* limit */
+ .long _gdt /* addr */
+ .word 0
+_pmcs:
+ /* 32 bit protected mode code segment */
+ .word 0xffff,0
+ .byte 0,0x9f,0xcf,0
+
+_pmds:
+ /* 32 bit protected mode data segment */
+ .word 0xffff,0
+ .byte 0,0x93,0xcf,0
+
+_rmcs:
+ /* 16 bit real mode code segment */
+ .word 0xffff,(RELOC&0xffff)
+ .byte (RELOC>>16),0x9b,0x00,(RELOC>>24)
+
+_rmds:
+ /* 16 bit real mode data segment */
+ .word 0xffff,(RELOC&0xffff)
+ .byte (RELOC>>16),0x93,0x00,(RELOC>>24)
+
+ .align 4
+RUN_GDT: /* POINTER TO GDT IN RAM */
+ .byte 0x7f,0 /* [BSP_GDT_NUM*8]-1 */
+ .long Gdt_Table
+
+ .align 4
+
+ .section ".rodata"
+err_not386:
+ .ascii "Etherboot/32 requires 386+"
+ .byte 0x0d, 0x0a
+err_not386_end:
+
+days: .long 0
+irq_num: .long
+
+ .data
+ .align 4
+ .org 2048
+.global stktop
+stktop:
+ .long
+
+.section ".armando"
+/* Â Â Â Â Â Â Â Â 1:::::::::2:::::::::3:::::::3 */
+/* Â Â Â Â 12345678901234567890123456789012345678 */
+/* Â Â Â v----+----v----+----v----+----v----+--- */
+
+.global EtherbootString
+EtherbootString:
+.ascii "EtherBoot MPCC " /* fw identifier */
+
+.byte 0, 0 /* mandatory hole */
+
+.long _start /* entry point */
+.word 0
+.byte 'E' /* type */
+.byte 0 /* selector */
+.word 0 /* CRC */
--- /dev/null
+
+CC=gcc
+CFLAGS=-Wall -O2
+
+bin2intelhex:
+
+
+clean:
+ rm -f bin2intelhex core *.o
--- /dev/null
+/* name : bin2intelhex.c
+ * from : Jean Marc Lacroix <jeanmarc.lacroix@free.fr>
+ * date : 06/12/1997.
+ * abstract : Y have rewrite this program from ????? with some modifications
+ * to add :
+ * - the Intel specification.
+ * - correct a bug because my prom programmer don't understand the
+ * initial format. Y suspect a bug in the calcul of the lrc
+ * in the original program.
+ * - correct the format of printf . In the original program, it was
+ * %x, and it is in fact %X, because in the Intel Format, all the
+ * char are in upper case.
+ * - correct the lrc calculation.
+ * usage:
+ *-------
+ * this program read the standard input and put to the standard output
+ * the result of the conversion.
+ * an example of use :
+ * cat my_bin | bin2intelhex > my_bin.hex or.....
+ * bin2intelhex < my_bin > my_bin.hex
+ */
+
+
+/*
+ * $Id$
+ * $Log$
+ * Revision 1.1 2005/05/17 16:45:06 mcb30
+ * Initial revision
+ *
+ * Revision 1.9 1997/12/14 05:14:54 install
+ * - some documentation....
+ *
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+
+/* Intel Hex format specifications
+
+The 8-bit Intel Hex File Format is a printable ASCII format consisting of one
+ or more data records followed by an end of file record. Each
+record consists of one line of information. Data records may appear in any
+ order. Address and data values are represented as 2 or 4 hexadecimal
+digit values.
+
+Record Format
+:LLAAAARRDDDD......DDDDCC
+
+
+LL
+AAAA
+RR
+DD
+CC
+Length field. Number of data bytes.
+Address field. Address of first byte.
+Record type field. 00 for data and 01 for end of record.
+Data field.
+Checksum field. One's complement of length, address, record type and data
+ fields modulo 256.
+CC = LL + AAAA + RR + all DD = 0
+
+Example:
+:06010000010203040506E4
+:00000001FF
+
+The first line in the above example Intel Hex file is a data record addressed
+ at location 100H with data values 1 to 6. The second line is the end
+of file record, so that the LL field is 0
+
+*/
+
+
+typedef unsigned char t_u8;
+typedef unsigned short t_u16;
+/*
+ * the choice for the total length (16) of a line, but the specification
+ * can support an another value
+ */
+#define LL_MAX_LINE 16
+typedef struct
+{
+ t_u8 intel_lg_data;
+ t_u16 intel_adr;
+ t_u8 intel_type;
+ t_u8 intel_data [LL_MAX_LINE];
+ t_u8 intel_lrc;
+} t_one_line;
+#define INTEL_DATA_TYPE 0
+#define EXIT_OK 0
+int main (const int argc, const char ** const argv)
+{
+ t_one_line line;
+ /*
+ * init for the adress, please note that it is assume that the program begin at 0
+ */
+ line.intel_adr = 0;
+ line.intel_type = INTEL_DATA_TYPE;
+ /*
+ * read the data on the standard input
+ */
+ while ((line.intel_lg_data = read (0, &line.intel_data [0] ,LL_MAX_LINE )) > 0)
+ {
+ t_u8 i;
+ /*
+ * and now for this line, calculate the lrc.
+ */
+ line.intel_lrc = line.intel_lg_data;
+ line.intel_lrc += ((line.intel_adr >> 8) & 0xff);
+ line.intel_lrc += (line.intel_adr &0xff);
+ line.intel_lrc += line.intel_type;
+ /*
+ * the structure is ready, print it to stdout in the
+ * right format
+ */
+ (void) printf (":%02X%04X%02X",
+ line.intel_lg_data,
+ line.intel_adr,
+ line.intel_type);
+ /*
+ * edit all the data read
+ */
+ for (i=0; i<line.intel_lg_data; i++)
+ {
+ (void) printf ("%02X",
+ (line.intel_data [i] & 0xff));
+ /*
+ * add to the lrc the data print
+ */
+ line.intel_lrc +=line.intel_data [i];
+ }
+ /*
+ * edit the value of the lrc and new line for the next
+ */
+ (void) printf ("%02X\n",
+ (0x100 - line.intel_lrc) & 0xff);
+ /*
+ * prepare the new adress for the next line
+ */
+ line.intel_adr+=line.intel_lg_data;
+ }
+ /*
+ * print the last line with a length of 0 data, so that the lrc is easy to
+ * calculate (ff+01 =0)
+ */
+ printf (":00000001FF\n");
+ exit (EXIT_OK);
+}
--- /dev/null
+/*
+
+ Quick and dirty program to make intel-hex from a binary.
+
+ Written by R.E.Wolff@BitWizard.nl
+ This file is in the public domain
+
+ Typing started:
+
+ Mon Jun 16 00:24:15 MET DST 1997
+
+ programming stopped:
+
+ Mon Jun 16 00:31:27 MET DST 1997
+
+ debugging finished (2 bugs found):
+ Mon Jun 16 00:32:52 MET DST 1997
+
+---------------------------------------------------------
+
+ Doc written in timeout. Everything else in this file was done while
+ the timer was running.
+
+ I promised "Mark Kopecki" that writing the bin-to-intel-hex
+ converter would cost less than 15 minutes, and that it would be more
+ trouble to find a converter on the net than to write the converter
+ myself. I ended up spending over half an hour searching for
+ spec/converter/docs because of unreachable hosts on the internet. I
+ got a file with docs, after that it was 8 minutes.....
+
+---------------------------------------------------------
+
+*/
+
+
+#include <stdio.h>
+#include <unistd.h>
+
+/* Intel Hex format:
+
+ ll aaaa tt dd....dd cc
+
+ ll = length
+ aaaa = address
+ tt = type
+ dd....dd = data
+ cc = checksum.
+*/
+
+
+int main (int argc, char **argv)
+{
+ unsigned char buf[32];
+ int addr = 0;
+ int n,i;
+
+ while ((n = read (0, buf+4, 16)) > 0) {
+ buf[0] = n;
+ buf[1] = addr >> 8;
+ buf[2] = addr & 0xff;
+ buf[3] = 0x00;
+ buf[4+n] = 0x00;
+
+ for (i=0;i<4+n;i++)
+ buf[4+n] -= buf[i];
+ printf (":");
+ for (i=0;i<= 4+n;i++)
+ printf ("%02x", buf[i]);
+ printf ("\n");
+ addr += n;
+ }
+ printf (":0000000001ff\n");
+ exit (0);
+}
--- /dev/null
+bochsout.txt
+parport.out
+ne2k-tx.log
+ne2k-txdump.txt
+
--- /dev/null
+all : serial-console.1
+
+%.1 : %
+ pod2man $< > $@
+
+clean :
+ rm -f serial-console.1
--- /dev/null
+Running Etherboot within Bochs
+==============================
+
+Michael Brown <mbrown@fensystems.co.uk>
+Based on an idea suggested by H. Peter Anvin <hpa@zytor.com>.
+
+$Id$
+
+Bochs is a program that simulates a complete Intel x86 computer,
+including hardware. It can be used to test Etherboot. There is a
+special pseudo NIC ("pnic") implemented in Bochs, with a corresponding
+driver in Etherboot. (There is also an NE2000 ISA driver in Bochs,
+but it doesn't seem to quite work.)
+
+To get bochs running is fairly simple:
+
+1. Get the bochs source code:
+ a) cvs -d:pserver:anonymous:@cvs.sourceforge.net:/cvsroot/bochs login
+ b) cvs -d:pserver:anonymous:@cvs.sourceforge.net:/cvsroot/bochs co bochs
+
+2. Configure bochs with
+ ./configure --enable-all-optimisations --enable-pci \
+ --enable-ne2000 --enable-pnic
+ Other potentially useful configure options:
+ --prefix=/usr
+ to force use of standard file locations
+ --enable-debugger
+ to enable the internal debugger
+
+3. Build bochs:
+ make
+
+4. Configure Etherboot with CONFIG_PCI_DIRECT: add the line
+ CFLAGS += -DCONFIG_PCI_DIRECT
+ to the end of src/arch/i386/Config.
+
+5. Build bin/pnic.zrom:
+ make bin/pnic.zrom
+
+6. Load the TUN/TAP kernel module:
+ modprobe tun
+ You should see the device /dev/net/tun is created automatically if
+ you're using devfs, otherwise you may have to create it by hand with:
+ mknod /dev/net/tun c 10 200
+
+7. Grant yourself write access to /dev/net/tun:
+ su -c 'chown <your user id> /dev/net/tun'
+ The alternative to this is to run Bochs as root. Don't do that.
+
+8. Add the following fragment to /etc/dhcpd.conf:
+ subnet 10.254.254.0 netmask 255.255.255.252 {
+ range dynamic-bootp 10.254.254.1 10.254.254.1;
+ }
+ You will also need to add in any of your usual declarations for
+ Etherboot, e.g. 'filename "vmlinuz.ltsp";'. Note that this setup
+ assumes that your DHCP server, TFTP server etc. all live on the
+ machine you are using for running Bochs. If not, then you're on
+ your own.
+
+9. Change back to this directory and run bochs from your Bochs source tree:
+ cd /path/to/Etherboot/contrib/bochs
+ /path/to/bochs/source/tree/bochs
+
+10. Select option 5 (Begin simulation). You will be prompted for your
+ root password. This is required in order to configure the tun1
+ network interface and to restart the DHCP server.
+
+11. You should see Bochs start up and attempt to boot from the network,
+ with a screen that looks like:
+
+VGA BIOS - Version 2.40
+Copyright (C) 1990-2000 Elpin Systems, Inc.
+All rights reserved.
+
+Licensed for use with bochs, courtesy of MandrakeSoft.
+
+For information on this or other VGA development products, contact
+Elpin Systems at: (800) 723-9038 or www.elpin.com
+
+Bochs BIOS, 1 cpu, $Revision$ $Date$
+
+
+Etherboot 5.3.6 (GPL) http://etherboot.org Tagged ELF for [PNIC]
+Relocating _text from: [00091020,0009fb50) to [01ef14d0,01f00000)
+Boot from (N)etwork or (Q)uit?
+
+Probing pci nic...
+[pnic] - Detected Bochs Pseudo NIC MAC FE:FD:00:00:00:01 (API v1.0) at 0xdc00
+Searching for server (DHCP)...
+..Me: 10.254.254.1, Server: 10.254.254.2
+Loading 10.254.254.2:/tftpboot/kernel
+
+
+
+
+Serial console
+==============
+
+You can use the program "serial-console" to obtain a virtual serial
+console for Etherboot running within Bochs. Simply run
+"./serial-console" on a spare tty (e.g. a separate xterm window)
+before starting Bochs, and ensure that you have compiled Etherboot
+with appropriate settings such as
+ CFLAGS+= -DCONSOLE_DUAL -DCOMCONSOLE=0x3F8 -DCONSPEED=9600
+
+There is a manual page for "serial-console"; use
+"man ./serial-console.1" to view it.
+
+
+
+TODO
+====
+
+Packet forwarding/masquerading - document what must be set up.
+
+Mention possibility of using RFB as the display device - in
+conjunction with the serial console, gives you a test facility that
+can be accessed remotely.
+
+Mention use of BOCHSBP instruction (xchgw %bx,%bx) to avoid need to
+calculate breakpoints.
--- /dev/null
+# You many now use double quotes around pathnames, in case
+# your pathname includes spaces.
+
+#=======================================================================
+# CONFIG_INTERFACE
+#
+# The configuration interface is a series of menus or dialog boxes that
+# allows you to change all the settings that control Bochs's behavior.
+# There are two choices of configuration interface: a text mode version
+# called "textconfig" and a graphical version called "wx". The text
+# mode version uses stdin/stdout and is always compiled in. The graphical
+# version is only available when you use "--with-wx" on the configure
+# command. If you do not write a config_interface line, Bochs will
+# choose a default for you.
+#
+# NOTE: if you use the "wx" configuration interface, you must also use
+# the "wx" display library.
+#=======================================================================
+#config_interface: textconfig
+#config_interface: wx
+
+#=======================================================================
+# DISPLAY_LIBRARY
+#
+# The display library is the code that displays the Bochs VGA screen. Bochs
+# has a selection of about 10 different display library implementations for
+# different platforms. If you run configure with multiple --with-* options,
+# the display_library command lets you choose which one you want to run with.
+# If you do not write a display_library line, Bochs will choose a default for
+# you.
+#
+# The choices are:
+# x use X windows interface, cross platform
+# win32 use native win32 libraries
+# carbon use Carbon library (for MacOS X)
+# beos use native BeOS libraries
+# macintosh use MacOS pre-10
+# amigaos use native AmigaOS libraries
+# sdl use SDL library, cross platform
+# svga use SVGALIB library for Linux, allows graphics without X11
+# term text only, uses curses/ncurses library, cross platform
+# rfb provides an interface to AT&T's VNC viewer, cross platform
+# wx use wxWindows library, cross platform
+# nogui no display at all
+#
+# NOTE: if you use the "wx" configuration interface, you must also use
+# the "wx" display library.
+#=======================================================================
+#display_library: amigaos
+#display_library: beos
+#display_library: carbon
+#display_library: macintosh
+#display_library: nogui
+#display_library: rfb
+#display_library: sdl
+#display_library: term
+#display_library: win32
+#display_library: wx
+#display_library: x
+
+#=======================================================================
+# ROMIMAGE:
+# You now need to load a ROM BIOS into F0000-FFFFF. I've wiped
+# out most of the BIOS hooks, and replace them with real BIOS
+# support. Normally, you can use a precompiled BIOS in the bios/
+# directory, named BIOS-bochs-latest.
+#=======================================================================
+#romimage: bios/BIOS-bochs-970717a
+#romimage: file=bios/BIOS-bochs-latest, address=0xf0000
+romimage: file=$BXSHARE/BIOS-bochs-latest, address=0xf0000
+#romimage: file=bios/BIOS-bochs-2-processors, address=0xf0000
+#romimage: file=bios/BIOS-bochs-4-processors, address=0xf0000
+#romimage: file=bios/rombios.bin, address=0xf0000
+
+#=======================================================================
+# MEGS
+# set this to the default number of Megabytes of memory you want
+# to emulate. You may also pass the '-megs xyz' option to bochs
+#
+# The default is 32MB, most OS's won't need more than that.
+#=======================================================================
+#megs: 256
+#megs: 128
+#megs: 64
+megs: 32
+#megs: 16
+#megs: 8
+
+#=======================================================================
+# OPTROMIMAGE[1-4]:
+# You may now load up to 4 optional ROM images. Be sure to use a
+# read-only area, typically between C8000 and EFFFF. These optional
+# ROM images should not overwrite the rombios (located at
+# F0000-FFFFF) and the videobios (located at C0000-C7FFF).
+# Those ROM images will be initialized by the bios if they contain
+# the right signature (0x55AA).
+# It can also be a convenient way to upload some arbitary code/data
+# in the simulation, that can be retrieved by the boot loader
+#=======================================================================
+#optromimage1: file=optionalrom.bin, address=0xd0000
+#optromimage2: file=optionalrom.bin, address=0xd1000
+#optromimage3: file=optionalrom.bin, address=0xd2000
+#optromimage4: file=optionalrom.bin, address=0xd3000
+#optromimage1: file=../../src/bin/ne.zrom, address=0xd0000
+optromimage1: file=../../src/bin/pnic.zrom, address=0xd0000
+
+#=======================================================================
+# VGAROMIMAGE
+# You now need to load a VGA ROM BIOS into C0000.
+#=======================================================================
+#vgaromimage: bios/VGABIOS-lgpl-latest
+#vgaromimage: bios/VGABIOS-elpin-2.40
+vgaromimage: $BXSHARE/VGABIOS-elpin-2.40
+
+#=======================================================================
+# FLOPPYA:
+# Point this to pathname of floppy image file or device
+# This should be of a bootable floppy(image/device) if you're
+# booting from 'a'.
+#
+# You can set the initial status of the media to 'ejected' or 'inserted'.
+# floppya: 2_88=path, status=ejected (2.88M 3.5" floppy)
+# floppya: 1_44=path, status=inserted (1.44M 3.5" floppy)
+# floppya: 1_2=path, status=ejected (1.2M 5.25" floppy)
+# floppya: 720k=path, status=inserted (720K 3.5" floppy)
+# floppya: 360k=path, status=inserted (360K 5.25" floppy)
+#
+# The path should be the name of a disk image file. On unix, you can use
+# a raw device name such as /dev/fd0 on Linux. On WinNT and Win2k, use
+# drive letters such as a: or b: as the path. Raw floppy access is not
+# supported on Windows 95 and 98.
+#=======================================================================
+floppya: 1_44=/dev/fd0, status=inserted
+#floppya: file=../1.44, status=inserted
+#floppya: 1_44=/dev/fd0H1440, status=inserted
+#floppya: 1_2=../1_2, status=inserted
+#floppya: 1_44=a:, status=inserted
+#floppya: 1_44=a.img, status=inserted
+
+#=======================================================================
+# FLOPPYB:
+# See FLOPPYA above for syntax
+#=======================================================================
+#floppyb: 1_44=b:, status=inserted
+floppyb: 1_44=b.img, status=inserted
+
+#=======================================================================
+# ATA0, ATA1, ATA2, ATA3
+# ATA controller for hard disks and cdroms
+#
+# ata[0-3]: enabled=[0|1], ioaddr1=addr, ioaddr2=addr, irq=number
+#
+# These options enables up to 4 ata channels. For each channel
+# the two base io address and the irq must be specified.
+#
+# ata0 is enabled by default, with ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
+#
+# Examples:
+# ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
+# ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
+# ata2: enabled=1, ioaddr1=0x1e8, ioaddr2=0x3e8, irq=11
+# ata3: enabled=1, ioaddr1=0x168, ioaddr2=0x368, irq=9
+#=======================================================================
+ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
+ata1: enabled=0, ioaddr1=0x170, ioaddr2=0x370, irq=15
+ata2: enabled=0, ioaddr1=0x1e8, ioaddr2=0x3e8, irq=11
+ata3: enabled=0, ioaddr1=0x168, ioaddr2=0x368, irq=9
+
+#=======================================================================
+# ATA[0-3]-MASTER, ATA[0-3]-SLAVE
+#
+# This defines the type and characteristics of all attached ata devices:
+# type= type of attached device [disk|cdrom]
+# path= path of the image
+# cylinders= only valid for disks
+# heads= only valid for disks
+# spt= only valid for disks
+# status= only valid for cdroms [inserted|ejected]
+# biosdetect= type of biosdetection [none|auto], only for disks on ata0 [cmos]
+# translation=type of transation of the bios, only for disks [none|lba|large|rechs|auto]
+# model= string returned by identify device command
+#
+# Point this at a hard disk image file, cdrom iso file, or physical cdrom
+# device. To create a hard disk image, try running bximage. It will help you
+# choose the size and then suggest a line that works with it.
+#
+# In UNIX it may be possible to use a raw device as a Bochs hard disk,
+# but WE DON'T RECOMMEND IT. In Windows there is no easy way.
+#
+# In windows, the drive letter + colon notation should be used for cdroms.
+# Depending on versions of windows and drivers, you may only be able to
+# access the "first" cdrom in the system. On MacOSX, use path="drive"
+# to access the physical drive.
+#
+# The path, cylinders, heads, and spt are mandatory for type=disk
+# The path is mandatory for type=cdrom
+#
+# Default values are:
+# biosdetect=auto, translation=auto, model="Generic 1234"
+#
+# The biosdetect option has currently no effect on the bios
+#
+# Examples:
+# ata0-master: type=disk, path=10M.sample, cylinders=306, heads=4, spt=17
+# ata0-slave: type=disk, path=20M.sample, cylinders=615, heads=4, spt=17
+# ata1-master: type=disk, path=30M.sample, cylinders=615, heads=6, spt=17
+# ata1-slave: type=disk, path=46M.sample, cylinders=940, heads=6, spt=17
+# ata2-master: type=disk, path=62M.sample, cylinders=940, heads=8, spt=17
+# ata2-slave: type=disk, path=112M.sample, cylinders=900, heads=15, spt=17
+# ata3-master: type=disk, path=483M.sample, cylinders=1024, heads=15, spt=63
+# ata3-slave: type=cdrom, path=iso.sample, status=inserted
+#=======================================================================
+#ata0-master: type=disk, path="30M.sample", cylinders=615, heads=6, spt=17
+#ata0-slave: type=cdrom, path=D:, status=inserted
+#ata0-slave: type=cdrom, path=/dev/cdrom, status=inserted
+#ata0-slave: type=cdrom, path="drive", status=inserted
+
+#=======================================================================
+#
+# The DISKC option is deprecated. Use ATA* options instead.
+#
+# DISKC: file=, cyl=, heads=, spt=
+# Point this at a hard disk image file. To create
+# a hard disk image, try running bximage. It will help you choose the
+# size and then suggest a diskc line that works with it.
+#
+# In UNIX it may be possible to use a raw device as a Bochs hard disk,
+# but WE DON'T RECOMMEND IT. In Windows there is no easy way.
+#
+# Examples:
+# diskc: file=10M.sample, cyl=306, heads=4, spt=17
+# diskc: file=20M.sample, cyl=615, heads=4, spt=17
+# diskc: file=30M.sample, cyl=615, heads=6, spt=17
+# diskc: file=46M.sample, cyl=940, heads=6, spt=17
+# diskc: file=62M.sample, cyl=940, heads=8, spt=17
+# diskc: file=112M.sample, cyl=900, heads=15, spt=17
+# diskc: file=483M.sample, cyl=1024, heads=15, spt=63
+#=======================================================================
+#diskc: file="30M.sample", cyl=615, heads=6, spt=17
+
+#=======================================================================
+#
+# The DISKD option is deprecated. Use ATA* options instead.
+#
+# DISKD:
+# See DISKC above for syntax
+#
+# NOTE: diskd and cdromd must not be used together!
+#=======================================================================
+#diskd: file="diskd.img", cyl=615, heads=6, spt=17
+
+#=======================================================================
+#
+# The CDROMD option is deprecated. Use ATA* options instead.
+#
+# CDROMD:
+#
+# cdromd: dev=/dev/cdrom, status=inserted
+# cdromd: dev=/dev/cdrom, status=ejected
+# cdromd: dev=e:, status=ejected
+#
+# In windows, the drive letter + colon notation should be used for cdroms.
+# Depending on versions of windows and drivers, you may only be able to
+# access the "first" cdrom in the system. On MacOSX, use path="drive"
+# to access the physical drive.
+#
+# NOTE: diskd and cdromd must not be used together!
+#=======================================================================
+#cdromd: dev=D:, status=inserted
+#cdromd: dev=/dev/cdrom, status=inserted
+#cdromd: dev="drive", status=inserted
+
+#=======================================================================
+# NEWHARDDRIVESUPPORT: enabled=[0|1]
+# As of cvs version on 5/17/2001, newharddrivesupport is on by default.
+#=======================================================================
+#newharddrivesupport: enabled=1
+
+#=======================================================================
+# BOOT:
+# This defines your boot drive.
+# You can either boot from 'floppy', 'disk' or 'cdrom'
+# legacy 'a' and 'c' are also supported
+# Examples:
+# boot: floppy
+# boot: disk
+# boot: cdrom
+# boot: c
+# boot: a
+#=======================================================================
+#boot: floppy
+#boot: disk
+
+#=======================================================================
+# FLOPPY_BOOTSIG_CHECK: disabled=[0|1]
+# Enables or disables the 0xaa55 signature check on boot floppies
+# Defaults to disabled=0
+# Examples:
+# floppy_bootsig_check: disabled=0
+# floppy_bootsig_check: disabled=1
+#=======================================================================
+#floppy_bootsig_check: disabled=1
+floppy_bootsig_check: disabled=0
+
+#=======================================================================
+# LOG:
+# Give&nb