ia64/xen-unstable

changeset 838:71f9c171157e

bitkeeper revision 1.520 (3f8d13d8qVVqxcYD--4cXYs5egqNyg)

Many files:
Fix the minos license so that it is usable for XP and BSD ports.
minios.lds:
Rename: extras/mini-os/vmlinux.lds -> extras/mini-os/minios.lds
.del-list.h~d612a8726e8d42e:
Delete: extras/mini-os/h/list.h
.del-COPYING~1f9753354580bd13:
Delete: extras/mini-os/COPYING
author kaf24@scramble.cl.cam.ac.uk
date Wed Oct 15 09:31:04 2003 +0000 (2003-10-15)
parents a9b037118083
children c727b650bf0c
files .rootkeys extras/mini-os/COPYING extras/mini-os/Makefile extras/mini-os/entry.S extras/mini-os/events.c extras/mini-os/h/hypervisor.h extras/mini-os/h/list.h extras/mini-os/h/mm.h extras/mini-os/h/os.h extras/mini-os/h/time.h extras/mini-os/hypervisor.c extras/mini-os/kernel.c extras/mini-os/lib/malloc.c extras/mini-os/minios.lds extras/mini-os/mm.c extras/mini-os/time.c extras/mini-os/traps.c extras/mini-os/vmlinux.lds
line diff
     1.1 --- a/.rootkeys	Tue Oct 14 23:57:45 2003 +0000
     1.2 +++ b/.rootkeys	Wed Oct 15 09:31:04 2003 +0000
     1.3 @@ -6,7 +6,6 @@ 3eb788d6Kleck_Cut0ouGneviGzliQ Makefile
     1.4  3f5ef5a24IaQasQE2tyMxrfxskMmvw README
     1.5  3f5ef5a2l4kfBYSQTUaOyyD76WROZQ README.CD
     1.6  3f69d8abYB1vMyD_QVDvzxy5Zscf1A TODO
     1.7 -3f831e59ioQmSyYPOsQ0z-AtLVXiSg extras/mini-os/COPYING
     1.8  3f815144d1vI2777JI-dO4wk49Iw7g extras/mini-os/Makefile
     1.9  3f815144zTnCV5591ulIJQrpe5b-5Q extras/mini-os/README
    1.10  3f815144wiiDekmfMl9LIPIvhR83Uw extras/mini-os/entry.S
    1.11 @@ -14,7 +13,6 @@ 3f815144r7AHj8GPvc3Nl1L9OSsWIg extras/mi
    1.12  3f815144h-Chna6E38yo40jqU95G1Q extras/mini-os/h/events.h
    1.13  3f8151445bYdgThGHQPeOW49PsrJ_A extras/mini-os/h/hypervisor.h
    1.14  3f815144f2Vg3qb6tiwt2VZad-DWsg extras/mini-os/h/lib.h
    1.15 -3f815144iqXtdYup_pyfPSmDZuvZcg extras/mini-os/h/list.h
    1.16  3f81514437EzzRWAnZl4_Ej1oznMjg extras/mini-os/h/mm.h
    1.17  3f815144nbSjjT1h4m99-QPbeSWY0Q extras/mini-os/h/os.h
    1.18  3f815144L1t0AevJt2JDXPegv6JTrw extras/mini-os/h/time.h
    1.19 @@ -26,10 +24,10 @@ 3f8151451k5emQAlRe80JdIvfSN4VA extras/mi
    1.20  3f815145Mb9WSKjOPsYTLsPIvPyy4Q extras/mini-os/lib/math.c
    1.21  3f8151454rEuPjN74V2Bcu65RLnM-Q extras/mini-os/lib/printf.c
    1.22  3f815145MQZrUJV0iRmTK2KIhwB2wg extras/mini-os/lib/string.c
    1.23 +3f815145AYE58Kpmsj5U7oHDpVDZJA extras/mini-os/minios.lds
    1.24  3f815145CB8XdPUqsmhAjSDFuwOoqA extras/mini-os/mm.c
    1.25  3f815145vGYx1WY79voKkZB9yKwJKQ extras/mini-os/time.c
    1.26  3f815145xlKBAQmal9oces3G_Mvxqw extras/mini-os/traps.c
    1.27 -3f815145AYE58Kpmsj5U7oHDpVDZJA extras/mini-os/vmlinux.lds
    1.28  3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
    1.29  3e6377b24eQqYMsDi9XrFkIgTzZ47A tools/balloon/Makefile
    1.30  3e6377d6eiFjF1hHIS6JEIOFk62xSA tools/balloon/README
     2.1 --- a/extras/mini-os/COPYING	Tue Oct 14 23:57:45 2003 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,340 +0,0 @@
     2.4 -		    GNU GENERAL PUBLIC LICENSE
     2.5 -		       Version 2, June 1991
     2.6 -
     2.7 - Copyright (C) 1989, 1991 Free Software Foundation, Inc.
     2.8 -                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     2.9 - Everyone is permitted to copy and distribute verbatim copies
    2.10 - of this license document, but changing it is not allowed.
    2.11 -
    2.12 -			    Preamble
    2.13 -
    2.14 -  The licenses for most software are designed to take away your
    2.15 -freedom to share and change it.  By contrast, the GNU General Public
    2.16 -License is intended to guarantee your freedom to share and change free
    2.17 -software--to make sure the software is free for all its users.  This
    2.18 -General Public License applies to most of the Free Software
    2.19 -Foundation's software and to any other program whose authors commit to
    2.20 -using it.  (Some other Free Software Foundation software is covered by
    2.21 -the GNU Library General Public License instead.)  You can apply it to
    2.22 -your programs, too.
    2.23 -
    2.24 -  When we speak of free software, we are referring to freedom, not
    2.25 -price.  Our General Public Licenses are designed to make sure that you
    2.26 -have the freedom to distribute copies of free software (and charge for
    2.27 -this service if you wish), that you receive source code or can get it
    2.28 -if you want it, that you can change the software or use pieces of it
    2.29 -in new free programs; and that you know you can do these things.
    2.30 -
    2.31 -  To protect your rights, we need to make restrictions that forbid
    2.32 -anyone to deny you these rights or to ask you to surrender the rights.
    2.33 -These restrictions translate to certain responsibilities for you if you
    2.34 -distribute copies of the software, or if you modify it.
    2.35 -
    2.36 -  For example, if you distribute copies of such a program, whether
    2.37 -gratis or for a fee, you must give the recipients all the rights that
    2.38 -you have.  You must make sure that they, too, receive or can get the
    2.39 -source code.  And you must show them these terms so they know their
    2.40 -rights.
    2.41 -
    2.42 -  We protect your rights with two steps: (1) copyright the software, and
    2.43 -(2) offer you this license which gives you legal permission to copy,
    2.44 -distribute and/or modify the software.
    2.45 -
    2.46 -  Also, for each author's protection and ours, we want to make certain
    2.47 -that everyone understands that there is no warranty for this free
    2.48 -software.  If the software is modified by someone else and passed on, we
    2.49 -want its recipients to know that what they have is not the original, so
    2.50 -that any problems introduced by others will not reflect on the original
    2.51 -authors' reputations.
    2.52 -
    2.53 -  Finally, any free program is threatened constantly by software
    2.54 -patents.  We wish to avoid the danger that redistributors of a free
    2.55 -program will individually obtain patent licenses, in effect making the
    2.56 -program proprietary.  To prevent this, we have made it clear that any
    2.57 -patent must be licensed for everyone's free use or not licensed at all.
    2.58 -
    2.59 -  The precise terms and conditions for copying, distribution and
    2.60 -modification follow.
    2.61 -
    2.62 -		    GNU GENERAL PUBLIC LICENSE
    2.63 -   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    2.64 -
    2.65 -  0. This License applies to any program or other work which contains
    2.66 -a notice placed by the copyright holder saying it may be distributed
    2.67 -under the terms of this General Public License.  The "Program", below,
    2.68 -refers to any such program or work, and a "work based on the Program"
    2.69 -means either the Program or any derivative work under copyright law:
    2.70 -that is to say, a work containing the Program or a portion of it,
    2.71 -either verbatim or with modifications and/or translated into another
    2.72 -language.  (Hereinafter, translation is included without limitation in
    2.73 -the term "modification".)  Each licensee is addressed as "you".
    2.74 -
    2.75 -Activities other than copying, distribution and modification are not
    2.76 -covered by this License; they are outside its scope.  The act of
    2.77 -running the Program is not restricted, and the output from the Program
    2.78 -is covered only if its contents constitute a work based on the
    2.79 -Program (independent of having been made by running the Program).
    2.80 -Whether that is true depends on what the Program does.
    2.81 -
    2.82 -  1. You may copy and distribute verbatim copies of the Program's
    2.83 -source code as you receive it, in any medium, provided that you
    2.84 -conspicuously and appropriately publish on each copy an appropriate
    2.85 -copyright notice and disclaimer of warranty; keep intact all the
    2.86 -notices that refer to this License and to the absence of any warranty;
    2.87 -and give any other recipients of the Program a copy of this License
    2.88 -along with the Program.
    2.89 -
    2.90 -You may charge a fee for the physical act of transferring a copy, and
    2.91 -you may at your option offer warranty protection in exchange for a fee.
    2.92 -
    2.93 -  2. You may modify your copy or copies of the Program or any portion
    2.94 -of it, thus forming a work based on the Program, and copy and
    2.95 -distribute such modifications or work under the terms of Section 1
    2.96 -above, provided that you also meet all of these conditions:
    2.97 -
    2.98 -    a) You must cause the modified files to carry prominent notices
    2.99 -    stating that you changed the files and the date of any change.
   2.100 -
   2.101 -    b) You must cause any work that you distribute or publish, that in
   2.102 -    whole or in part contains or is derived from the Program or any
   2.103 -    part thereof, to be licensed as a whole at no charge to all third
   2.104 -    parties under the terms of this License.
   2.105 -
   2.106 -    c) If the modified program normally reads commands interactively
   2.107 -    when run, you must cause it, when started running for such
   2.108 -    interactive use in the most ordinary way, to print or display an
   2.109 -    announcement including an appropriate copyright notice and a
   2.110 -    notice that there is no warranty (or else, saying that you provide
   2.111 -    a warranty) and that users may redistribute the program under
   2.112 -    these conditions, and telling the user how to view a copy of this
   2.113 -    License.  (Exception: if the Program itself is interactive but
   2.114 -    does not normally print such an announcement, your work based on
   2.115 -    the Program is not required to print an announcement.)
   2.116 -
   2.117 -These requirements apply to the modified work as a whole.  If
   2.118 -identifiable sections of that work are not derived from the Program,
   2.119 -and can be reasonably considered independent and separate works in
   2.120 -themselves, then this License, and its terms, do not apply to those
   2.121 -sections when you distribute them as separate works.  But when you
   2.122 -distribute the same sections as part of a whole which is a work based
   2.123 -on the Program, the distribution of the whole must be on the terms of
   2.124 -this License, whose permissions for other licensees extend to the
   2.125 -entire whole, and thus to each and every part regardless of who wrote it.
   2.126 -
   2.127 -Thus, it is not the intent of this section to claim rights or contest
   2.128 -your rights to work written entirely by you; rather, the intent is to
   2.129 -exercise the right to control the distribution of derivative or
   2.130 -collective works based on the Program.
   2.131 -
   2.132 -In addition, mere aggregation of another work not based on the Program
   2.133 -with the Program (or with a work based on the Program) on a volume of
   2.134 -a storage or distribution medium does not bring the other work under
   2.135 -the scope of this License.
   2.136 -
   2.137 -  3. You may copy and distribute the Program (or a work based on it,
   2.138 -under Section 2) in object code or executable form under the terms of
   2.139 -Sections 1 and 2 above provided that you also do one of the following:
   2.140 -
   2.141 -    a) Accompany it with the complete corresponding machine-readable
   2.142 -    source code, which must be distributed under the terms of Sections
   2.143 -    1 and 2 above on a medium customarily used for software interchange; or,
   2.144 -
   2.145 -    b) Accompany it with a written offer, valid for at least three
   2.146 -    years, to give any third party, for a charge no more than your
   2.147 -    cost of physically performing source distribution, a complete
   2.148 -    machine-readable copy of the corresponding source code, to be
   2.149 -    distributed under the terms of Sections 1 and 2 above on a medium
   2.150 -    customarily used for software interchange; or,
   2.151 -
   2.152 -    c) Accompany it with the information you received as to the offer
   2.153 -    to distribute corresponding source code.  (This alternative is
   2.154 -    allowed only for noncommercial distribution and only if you
   2.155 -    received the program in object code or executable form with such
   2.156 -    an offer, in accord with Subsection b above.)
   2.157 -
   2.158 -The source code for a work means the preferred form of the work for
   2.159 -making modifications to it.  For an executable work, complete source
   2.160 -code means all the source code for all modules it contains, plus any
   2.161 -associated interface definition files, plus the scripts used to
   2.162 -control compilation and installation of the executable.  However, as a
   2.163 -special exception, the source code distributed need not include
   2.164 -anything that is normally distributed (in either source or binary
   2.165 -form) with the major components (compiler, kernel, and so on) of the
   2.166 -operating system on which the executable runs, unless that component
   2.167 -itself accompanies the executable.
   2.168 -
   2.169 -If distribution of executable or object code is made by offering
   2.170 -access to copy from a designated place, then offering equivalent
   2.171 -access to copy the source code from the same place counts as
   2.172 -distribution of the source code, even though third parties are not
   2.173 -compelled to copy the source along with the object code.
   2.174 -
   2.175 -  4. You may not copy, modify, sublicense, or distribute the Program
   2.176 -except as expressly provided under this License.  Any attempt
   2.177 -otherwise to copy, modify, sublicense or distribute the Program is
   2.178 -void, and will automatically terminate your rights under this License.
   2.179 -However, parties who have received copies, or rights, from you under
   2.180 -this License will not have their licenses terminated so long as such
   2.181 -parties remain in full compliance.
   2.182 -
   2.183 -  5. You are not required to accept this License, since you have not
   2.184 -signed it.  However, nothing else grants you permission to modify or
   2.185 -distribute the Program or its derivative works.  These actions are
   2.186 -prohibited by law if you do not accept this License.  Therefore, by
   2.187 -modifying or distributing the Program (or any work based on the
   2.188 -Program), you indicate your acceptance of this License to do so, and
   2.189 -all its terms and conditions for copying, distributing or modifying
   2.190 -the Program or works based on it.
   2.191 -
   2.192 -  6. Each time you redistribute the Program (or any work based on the
   2.193 -Program), the recipient automatically receives a license from the
   2.194 -original licensor to copy, distribute or modify the Program subject to
   2.195 -these terms and conditions.  You may not impose any further
   2.196 -restrictions on the recipients' exercise of the rights granted herein.
   2.197 -You are not responsible for enforcing compliance by third parties to
   2.198 -this License.
   2.199 -
   2.200 -  7. If, as a consequence of a court judgment or allegation of patent
   2.201 -infringement or for any other reason (not limited to patent issues),
   2.202 -conditions are imposed on you (whether by court order, agreement or
   2.203 -otherwise) that contradict the conditions of this License, they do not
   2.204 -excuse you from the conditions of this License.  If you cannot
   2.205 -distribute so as to satisfy simultaneously your obligations under this
   2.206 -License and any other pertinent obligations, then as a consequence you
   2.207 -may not distribute the Program at all.  For example, if a patent
   2.208 -license would not permit royalty-free redistribution of the Program by
   2.209 -all those who receive copies directly or indirectly through you, then
   2.210 -the only way you could satisfy both it and this License would be to
   2.211 -refrain entirely from distribution of the Program.
   2.212 -
   2.213 -If any portion of this section is held invalid or unenforceable under
   2.214 -any particular circumstance, the balance of the section is intended to
   2.215 -apply and the section as a whole is intended to apply in other
   2.216 -circumstances.
   2.217 -
   2.218 -It is not the purpose of this section to induce you to infringe any
   2.219 -patents or other property right claims or to contest validity of any
   2.220 -such claims; this section has the sole purpose of protecting the
   2.221 -integrity of the free software distribution system, which is
   2.222 -implemented by public license practices.  Many people have made
   2.223 -generous contributions to the wide range of software distributed
   2.224 -through that system in reliance on consistent application of that
   2.225 -system; it is up to the author/donor to decide if he or she is willing
   2.226 -to distribute software through any other system and a licensee cannot
   2.227 -impose that choice.
   2.228 -
   2.229 -This section is intended to make thoroughly clear what is believed to
   2.230 -be a consequence of the rest of this License.
   2.231 -
   2.232 -  8. If the distribution and/or use of the Program is restricted in
   2.233 -certain countries either by patents or by copyrighted interfaces, the
   2.234 -original copyright holder who places the Program under this License
   2.235 -may add an explicit geographical distribution limitation excluding
   2.236 -those countries, so that distribution is permitted only in or among
   2.237 -countries not thus excluded.  In such case, this License incorporates
   2.238 -the limitation as if written in the body of this License.
   2.239 -
   2.240 -  9. The Free Software Foundation may publish revised and/or new versions
   2.241 -of the General Public License from time to time.  Such new versions will
   2.242 -be similar in spirit to the present version, but may differ in detail to
   2.243 -address new problems or concerns.
   2.244 -
   2.245 -Each version is given a distinguishing version number.  If the Program
   2.246 -specifies a version number of this License which applies to it and "any
   2.247 -later version", you have the option of following the terms and conditions
   2.248 -either of that version or of any later version published by the Free
   2.249 -Software Foundation.  If the Program does not specify a version number of
   2.250 -this License, you may choose any version ever published by the Free Software
   2.251 -Foundation.
   2.252 -
   2.253 -  10. If you wish to incorporate parts of the Program into other free
   2.254 -programs whose distribution conditions are different, write to the author
   2.255 -to ask for permission.  For software which is copyrighted by the Free
   2.256 -Software Foundation, write to the Free Software Foundation; we sometimes
   2.257 -make exceptions for this.  Our decision will be guided by the two goals
   2.258 -of preserving the free status of all derivatives of our free software and
   2.259 -of promoting the sharing and reuse of software generally.
   2.260 -
   2.261 -			    NO WARRANTY
   2.262 -
   2.263 -  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
   2.264 -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
   2.265 -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
   2.266 -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
   2.267 -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   2.268 -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
   2.269 -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
   2.270 -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
   2.271 -REPAIR OR CORRECTION.
   2.272 -
   2.273 -  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
   2.274 -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
   2.275 -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
   2.276 -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
   2.277 -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
   2.278 -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
   2.279 -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
   2.280 -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
   2.281 -POSSIBILITY OF SUCH DAMAGES.
   2.282 -
   2.283 -		     END OF TERMS AND CONDITIONS
   2.284 -
   2.285 -	    How to Apply These Terms to Your New Programs
   2.286 -
   2.287 -  If you develop a new program, and you want it to be of the greatest
   2.288 -possible use to the public, the best way to achieve this is to make it
   2.289 -free software which everyone can redistribute and change under these terms.
   2.290 -
   2.291 -  To do so, attach the following notices to the program.  It is safest
   2.292 -to attach them to the start of each source file to most effectively
   2.293 -convey the exclusion of warranty; and each file should have at least
   2.294 -the "copyright" line and a pointer to where the full notice is found.
   2.295 -
   2.296 -    <one line to give the program's name and a brief idea of what it does.>
   2.297 -    Copyright (C) <year>  <name of author>
   2.298 -
   2.299 -    This program is free software; you can redistribute it and/or modify
   2.300 -    it under the terms of the GNU General Public License as published by
   2.301 -    the Free Software Foundation; either version 2 of the License, or
   2.302 -    (at your option) any later version.
   2.303 -
   2.304 -    This program is distributed in the hope that it will be useful,
   2.305 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   2.306 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   2.307 -    GNU General Public License for more details.
   2.308 -
   2.309 -    You should have received a copy of the GNU General Public License
   2.310 -    along with this program; if not, write to the Free Software
   2.311 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   2.312 -
   2.313 -
   2.314 -Also add information on how to contact you by electronic and paper mail.
   2.315 -
   2.316 -If the program is interactive, make it output a short notice like this
   2.317 -when it starts in an interactive mode:
   2.318 -
   2.319 -    Gnomovision version 69, Copyright (C) year name of author
   2.320 -    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
   2.321 -    This is free software, and you are welcome to redistribute it
   2.322 -    under certain conditions; type `show c' for details.
   2.323 -
   2.324 -The hypothetical commands `show w' and `show c' should show the appropriate
   2.325 -parts of the General Public License.  Of course, the commands you use may
   2.326 -be called something other than `show w' and `show c'; they could even be
   2.327 -mouse-clicks or menu items--whatever suits your program.
   2.328 -
   2.329 -You should also get your employer (if you work as a programmer) or your
   2.330 -school, if any, to sign a "copyright disclaimer" for the program, if
   2.331 -necessary.  Here is a sample; alter the names:
   2.332 -
   2.333 -  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
   2.334 -  `Gnomovision' (which makes passes at compilers) written by James Hacker.
   2.335 -
   2.336 -  <signature of Ty Coon>, 1 April 1989
   2.337 -  Ty Coon, President of Vice
   2.338 -
   2.339 -This General Public License does not permit incorporating your program into
   2.340 -proprietary programs.  If your program is a subroutine library, you may
   2.341 -consider it more useful to permit linking proprietary applications with the
   2.342 -library.  If this is what you want to do, use the GNU Library General
   2.343 -Public License instead of this License.
     3.1 --- a/extras/mini-os/Makefile	Tue Oct 14 23:57:45 2003 +0000
     3.2 +++ b/extras/mini-os/Makefile	Wed Oct 15 09:31:04 2003 +0000
     3.3 @@ -21,7 +21,7 @@ hypervisor-ifs:
     3.4  $(TARGET): hypervisor-ifs head.o $(OBJS)
     3.5  	# Image will load at 0xC0000000. First bytes from head.o
     3.6  	#$(LD) -N -Ttext 0xC0000000 head.o $(OBJS) -o $@.elf
     3.7 -	$(LD) -N -T vmlinux.lds head.o $(OBJS) -o $@.elf
     3.8 +	$(LD) -N -T minios.lds head.o $(OBJS) -o $@.elf
     3.9  	# Guest OS header -- first 8 bytes are identifier 'XenoGues'.
    3.10  	echo -e -n 'XenoGues' >$@ 
    3.11  	# Guest OS header -- next 4 bytes are load address (0xC0000000).
     4.1 --- a/extras/mini-os/entry.S	Tue Oct 14 23:57:45 2003 +0000
     4.2 +++ b/extras/mini-os/entry.S	Wed Oct 15 09:31:04 2003 +0000
     4.3 @@ -1,41 +1,13 @@
     4.4 -/*
     4.5 - *  linux/arch/i386/entry.S
     4.6 - *
     4.7 - *  Copyright (C) 1991, 1992  Linus Torvalds
     4.8 - *
     4.9 - *  Adjusted for XenoLinux use by K A Frasier
    4.10 - *  Adjusted for Xen minimal os by R Neugebauer
    4.11 - */
    4.12 -
    4.13          
    4.14  #include <os.h>
    4.15 -        
    4.16 -EBX		= 0x00
    4.17 -ECX		= 0x04
    4.18 -EDX		= 0x08
    4.19 -ESI		= 0x0C
    4.20 -EDI		= 0x10
    4.21 -EBP		= 0x14
    4.22 -EAX		= 0x18
    4.23 -DS		= 0x1C
    4.24 +
    4.25  ES		= 0x20
    4.26  ORIG_EAX	= 0x24
    4.27  EIP		= 0x28
    4.28  CS		= 0x2C
    4.29 -EFLAGS		= 0x30
    4.30 -OLDESP		= 0x34
    4.31 -OLDSS		= 0x38
    4.32  
    4.33 -CF_MASK		= 0x00000001
    4.34 -IF_MASK		= 0x00000200
    4.35 -NT_MASK		= 0x00004000
    4.36 -
    4.37 -/* Declare a globally-visible label */
    4.38  #define ENTRY(X) .globl X ; X :
    4.39  
    4.40 -/* A Linux hangover. Just ignore it. */
    4.41 -#define SYMBOL_NAME(X) X
    4.42 -        
    4.43  #define SAVE_ALL \
    4.44  	cld; \
    4.45  	pushl %es; \
    4.46 @@ -59,34 +31,15 @@ NT_MASK		= 0x00004000
    4.47  	popl %edi;	\
    4.48  	popl %ebp;	\
    4.49  	popl %eax;	\
    4.50 -1:	popl %ds;	\
    4.51 -2:	popl %es;	\
    4.52 -	addl $4,%esp;	\
    4.53 -3:	iret;		\
    4.54 -.section .fixup,"ax";	\
    4.55 -4:	movl $0,(%esp);	\
    4.56 -	jmp 1b;		\
    4.57 -5:	movl $0,(%esp);	\
    4.58 -	jmp 2b;		\
    4.59 -6:	pushl %ss;	\
    4.60  	popl %ds;	\
    4.61 -	pushl %ss;	\
    4.62  	popl %es;	\
    4.63 -	pushl $11;	\
    4.64 -        call do_exit;	\
    4.65 -.previous;		\
    4.66 -.section __ex_table,"a";\
    4.67 -	.align 4;	\
    4.68 -	.long 1b,4b;	\
    4.69 -	.long 2b,5b;	\
    4.70 -	.long 3b,6b;	\
    4.71 -.previous
    4.72 +	addl $4,%esp;	\
    4.73 +	iret;		\
    4.74  
    4.75  ENTRY(divide_error)
    4.76  	pushl $0		# no error code
    4.77 -	pushl $ SYMBOL_NAME(do_divide_error)
    4.78 -	.align 4
    4.79 -error_code:
    4.80 +	pushl $do_divide_error
    4.81 +do_exception:
    4.82  	pushl %ds
    4.83  	pushl %eax
    4.84  	xorl %eax,%eax
    4.85 @@ -112,20 +65,11 @@ error_code:
    4.86  	call *%edi
    4.87  	addl $8,%esp
    4.88  
    4.89 -# These are the tests Linux makes before exiting the OS back to userland.
    4.90 -# At these point preeemption may occur, or signals may get delivered.
    4.91 -ret_to_user_tests:
    4.92 -#        cmpl $0,need_resched(%ebx)
    4.93 -#        jne reschedule
    4.94 -#        cmpl $0,sigpending(%ebx)
    4.95 -#        je   safesti
    4.96 -        jmp safesti
    4.97 -               
    4.98          
    4.99  ret_from_exception:
   4.100          movb CS(%esp),%cl
   4.101 -	    test $2,%cl          # slow return to ring 2 or 3
   4.102 -	    jne  ret_to_user_tests
   4.103 +	test $2,%cl          # slow return to ring 2 or 3
   4.104 +	jne  safesti
   4.105          RESTORE_ALL
   4.106  
   4.107  # A note on the "critical region" in our callback handler.
   4.108 @@ -150,11 +94,11 @@ ENTRY(hypervisor_callback)
   4.109  11:     push %esp
   4.110          call do_hypervisor_callback
   4.111          add  $4,%esp
   4.112 -        movl SYMBOL_NAME(HYPERVISOR_shared_info),%esi
   4.113 +        movl HYPERVISOR_shared_info,%esi
   4.114          xorl %eax,%eax
   4.115          movb CS(%esp),%cl
   4.116      	test $2,%cl          # slow return to ring 2 or 3
   4.117 -	    jne  ret_to_user_tests
   4.118 +        jne  safesti
   4.119  safesti:btsl $31,4(%esi)     # reenable event callbacks
   4.120  scrit:  /**** START OF CRITICAL REGION ****/
   4.121          cmpl %eax,(%esi)
   4.122 @@ -207,105 +151,78 @@ critical_fixup_table:
   4.123         
   4.124  # Hypervisor uses this for application faults while it executes.
   4.125  ENTRY(failsafe_callback)
   4.126 -1:      pop  %ds
   4.127 -2:      pop  %es
   4.128 -3:      pop  %fs
   4.129 -4:      pop  %gs
   4.130 -5:      iret
   4.131 -.section .fixup,"ax";	\
   4.132 -6:	movl $0,(%esp);	\
   4.133 -	jmp 1b;		\
   4.134 -7:	movl $0,(%esp);	\
   4.135 -	jmp 2b;		\
   4.136 -8:	movl $0,(%esp);	\
   4.137 -	jmp 3b;		\
   4.138 -9:	movl $0,(%esp);	\
   4.139 -	jmp 4b;		\
   4.140 -10:	pushl %ss;	\
   4.141 -	popl %ds;	\
   4.142 -	pushl %ss;	\
   4.143 -	popl %es;	\
   4.144 -	pushl $11;	\
   4.145 -	call do_exit;	\
   4.146 -.previous;		\
   4.147 -.section __ex_table,"a";\
   4.148 -	.align 4;	\
   4.149 -	.long 1b,6b;	\
   4.150 -	.long 2b,7b;	\
   4.151 -	.long 3b,8b;	\
   4.152 -	.long 4b,9b;	\
   4.153 -	.long 5b,10b;	\
   4.154 -.previous
   4.155 +      pop  %ds
   4.156 +      pop  %es
   4.157 +      pop  %fs
   4.158 +      pop  %gs
   4.159 +      iret
   4.160                  
   4.161  ENTRY(coprocessor_error)
   4.162  	pushl $0
   4.163 -	pushl $ SYMBOL_NAME(do_coprocessor_error)
   4.164 -	jmp error_code
   4.165 +	pushl $do_coprocessor_error
   4.166 +	jmp do_exception
   4.167  
   4.168  ENTRY(simd_coprocessor_error)
   4.169  	pushl $0
   4.170 -	pushl $ SYMBOL_NAME(do_simd_coprocessor_error)
   4.171 -	jmp error_code
   4.172 +	pushl $do_simd_coprocessor_error
   4.173 +	jmp do_exception
   4.174  
   4.175  ENTRY(device_not_available)
   4.176 -	pushl $-1		# mark this as an int
   4.177 -	SAVE_ALL
   4.178 -	#call SYMBOL_NAME(math_state_restore)
   4.179 -	jmp ret_from_exception
   4.180 +        iret
   4.181  
   4.182  ENTRY(debug)
   4.183  	pushl $0
   4.184 -	pushl $ SYMBOL_NAME(do_debug)
   4.185 -	jmp error_code
   4.186 +	pushl $do_debug
   4.187 +	jmp do_exception
   4.188  
   4.189  ENTRY(int3)
   4.190  	pushl $0
   4.191 -	pushl $ SYMBOL_NAME(do_int3)
   4.192 -	jmp error_code
   4.193 +	pushl $do_int3
   4.194 +	jmp do_exception
   4.195  
   4.196  ENTRY(overflow)
   4.197  	pushl $0
   4.198 -	pushl $ SYMBOL_NAME(do_overflow)
   4.199 -	jmp error_code
   4.200 +	pushl $do_overflow
   4.201 +	jmp do_exception
   4.202  
   4.203  ENTRY(bounds)
   4.204  	pushl $0
   4.205 -	pushl $ SYMBOL_NAME(do_bounds)
   4.206 -	jmp error_code
   4.207 +	pushl $do_bounds
   4.208 +	jmp do_exception
   4.209  
   4.210  ENTRY(invalid_op)
   4.211  	pushl $0
   4.212 -	pushl $ SYMBOL_NAME(do_invalid_op)
   4.213 -	jmp error_code
   4.214 +	pushl $do_invalid_op
   4.215 +	jmp do_exception
   4.216  
   4.217  ENTRY(coprocessor_segment_overrun)
   4.218  	pushl $0
   4.219 -	pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun)
   4.220 -	jmp error_code
   4.221 +	pushl $do_coprocessor_segment_overrun
   4.222 +	jmp do_exception
   4.223  
   4.224  ENTRY(double_fault)
   4.225 -	pushl $ SYMBOL_NAME(do_double_fault)
   4.226 -	jmp error_code
   4.227 +	pushl $do_double_fault
   4.228 +	jmp do_exception
   4.229  
   4.230  ENTRY(invalid_TSS)
   4.231 -	pushl $ SYMBOL_NAME(do_invalid_TSS)
   4.232 -	jmp error_code
   4.233 +	pushl $do_invalid_TSS
   4.234 +	jmp do_exception
   4.235  
   4.236  ENTRY(segment_not_present)
   4.237 -	pushl $ SYMBOL_NAME(do_segment_not_present)
   4.238 -	jmp error_code
   4.239 +	pushl $do_segment_not_present
   4.240 +	jmp do_exception
   4.241  
   4.242  ENTRY(stack_segment)
   4.243 -	pushl $ SYMBOL_NAME(do_stack_segment)
   4.244 -	jmp error_code
   4.245 +	pushl $do_stack_segment
   4.246 +	jmp do_exception
   4.247  
   4.248  ENTRY(general_protection)
   4.249 -	pushl $ SYMBOL_NAME(do_general_protection)
   4.250 -	jmp error_code
   4.251 +	pushl $do_general_protection
   4.252 +	jmp do_exception
   4.253  
   4.254  ENTRY(alignment_check)
   4.255 -	pushl $ SYMBOL_NAME(do_alignment_check)
   4.256 -	jmp error_code
   4.257 +	pushl $do_alignment_check
   4.258 +	jmp do_exception
   4.259  
   4.260  # This handler is special, because it gets an extra value on its stack,
   4.261  # which is the linear faulting address.
   4.262 @@ -333,16 +250,16 @@ ENTRY(page_fault)
   4.263  	movl $(__KERNEL_DS),%edx
   4.264  	movl %edx,%ds
   4.265  	movl %edx,%es
   4.266 -	call SYMBOL_NAME(do_page_fault)
   4.267 +	call do_page_fault
   4.268  	addl $12,%esp
   4.269  	jmp ret_from_exception
   4.270  
   4.271  ENTRY(machine_check)
   4.272  	pushl $0
   4.273 -	pushl $ SYMBOL_NAME(do_machine_check)
   4.274 -	jmp error_code
   4.275 +	pushl $do_machine_check
   4.276 +	jmp do_exception
   4.277  
   4.278  ENTRY(spurious_interrupt_bug)
   4.279  	pushl $0
   4.280 -	pushl $ SYMBOL_NAME(do_spurious_interrupt_bug)
   4.281 -	jmp error_code
   4.282 +	pushl $do_spurious_interrupt_bug
   4.283 +	jmp do_exception
     5.1 --- a/extras/mini-os/events.c	Tue Oct 14 23:57:45 2003 +0000
     5.2 +++ b/extras/mini-os/events.c	Wed Oct 15 09:31:04 2003 +0000
     5.3 @@ -29,7 +29,7 @@ void default_handler(int ev, struct pt_r
     5.4  /*
     5.5   * demux events to different handlers
     5.6   */
     5.7 -asmlinkage unsigned int do_event(int ev, struct pt_regs *regs)
     5.8 +unsigned int do_event(int ev, struct pt_regs *regs)
     5.9  {
    5.10      ev_action_t  *action;
    5.11  
     6.1 --- a/extras/mini-os/h/hypervisor.h	Tue Oct 14 23:57:45 2003 +0000
     6.2 +++ b/extras/mini-os/h/hypervisor.h	Wed Oct 15 09:31:04 2003 +0000
     6.3 @@ -1,13 +1,3 @@
     6.4 -
     6.5 -/******************************************************************************
     6.6 - * hypervisor.h
     6.7 - * 
     6.8 - * Linux-specific hypervisor handling.
     6.9 - * 
    6.10 - * Adjusted by R Neugebauer for Xen minimal OS
    6.11 - *
    6.12 - * Copyright (c) 2002, K A Fraser
    6.13 - */
    6.14  
    6.15  #ifndef _HYPERVISOR_H_
    6.16  #define _HYPERVISOR_H_
     7.1 --- a/extras/mini-os/h/list.h	Tue Oct 14 23:57:45 2003 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,164 +0,0 @@
     7.4 -#ifndef _LINUX_LIST_H
     7.5 -#define _LINUX_LIST_H
     7.6 -
     7.7 -#define ASSERT(x) ((void)0)
     7.8 -
     7.9 -/*
    7.10 - * Simple doubly linked list implementation.
    7.11 - *
    7.12 - * Some of the internal functions ("__xxx") are useful when
    7.13 - * manipulating whole lists rather than single entries, as
    7.14 - * sometimes we already know the next/prev entries and we can
    7.15 - * generate better code by using them directly rather than
    7.16 - * using the generic single-entry routines.
    7.17 - */
    7.18 -
    7.19 -struct list_head {
    7.20 -	struct list_head *next, *prev;
    7.21 -};
    7.22 -
    7.23 -#define LIST_HEAD_INIT(name) { &(name), &(name) }
    7.24 -
    7.25 -#define LIST_HEAD(name) \
    7.26 -	struct list_head name = LIST_HEAD_INIT(name)
    7.27 -
    7.28 -#define INIT_LIST_HEAD(ptr) do { \
    7.29 -	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
    7.30 -} while (0)
    7.31 -
    7.32 -/*
    7.33 - * Insert a new entry between two known consecutive entries. 
    7.34 - *
    7.35 - * This is only for internal list manipulation where we know
    7.36 - * the prev/next entries already!
    7.37 - */
    7.38 -static __inline__ void __list_add(struct list_head * new,
    7.39 -	struct list_head * prev,
    7.40 -	struct list_head * next)
    7.41 -{
    7.42 -	next->prev = new;
    7.43 -	new->next = next;
    7.44 -	new->prev = prev;
    7.45 -	prev->next = new;
    7.46 -}
    7.47 -
    7.48 -/**
    7.49 - * list_add - add a new entry
    7.50 - * @new: new entry to be added
    7.51 - * @head: list head to add it after
    7.52 - *
    7.53 - * Insert a new entry after the specified head.
    7.54 - * This is good for implementing stacks.
    7.55 - */
    7.56 -static __inline__ void list_add(struct list_head *new, struct list_head *head)
    7.57 -{
    7.58 -	__list_add(new, head, head->next);
    7.59 -}
    7.60 -
    7.61 -/**
    7.62 - * list_add_tail - add a new entry
    7.63 - * @new: new entry to be added
    7.64 - * @head: list head to add it before
    7.65 - *
    7.66 - * Insert a new entry before the specified head.
    7.67 - * This is useful for implementing queues.
    7.68 - */
    7.69 -static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
    7.70 -{
    7.71 -	__list_add(new, head->prev, head);
    7.72 -}
    7.73 -
    7.74 -/*
    7.75 - * Delete a list entry by making the prev/next entries
    7.76 - * point to each other.
    7.77 - *
    7.78 - * This is only for internal list manipulation where we know
    7.79 - * the prev/next entries already!
    7.80 - */
    7.81 -static __inline__ void __list_del(struct list_head * prev,
    7.82 -				  struct list_head * next)
    7.83 -{
    7.84 -	next->prev = prev;
    7.85 -	prev->next = next;
    7.86 -}
    7.87 -
    7.88 -/**
    7.89 - * list_del - deletes entry from list.
    7.90 - * @entry: the element to delete from the list.
    7.91 - * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
    7.92 - */
    7.93 -static __inline__ void list_del(struct list_head *entry)
    7.94 -{
    7.95 -	ASSERT(entry->next->prev == entry);
    7.96 -	ASSERT(entry->prev->next == entry);
    7.97 -	__list_del(entry->prev, entry->next);
    7.98 -}
    7.99 -
   7.100 -/**
   7.101 - * list_del_init - deletes entry from list and reinitialize it.
   7.102 - * @entry: the element to delete from the list.
   7.103 - */
   7.104 -static __inline__ void list_del_init(struct list_head *entry)
   7.105 -{
   7.106 -	__list_del(entry->prev, entry->next);
   7.107 -	INIT_LIST_HEAD(entry); 
   7.108 -}
   7.109 -
   7.110 -/**
   7.111 - * list_empty - tests whether a list is empty
   7.112 - * @head: the list to test.
   7.113 - */
   7.114 -static __inline__ int list_empty(struct list_head *head)
   7.115 -{
   7.116 -	return head->next == head;
   7.117 -}
   7.118 -
   7.119 -/**
   7.120 - * list_splice - join two lists
   7.121 - * @list: the new list to add.
   7.122 - * @head: the place to add it in the first list.
   7.123 - */
   7.124 -static __inline__ void list_splice(struct list_head *list, struct list_head *head)
   7.125 -{
   7.126 -	struct list_head *first = list->next;
   7.127 -
   7.128 -	if (first != list) {
   7.129 -		struct list_head *last = list->prev;
   7.130 -		struct list_head *at = head->next;
   7.131 -
   7.132 -		first->prev = head;
   7.133 -		head->next = first;
   7.134 -
   7.135 -		last->next = at;
   7.136 -		at->prev = last;
   7.137 -	}
   7.138 -}
   7.139 -
   7.140 -/**
   7.141 - * list_entry - get the struct for this entry
   7.142 - * @ptr:	the &struct list_head pointer.
   7.143 - * @type:	the type of the struct this is embedded in.
   7.144 - * @member:	the name of the list_struct within the struct.
   7.145 - */
   7.146 -#define list_entry(ptr, type, member) \
   7.147 -	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
   7.148 -
   7.149 -/**
   7.150 - * list_for_each	-	iterate over a list
   7.151 - * @pos:	the &struct list_head to use as a loop counter.
   7.152 - * @head:	the head for your list.
   7.153 - */
   7.154 -#define list_for_each(pos, head) \
   7.155 -	for (pos = (head)->next; pos != (head); pos = pos->next)
   7.156 -        	
   7.157 -/**
   7.158 - * list_for_each_safe	-	iterate over a list safe against removal of list entry
   7.159 - * @pos:	the &struct list_head to use as a loop counter.
   7.160 - * @n:		another &struct list_head to use as temporary storage
   7.161 - * @head:	the head for your list.
   7.162 - */
   7.163 -#define list_for_each_safe(pos, n, head) \
   7.164 -	for (pos = (head)->next, n = pos->next; pos != (head); \
   7.165 -		pos = n, n = pos->next)
   7.166 -
   7.167 -#endif
     8.1 --- a/extras/mini-os/h/mm.h	Tue Oct 14 23:57:45 2003 +0000
     8.2 +++ b/extras/mini-os/h/mm.h	Wed Oct 15 09:31:04 2003 +0000
     8.3 @@ -15,26 +15,39 @@
     8.4   ****************************************************************************
     8.5   * $Id: h-insert.h,v 1.4 2002/11/08 16:03:55 rn Exp $
     8.6   ****************************************************************************
     8.7 + * Permission is hereby granted, free of charge, to any person obtaining a copy
     8.8 + * of this software and associated documentation files (the "Software"), to
     8.9 + * deal in the Software without restriction, including without limitation the
    8.10 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
    8.11 + * sell copies of the Software, and to permit persons to whom the Software is
    8.12 + * furnished to do so, subject to the following conditions:
    8.13 + * 
    8.14 + * The above copyright notice and this permission notice shall be included in
    8.15 + * all copies or substantial portions of the Software.
    8.16 + * 
    8.17 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
    8.18 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
    8.19 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
    8.20 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
    8.21 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
    8.22 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
    8.23 + * DEALINGS IN THE SOFTWARE.
    8.24   */
    8.25  
    8.26  #ifndef _MM_H_
    8.27  #define _MM_H_
    8.28  
    8.29 -/* PAGE_SHIFT determines the page size */
    8.30  #define PAGE_SHIFT      12
    8.31  #define PAGE_SIZE       (1UL << PAGE_SHIFT)
    8.32  #define PAGE_MASK       (~(PAGE_SIZE-1))
    8.33  
    8.34 -
    8.35  #define PFN_UP(x)	(((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
    8.36  #define PFN_DOWN(x)	((x) >> PAGE_SHIFT)
    8.37  #define PFN_PHYS(x)	((x) << PAGE_SHIFT)
    8.38  
    8.39 -
    8.40  /* to align the pointer to the (next) page boundary */
    8.41  #define PAGE_ALIGN(addr)        (((addr)+PAGE_SIZE-1)&PAGE_MASK)
    8.42  
    8.43 -
    8.44  extern unsigned long *phys_to_machine_mapping;
    8.45  #define pfn_to_mfn(_pfn) (phys_to_machine_mapping[(_pfn)])
    8.46  #define mfn_to_pfn(_mfn) (machine_to_phys_mapping[(_mfn)])
    8.47 @@ -51,57 +64,12 @@ static inline unsigned long machine_to_p
    8.48      return phys;
    8.49  }
    8.50  
    8.51 -/* VIRT <-> MACHINE conversion */
    8.52 -#define virt_to_machine(_a) (phys_to_machine(__pa(_a)))
    8.53 -#define machine_to_virt(_m) (__va(machine_to_phys(_m)))
    8.54 -
    8.55 -/*
    8.56 - * This handles the memory map.. We could make this a config
    8.57 - * option, but too many people screw it up, and too few need
    8.58 - * it.
    8.59 - *
    8.60 - * A __PAGE_OFFSET of 0xC0000000 means that the kernel has
    8.61 - * a virtual address space of one gigabyte, which limits the
    8.62 - * amount of physical memory you can use to about 950MB. 
    8.63 - *
    8.64 - * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
    8.65 - * and CONFIG_HIGHMEM64G options in the kernel configuration.
    8.66 - */
    8.67 -
    8.68 -#define __PAGE_OFFSET           (0xC0000000)
    8.69 -
    8.70 -#define PAGE_OFFSET             ((unsigned long)__PAGE_OFFSET)
    8.71 -#define __pa(x)                 ((unsigned long)(x)-PAGE_OFFSET)
    8.72 -#define __va(x)                 ((void *)((unsigned long)(x)+PAGE_OFFSET))
    8.73 -#define virt_to_page(kaddr)     (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
    8.74 -#define VALID_PAGE(page)        ((page - mem_map) < max_mapnr)
    8.75 +#define VIRT_START              0xC0000000UL
    8.76  
    8.77 -#define VM_DATA_DEFAULT_FLAGS   (VM_READ | VM_WRITE | VM_EXEC | \
    8.78 -                                 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
    8.79 +#define to_phys(x)                 ((unsigned long)(x)-VIRT_START)
    8.80 +#define to_virt(x)                 ((void *)((unsigned long)(x)+VIRT_START))
    8.81  
    8.82 -
    8.83 -/* prototypes */
    8.84  void init_mm();
    8.85 -void release_bytes_to_allocator(unsigned long min, unsigned long max);
    8.86 -unsigned long __get_free_pages(int order);
    8.87 -void __free_pages(unsigned long p, int order);
    8.88 -#define get_free_pages(_o) (__get_free_pages(_o))
    8.89 -#define get_free_page() (__get_free_pages(0))
    8.90 -#define free_pages(_p,_o) (__free_pages(_p,_o))
    8.91 -#define free_page(_p) (__free_pages(_p,0))
    8.92 -
    8.93 -static __inline__ int get_order(unsigned long size)
    8.94 -{
    8.95 -    int order;
    8.96 -    
    8.97 -    size = (size-1) >> (PAGE_SHIFT-1);
    8.98 -    order = -1;
    8.99 -    do {
   8.100 -        size >>= 1;
   8.101 -        order++;
   8.102 -    } while (size);
   8.103 -    return order;
   8.104 -}
   8.105 -
   8.106 +unsigned long alloc_pages(int order);
   8.107  
   8.108  #endif /* _MM_H_ */
     9.1 --- a/extras/mini-os/h/os.h	Tue Oct 14 23:57:45 2003 +0000
     9.2 +++ b/extras/mini-os/h/os.h	Wed Oct 15 09:31:04 2003 +0000
     9.3 @@ -7,7 +7,6 @@
     9.4  #ifndef _OS_H_
     9.5  #define _OS_H_
     9.6  
     9.7 -
     9.8  #define NULL 0
     9.9  
    9.10  /*
    9.11 @@ -126,9 +125,6 @@ do {                                    
    9.12  typedef struct { volatile int counter; } atomic_t;
    9.13  
    9.14  
    9.15 -/*
    9.16 - * This XCHG macro is straight from Linux. It is gross.
    9.17 - */
    9.18  #define xchg(ptr,v) \
    9.19          ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
    9.20  struct __xchg_dummy { unsigned long a[100]; };
    9.21 @@ -252,19 +248,6 @@ static __inline__ void atomic_inc(atomic
    9.22  }
    9.23  
    9.24  
    9.25 -/* useful hypervisor macros */
    9.26 -
    9.27 -struct desc_struct {
    9.28 -        unsigned long a,b;
    9.29 -};
    9.30 -extern struct desc_struct default_ldt[];
    9.31 -
    9.32 -#define asmlinkage        __attribute__((regparm(0)))
    9.33 -
    9.34 -/*
    9.35 - * some random linux macros
    9.36 - */
    9.37 -
    9.38  #define rdtscll(val) \
    9.39       __asm__ __volatile__("rdtsc" : "=A" (val))
    9.40  
    10.1 --- a/extras/mini-os/h/time.h	Tue Oct 14 23:57:45 2003 +0000
    10.2 +++ b/extras/mini-os/h/time.h	Wed Oct 15 09:31:04 2003 +0000
    10.3 @@ -20,8 +20,6 @@
    10.4  #ifndef _TIME_H_
    10.5  #define _TIME_H_
    10.6  
    10.7 -#include <list.h>
    10.8 -
    10.9  /*
   10.10   * System Time
   10.11   * 64 bit value containing the nanoseconds elapsed since boot time.
    11.1 --- a/extras/mini-os/hypervisor.c	Tue Oct 14 23:57:45 2003 +0000
    11.2 +++ b/extras/mini-os/hypervisor.c	Wed Oct 15 09:31:04 2003 +0000
    11.3 @@ -2,24 +2,26 @@
    11.4   * hypervisor.c
    11.5   * 
    11.6   * Communication to/from hypervisor.
    11.7 - *
    11.8 - * Copied from XenoLinux and adjusted by Rolf.Neugebauer@intel.com
    11.9 - * 
   11.10 - * Copyright (c) 2002, K A Fraser
   11.11   * 
   11.12 - * This program is free software; you can redistribute it and/or modify
   11.13 - * it under the terms of the GNU General Public License as published by
   11.14 - * the Free Software Foundation; either version 2 of the License, or
   11.15 - * (at your option) any later version.
   11.16 + * Copyright (c) 2002-2003, K A Fraser
   11.17   * 
   11.18 - * This program is distributed in the hope that it will be useful,
   11.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   11.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   11.21 - * GNU General Public License for more details.
   11.22 + * Permission is hereby granted, free of charge, to any person obtaining a copy
   11.23 + * of this software and associated documentation files (the "Software"), to
   11.24 + * deal in the Software without restriction, including without limitation the
   11.25 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   11.26 + * sell copies of the Software, and to permit persons to whom the Software is
   11.27 + * furnished to do so, subject to the following conditions:
   11.28   * 
   11.29 - * You should have received a copy of the GNU General Public License
   11.30 - * along with this program; if not, write to the Free Software
   11.31 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   11.32 + * The above copyright notice and this permission notice shall be included in
   11.33 + * all copies or substantial portions of the Software.
   11.34 + * 
   11.35 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
   11.36 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   11.37 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
   11.38 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
   11.39 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
   11.40 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
   11.41 + * DEALINGS IN THE SOFTWARE.
   11.42   */
   11.43  
   11.44  #include <os.h>
   11.45 @@ -65,12 +67,6 @@ void do_hypervisor_callback(struct pt_re
   11.46      while ( shared->events );
   11.47  }
   11.48  
   11.49 -
   11.50 -
   11.51 -/*
   11.52 - * Define interface to generic handling in irq.c
   11.53 - */
   11.54 -
   11.55  void enable_hypervisor_event(unsigned int ev)
   11.56  {
   11.57      set_bit(ev, &event_mask);
   11.58 @@ -89,9 +85,6 @@ void disable_hypervisor_event(unsigned i
   11.59  void ack_hypervisor_event(unsigned int ev)
   11.60  {
   11.61      if ( !(event_mask & (1<<ev)) )
   11.62 -    {
   11.63 -        //printk("Unexpected hypervisor event %d\n", ev);
   11.64          atomic_inc((atomic_t *)&ev_err_count);
   11.65 -    }
   11.66      set_bit(ev, &HYPERVISOR_shared_info->events_mask);
   11.67  }
    12.1 --- a/extras/mini-os/kernel.c	Tue Oct 14 23:57:45 2003 +0000
    12.2 +++ b/extras/mini-os/kernel.c	Wed Oct 15 09:31:04 2003 +0000
    12.3 @@ -3,6 +3,26 @@
    12.4   * 
    12.5   * Assorted crap goes here, including the initial C entry point, jumped at
    12.6   * from head.S.
    12.7 + * 
    12.8 + * Copyright (c) 2002-2003, K A Fraser & R Neugebauer
    12.9 + * 
   12.10 + * Permission is hereby granted, free of charge, to any person obtaining a copy
   12.11 + * of this software and associated documentation files (the "Software"), to
   12.12 + * deal in the Software without restriction, including without limitation the
   12.13 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   12.14 + * sell copies of the Software, and to permit persons to whom the Software is
   12.15 + * furnished to do so, subject to the following conditions:
   12.16 + * 
   12.17 + * The above copyright notice and this permission notice shall be included in
   12.18 + * all copies or substantial portions of the Software.
   12.19 + * 
   12.20 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
   12.21 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   12.22 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
   12.23 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
   12.24 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
   12.25 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
   12.26 + * DEALINGS IN THE SOFTWARE.
   12.27   */
   12.28  
   12.29  #include <os.h>
    13.1 --- a/extras/mini-os/lib/malloc.c	Tue Oct 14 23:57:45 2003 +0000
    13.2 +++ b/extras/mini-os/lib/malloc.c	Wed Oct 15 09:31:04 2003 +0000
    13.3 @@ -51,17 +51,17 @@ static void *more_core(size_t n)
    13.4      if (n == 0)
    13.5          return last;
    13.6      
    13.7 -    /* get pages */
    13.8 -    order = get_order(n);
    13.9 -    ret = (void *)get_free_pages(order);
   13.10 +    n = PFN_UP(n);
   13.11 +    for ( order = 0; n > 1; order++ )
   13.12 +        n >>= 1;
   13.13 +    ret = (void *)alloc_pages(order);
   13.14  
   13.15      /* work out pointer to end of chunk */
   13.16 -    if (ret) {
   13.17 +    if ( ret )
   13.18 +    {
   13.19          num_pages = 1 << order;
   13.20          last = ret + (num_pages * PAGE_SIZE);
   13.21      }
   13.22 -    
   13.23 -    //printk("malloc(%lu) -> o=%lu r=%p, l=%p", n, order, ret, last);
   13.24  
   13.25      return ret;      
   13.26  }
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/extras/mini-os/minios.lds	Wed Oct 15 09:31:04 2003 +0000
    14.3 @@ -0,0 +1,54 @@
    14.4 +OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
    14.5 +OUTPUT_ARCH(i386)
    14.6 +ENTRY(_start)
    14.7 +SECTIONS
    14.8 +{
    14.9 +  . = 0xC0000000;
   14.10 +  _text = .;			/* Text and read-only data */
   14.11 +  .text : {
   14.12 +	*(.text)
   14.13 +	*(.gnu.warning)
   14.14 +	} = 0x9090
   14.15 +
   14.16 +  _etext = .;			/* End of text section */
   14.17 +
   14.18 +  .rodata : { *(.rodata) *(.rodata.*) }
   14.19 +
   14.20 +  .data : {			/* Data */
   14.21 +	*(.data)
   14.22 +	CONSTRUCTORS
   14.23 +	}
   14.24 +
   14.25 +  _edata = .;			/* End of data section */
   14.26 +
   14.27 +  . = ALIGN(8192);		/* init_task */
   14.28 +  .data.init_task : { *(.data.init_task) }
   14.29 +
   14.30 +  . = ALIGN(4096);
   14.31 +  .data.page_aligned : { *(.data.idt) }
   14.32 +
   14.33 +  . = ALIGN(32);
   14.34 +  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
   14.35 +
   14.36 +  __bss_start = .;		/* BSS */
   14.37 +  .bss : {
   14.38 +	*(.bss)
   14.39 +	}
   14.40 +  _end = . ;
   14.41 +
   14.42 +  /* Sections to be discarded */
   14.43 +  /DISCARD/ : {
   14.44 +	*(.text.exit)
   14.45 +	*(.data.exit)
   14.46 +	*(.exitcall.exit)
   14.47 +	}
   14.48 +
   14.49 +  /* Stabs debugging sections.  */
   14.50 +  .stab 0 : { *(.stab) }
   14.51 +  .stabstr 0 : { *(.stabstr) }
   14.52 +  .stab.excl 0 : { *(.stab.excl) }
   14.53 +  .stab.exclstr 0 : { *(.stab.exclstr) }
   14.54 +  .stab.index 0 : { *(.stab.index) }
   14.55 +  .stab.indexstr 0 : { *(.stab.indexstr) }
   14.56 +  .comment 0 : { *(.comment) }
   14.57 +}
    15.1 --- a/extras/mini-os/mm.c	Tue Oct 14 23:57:45 2003 +0000
    15.2 +++ b/extras/mini-os/mm.c	Wed Oct 15 09:31:04 2003 +0000
    15.3 @@ -16,19 +16,23 @@
    15.4   ****************************************************************************
    15.5   * $Id: c-insert.c,v 1.7 2002/11/08 16:04:34 rn Exp $
    15.6   ****************************************************************************
    15.7 - * This program is free software; you can redistribute it and/or modify
    15.8 - * it under the terms of the GNU General Public License as published by
    15.9 - * the Free Software Foundation; either version 2 of the License, or
   15.10 - * (at your option) any later version.
   15.11 + * Permission is hereby granted, free of charge, to any person obtaining a copy
   15.12 + * of this software and associated documentation files (the "Software"), to
   15.13 + * deal in the Software without restriction, including without limitation the
   15.14 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   15.15 + * sell copies of the Software, and to permit persons to whom the Software is
   15.16 + * furnished to do so, subject to the following conditions:
   15.17   * 
   15.18 - * This program is distributed in the hope that it will be useful,
   15.19 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   15.20 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15.21 - * GNU General Public License for more details.
   15.22 + * The above copyright notice and this permission notice shall be included in
   15.23 + * all copies or substantial portions of the Software.
   15.24   * 
   15.25 - * You should have received a copy of the GNU General Public License
   15.26 - * along with this program; if not, write to the Free Software
   15.27 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   15.28 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
   15.29 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   15.30 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
   15.31 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
   15.32 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
   15.33 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
   15.34 + * DEALINGS IN THE SOFTWARE.
   15.35   */
   15.36  
   15.37  #include <os.h>
   15.38 @@ -59,7 +63,7 @@ void init_mm(void)
   15.39      printk("  _end:         %p\n", &_end);
   15.40  
   15.41      /* set up minimal memory infos */
   15.42 -    start_pfn = PFN_UP(__pa(&_end));
   15.43 +    start_pfn = PFN_UP(to_phys(&_end));
   15.44      max_pfn = start_info.nr_pages;
   15.45  
   15.46      printk("  start_pfn:    %lx\n", start_pfn);
   15.47 @@ -79,19 +83,19 @@ void init_mm(void)
   15.48       * is always true.
   15.49       */
   15.50  
   15.51 -    max_free_pfn = PFN_DOWN(__pa(pgd));
   15.52 +    max_free_pfn = PFN_DOWN(to_phys(pgd));
   15.53      {
   15.54          unsigned long *pgd = (unsigned long *)start_info.pt_base;
   15.55          unsigned long  pte;
   15.56          int i;
   15.57 -        printk("  pgd(pa(pgd)): %lx(%lx)", (u_long)pgd, __pa(pgd));
   15.58 +        printk("  pgd(pa(pgd)): %lx(%lx)", (u_long)pgd, to_phys(pgd));
   15.59  
   15.60          for ( i = 0; i < (HYPERVISOR_VIRT_START>>22); i++ )
   15.61          {
   15.62              unsigned long pgde = *pgd++;
   15.63              if ( !(pgde & 1) ) continue;
   15.64              pte = machine_to_phys(pgde & PAGE_MASK);
   15.65 -            printk("  PT(%x): %lx(%lx)", i, (u_long)__va(pte), pte);
   15.66 +            printk("  PT(%x): %lx(%lx)", i, (u_long)to_virt(pte), pte);
   15.67              if (PFN_DOWN(pte) <= max_free_pfn) 
   15.68                  max_free_pfn = PFN_DOWN(pte);
   15.69          }
   15.70 @@ -103,8 +107,8 @@ void init_mm(void)
   15.71       * now we can initialise the page allocator
   15.72       */
   15.73      printk("MM: Initialise page allocator for %lx(%lx)-%lx(%lx)\n",
   15.74 -           (u_long)__va(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
   15.75 -           (u_long)__va(PFN_PHYS(max_free_pfn)), PFN_PHYS(max_free_pfn));
   15.76 +           (u_long)to_virt(PFN_PHYS(start_pfn)), PFN_PHYS(start_pfn), 
   15.77 +           (u_long)to_virt(PFN_PHYS(max_free_pfn)), PFN_PHYS(max_free_pfn));
   15.78      init_page_allocator(PFN_PHYS(start_pfn), PFN_PHYS(max_free_pfn));   
   15.79  
   15.80  
   15.81 @@ -233,7 +237,7 @@ static void init_page_allocator(unsigned
   15.82      /* Allocate space for the allocation bitmap. */
   15.83      bitmap_size  = (max+1) >> (PAGE_SHIFT+3);
   15.84      bitmap_size  = round_pgup(bitmap_size);
   15.85 -    alloc_bitmap = (unsigned long *)__va(min);
   15.86 +    alloc_bitmap = (unsigned long *)to_virt(min);
   15.87      min         += bitmap_size;
   15.88      range        = max - min;
   15.89  
   15.90 @@ -243,8 +247,8 @@ static void init_page_allocator(unsigned
   15.91      map_free(min>>PAGE_SHIFT, range>>PAGE_SHIFT);
   15.92  
   15.93      /* The buddy lists are addressed in high memory. */
   15.94 -    min += PAGE_OFFSET;
   15.95 -    max += PAGE_OFFSET;
   15.96 +    min += VIRT_START;
   15.97 +    max += VIRT_START;
   15.98  
   15.99      while ( range != 0 )
  15.100      {
  15.101 @@ -271,22 +275,8 @@ static void init_page_allocator(unsigned
  15.102  }
  15.103  
  15.104  
  15.105 -/* Release a PHYSICAL address range to the allocator. */
  15.106 -void release_bytes_to_allocator(unsigned long min, unsigned long max)
  15.107 -{
  15.108 -    min = round_pgup  (min) + PAGE_OFFSET;
  15.109 -    max = round_pgdown(max) + PAGE_OFFSET;
  15.110 -
  15.111 -    while ( min < max )
  15.112 -    {
  15.113 -        __free_pages(min, 0);
  15.114 -        min += PAGE_SIZE;
  15.115 -    }
  15.116 -}
  15.117 -
  15.118 -
  15.119  /* Allocate 2^@order contiguous pages. Returns a VIRTUAL address. */
  15.120 -unsigned long __get_free_pages(int order)
  15.121 +unsigned long alloc_pages(int order)
  15.122  {
  15.123      int i;
  15.124      chunk_head_t *alloc_ch, *spare_ch;
  15.125 @@ -325,7 +315,7 @@ unsigned long __get_free_pages(int order
  15.126          free_head[i] = spare_ch;
  15.127      }
  15.128      
  15.129 -    map_alloc(__pa(alloc_ch)>>PAGE_SHIFT, 1<<order);
  15.130 +    map_alloc(to_phys(alloc_ch)>>PAGE_SHIFT, 1<<order);
  15.131  
  15.132      return((unsigned long)alloc_ch);
  15.133  
  15.134 @@ -336,52 +326,3 @@ unsigned long __get_free_pages(int order
  15.135      return 0;
  15.136  }
  15.137  
  15.138 -
  15.139 -/* Free 2^@order pages at VIRTUAL address @p. */
  15.140 -void __free_pages(unsigned long p, int order)
  15.141 -{
  15.142 -    unsigned long size = 1 << (order + PAGE_SHIFT);
  15.143 -    chunk_head_t *ch;
  15.144 -    chunk_tail_t *ct;
  15.145 -    unsigned long pagenr = __pa(p) >> PAGE_SHIFT;
  15.146 -
  15.147 -    map_free(pagenr, 1<<order);
  15.148 -    
  15.149 -    /* Merge chunks as far as possible. */
  15.150 -    for ( ; ; )
  15.151 -    {
  15.152 -        if ( (p & size) )
  15.153 -        {
  15.154 -            /* Merge with predecessor block? */
  15.155 -            if ( allocated_in_map(pagenr-1) ) break;
  15.156 -            ct = (chunk_tail_t *)p - 1;
  15.157 -            if ( ct->level != order ) break;
  15.158 -            ch = (chunk_head_t *)(p - size);
  15.159 -            p -= size;
  15.160 -        }
  15.161 -        else
  15.162 -        {
  15.163 -            /* Merge with successor block? */
  15.164 -            if ( allocated_in_map(pagenr+(1<<order)) ) break;
  15.165 -            ch = (chunk_head_t *)(p + size);
  15.166 -            if ( ch->level != order ) break;
  15.167 -        }
  15.168 -        
  15.169 -        /* Okay, unlink the neighbour. */
  15.170 -        *ch->pprev = ch->next;
  15.171 -        ch->next->pprev = ch->pprev;
  15.172 -
  15.173 -        order++;
  15.174 -        size <<= 1;
  15.175 -    }
  15.176 -
  15.177 -    /* Okay, add the final chunk to the appropriate free list. */
  15.178 -    ch = (chunk_head_t *)p;
  15.179 -    ct = (chunk_tail_t *)(p+size)-1;
  15.180 -    ct->level = order;
  15.181 -    ch->level = order;
  15.182 -    ch->pprev = &free_head[order];
  15.183 -    ch->next  = free_head[order];
  15.184 -    ch->next->pprev = &ch->next;
  15.185 -    free_head[order] = ch;
  15.186 -}
    16.1 --- a/extras/mini-os/time.c	Tue Oct 14 23:57:45 2003 +0000
    16.2 +++ b/extras/mini-os/time.c	Wed Oct 15 09:31:04 2003 +0000
    16.3 @@ -15,6 +15,23 @@
    16.4   ****************************************************************************
    16.5   * $Id: c-insert.c,v 1.7 2002/11/08 16:04:34 rn Exp $
    16.6   ****************************************************************************
    16.7 + * Permission is hereby granted, free of charge, to any person obtaining a copy
    16.8 + * of this software and associated documentation files (the "Software"), to
    16.9 + * deal in the Software without restriction, including without limitation the
   16.10 + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
   16.11 + * sell copies of the Software, and to permit persons to whom the Software is
   16.12 + * furnished to do so, subject to the following conditions:
   16.13 + * 
   16.14 + * The above copyright notice and this permission notice shall be included in
   16.15 + * all copies or substantial portions of the Software.
   16.16 + * 
   16.17 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
   16.18 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   16.19 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
   16.20 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
   16.21 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
   16.22 + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
   16.23 + * DEALINGS IN THE SOFTWARE.
   16.24   */
   16.25  
   16.26  
    17.1 --- a/extras/mini-os/traps.c	Tue Oct 14 23:57:45 2003 +0000
    17.2 +++ b/extras/mini-os/traps.c	Wed Oct 15 09:31:04 2003 +0000
    17.3 @@ -31,52 +31,6 @@ void machine_check(void);
    17.4  
    17.5  extern void do_exit(void);
    17.6  
    17.7 -int kstack_depth_to_print = 24;
    17.8 -#define THREAD_SIZE (2*PAGE_SIZE)
    17.9 -
   17.10 -static inline int kernel_text_address(unsigned long addr)
   17.11 -{
   17.12 -    return ( (addr >> 20) > 0x800 && (addr >> 20) < 0x804 );
   17.13 -}
   17.14 -
   17.15 -void show_trace(unsigned long * stack)
   17.16 -{
   17.17 -    int i;
   17.18 -    unsigned long addr;
   17.19 -
   17.20 -    if (!stack)
   17.21 -        stack = (unsigned long*)&stack;
   17.22 -
   17.23 -    printk("Call Trace: ");
   17.24 -    i = 1;
   17.25 -    while (((long) stack & (4095)) != 0) {
   17.26 -        addr = *stack++;
   17.27 -        if (kernel_text_address(addr)) {
   17.28 -            printf("0x%lx", addr);
   17.29 -            i++;
   17.30 -        }
   17.31 -    }
   17.32 -    printk("\n");
   17.33 -}
   17.34 -
   17.35 -void show_stack(unsigned long * esp)
   17.36 -{
   17.37 -	unsigned long *stack;
   17.38 -	int i;
   17.39 -
   17.40 -	if(esp==NULL)
   17.41 -		esp=(unsigned long*)&esp;
   17.42 -
   17.43 -	stack = esp;
   17.44 -	for(i=0; i < kstack_depth_to_print; i++) {
   17.45 -		if (((long) stack & (THREAD_SIZE-1)) == 0)
   17.46 -			break;
   17.47 -		printk("%08lx ", *stack++);
   17.48 -	}
   17.49 -	printk("\n");
   17.50 -	show_trace(esp);
   17.51 -}
   17.52 -
   17.53  void dump_regs(struct pt_regs *regs)
   17.54  {
   17.55  	int in_kernel = 1;
   17.56 @@ -132,7 +86,6 @@ static void inline do_trap(int trapnr, c
   17.57    printk("FATAL:  Unhandled Trap (see mini-os:traps.c)");
   17.58    printf("%d %s", trapnr, str);
   17.59    dump_regs(regs);
   17.60 -  show_trace((void *)regs->esp);
   17.61    dump_code(regs->eip);
   17.62  
   17.63    do_exit();
   17.64 @@ -164,7 +117,7 @@ DO_ERROR(12, "stack segment", stack_segm
   17.65  DO_ERROR_INFO(17, "alignment check", alignment_check, BUS_ADRALN, 0)
   17.66  DO_ERROR(18, "machine check", machine_check)
   17.67  
   17.68 -void do_page_fault(struct pt_regs * regs, long error_code,
   17.69 +void do_page_fault(struct pt_regs *regs, long error_code,
   17.70                     unsigned long address)
   17.71  {
   17.72      printk("Page fault\n");
   17.73 @@ -211,13 +164,13 @@ void simd_math_error(void *eip)
   17.74  }
   17.75  
   17.76  void do_simd_coprocessor_error(struct pt_regs * regs,
   17.77 -					  long error_code)
   17.78 +                               long error_code)
   17.79  {
   17.80      printk("SIMD copro error\n");
   17.81  }
   17.82  
   17.83  void do_spurious_interrupt_bug(struct pt_regs * regs,
   17.84 -					  long error_code)
   17.85 +                               long error_code)
   17.86  {
   17.87  }
   17.88  
    18.1 --- a/extras/mini-os/vmlinux.lds	Tue Oct 14 23:57:45 2003 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,82 +0,0 @@
    18.4 -/* ld script to make i386 Linux kernel
    18.5 - * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
    18.6 - */
    18.7 -OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
    18.8 -OUTPUT_ARCH(i386)
    18.9 -ENTRY(_start)
   18.10 -SECTIONS
   18.11 -{
   18.12 -  . = 0xC0000000 + 0x000000;
   18.13 -  _text = .;			/* Text and read-only data */
   18.14 -  .text : {
   18.15 -	*(.text)
   18.16 -	*(.fixup)
   18.17 -	*(.gnu.warning)
   18.18 -	} = 0x9090
   18.19 -
   18.20 -  _etext = .;			/* End of text section */
   18.21 -
   18.22 -  .rodata : { *(.rodata) *(.rodata.*) }
   18.23 -  .kstrtab : { *(.kstrtab) }
   18.24 -
   18.25 -  . = ALIGN(16);		/* Exception table */
   18.26 -  __start___ex_table = .;
   18.27 -  __ex_table : { *(__ex_table) }
   18.28 -  __stop___ex_table = .;
   18.29 -
   18.30 -  __start___ksymtab = .;	/* Kernel symbol table */
   18.31 -  __ksymtab : { *(__ksymtab) }
   18.32 -  __stop___ksymtab = .;
   18.33 -
   18.34 -  .data : {			/* Data */
   18.35 -	*(.data)
   18.36 -	CONSTRUCTORS
   18.37 -	}
   18.38 -
   18.39 -  _edata = .;			/* End of data section */
   18.40 -
   18.41 -  . = ALIGN(8192);		/* init_task */
   18.42 -  .data.init_task : { *(.data.init_task) }
   18.43 -
   18.44 -  . = ALIGN(4096);		/* Init code and data */
   18.45 -  __init_begin = .;
   18.46 -  .text.init : { *(.text.init) }
   18.47 -  .data.init : { *(.data.init) }
   18.48 -  . = ALIGN(16);
   18.49 -  __setup_start = .;
   18.50 -  .setup.init : { *(.setup.init) }
   18.51 -  __setup_end = .;
   18.52 -  __initcall_start = .;
   18.53 -  .initcall.init : { *(.initcall.init) }
   18.54 -  __initcall_end = .;
   18.55 -  . = ALIGN(4096);
   18.56 -  __init_end = .;
   18.57 -
   18.58 -  . = ALIGN(4096);
   18.59 -  .data.page_aligned : { *(.data.idt) }
   18.60 -
   18.61 -  . = ALIGN(32);
   18.62 -  .data.cacheline_aligned : { *(.data.cacheline_aligned) }
   18.63 -
   18.64 -  __bss_start = .;		/* BSS */
   18.65 -  .bss : {
   18.66 -	*(.bss)
   18.67 -	}
   18.68 -  _end = . ;
   18.69 -
   18.70 -  /* Sections to be discarded */
   18.71 -  /DISCARD/ : {
   18.72 -	*(.text.exit)
   18.73 -	*(.data.exit)
   18.74 -	*(.exitcall.exit)
   18.75 -	}
   18.76 -
   18.77 -  /* Stabs debugging sections.  */
   18.78 -  .stab 0 : { *(.stab) }
   18.79 -  .stabstr 0 : { *(.stabstr) }
   18.80 -  .stab.excl 0 : { *(.stab.excl) }
   18.81 -  .stab.exclstr 0 : { *(.stab.exclstr) }
   18.82 -  .stab.index 0 : { *(.stab.index) }
   18.83 -  .stab.indexstr 0 : { *(.stab.indexstr) }
   18.84 -  .comment 0 : { *(.comment) }
   18.85 -}