mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
ADLO
This commit is contained in:
parent
6dc937f328
commit
11b2e5d24b
44 changed files with 61485 additions and 0 deletions
9
util/ADLO/CAST
Normal file
9
util/ADLO/CAST
Normal file
|
@ -0,0 +1,9 @@
|
|||
Most of the analysis, design and implementation of the project was done by
|
||||
me, Adam Sulmicki. I have received invaluable help from Adam Agnew. Bill
|
||||
Arbaugh was the person who made it all possible.
|
||||
|
||||
I also received help from Christophe Bothamy, Bochs' developer, on all
|
||||
Boch's bios related issues. Thanks!
|
||||
|
||||
I also got tips from Eric W. Biederman, as well as other members of the
|
||||
LinuxBIOS mailing list.
|
340
util/ADLO/COPYING
Normal file
340
util/ADLO/COPYING
Normal file
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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.
|
||||
|
||||
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.)
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
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) <year> <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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) year 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.
|
16
util/ADLO/HACKING
Normal file
16
util/ADLO/HACKING
Normal file
|
@ -0,0 +1,16 @@
|
|||
DEVELOPER/HACKING/DESIGN
|
||||
|
||||
- bochs bios.
|
||||
|
||||
we expect most of the bochs patches will be rolled back into
|
||||
the bochs mainline.
|
||||
|
||||
thus when designing an patch for rombios.c both needs of
|
||||
linuxbios as well as bochs needed to be taken into
|
||||
consideration.
|
||||
|
||||
- there are motherboard specific code in loader.s. until this issue
|
||||
is fixed, you need to adjust various motherboard specific
|
||||
settings in loader.s In particular control of the
|
||||
shadow ram.
|
||||
|
47
util/ADLO/INSTALL
Normal file
47
util/ADLO/INSTALL
Normal file
|
@ -0,0 +1,47 @@
|
|||
1) Are you familar with LinuxBIOS?
|
||||
|
||||
no : abort
|
||||
yes: go to next step.
|
||||
|
||||
2) do you have Matsonic 7308e motherboard?
|
||||
|
||||
no : you are on your own (untested).
|
||||
yes: go to next step.
|
||||
|
||||
3) do you have LiuxBIOS running on Matsonic 7308e motherboard?
|
||||
|
||||
no : get it working first on your motherboard.
|
||||
yes: go to next step.
|
||||
|
||||
4) Acquire copy of your VIDEO BIOS.
|
||||
|
||||
-Put in your PC BIOS into the system,
|
||||
-Boot into linux.
|
||||
-as root run "make videobios" from ADLO's root dir.
|
||||
-copy the file to video directory
|
||||
adjust make file as needed.
|
||||
|
||||
5) Acquire copy of your PIRQ table.
|
||||
|
||||
At present time it is not necessary to do this
|
||||
and you can use supplied PIRQ table.
|
||||
|
||||
6) Acquire copy of BOCHS bios.
|
||||
|
||||
At present time it is not necessary to do this
|
||||
and you can use supplied rombios.c.
|
||||
|
||||
In fact you should use supplied rombios.c
|
||||
file as the one used with BOCHS is not
|
||||
complete at the present time.
|
||||
|
||||
7) Examine make file to see that it does what u want.
|
||||
|
||||
8) compile
|
||||
|
||||
make
|
||||
|
||||
9) use the resulting elf "payload" file with LinuxBIOS as you would
|
||||
have used any other elf file. For example put it on the same
|
||||
EERPOM as LinuxBIOS is, or use EtherBOOT to load the payload
|
||||
file from hdd or network.
|
117
util/ADLO/Makefile
Normal file
117
util/ADLO/Makefile
Normal file
|
@ -0,0 +1,117 @@
|
|||
#-------------------------------------------------
|
||||
# $Id$
|
||||
#-------------------------------------------------
|
||||
|
||||
ELF064=elf/elf-header-065kb.payload
|
||||
ELF113=elf/elf-header-113kb.payload
|
||||
ELF129=elf/elf-header-129kb.payload
|
||||
|
||||
LOADER=loader.o
|
||||
|
||||
PIRQ_W=
|
||||
PIRQ_M=pirq/pirq-MS7308E.bin
|
||||
PIRQ_P=pirq/pirq-P6STMT.bin
|
||||
PIRQ_T=pirq/pirq-ThinkPad.T23.bin
|
||||
|
||||
BOCHS_R=bochs
|
||||
BOCHS_B=bochs/bios
|
||||
BOCHS_C=bochs/bochs-cvs
|
||||
BOCHS_X=bochs/bochs-cvs/bochs/bios
|
||||
|
||||
BIOS_R=${BOCHS_R}/rombios.bin
|
||||
BIOS_B=${BOCHS_B}/rombios.bin
|
||||
BIOS_X=${BOCHS_X}/rombios.bin
|
||||
|
||||
VIDEO64W=video/video.bios-WINFAST64kb.bin
|
||||
VIDEO64M=
|
||||
VIDEO64P=video/video.bios-P6STMT-64kb.bin
|
||||
|
||||
PAYLOAD=payload
|
||||
|
||||
BOCHSCVS=-d:pserver:anonymous@cvs.bochs.sourceforge.net:/cvsroot/bochs
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
all: clean build #install
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
build: loader.o bios
|
||||
cat ${ELF129} ${LOADER} ${PIRQ_M} ${BIOS_B} ${VIDEO64P} > ${PAYLOAD}
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
loader.o: loader.s
|
||||
as86 loader.s -b ${LOADER}
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
bios:
|
||||
( cd ${BOCHS_B} ; make )
|
||||
sync
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
#64kb -- sive of Video BIOS
|
||||
#
|
||||
#C=`echo 64*1024 | bc`
|
||||
C=65536
|
||||
|
||||
#0xC0000 -- start of Video BIOS in ram.
|
||||
#S=`echo -e "ibase=16 \n C0000" | bc`
|
||||
#
|
||||
# ELF header offset -- 0x1000 == 4096
|
||||
#
|
||||
# 786432+4096 = 790528
|
||||
S=790528
|
||||
|
||||
videobios:
|
||||
dd if=/proc/kcore of=./video.bios.bin bs=1 count=${C} skip=${S}
|
||||
|
||||
# 0xF000+0x1000
|
||||
S2=987136
|
||||
|
||||
pcbios:
|
||||
dd if=/proc/kcore of=./pc.bios.bin bs=1 count=${C} skip=${S2}
|
||||
|
||||
pirq: pcbios
|
||||
#grep -a "\$PIR" -B0 -A127 pc.bios.bin > pirq.bin
|
||||
grep -a "\$PIR" -B0 -A0 pc.bios.bin > pirq.bin
|
||||
|
||||
#now you have to hand edit the pirq.bin file
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
bochslogin:
|
||||
mkdir -p ${BOCHS_C}
|
||||
echo "When prompted for a password, simply press the Enter key."
|
||||
( cd ${BOCHS_C} ; cvs ${BOCHSCVS} login )
|
||||
|
||||
bochsco:
|
||||
mkdir -p ${BOCHS_C}
|
||||
( cd ${BOCHS_C} ; cvs ${BOCHSCVS} co bochs/bios )
|
||||
|
||||
bochsstat:
|
||||
( cd ${BOCHS_C} ; cvs ${BOCHSCVS} status bochs/bios/rombios.c )
|
||||
|
||||
bochsupdate:
|
||||
( cd ${BOCHS_C} ; cvs ${BOCHSCVS} update bochs/bios/rombios.c )
|
||||
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
install:
|
||||
cp -abf ${PAYLOAD} /tftpboot/kernel
|
||||
sync
|
||||
|
||||
#-------------------------------------------------
|
||||
|
||||
clean:
|
||||
rm -rf *.o ${PAYLOAD}
|
||||
(cd ${BOCHS_B} ; make clean )
|
||||
|
||||
distclean: clean
|
||||
rm -rf ${BOCHS_C}
|
||||
|
||||
#-------------------------------------------------
|
||||
|
38
util/ADLO/NEWS
Normal file
38
util/ADLO/NEWS
Normal file
|
@ -0,0 +1,38 @@
|
|||
initial release
|
||||
|
||||
boots LILO
|
||||
|
||||
"linux_alpha" release
|
||||
|
||||
fixed keyboard in lilo
|
||||
|
||||
boots linux
|
||||
(must use "linux mem=100mb ro init=/bin/sh ")
|
||||
|
||||
"win2k" release
|
||||
|
||||
lilo works
|
||||
no restrictions
|
||||
grub works
|
||||
no restrictions
|
||||
linux works
|
||||
no restrictions
|
||||
openbsd works
|
||||
no restrictions
|
||||
win2k
|
||||
no restrictions
|
||||
|
||||
freebsd
|
||||
hangs at /sbin/init
|
||||
win98
|
||||
sometimes boots up to desktop
|
||||
winXP
|
||||
finish text mode bar,
|
||||
switch to gfx mode
|
||||
stop 7b
|
||||
|
||||
"public" release
|
||||
|
||||
just bit of cleanups, other than that same as
|
||||
"win2k" release.
|
||||
|
231
util/ADLO/README
Normal file
231
util/ADLO/README
Normal file
|
@ -0,0 +1,231 @@
|
|||
==========================================
|
||||
$Id$
|
||||
==========================================
|
||||
|
||||
ADLO
|
||||
|
||||
A project to combine LinuxBIOS and BOCHS BIOS to add support
|
||||
for booting legacy applications, such as Microsoft Windows.
|
||||
|
||||
==========================================
|
||||
|
||||
Boot Overvew:
|
||||
|
||||
ADLO requires an boot loader with ELF support.
|
||||
In our case it is either LinuxBIOS or EtherBOOT.
|
||||
|
||||
Sample execution paths:
|
||||
|
||||
LinuxBIOS -> ADLO -> LILO -> LINUX
|
||||
|
||||
LinuxBIOS -> EtherBOOT -> ADLO -> LILO -> LINUX
|
||||
|
||||
Then it can start any real mode application.
|
||||
In our case it could be LILO or GRUB, but
|
||||
choices are not limited to this.
|
||||
|
||||
==========================================
|
||||
|
||||
ADLO overview:
|
||||
|
||||
-Elf header
|
||||
-mainteance routines
|
||||
-bochs bios
|
||||
-vga bios
|
||||
|
||||
------------------------------------------
|
||||
|
||||
Elf header
|
||||
|
||||
hand crafted binary. Currently there are 3 diff binaries
|
||||
for three different sizes of payload (65kb,113kb,129kb).
|
||||
|
||||
they are catted at beginning of file
|
||||
|
||||
------------------------------------------
|
||||
|
||||
mainteance routines
|
||||
|
||||
this is the loader.s file which gets compiled into loader.o binary
|
||||
|
||||
it is catted 2nd right after elf header and it is where
|
||||
control is being transfered when the elf is executed.
|
||||
|
||||
it consist of :
|
||||
-tuneups:
|
||||
select device to boot
|
||||
set memory for Int15/EAX=E820
|
||||
enable LBA
|
||||
copy LinuxBIOS table [TODO]
|
||||
-shadow :
|
||||
enable/write/read
|
||||
-copy:
|
||||
bochs @ 0xF00000
|
||||
video bios (binary only) @ 0xC00000
|
||||
-switch
|
||||
from Real to Protected Mode
|
||||
-jump
|
||||
jmp to the bios at 0xFFFF:0x0000
|
||||
|
||||
we must have bios payload always at 1kb
|
||||
offset from start of ELF payload so loader.o
|
||||
must be always 1024 bytes.
|
||||
|
||||
------------------------------------------
|
||||
|
||||
BOCHS BIOS
|
||||
|
||||
we have taken the boch's project and just extracted
|
||||
its bios from it only. it took us (so far) only
|
||||
minor modifications in order to make it work.
|
||||
|
||||
basically it is the following directory in the
|
||||
bochs sources
|
||||
|
||||
bochs-cvs/bochs/bios
|
||||
|
||||
of all files there the rombios.c is the key file.
|
||||
Most of the times our patches are against current
|
||||
version of the rombios.c file. We try to feed back
|
||||
the patches to bochs maintainers so that's possible
|
||||
to use the bochs bios as is.
|
||||
|
||||
the boch's related stuff are in bochs subdirectory.
|
||||
|
||||
building boch's bios is as simple as
|
||||
|
||||
cd bochs/bochs-cvs/bochs/bios
|
||||
make
|
||||
|
||||
the resulting file rombios.bin is our bios image.
|
||||
|
||||
-----
|
||||
At present time, it is recommended to use
|
||||
dev86-0.16.3 + my patch in order to compile
|
||||
bochs' bios. The dev86 package can be found
|
||||
at:
|
||||
|
||||
http://www.cix.co.uk/~mayday/
|
||||
|
||||
prepatched sources at:
|
||||
|
||||
http://www.missl.cs.umd.edu/~adam/dev86-0.16.3-MSR.tgz
|
||||
|
||||
------------------------------------------
|
||||
|
||||
Video BIOS
|
||||
|
||||
Video BIOS we use is binary only, so far.
|
||||
|
||||
At the present time we are using the original
|
||||
Video BIOS as supplied from the system.
|
||||
|
||||
To get the image simply type:
|
||||
|
||||
make makevideobios
|
||||
|
||||
The right thing will happen. For refernece the
|
||||
magic line in the Makefile is:
|
||||
|
||||
videobios:
|
||||
dd if=/proc/kcore \
|
||||
of=./video.bios.bin \
|
||||
bs=1 count=65536 skip=790528
|
||||
|
||||
---------------
|
||||
|
||||
We assume it is located at 0xC00000-0xE00000
|
||||
and we use 'dd and /proc/kcore to extract it
|
||||
(obviously it works as root only).
|
||||
|
||||
Obviously it needs to be done with original
|
||||
(as shipped by manufactuer bios) so it should
|
||||
be done as the first step of the ADLO setup.
|
||||
|
||||
---------------
|
||||
|
||||
The /proc/kcore is in ELF format (linux kernel
|
||||
2.4.x and later) so if we want to get accurate
|
||||
image of ram we must skip the ELF header.
|
||||
The magic command is :
|
||||
|
||||
readelf -a /proc/kcore
|
||||
|
||||
Program Headers:
|
||||
Type Offset VirtAddr PhysAddr FileSiz MemSiz
|
||||
NOTE 0x0007d4 0x00000000 0x00000000 0x005b0 0x00000
|
||||
LOAD 0x001000 0xc0000000 0x00000000 0xff60000 0xff60000
|
||||
^^^^^^^^
|
||||
|
||||
There we look for the first LOAD section, and see what
|
||||
is its offset (for us it is 0x1000)
|
||||
|
||||
---------------
|
||||
|
||||
64KiB = 65536
|
||||
|
||||
0x0C 00 00 + 0x10 00 = 790528
|
||||
|
||||
---------------
|
||||
|
||||
On technical note in our case video bios
|
||||
is just 48kb, but for paranoia sake we copy
|
||||
64kb.
|
||||
|
||||
==========================================
|
||||
|
||||
Environment overview
|
||||
|
||||
ADLO is an ELF file and thus can be loaded either directly from 1)
|
||||
LinuxBIOS, or 2) via EtherBOOT, or 3) via EtherBOOT+ AA patch for FS
|
||||
support.
|
||||
|
||||
1)
|
||||
Both LinuxBIOS and ADLO are on the same EEPROM chip. From end-user
|
||||
viewpoint it is probably the most similar to the bios classic.
|
||||
(computer boots up and just loads whatever is in MBR).
|
||||
|
||||
2)
|
||||
Set it up in /tftpboot directory on dhcp/tftp server and have it served
|
||||
from there. (this is how we did the development)
|
||||
|
||||
3)
|
||||
Use AA patch and put it as /kernel file and it will be then loaded by
|
||||
etherboot from local hard disk.
|
||||
|
||||
|
||||
------------------------------------------
|
||||
|
||||
Before ADLO starts.
|
||||
|
||||
ADLO requires an boot loader with ELF support.
|
||||
In our case it is:
|
||||
|
||||
-LinuxBIOS
|
||||
-LinuxBIOS and EtherBOOT
|
||||
-LinuxBIOS and EtherBOOT + AA polled I/O patch (w/ FS support).
|
||||
|
||||
As little as LinuxBIOS only is required to get ADLO
|
||||
up and running.
|
||||
|
||||
For development purposes it is recommended full set of
|
||||
LinuxBIOS + EtherBOOT and boot via DHCP/TFTP.
|
||||
|
||||
------------------------------------------
|
||||
|
||||
After ADLO finish.
|
||||
|
||||
ADLO will attempt to locate the first hard disk
|
||||
and read MBR from it and execute.
|
||||
|
||||
Then it can start any real mode application.
|
||||
In our case it could be LILO or GRUB
|
||||
but choices are not limited to this.
|
||||
|
||||
In our case it would cause LILO to load
|
||||
(fully usable) and from there it was able to
|
||||
execute simple programs. so far the list
|
||||
of the program is limited to linux which
|
||||
runs somewhat. More to come in future.
|
||||
|
||||
==========================================
|
37
util/ADLO/README.1st
Normal file
37
util/ADLO/README.1st
Normal file
|
@ -0,0 +1,37 @@
|
|||
Date: Sat, 23 Nov 2002 22:20:57 -0500
|
||||
From: Adam Sulmicki <adam@cfar.umd.edu>
|
||||
To: LinuxBIOS <linuxbios@clustermatic.org>
|
||||
Cc: William Arbaugh <waa@cs.umd.edu>, Adam Agnew <agnew@cs.umd.edu>
|
||||
Subject: [ANNOUNCE] LinuxBIOS boots Windows 2000, GRUB, and OpenBSD.
|
||||
|
||||
We're happy to announce that we've been able to successfully boot
|
||||
Windows 2000 without a legacy BIOS. We accomplished this by developing
|
||||
software that combined elements from two very successful projects:
|
||||
LinuxBIOS and BOCHS. The Etherboot project also helped in various ways.
|
||||
|
||||
As a result now, we have a completely open source replacement for the
|
||||
BIOS that can use (without modification) either LILO or GRUB as
|
||||
bootloaders, and Linux, OpenBSD, and Windows 2000 as operating systems
|
||||
(NOTE: We're still working on supporting FreeBSD and Windows XP. We
|
||||
expect that improving ATA support will permit Win98 and WinXP to boot,
|
||||
and finishing PIRQ support will permit FreeBSD to boot.) Motherboard
|
||||
support is also limited at this time, but we hope to expand that along
|
||||
with LinuxBIOS.
|
||||
|
||||
More details can be found at:
|
||||
|
||||
http://www.missl.cs.umd.edu/Projects/sebos/main.shtml
|
||||
|
||||
and
|
||||
|
||||
http://www.missl.cs.umd.edu/Projects/sebos/phase2.shtml
|
||||
|
||||
Ironically, twenty years ago this month Compaq introduced their Compaq
|
||||
portable computer with the first BIOS outside of IBM, see
|
||||
http://www.old-computers.com/museum/computer.asp?st=1&c=547 .
|
||||
|
||||
Adam Sulmicki
|
||||
Adam Agnew
|
||||
William Arbaugh
|
||||
|
||||
This work has been funded by a grant from DARPA under the CHATS program.
|
154
util/ADLO/STATUS
Normal file
154
util/ADLO/STATUS
Normal file
|
@ -0,0 +1,154 @@
|
|||
$Id$
|
||||
==========================================
|
||||
==========================================
|
||||
|
||||
STATUS
|
||||
|
||||
==========================================
|
||||
==========================================
|
||||
|
||||
LILO
|
||||
fully supported
|
||||
|
||||
==========================================
|
||||
|
||||
GRUB
|
||||
fully supported
|
||||
|
||||
notes
|
||||
int15/eAX=00C0 - not supported
|
||||
int15/Eax=5300 - not supported
|
||||
int 13 ; fn 41 -> dev 81
|
||||
int 13 ; fn 08 -> dev 81
|
||||
|
||||
==========================================
|
||||
|
||||
LINUX
|
||||
fully supported
|
||||
|
||||
notes
|
||||
won't reboot
|
||||
fix fb?
|
||||
|
||||
==========================================
|
||||
|
||||
openbsd
|
||||
fully supported
|
||||
|
||||
notes
|
||||
won't reboot
|
||||
|
||||
==========================================
|
||||
Win2k
|
||||
|
||||
fully supported
|
||||
|
||||
notes
|
||||
network?
|
||||
better gfx?
|
||||
|
||||
==========================================
|
||||
|
||||
freebsd
|
||||
somewhat supported
|
||||
|
||||
notes
|
||||
won't reboot
|
||||
|
||||
right now it hangs somewhere around fsck/net startup
|
||||
|
||||
probably due to bad PIRQ table,
|
||||
it probably switches to polled IO and is dog slow.
|
||||
|
||||
==========================================
|
||||
|
||||
Win98
|
||||
somewhat supported
|
||||
|
||||
lots of ata issues, but if get past
|
||||
ata hurdles, desktop will show up
|
||||
|
||||
press F8 for safe mode.
|
||||
the desktop comes up
|
||||
(can see "safe mode")
|
||||
|
||||
int 15 D8 (?) not supporte
|
||||
int 15 ?? not supported
|
||||
int 15 fn 24 (set A20 gate) not suported)
|
||||
|
||||
==========================================
|
||||
|
||||
winXP
|
||||
|
||||
no go
|
||||
|
||||
safe/normal boot
|
||||
|
||||
progress bar finishes, switches to gfx mode
|
||||
and immediatelly STOP 7B, no sub error.
|
||||
|
||||
more timing problems!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
more likely "unexpected previous state" problems.
|
||||
|
||||
cold reboot, normal boot and safe mode
|
||||
missing hal
|
||||
\system32\hal.dll
|
||||
|
||||
missing system
|
||||
-------------------
|
||||
no lba - ie none
|
||||
function 02, error 11 - drv not ready.
|
||||
|
||||
|
||||
==========================================
|
||||
==========================================
|
||||
|
||||
syslinux
|
||||
netbsd
|
||||
hurd
|
||||
dos
|
||||
other applications
|
||||
|
||||
not supported/tested at present time
|
||||
|
||||
==========================================
|
||||
TODO:
|
||||
|
||||
timing in ide read code (int13) [WIP]
|
||||
grub boot
|
||||
sometimes it work, sometimes it doesn't
|
||||
|
||||
openbsd boot /WinXP boot.
|
||||
(AH=0x02) misreads sometimes.
|
||||
|
||||
fix int15 memory functions. (E820, etc)
|
||||
so that mem size is not hard coded.
|
||||
(see prep "fixup" section in loader.s)
|
||||
|
||||
fix bios to properly handle reboot
|
||||
|
||||
setup PIRQ table for P6STMT mbo.
|
||||
have it extract from linuxbios somehow..
|
||||
find it in ram and copy...
|
||||
|
||||
hack gcc to support 16 bit real mode.
|
||||
|
||||
|
||||
port 80 card broken?
|
||||
|
||||
hack dev86 to support rdmsr and wrmsr [done]
|
||||
|
||||
|
||||
==========================================
|
||||
problems:
|
||||
-binary only video bios required
|
||||
-binary only bios required
|
||||
-warm reboot from pc bios is required
|
||||
chipset timings or something
|
||||
P6STMT board only.
|
||||
|
||||
|
||||
int 12 not stable, multiple reboot required
|
||||
debug msg for slowing down required
|
||||
|
||||
==========================================
|
58
util/ADLO/bochs/bios/Makefile
Normal file
58
util/ADLO/bochs/bios/Makefile
Normal file
|
@ -0,0 +1,58 @@
|
|||
# Copyright (C) 2001 MandrakeSoft S.A.
|
||||
#
|
||||
# MandrakeSoft S.A.
|
||||
# 43, rue d'Aboukir
|
||||
# 75002 Paris - France
|
||||
# http://www.linux-mandrake.com/
|
||||
# http://www.mandrakesoft.com/
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2 of the License, or (at your option) any later version.
|
||||
#
|
||||
# This library 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
# Makefile for the BIOS component of bochs
|
||||
|
||||
.SUFFIXES: .cc
|
||||
|
||||
# -------- end configurable options --------------------------
|
||||
|
||||
.cc.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(LOCAL_CXXFLAGS) $(BX_INCDIRS) $< -o $@
|
||||
|
||||
bios: rombios.bin
|
||||
|
||||
rombios.bin: rombios.c
|
||||
gcc -E $< > _rombios_.c
|
||||
bcc -o rombios.s -C-c -D__i86__ -0 -S _rombios_.c
|
||||
sed -e 's/^\.text//' -e 's/^\.data//' rombios.s > _rombios_.s
|
||||
as86 _rombios_.s -b rombios.bin -u- -w- -g -0 -j -O -l rombios.txt
|
||||
ls -l rombios.bin
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
rm -f *.s
|
||||
rm -f _rombios_.c
|
||||
rm -f rombios.txt
|
||||
|
||||
biosclean:
|
||||
rm -f rombios.bin
|
||||
|
||||
distclean: clean biosclean
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
diff:
|
||||
( diff -Bbwiu ../bochs-cvs/bochs/bios/rombios.c rombios.c ; true )
|
||||
|
||||
# -----------------------------------------------------------------
|
1
util/ADLO/bochs/bios/README
Normal file
1
util/ADLO/bochs/bios/README
Normal file
|
@ -0,0 +1 @@
|
|||
The bochs bios.
|
2
util/ADLO/bochs/bios/bochs/README
Normal file
2
util/ADLO/bochs/bios/bochs/README
Normal file
|
@ -0,0 +1,2 @@
|
|||
For reference we keep here current releases of bochs'
|
||||
rombios.c file.
|
9567
util/ADLO/bochs/bios/bochs/rombios.c-1.76
Normal file
9567
util/ADLO/bochs/bios/bochs/rombios.c-1.76
Normal file
File diff suppressed because it is too large
Load diff
9716
util/ADLO/bochs/bios/bochs/rombios.c-1.77
Normal file
9716
util/ADLO/bochs/bios/bochs/rombios.c-1.77
Normal file
File diff suppressed because it is too large
Load diff
9727
util/ADLO/bochs/bios/bochs/rombios.c-1.78
Normal file
9727
util/ADLO/bochs/bios/bochs/rombios.c-1.78
Normal file
File diff suppressed because it is too large
Load diff
9723
util/ADLO/bochs/bios/bochs/rombios.c-1.79
Normal file
9723
util/ADLO/bochs/bios/bochs/rombios.c-1.79
Normal file
File diff suppressed because it is too large
Load diff
13
util/ADLO/bochs/bios/diff/79.diff
Normal file
13
util/ADLO/bochs/bios/diff/79.diff
Normal file
|
@ -0,0 +1,13 @@
|
|||
--- rombios.c Sun Nov 10 10:18:43 2002
|
||||
+++ rombios.c Thu Nov 14 21:07:54 2002
|
||||
@@ -24,10 +24,6 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
-/* includes a subset of config.h that can be compiled by bcc, and applies
|
||||
- to this file */
|
||||
-#include "biosconfig.h"
|
||||
-
|
||||
// ROM BIOS for use with Bochs/Plex x86 emulation environment
|
||||
|
||||
|
11
util/ADLO/bochs/bios/diff/ATA_INTERFACES_DEVICES.diff
Normal file
11
util/ADLO/bochs/bios/diff/ATA_INTERFACES_DEVICES.diff
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- rombios.c-1.78 2002-11-10 10:18:43.000000000 -0500
|
||||
+++ rombios.c-1.78-new 2002-11-12 17:45:54.000000000 -0500
|
||||
@@ -2095,7 +2095,7 @@
|
||||
// Device detection
|
||||
hdcount=cdcount=0;
|
||||
|
||||
- for(device=0; device<BX_MAX_ATA_DEVICES; device++) {
|
||||
+ for(device=0; device<BX_MAX_ATA_INTERFACES; device++) {
|
||||
Bit16u iobase1, iobase2;
|
||||
Bit8u channel, slave, shift;
|
||||
Bit8u sc, sn, cl, ch, st;
|
5
util/ADLO/bochs/bios/diff/README
Normal file
5
util/ADLO/bochs/bios/diff/README
Normal file
|
@ -0,0 +1,5 @@
|
|||
Here we have various patches against bochs bios.
|
||||
|
||||
The goal is that, once they are stable enough, we will submit them
|
||||
back into bochs project for inclusion into the mainline sources.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
--- rombios.c Tue Nov 12 17:41:36 2002
|
||||
+++ rombios.c-current Tue Nov 12 12:44:20 2002
|
||||
@@ -9027,6 +9028,9 @@
|
||||
call _cdemu_init
|
||||
;;
|
||||
#endif // BX_ELTORITO_BOOT
|
||||
+
|
||||
+ ;; VGA Fonts.: F000h:FA6Eh : SYSTEM DATA - 8x8 GRAPHICS FONT
|
||||
+ SET_INT_VECTOR(0x1F, #0xF000, #0xFA6E)
|
||||
|
||||
int #0x19
|
||||
//JMP_EP(0x0064) ; INT 19h location
|
74
util/ADLO/bochs/bios/diff/bochs-bios-178-vga-font.diff
Normal file
74
util/ADLO/bochs/bios/diff/bochs-bios-178-vga-font.diff
Normal file
|
@ -0,0 +1,74 @@
|
|||
--- rombios.c Tue Nov 12 17:41:36 2002
|
||||
+++ rombios.c-current Tue Nov 12 12:44:20 2002
|
||||
@@ -9477,7 +9481,70 @@
|
||||
|
||||
.org 0xfa6e ; Character Font for 320x200 & 640x200 Graphics (lower 128 characters)
|
||||
|
||||
-
|
||||
+db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e
|
||||
+db 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7, 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00
|
||||
+db 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x38, 0x7c, 0x38, 0xfe, 0xfe, 0x7c, 0x38, 0x7c
|
||||
+db 0x10, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x7c, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00
|
||||
+db 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00
|
||||
+db 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0x0f, 0x07, 0x0f, 0x7d, 0xcc, 0xcc, 0xcc, 0x78
|
||||
+db 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x70, 0xf0, 0xe0
|
||||
+db 0x7f, 0x63, 0x7f, 0x63, 0x63, 0x67, 0xe6, 0xc0, 0x99, 0x5a, 0x3c, 0xe7, 0xe7, 0x3c, 0x5a, 0x99
|
||||
+db 0x80, 0xe0, 0xf8, 0xfe, 0xf8, 0xe0, 0x80, 0x00, 0x02, 0x0e, 0x3e, 0xfe, 0x3e, 0x0e, 0x02, 0x00
|
||||
+db 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x00
|
||||
+db 0x7f, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x00, 0x3e, 0x63, 0x38, 0x6c, 0x6c, 0x38, 0xcc, 0x78
|
||||
+db 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x7e, 0x3c, 0x18, 0xff
|
||||
+db 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00
|
||||
+db 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00
|
||||
+db 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00
|
||||
+db 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x3c, 0x18, 0x00, 0x00
|
||||
+db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x78, 0x30, 0x30, 0x00, 0x30, 0x00
|
||||
+db 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0xfe, 0x6c, 0x6c, 0x00
|
||||
+db 0x30, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, 0x30, 0x00, 0x00, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xc6, 0x00
|
||||
+db 0x38, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0x76, 0x00, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
+db 0x18, 0x30, 0x60, 0x60, 0x60, 0x30, 0x18, 0x00, 0x60, 0x30, 0x18, 0x18, 0x18, 0x30, 0x60, 0x00
|
||||
+db 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, 0x00
|
||||
+db 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00
|
||||
+db 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00
|
||||
+db 0x7c, 0xc6, 0xce, 0xde, 0xf6, 0xe6, 0x7c, 0x00, 0x30, 0x70, 0x30, 0x30, 0x30, 0x30, 0xfc, 0x00
|
||||
+db 0x78, 0xcc, 0x0c, 0x38, 0x60, 0xcc, 0xfc, 0x00, 0x78, 0xcc, 0x0c, 0x38, 0x0c, 0xcc, 0x78, 0x00
|
||||
+db 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x1e, 0x00, 0xfc, 0xc0, 0xf8, 0x0c, 0x0c, 0xcc, 0x78, 0x00
|
||||
+db 0x38, 0x60, 0xc0, 0xf8, 0xcc, 0xcc, 0x78, 0x00, 0xfc, 0xcc, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x00
|
||||
+db 0x78, 0xcc, 0xcc, 0x78, 0xcc, 0xcc, 0x78, 0x00, 0x78, 0xcc, 0xcc, 0x7c, 0x0c, 0x18, 0x70, 0x00
|
||||
+db 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x30, 0x30, 0x60
|
||||
+db 0x18, 0x30, 0x60, 0xc0, 0x60, 0x30, 0x18, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0xfc, 0x00, 0x00
|
||||
+db 0x60, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x78, 0xcc, 0x0c, 0x18, 0x30, 0x00, 0x30, 0x00
|
||||
+db 0x7c, 0xc6, 0xde, 0xde, 0xde, 0xc0, 0x78, 0x00, 0x30, 0x78, 0xcc, 0xcc, 0xfc, 0xcc, 0xcc, 0x00
|
||||
+db 0xfc, 0x66, 0x66, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x3c, 0x66, 0xc0, 0xc0, 0xc0, 0x66, 0x3c, 0x00
|
||||
+db 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00
|
||||
+db 0xfe, 0x62, 0x68, 0x78, 0x68, 0x60, 0xf0, 0x00, 0x3c, 0x66, 0xc0, 0xc0, 0xce, 0x66, 0x3e, 0x00
|
||||
+db 0xcc, 0xcc, 0xcc, 0xfc, 0xcc, 0xcc, 0xcc, 0x00, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00
|
||||
+db 0x1e, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78, 0x00, 0xe6, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0xe6, 0x00
|
||||
+db 0xf0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0x00
|
||||
+db 0xc6, 0xe6, 0xf6, 0xde, 0xce, 0xc6, 0xc6, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x00
|
||||
+db 0xfc, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xdc, 0x78, 0x1c, 0x00
|
||||
+db 0xfc, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0xe6, 0x00, 0x78, 0xcc, 0xe0, 0x70, 0x1c, 0xcc, 0x78, 0x00
|
||||
+db 0xfc, 0xb4, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0x00
|
||||
+db 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xfe, 0xee, 0xc6, 0x00
|
||||
+db 0xc6, 0xc6, 0x6c, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x30, 0x78, 0x00
|
||||
+db 0xfe, 0xc6, 0x8c, 0x18, 0x32, 0x66, 0xfe, 0x00, 0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x00
|
||||
+db 0xc0, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x02, 0x00, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00
|
||||
+db 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff
|
||||
+db 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0x76, 0x00
|
||||
+db 0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0xdc, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xc0, 0xcc, 0x78, 0x00
|
||||
+db 0x1c, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xfc, 0xc0, 0x78, 0x00
|
||||
+db 0x38, 0x6c, 0x60, 0xf0, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8
|
||||
+db 0xe0, 0x60, 0x6c, 0x76, 0x66, 0x66, 0xe6, 0x00, 0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00
|
||||
+db 0x0c, 0x00, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78, 0xe0, 0x60, 0x66, 0x6c, 0x78, 0x6c, 0xe6, 0x00
|
||||
+db 0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0xcc, 0xfe, 0xfe, 0xd6, 0xc6, 0x00
|
||||
+db 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0x78, 0x00
|
||||
+db 0x00, 0x00, 0xdc, 0x66, 0x66, 0x7c, 0x60, 0xf0, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0x7c, 0x0c, 0x1e
|
||||
+db 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x7c, 0xc0, 0x78, 0x0c, 0xf8, 0x00
|
||||
+db 0x10, 0x30, 0x7c, 0x30, 0x30, 0x34, 0x18, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00
|
||||
+db 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x78, 0x30, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xfe, 0xfe, 0x6c, 0x00
|
||||
+db 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xf8
|
||||
+db 0x00, 0x00, 0xfc, 0x98, 0x30, 0x64, 0xfc, 0x00, 0x1c, 0x30, 0x30, 0xe0, 0x30, 0x30, 0x1c, 0x00
|
||||
+db 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0xe0, 0x30, 0x30, 0x1c, 0x30, 0x30, 0xe0, 0x00
|
||||
+db 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0x00
|
||||
;----------
|
||||
;- INT1Ah -
|
||||
;----------
|
26
util/ADLO/bochs/bios/diff/bochs-bios-8E20-0.diff
Normal file
26
util/ADLO/bochs/bios/diff/bochs-bios-8E20-0.diff
Normal file
|
@ -0,0 +1,26 @@
|
|||
an quick and dirty fix for Int15/EAX=8E20.
|
||||
|
||||
use 8E20-1.diff instead.
|
||||
|
||||
do not apply.
|
||||
---------------------------------
|
||||
|
||||
Adam Sulmicki <adam@cfar.umd.edu>
|
||||
Wed Nov 6 04:43:05 EST 2002
|
||||
http://www.eax.com/patches/
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
--- rombios.c-1.76 Mon Nov 4 01:43:51 2002
|
||||
+++ rombios.c Tue Nov 5 17:37:55 2002
|
||||
@@ -3629,7 +3923,9 @@
|
||||
extended_memory_size = 0x3bc000; // everything after this is reserved memory until we get to 0x100000000
|
||||
}
|
||||
extended_memory_size *= 1024;
|
||||
- extended_memory_size += 15728640; // make up for the 16mb of memory that is chopped off
|
||||
+
|
||||
+// make up for the 16mb of memory that is chopped off
|
||||
+// extended_memory_size += 15728640;
|
||||
|
||||
if(extended_memory_size <= 15728640)
|
||||
{
|
56
util/ADLO/bochs/bios/diff/bochs-bios-8E20-1.diff
Normal file
56
util/ADLO/bochs/bios/diff/bochs-bios-8E20-1.diff
Normal file
|
@ -0,0 +1,56 @@
|
|||
An better fix for Int15/EAX=8E20.
|
||||
|
||||
|
||||
Basically. we are given 4 bytes to store an 4 byte long number.
|
||||
So just treat it as such.
|
||||
|
||||
It also makes it consistent with CMOS description of those numbers.
|
||||
|
||||
---------------------------------
|
||||
|
||||
Adam Sulmicki <adam@cfar.umd.edu>
|
||||
Wed Nov 6 04:43:05 EST 2002
|
||||
http://www.eax.com/patches/
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.5
|
||||
diff -u -r1.5 rombios.c
|
||||
--- rombios.c 6 Nov 2002 09:11:47 -0000 1.5
|
||||
+++ rombios.c 6 Nov 2002 09:35:55 -0000
|
||||
@@ -3783,24 +3783,14 @@
|
||||
return;
|
||||
break;
|
||||
case 1:
|
||||
- extended_memory_size = inb_cmos(0x35);
|
||||
- extended_memory_size <<= 8;
|
||||
- extended_memory_size |= inb_cmos(0x34);
|
||||
- extended_memory_size *= 64;
|
||||
- if(extended_memory_size > 0x3bc000) // greater than EFF00000???
|
||||
- {
|
||||
- extended_memory_size = 0x3bc000; // everything after this is reserved memory until we get to 0x100000000
|
||||
- }
|
||||
- extended_memory_size *= 1024;
|
||||
- extended_memory_size += 15728640; // make up for the 16mb of memory that is chopped off
|
||||
-
|
||||
- if(extended_memory_size <= 15728640)
|
||||
- {
|
||||
- extended_memory_size = inb_cmos(0x31);
|
||||
- extended_memory_size <<= 8;
|
||||
- extended_memory_size |= inb_cmos(0x30);
|
||||
- extended_memory_size *= 1024;
|
||||
- }
|
||||
+ extended_memory_size =
|
||||
+ extended_memory_size*0x00 + inb_cmos(0x30);
|
||||
+ extended_memory_size =
|
||||
+ extended_memory_size*0x10 + inb_cmos(0x31);
|
||||
+ extended_memory_size =
|
||||
+ extended_memory_size*0x10 + inb_cmos(0x34);
|
||||
+ extended_memory_size =
|
||||
+ extended_memory_size*0x10 + inb_cmos(0x35);
|
||||
|
||||
write_word(ES, regs.u.r16.di, 0x0000);
|
||||
write_word(ES, regs.u.r16.di+2, 0x0010);
|
|
@ -0,0 +1,49 @@
|
|||
this patch makes use of previous patch ata-177-waitfor.diff
|
||||
|
||||
It also makes the (h) step do not depend on (g) step anymore.
|
||||
|
||||
Should (g) die out completely?
|
||||
Does not seem to do anything worthwhile.
|
||||
|
||||
---------------------------------
|
||||
|
||||
Adam Sulmicki <adam@cfar.umd.edu>
|
||||
Wed Nov 6 04:43:05 EST 2002
|
||||
http://www.eax.com/patches/
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.8
|
||||
diff -u -r1.8 rombios.c
|
||||
--- rombios.c 6 Nov 2002 09:45:16 -0000 1.8
|
||||
+++ rombios.c 6 Nov 2002 09:50:45 -0000
|
||||
@@ -2454,23 +2454,13 @@
|
||||
sc = inb(iobase1+ATA_CB_SC);
|
||||
sn = inb(iobase1+ATA_CB_SN);
|
||||
|
||||
- if ( (sc==0x01) && (sn==0x01) ) {
|
||||
+ }
|
||||
|
||||
// 8.2.1 (h) -- wait for not BSY
|
||||
- max=0xff;
|
||||
- while(max--!=0) {
|
||||
- Bit8u status = inb(iobase1+ATA_CB_STAT);
|
||||
- if ((status & ATA_CB_STAT_BSY) == 0) break;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ ata_wait_for_notbusy(iobase1);
|
||||
|
||||
// 8.2.1 (i) -- wait for DRDY
|
||||
- max=0xfff;
|
||||
- while(max--!=0) {
|
||||
- Bit8u status = inb(iobase1+ATA_CB_STAT);
|
||||
- if ((status & ATA_CB_STAT_RDY) != 0) break;
|
||||
- }
|
||||
+ ata_wait_for_devrdy(iobase1);
|
||||
|
||||
// Enable interrupts
|
||||
outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15);
|
30
util/ADLO/bochs/bios/diff/bochs-bios-ata-177-info.diff
Normal file
30
util/ADLO/bochs/bios/diff/bochs-bios-ata-177-info.diff
Normal file
|
@ -0,0 +1,30 @@
|
|||
an patch to display CHS information.
|
||||
|
||||
I believe it should being displayed, just like PC BIOS classic does.
|
||||
|
||||
---------------------------------
|
||||
|
||||
Adam Sulmicki <adam@cfar.umd.edu>
|
||||
Wed Nov 6 04:43:05 EST 2002
|
||||
http://www.eax.com/patches/
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.6
|
||||
diff -u -r1.6 rombios.c
|
||||
--- rombios.c 6 Nov 2002 09:37:27 -0000 1.6
|
||||
+++ rombios.c 6 Nov 2002 09:40:53 -0000
|
||||
@@ -2174,7 +2174,9 @@
|
||||
write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.cylinders, cylinders);
|
||||
write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.spt, spt);
|
||||
write_dword(ebda_seg,&EbdaData->ata.devices[device].sectors, sectors);
|
||||
- BX_INFO("ata%d-%d: PCHS=%u/%d/%d translation=", channel, slave,cylinders, heads, spt);
|
||||
+
|
||||
+ printf("ata%d %s: ",channel,slave?" slave":"master");
|
||||
+ printf("PCHS=%u/%d/%d translation=",cylinders, heads, spt);
|
||||
|
||||
translation = inb_cmos(0x39 + channel/2);
|
||||
for (shift=device%4; shift>0; shift--) translation >>= 2;
|
|
@ -0,0 +1,53 @@
|
|||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.10
|
||||
diff -u -r1.10 rombios.c
|
||||
--- rombios.c 6 Nov 2002 16:11:02 -0000 1.10
|
||||
+++ rombios.c 10 Nov 2002 09:51:50 -0000
|
||||
@@ -911,7 +911,7 @@
|
||||
|
||||
Bit16u ata_wait_for_notbusy();
|
||||
Bit16u ata_wait_for_devrdy();
|
||||
-//Bit16u ata_wait_for_dataready();
|
||||
+Bit16u ata_wait_for_dataready();
|
||||
|
||||
Bit16u ata_cmd_non_data();
|
||||
Bit16u ata_cmd_data_in();
|
||||
@@ -2076,7 +2076,35 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
// based on ide.c from "The Universal Talkware Boot Loader" (GPL)
|
||||
|
||||
-//Bit16u ata_wait_for_dataready(iobase){}
|
||||
+Bit16u ata_wait_for_dataready(iobase)
|
||||
+Bit16u iobase;
|
||||
+{
|
||||
+ Bit32u i = 0;
|
||||
+
|
||||
+/*
|
||||
+ printf("wait for dta ready ...status %x\n",
|
||||
+ inb(iobase+ATA_CB_STAT));
|
||||
+*/
|
||||
+
|
||||
+ do {
|
||||
+
|
||||
+ //CHECK DF && ERR
|
||||
+ if (((inb(iobase+ATA_CB_STAT) &
|
||||
+ (ATA_CB_STAT_DF|ATA_CB_STAT_ERR)) != 0)) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ //Check DRQ
|
||||
+ if (((inb(iobase+ATA_CB_STAT) & ATA_CB_STAT_DRQ) ==
|
||||
+ ATA_CB_STAT_DRQ)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ } while (i++ <= ATA_WAIT_COUNT);
|
||||
+
|
||||
+ return 1;
|
||||
+
|
||||
+}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ATA/ATAPI driver : initialization
|
115
util/ADLO/bochs/bios/diff/bochs-bios-ata-177-waitfor.diff
Normal file
115
util/ADLO/bochs/bios/diff/bochs-bios-ata-177-waitfor.diff
Normal file
|
@ -0,0 +1,115 @@
|
|||
this patch add two timing out wait functions.
|
||||
namely:
|
||||
|
||||
Bit16u ata_wait_for_notbusy();
|
||||
Bit16u ata_wait_for_devrdy();
|
||||
|
||||
They will come to use later in ata_reset() as well as ide write and read
|
||||
functions.
|
||||
|
||||
basically a fundation laying patch.
|
||||
|
||||
---------------------------------
|
||||
|
||||
Adam Sulmicki <adam@cfar.umd.edu>
|
||||
Wed Nov 6 04:43:05 EST 2002
|
||||
http://www.eax.com/patches/
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.7
|
||||
diff -u -r1.7 rombios.c
|
||||
--- rombios.c 6 Nov 2002 09:41:17 -0000 1.7
|
||||
+++ rombios.c 6 Nov 2002 09:44:39 -0000
|
||||
@@ -909,6 +909,10 @@
|
||||
void ata_detect();
|
||||
void ata_reset();
|
||||
|
||||
+Bit16u ata_wait_for_notbusy();
|
||||
+Bit16u ata_wait_for_devrdy();
|
||||
+//Bit16u ata_wait_for_dataready();
|
||||
+
|
||||
Bit16u ata_cmd_non_data();
|
||||
Bit16u ata_cmd_data_in();
|
||||
Bit16u ata_cmd_data_out();
|
||||
@@ -2003,7 +2007,77 @@
|
||||
#define ATA_DATA_NO 0x00
|
||||
#define ATA_DATA_IN 0x01
|
||||
#define ATA_DATA_OUT 0x02
|
||||
+
|
||||
+#define ATA_WAIT_COUNT 0xFFFF
|
||||
|
||||
+// ---------------------------------------------------------------------------
|
||||
+// ATA/ATAPI driver : ata_wait_for_notbusy()
|
||||
+// ---------------------------------------------------------------------------
|
||||
+// based on ide.c from "The Universal Talkware Boot Loader" (GPL)
|
||||
+
|
||||
+Bit16u ata_wait_for_notbusy(iobase)
|
||||
+Bit16u iobase;
|
||||
+{
|
||||
+
|
||||
+ Bit32u i = 0;
|
||||
+
|
||||
+/*
|
||||
+ printf("wait for busy ...status %x\n",inb(iobase+ATA_CB_STAT));
|
||||
+*/
|
||||
+
|
||||
+ do {
|
||||
+ //Wait BSY from 1 to 0
|
||||
+ if (((inb(iobase+ATA_CB_STAT) & ATA_CB_STAT_BSY) == 0)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ } while (i++ <= ATA_WAIT_COUNT);
|
||||
+
|
||||
+ return 1;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+// ---------------------------------------------------------------------------
|
||||
+// ATA/ATAPI driver : ata_wait_for_devrdy()
|
||||
+// ---------------------------------------------------------------------------
|
||||
+// based on ide.c from "The Universal Talkware Boot Loader" (GPL)
|
||||
+
|
||||
+Bit16u ata_wait_for_devrdy(iobase)
|
||||
+Bit16u iobase;
|
||||
+{
|
||||
+ Bit32u i = 0;
|
||||
+
|
||||
+/*
|
||||
+ printf("wait for device ready ...status %x\n",
|
||||
+ inb(iobase+ATA_CB_STAT));
|
||||
+*/
|
||||
+
|
||||
+ do {
|
||||
+
|
||||
+ //CHECK DF && ERR
|
||||
+ if (((inb(iobase+ATA_CB_STAT) &
|
||||
+ (ATA_CB_STAT_DF|ATA_CB_STAT_ERR)) != 0)) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ //Check DRDY
|
||||
+ if (((inb(iobase+ATA_CB_STAT) & ATA_CB_STAT_RDY) ==
|
||||
+ ATA_CB_STAT_RDY)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ } while (i++ <= ATA_WAIT_COUNT);
|
||||
+
|
||||
+ return 1;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+// ---------------------------------------------------------------------------
|
||||
+// ATA/ATAPI driver : ata_wait_for_dataready()
|
||||
+// ---------------------------------------------------------------------------
|
||||
+// based on ide.c from "The Universal Talkware Boot Loader" (GPL)
|
||||
+
|
||||
+//Bit16u ata_wait_for_dataready(iobase){}
|
||||
+
|
||||
// ---------------------------------------------------------------------------
|
||||
// ATA/ATAPI driver : initialization
|
||||
// ---------------------------------------------------------------------------
|
253
util/ADLO/bochs/bios/diff/bochs-bios-ata-178-readwrite-WIP.diff
Normal file
253
util/ADLO/bochs/bios/diff/bochs-bios-ata-178-readwrite-WIP.diff
Normal file
|
@ -0,0 +1,253 @@
|
|||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.13
|
||||
diff -u -r1.13 rombios.c
|
||||
--- rombios.c 10 Nov 2002 14:30:52 -0000 1.13
|
||||
+++ rombios.c 12 Nov 2002 01:41:56 -0000
|
||||
@@ -133,10 +133,10 @@
|
||||
//
|
||||
// BCC Bug: find a generic way to handle the bug of #asm after an "if" (fixed in 0.16.7)
|
||||
|
||||
-#define DEBUG_ROMBIOS 0
|
||||
+#define DEBUG_ROMBIOS 1
|
||||
|
||||
-#define DEBUG_ATA 0
|
||||
-#define DEBUG_INT13_HD 0
|
||||
+#define DEBUG_ATA 1
|
||||
+#define DEBUG_INT13_HD 1
|
||||
#define DEBUG_INT13_CD 0
|
||||
#define DEBUG_INT13_ET 0
|
||||
#define DEBUG_INT13_FL 0
|
||||
@@ -154,7 +154,7 @@
|
||||
#define BX_USE_ATADRV 1
|
||||
#define BX_ELTORITO_BOOT 1
|
||||
|
||||
-#define BX_MAX_ATA_INTERFACES 4
|
||||
+#define BX_MAX_ATA_INTERFACES 1
|
||||
#define BX_MAX_ATA_DEVICES (BX_MAX_ATA_INTERFACES*2)
|
||||
|
||||
/* model byte 0xFC = AT */
|
||||
@@ -2018,7 +2018,7 @@
|
||||
#define ATA_DATA_IN 0x01
|
||||
#define ATA_DATA_OUT 0x02
|
||||
|
||||
-#define ATA_WAIT_COUNT 0xFFFF
|
||||
+#define ATA_WAIT_COUNT 0xFFFFFF
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ATA/ATAPI driver : ata_wait_for_notbusy()
|
||||
@@ -2202,11 +2202,14 @@
|
||||
// Device detection
|
||||
hdcount=cdcount=0;
|
||||
|
||||
- for(device=0; device<BX_MAX_ATA_DEVICES; device++) {
|
||||
+// for(device=0; device<BX_MAX_ATA_DEVICES; device++) {
|
||||
+{
|
||||
Bit16u iobase1, iobase2;
|
||||
Bit8u channel, slave, shift;
|
||||
Bit8u sc, sn, cl, ch, st;
|
||||
|
||||
+ printf("DEVICE:%d\n",device);
|
||||
+
|
||||
channel = device / 2;
|
||||
slave = device % 2;
|
||||
|
||||
@@ -2269,7 +2272,7 @@
|
||||
BX_PANIC("ata-detect: Failed to detect ATA device\n");
|
||||
|
||||
removable = (read_byte(get_SS(),buffer+0) & 0x80) ? 1 : 0;
|
||||
- mode = read_byte(get_SS(),buffer+96) ? ATA_MODE_PIO32 : ATA_MODE_PIO16;
|
||||
+// mode = read_byte(get_SS(),buffer+96) ? ATA_MODE_PIO32 : ATA_MODE_PIO16;
|
||||
blksize = read_word(get_SS(),buffer+10);
|
||||
|
||||
cylinders = read_word(get_SS(),buffer+(1*2)); // word 1
|
||||
@@ -2556,9 +2559,24 @@
|
||||
write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
|
||||
current = 0;
|
||||
|
||||
- status = inb(iobase1 + ATA_CB_STAT);
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+
|
||||
+status = inb(iobase1 + ATA_CB_STAT);
|
||||
if (status & ATA_CB_STAT_BSY) return 1;
|
||||
|
||||
+// 1) SEND COMMAND
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+
|
||||
+ status = ata_wait_for_devrdy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
+
|
||||
outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
|
||||
outb(iobase1 + ATA_CB_FR, 0x00);
|
||||
outb(iobase1 + ATA_CB_SC, count);
|
||||
@@ -2566,6 +2584,11 @@
|
||||
outb(iobase1 + ATA_CB_CL, cylinder & 0x00ff);
|
||||
outb(iobase1 + ATA_CB_CH, cylinder >> 8);
|
||||
outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 12;
|
||||
+
|
||||
outb(iobase1 + ATA_CB_CMD, command);
|
||||
|
||||
while (1) {
|
||||
@@ -2573,6 +2596,11 @@
|
||||
if ( !(status & ATA_CB_STAT_BSY) ) break;
|
||||
}
|
||||
|
||||
+ ata_wait_for_notbusy(iobase1);
|
||||
+
|
||||
+
|
||||
+// 1) END OF SEND COMMAND
|
||||
+
|
||||
if (status & ATA_CB_STAT_ERR) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : read error\n");
|
||||
return 2;
|
||||
@@ -2581,6 +2609,19 @@
|
||||
return 3;
|
||||
}
|
||||
|
||||
+// 2) READ BACK DATA
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 31;
|
||||
+
|
||||
+ status = ata_wait_for_dataready(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 32;
|
||||
+
|
||||
// FIXME : move seg/off translation here
|
||||
|
||||
ASM_START
|
||||
@@ -2636,7 +2677,7 @@
|
||||
if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
|
||||
!= ATA_CB_STAT_RDY ) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : no sectors left (status %02x)\n", (unsigned) status);
|
||||
- return 4;
|
||||
+ //return 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2644,11 +2685,12 @@
|
||||
if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
|
||||
!= (ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ) ) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : more sectors left (status %02x)\n", (unsigned) status);
|
||||
- return 5;
|
||||
+ // return 5;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
- }
|
||||
+ } // while(1)
|
||||
+
|
||||
// Enable interrupts
|
||||
outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15);
|
||||
return 0;
|
||||
@@ -2699,8 +2741,21 @@
|
||||
write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
|
||||
current = 0;
|
||||
|
||||
- status = inb(iobase1 + ATA_CB_STAT);
|
||||
- if (status & ATA_CB_STAT_BSY) return 1;
|
||||
+ //status = inb(iobase1 + ATA_CB_STAT);
|
||||
+ //if (status & ATA_CB_STAT_BSY) return 1;
|
||||
+
|
||||
+// 1) SEND COMMAND
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+
|
||||
+ status = ata_wait_for_devrdy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
|
||||
outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
|
||||
outb(iobase1 + ATA_CB_FR, 0x00);
|
||||
@@ -2709,12 +2764,23 @@
|
||||
outb(iobase1 + ATA_CB_CL, cylinder & 0x00ff);
|
||||
outb(iobase1 + ATA_CB_CH, cylinder >> 8);
|
||||
outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 12;
|
||||
+
|
||||
outb(iobase1 + ATA_CB_CMD, command);
|
||||
|
||||
while (1) {
|
||||
status = inb(iobase1 + ATA_CB_STAT);
|
||||
if ( !(status & ATA_CB_STAT_BSY) ) break;
|
||||
}
|
||||
+ ata_wait_for_notbusy(iobase1);
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+// 1) END OF SEND COMMAND
|
||||
|
||||
if (status & ATA_CB_STAT_ERR) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_out : read error\n");
|
||||
@@ -2724,6 +2790,18 @@
|
||||
return 3;
|
||||
}
|
||||
|
||||
+// 2) WRITE DATA
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 31;
|
||||
+ status = ata_wait_for_dataready(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 32;
|
||||
+
|
||||
// FIXME : move seg/off translation here
|
||||
|
||||
ASM_START
|
||||
@@ -2781,7 +2859,7 @@
|
||||
if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DF | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
|
||||
!= ATA_CB_STAT_RDY ) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_out : no sectors left (status %02x)\n", (unsigned) status);
|
||||
- return 6;
|
||||
+ //return 6;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2789,7 +2867,7 @@
|
||||
if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
|
||||
!= (ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ) ) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_out : more sectors left (status %02x)\n", (unsigned) status);
|
||||
- return 7;
|
||||
+ //return 7;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -4817,6 +4895,9 @@
|
||||
case 0x09: /* initialize drive parameters */
|
||||
case 0x0c: /* seek to specified cylinder */
|
||||
case 0x0d: /* alternate disk reset */
|
||||
+ ata_reset();
|
||||
+ goto int13_success;
|
||||
+ break;
|
||||
case 0x11: /* recalibrate */
|
||||
case 0x14: /* controller internal diagnostic */
|
||||
BX_INFO("int13h_harddisk function %02xh unimplemented, returns success\n", GET_AH());
|
170
util/ADLO/bochs/bios/diff/bochs-bios-ata-read-2-WIP.diff
Normal file
170
util/ADLO/bochs/bios/diff/bochs-bios-ata-read-2-WIP.diff
Normal file
|
@ -0,0 +1,170 @@
|
|||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.13
|
||||
diff -u -r1.13 rombios.c
|
||||
--- rombios.c 10 Nov 2002 14:30:52 -0000 1.13
|
||||
+++ rombios.c 10 Nov 2002 15:20:45 -0000
|
||||
@@ -2269,7 +2269,7 @@
|
||||
BX_PANIC("ata-detect: Failed to detect ATA device\n");
|
||||
|
||||
removable = (read_byte(get_SS(),buffer+0) & 0x80) ? 1 : 0;
|
||||
- mode = read_byte(get_SS(),buffer+96) ? ATA_MODE_PIO32 : ATA_MODE_PIO16;
|
||||
+// mode = read_byte(get_SS(),buffer+96) ? ATA_MODE_PIO32 : ATA_MODE_PIO16;
|
||||
blksize = read_word(get_SS(),buffer+10);
|
||||
|
||||
cylinders = read_word(get_SS(),buffer+(1*2)); // word 1
|
||||
@@ -2556,8 +2556,21 @@
|
||||
write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
|
||||
current = 0;
|
||||
|
||||
- status = inb(iobase1 + ATA_CB_STAT);
|
||||
- if (status & ATA_CB_STAT_BSY) return 1;
|
||||
+// status = inb(iobase1 + ATA_CB_STAT);
|
||||
+// if (status & ATA_CB_STAT_BSY) return 1;
|
||||
+
|
||||
+// 1) SEND COMMAND
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+
|
||||
+ status = ata_wait_for_devrdy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
|
||||
outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
|
||||
outb(iobase1 + ATA_CB_FR, 0x00);
|
||||
@@ -2566,12 +2579,23 @@
|
||||
outb(iobase1 + ATA_CB_CL, cylinder & 0x00ff);
|
||||
outb(iobase1 + ATA_CB_CH, cylinder >> 8);
|
||||
outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 12;
|
||||
+
|
||||
outb(iobase1 + ATA_CB_CMD, command);
|
||||
|
||||
while (1) {
|
||||
status = inb(iobase1 + ATA_CB_STAT);
|
||||
if ( !(status & ATA_CB_STAT_BSY) ) break;
|
||||
}
|
||||
+// ata_wait_for_notbusy(iobase1);
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+// 1) END OF SEND COMMAND
|
||||
|
||||
if (status & ATA_CB_STAT_ERR) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : read error\n");
|
||||
@@ -2581,6 +2605,18 @@
|
||||
return 3;
|
||||
}
|
||||
|
||||
+// 2) READ BACK DATA
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+ status = ata_wait_for_dataready(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
+
|
||||
// FIXME : move seg/off translation here
|
||||
|
||||
ASM_START
|
||||
@@ -2636,7 +2672,7 @@
|
||||
if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
|
||||
!= ATA_CB_STAT_RDY ) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : no sectors left (status %02x)\n", (unsigned) status);
|
||||
- return 4;
|
||||
+ // return 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2644,11 +2680,12 @@
|
||||
if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
|
||||
!= (ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ) ) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : more sectors left (status %02x)\n", (unsigned) status);
|
||||
- return 5;
|
||||
+ // return 5;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
- }
|
||||
+ } // while(1)
|
||||
+
|
||||
// Enable interrupts
|
||||
outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15);
|
||||
return 0;
|
||||
@@ -2702,6 +2739,19 @@
|
||||
status = inb(iobase1 + ATA_CB_STAT);
|
||||
if (status & ATA_CB_STAT_BSY) return 1;
|
||||
|
||||
+// 1) SEND COMMAND
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+
|
||||
+ status = ata_wait_for_devrdy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
+
|
||||
outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
|
||||
outb(iobase1 + ATA_CB_FR, 0x00);
|
||||
outb(iobase1 + ATA_CB_SC, count);
|
||||
@@ -2709,12 +2759,23 @@
|
||||
outb(iobase1 + ATA_CB_CL, cylinder & 0x00ff);
|
||||
outb(iobase1 + ATA_CB_CH, cylinder >> 8);
|
||||
outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 12;
|
||||
+
|
||||
outb(iobase1 + ATA_CB_CMD, command);
|
||||
|
||||
while (1) {
|
||||
status = inb(iobase1 + ATA_CB_STAT);
|
||||
if ( !(status & ATA_CB_STAT_BSY) ) break;
|
||||
}
|
||||
+// ata_wait_for_notbusy(iobase1);
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+// 1) END OF SEND COMMAND
|
||||
|
||||
if (status & ATA_CB_STAT_ERR) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_out : read error\n");
|
||||
@@ -2723,6 +2784,18 @@
|
||||
BX_DEBUG_ATA("ata_cmd_data_out : DRQ not set (status %02x)\n", (unsigned) status);
|
||||
return 3;
|
||||
}
|
||||
+
|
||||
+// 2) READ BACK DATA
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+ status = ata_wait_for_dataready(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
|
||||
// FIXME : move seg/off translation here
|
||||
|
88
util/ADLO/bochs/bios/diff/bochs-bios-ata-read-WIP.diff
Normal file
88
util/ADLO/bochs/bios/diff/bochs-bios-ata-read-WIP.diff
Normal file
|
@ -0,0 +1,88 @@
|
|||
--- rombios.c-1.76 Mon Nov 4 01:43:51 2002
|
||||
+++ rombios.c Tue Nov 5 17:37:55 2002
|
||||
@@ -2301,6 +2551,19 @@
|
||||
status = inb(iobase1 + ATA_CB_STAT);
|
||||
if (status & ATA_CB_STAT_BSY) return 1;
|
||||
|
||||
+// 1) SEND COMMAND
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+
|
||||
+ status = ata_wait_for_devrdy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
+
|
||||
outb(iobase2 + ATA_CB_DC, ATA_CB_DC_HD15 | ATA_CB_DC_NIEN);
|
||||
outb(iobase1 + ATA_CB_FR, 0x00);
|
||||
outb(iobase1 + ATA_CB_SC, count);
|
||||
@@ -2308,12 +2571,23 @@
|
||||
outb(iobase1 + ATA_CB_CL, cylinder & 0x00ff);
|
||||
outb(iobase1 + ATA_CB_CH, cylinder >> 8);
|
||||
outb(iobase1 + ATA_CB_DH, (slave ? ATA_CB_DH_DEV1 : ATA_CB_DH_DEV0) | (Bit8u) head );
|
||||
+
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 12;
|
||||
+
|
||||
outb(iobase1 + ATA_CB_CMD, command);
|
||||
|
||||
while (1) {
|
||||
status = inb(iobase1 + ATA_CB_STAT);
|
||||
if ( !(status & ATA_CB_STAT_BSY) ) break;
|
||||
}
|
||||
+// ata_wait_for_notbusy(iobase1);
|
||||
+
|
||||
+
|
||||
+
|
||||
+
|
||||
+// 1) END OF SEND COMMAND
|
||||
|
||||
if (status & ATA_CB_STAT_ERR) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : read error\n");
|
||||
@@ -2323,12 +2597,24 @@
|
||||
return 3;
|
||||
}
|
||||
|
||||
- // FIXME : move seg/off translation here
|
||||
+// 2) READ BACK DATA
|
||||
+
|
||||
+ /* clear Device/Head register */
|
||||
+ outb(iobase1 + ATA_CB_DH, 0x00);
|
||||
|
||||
+ status = ata_wait_for_notbusy(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 10;
|
||||
+ status = ata_wait_for_dataready(iobase1);
|
||||
+ if (status!=0)
|
||||
+ return 11;
|
||||
+
|
||||
+ // FIXME : move seg/off translation here
|
||||
+/*
|
||||
ASM_START
|
||||
sti ;; enable higher priority interrupts
|
||||
ASM_END
|
||||
-
|
||||
+*/
|
||||
while (1) {
|
||||
|
||||
ASM_START
|
||||
@@ -2386,11 +2672,12 @@
|
||||
if ( (status & (ATA_CB_STAT_BSY | ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ | ATA_CB_STAT_ERR) )
|
||||
!= (ATA_CB_STAT_RDY | ATA_CB_STAT_DRQ) ) {
|
||||
BX_DEBUG_ATA("ata_cmd_data_in : more sectors left (status %02x)\n", (unsigned) status);
|
||||
- return 5;
|
||||
+ // return 5;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
- }
|
||||
+ } // while(1)
|
||||
+
|
||||
// Enable interrupts
|
||||
outb(iobase2+ATA_CB_DC, ATA_CB_DC_HD15);
|
||||
return 0;
|
54
util/ADLO/bochs/bios/diff/bochs-bios-standard.diff
Normal file
54
util/ADLO/bochs/bios/diff/bochs-bios-standard.diff
Normal file
|
@ -0,0 +1,54 @@
|
|||
our internal patch to keep bios track.
|
||||
|
||||
not for external use.
|
||||
|
||||
do not apply.
|
||||
|
||||
---------------------------------
|
||||
|
||||
Adam Sulmicki <adam@cfar.umd.edu>
|
||||
Wed Nov 6 04:43:05 EST 2002
|
||||
http://www.eax.com/patches/
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Index: rombios.c
|
||||
===================================================================
|
||||
RCS file: /fs/cvsroot/loader/bochs/bios/rombios.c,v
|
||||
retrieving revision 1.3
|
||||
diff -u -r1.3 rombios.c
|
||||
--- rombios.c 6 Nov 2002 09:01:13 -0000 1.3
|
||||
+++ rombios.c 6 Nov 2002 09:06:11 -0000
|
||||
@@ -937,6 +937,9 @@
|
||||
|
||||
/* Offset to skip the CVS $Id: prefix */
|
||||
#define bios_version_string (CVSID + 4)
|
||||
+static char bios_info_string[] = "BOCHS BIOS VER:1.XX";
|
||||
+static char bis1[] = __DATE__;
|
||||
+static char bis2[] = __TIME__;
|
||||
|
||||
#define BIOS_PRINTF_HALT 1
|
||||
#define BIOS_PRINTF_SCREEN 2
|
||||
@@ -951,11 +954,11 @@
|
||||
// BX_DEBUG goes to INFO port until we can easily choose debug info on a
|
||||
// per-device basis. Debug info are sent only in debug mode
|
||||
#if DEBUG_ROMBIOS
|
||||
-# define BX_DEBUG(format, p...) bios_printf(BIOS_PRINTF_INFO, format, ##p)
|
||||
+# define BX_DEBUG(format, p...) printf(format, ##p)
|
||||
#else
|
||||
# define BX_DEBUG(format, p...)
|
||||
#endif
|
||||
-#define BX_INFO(format, p...) bios_printf(BIOS_PRINTF_INFO, format, ##p)
|
||||
+#define BX_INFO(format, p...) printf(format, ##p)
|
||||
#define BX_PANIC(format, p...) bios_printf(BIOS_PRINTF_DEBHALT, format, ##p)
|
||||
|
||||
#if DEBUG_ATA
|
||||
@@ -1747,6 +1750,8 @@
|
||||
|
||||
printf(BX_APPNAME" BIOS, %d cpu%s, ", BX_SMP_PROCESSORS, BX_SMP_PROCESSORS>1?"s":"");
|
||||
printf("%s %s\n", bios_cvs_version_string, bios_date_string);
|
||||
+ printf("[%s]\n", bios_info_string);
|
||||
+ printf("[COMPILE DATE:%s TIME:%s]\n", bis1, bis2);
|
||||
printf("\n");
|
||||
}
|
||||
|
10017
util/ADLO/bochs/bios/rombios-cvs.c
Normal file
10017
util/ADLO/bochs/bios/rombios-cvs.c
Normal file
File diff suppressed because it is too large
Load diff
BIN
util/ADLO/bochs/bios/rombios.bin
Normal file
BIN
util/ADLO/bochs/bios/rombios.bin
Normal file
Binary file not shown.
10017
util/ADLO/bochs/bios/rombios.c
Normal file
10017
util/ADLO/bochs/bios/rombios.c
Normal file
File diff suppressed because it is too large
Load diff
103
util/ADLO/dev86-0.16.9-msr-diff
Normal file
103
util/ADLO/dev86-0.16.9-msr-diff
Normal file
|
@ -0,0 +1,103 @@
|
|||
diff -u -r dev86-0.16.9-orig/as/asm/each.asm dev86-0.16.9-new/as/asm/each.asm
|
||||
--- dev86-0.16.9-orig/as/asm/each.asm Wed Sep 4 05:26:12 1991
|
||||
+++ dev86-0.16.9-new/as/asm/each.asm Sun Nov 3 19:15:38 2002
|
||||
@@ -101,6 +101,7 @@
|
||||
pushfd
|
||||
rcl [esi*4],1
|
||||
rcr [esi*4],1
|
||||
+rdmsr
|
||||
rol [esi*4],1
|
||||
ror [esi*4],1
|
||||
rep
|
||||
@@ -139,6 +140,7 @@
|
||||
verw [esi*4]
|
||||
wait
|
||||
wbinvd
|
||||
+wrmsr
|
||||
xadd [esi*4],bx
|
||||
xchg bx,[esi*4]
|
||||
xlat
|
||||
diff -u -r dev86-0.16.9-orig/as/asm/inher.asm dev86-0.16.9-new/as/asm/inher.asm
|
||||
--- dev86-0.16.9-orig/as/asm/inher.asm Fri Jun 10 22:42:12 1988
|
||||
+++ dev86-0.16.9-new/as/asm/inher.asm Sun Nov 3 19:43:32 2002
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
OUTSB
|
||||
|
||||
+ RDMSR
|
||||
REP
|
||||
REPE
|
||||
REPNE
|
||||
@@ -97,6 +98,7 @@
|
||||
|
||||
INSW
|
||||
INSD
|
||||
+ INVD
|
||||
IRET
|
||||
IRETD
|
||||
|
||||
@@ -123,5 +125,7 @@
|
||||
STOSW
|
||||
STOSW
|
||||
|
||||
+ WRMSR
|
||||
+
|
||||
XLAT
|
||||
XLATB
|
||||
diff -u -r dev86-0.16.9-orig/as/asm/summary.as dev86-0.16.9-new/as/asm/summary.as
|
||||
--- dev86-0.16.9-orig/as/asm/summary.as Tue Sep 3 16:40:02 1991
|
||||
+++ dev86-0.16.9-new/as/asm/summary.as Sun Nov 3 19:20:49 2002
|
||||
@@ -293,6 +293,7 @@
|
||||
PUSHFD
|
||||
RCL ; shiftcount
|
||||
RCR ; shiftcount
|
||||
+ RDMSR
|
||||
ROL ; shiftcount
|
||||
ROR ; shiftcount
|
||||
REP ; INS/MOVS/OUTS/STOS
|
||||
@@ -372,6 +373,7 @@
|
||||
VERW ; r/m16
|
||||
WAIT
|
||||
WBINVD
|
||||
+ WRMSR
|
||||
XADD ; r/m8,r8
|
||||
XADD ; r/m16,r16
|
||||
XADD ; r/m32,r32
|
||||
diff -u -r dev86-0.16.9-orig/as/keywords.c dev86-0.16.9-new/as/keywords.c
|
||||
--- dev86-0.16.9-orig/as/keywords.c Wed Jun 27 12:08:22 2001
|
||||
+++ dev86-0.16.9-new/as/keywords.c Sun Nov 3 20:13:23 2002
|
||||
@@ -621,6 +621,7 @@
|
||||
3, 'L', 'T', 'R', GROUP6, 0x18,
|
||||
5, 'M', 'O', 'V', 'S', 'X', MOVX, 0xBE,
|
||||
5, 'M', 'O', 'V', 'Z', 'X', MOVX, 0xB6,
|
||||
+ 5, 'R', 'D', 'M', 'S', 'R', INHER, 0x32,
|
||||
4, 'S', 'E', 'T', 'A', SETCC, 0x97,
|
||||
5, 'S', 'E', 'T', 'A', 'E', SETCC, 0x93,
|
||||
4, 'S', 'E', 'T', 'B', SETCC, 0x92,
|
||||
@@ -661,6 +662,7 @@
|
||||
4, 'V', 'E', 'R', 'R', GROUP6, 0x20,
|
||||
4, 'V', 'E', 'R', 'W', GROUP6, 0x28,
|
||||
6, 'W', 'B', 'I', 'N', 'V', 'D', INHER, 0x09,
|
||||
+ 5, 'W', 'R', 'M', 'S', 'R', INHER, 0x30,
|
||||
4, 'X', 'A', 'D', 'D', ExGx, 0xC0,
|
||||
#endif /* I80386 */
|
||||
|
||||
diff -u -r dev86-0.16.9-orig/man/as86.1 dev86-0.16.9-new/man/as86.1
|
||||
--- dev86-0.16.9-orig/man/as86.1 Tue Sep 26 16:18:31 2000
|
||||
+++ dev86-0.16.9-new/man/as86.1 Sun Nov 3 19:12:25 2002
|
||||
@@ -395,13 +395,13 @@
|
||||
LFS LGDT LGS LIDT LLDT LMSW LOCK LODB LODS LODSB LODSD LODSW LODW LOOP
|
||||
LOOPE LOOPNE LOOPNZ LOOPZ LSL LSS LTR MOV MOVS MOVSB MOVSD MOVSW MOVSX
|
||||
MOVW MOVZX MUL NEG NOP NOT OR OUT OUTS OUTSB OUTSD OUTSW OUTW POP POPA
|
||||
-POPAD POPF POPFD PUSH PUSHA PUSHAD PUSHF PUSHFD RCL RCR REP REPE REPNE
|
||||
+POPAD POPF POPFD PUSH PUSHA PUSHAD PUSHF PUSHFD RCL RCR RDMSR REP REPE REPNE
|
||||
REPNZ REPZ RET RETF RETI ROL ROR SAHF SAL SAR SBB SCAB SCAS SCASB SCASD
|
||||
SCASW SCAW SEG SETA SETAE SETB SETBE SETC SETE SETG SETGE SETL SETLE
|
||||
SETNA SETNAE SETNB SETNBE SETNC SETNE SETNG SETNGE SETNL SETNLE SETNO
|
||||
SETNP SETNS SETNZ SETO SETP SETPE SETPO SETS SETZ SGDT SHL SHLD SHR SHRD
|
||||
SIDT SLDT SMSW STC STD STI STOB STOS STOSB STOSD STOSW STOW STR SUB TEST
|
||||
-VERR VERW WAIT WBINVD XADD XCHG XLAT XLATB XOR
|
||||
+VERR VERW WAIT WBINVD WRMSR XADD XCHG XLAT XLATB XOR
|
||||
.TP
|
||||
Floating point
|
||||
F2XM1 FABS FADD FADDP FBLD FBSTP FCHS FCLEX FCOM FCOMP FCOMPP FCOS
|
BIN
util/ADLO/elf/elf-header-065kb.payload
Executable file
BIN
util/ADLO/elf/elf-header-065kb.payload
Executable file
Binary file not shown.
BIN
util/ADLO/elf/elf-header-113kb.payload
Executable file
BIN
util/ADLO/elf/elf-header-113kb.payload
Executable file
Binary file not shown.
BIN
util/ADLO/elf/elf-header-129kb.payload
Executable file
BIN
util/ADLO/elf/elf-header-129kb.payload
Executable file
Binary file not shown.
526
util/ADLO/loader.s
Normal file
526
util/ADLO/loader.s
Normal file
|
@ -0,0 +1,526 @@
|
|||
;*****************************************************
|
||||
; $Id$
|
||||
;*****************************************************
|
||||
USE32
|
||||
; code it is loaded into memory at 0x7C00
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; A) setup GDT, so that we do not depend on program
|
||||
; that loaded us for GDT.
|
||||
; Ex: LinuxBIOS and EtherBOOT use different GDT's.
|
||||
|
||||
;-----------------------------------------------------
|
||||
; 0)
|
||||
|
||||
cli
|
||||
|
||||
;-----------------------------------------------------
|
||||
; I)
|
||||
|
||||
lgdt [0x7C00+protected_gdt]
|
||||
|
||||
;-----------------------------------------------------
|
||||
; II) setup CS
|
||||
|
||||
jmp 0x08:0x7C00+newpgdt
|
||||
|
||||
newpgdt: nop
|
||||
|
||||
;-----------------------------------------------------
|
||||
; III) setup all other segments
|
||||
|
||||
mov ax, #0x10
|
||||
mov ss, ax
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
;-----------------------------------------------------
|
||||
; IV)
|
||||
|
||||
; not now
|
||||
;sti
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; B) shadow - ON (enable/read/write)
|
||||
|
||||
mov eax, #0x80000070
|
||||
mov dx, #0x0cf8
|
||||
out dx, eax
|
||||
|
||||
mov eax, #0xFFFFFFFF
|
||||
mov dx, #0x0cfc
|
||||
out dx, eax
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; C) copy -- boch bios
|
||||
|
||||
; counter - 64kb.
|
||||
mov ecx, #0x10000
|
||||
|
||||
; source - 0x8000 ( 0x7C00+0x400 = 0x8000 )
|
||||
mov ax, #0x10 ; src-segment - 2nd entry in GDT
|
||||
mov ds, ax
|
||||
mov eax, #0x8000 ; src-offset - 0x8000
|
||||
mov esi, eax
|
||||
|
||||
; destination - 0xF0000
|
||||
mov ax, #0x10 ; dst-segment - 2nd entry in GDT
|
||||
mov es, ax
|
||||
mov eax, #0xF0000 ; dst-offset - 0xF0000
|
||||
mov edi, eax
|
||||
|
||||
; clear direction flag
|
||||
cld
|
||||
|
||||
; the copy
|
||||
rep
|
||||
movsb
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; D) copy -- video bios
|
||||
|
||||
; on my system video bios is just 48KB (0x0C000)
|
||||
; but just for paranoida we copy 64kb (0X10000)
|
||||
|
||||
; counter - 64kb
|
||||
mov ecx, #0x10000
|
||||
|
||||
; source - 0x18000 ( 0x8000+0x10000 = 0x18000 )
|
||||
mov ax, #0x10 ; src-segment - 2nd entry in GDT
|
||||
mov ds, ax
|
||||
mov eax, #0x18000 ; src-offset - 0x18000
|
||||
mov esi, eax
|
||||
|
||||
; destination - 0xC0000
|
||||
mov ax, #0x10 ; dst-segment - 2nd entry in GDT
|
||||
mov es, ax
|
||||
mov eax, #0xC0000 ; dst-offset - 0xC0000
|
||||
mov edi, eax
|
||||
|
||||
; clear direction flag
|
||||
cld
|
||||
|
||||
; the copy
|
||||
rep
|
||||
movsb
|
||||
|
||||
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; E) copy -- pirq table
|
||||
|
||||
; on my system video bios is just 48KB (0x0C000)
|
||||
; but just for paranoida we copy 64kb (0X10000)
|
||||
|
||||
; counter - 256kb -- 0x100
|
||||
mov ecx, #0x100
|
||||
|
||||
; source - 0x7F00 ( 0x7C00+0x300 = 0x7F00 )
|
||||
mov ax, #0x10 ; src-segment - 2nd entry in GDT
|
||||
mov ds, ax
|
||||
mov eax, #0x7F00 ; src-offset - 0x7F00
|
||||
mov esi, eax
|
||||
|
||||
; destination - 0xFFD00
|
||||
mov ax, #0x10 ; dst-segment - 2nd entry in GDT
|
||||
mov es, ax
|
||||
mov eax, #0xFFD00 ; dst-offset - 0xFD00
|
||||
mov edi, eax
|
||||
|
||||
; clear direction flag
|
||||
cld
|
||||
|
||||
; the copy
|
||||
rep
|
||||
movsb
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; X) copy -- LinuxBIOS table into safe place.
|
||||
|
||||
;; TODO.
|
||||
;; Q1 : what is the size of table.
|
||||
;; Q2 : where to copy?
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; E) shadow - OFF (write)
|
||||
|
||||
mov eax, #0x80000070
|
||||
mov dx, #0x0cf8
|
||||
out dx, eax
|
||||
|
||||
;mov eax, #0xFFFFFFFF
|
||||
mov eax, #0x0000FFFF
|
||||
mov dx, #0x0cfc
|
||||
out dx, eax
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; F) do a little prep work.
|
||||
|
||||
;-----------------------------------------------------
|
||||
; I) disable cache
|
||||
|
||||
; if you disable cache, GRUB's GFX mode will be VERY slow.
|
||||
; so DO NOT DISABLE
|
||||
|
||||
;mov eax, cr0
|
||||
;or eax, #0x60000000
|
||||
;wbinvd
|
||||
;mov cr0, eax
|
||||
;wbinvd
|
||||
|
||||
;-----------------------------------------------------
|
||||
; II) disable MTRR
|
||||
; clear the "E" (0x800) and "FE" (0x400) flags in
|
||||
; IA32_MTRRdefType register (0x2FF)
|
||||
|
||||
;-----------------------
|
||||
|
||||
;mov ECX,#0x2FF
|
||||
|
||||
; select either of the two below
|
||||
; depending on if your compiler suports
|
||||
; {RD,WR}MSR or not
|
||||
;rdmsr
|
||||
; .byte 0x0F, 0x32
|
||||
|
||||
;xor edx, edx
|
||||
; xor eax, eax
|
||||
;and eax, #0xFFFFF3FF
|
||||
|
||||
; select either of the two below
|
||||
; depending on if your compiler suports
|
||||
; {RD,WR}MSR or not
|
||||
;wrmsr
|
||||
; .byte 0x0F, 0x30
|
||||
|
||||
;-----------------------
|
||||
;; This is what PC BIOS is setting. -- P6STMT.
|
||||
; add VIDEO BIOS cacheable!!!!
|
||||
;-----------------------
|
||||
; Fixed Range C0--C8
|
||||
;mov ECX,#0x268
|
||||
;mov EDX,#0x05050505
|
||||
;mov EAX,#0x05050505
|
||||
;wrmsr
|
||||
;-----------------------
|
||||
; Fixed Range C8--CF
|
||||
;mov ECX,#0x269
|
||||
;mov EDX,#0x0
|
||||
;mov EAX,#0x05050505
|
||||
;wrmsr
|
||||
;-----------------------
|
||||
|
||||
;-----------------------------------------------------
|
||||
; III) tell BOCHS' BIOS we want to boot from hdd.
|
||||
; 0x00 - floppy
|
||||
; 0x02 - hdd
|
||||
; In future there will be 'fd failover'option in bochs.
|
||||
|
||||
mov al, #0x3d ;; cmos_reg
|
||||
out 0x70, al
|
||||
mov al, #0x02 ;; val (hdd)
|
||||
out 0x71, al
|
||||
|
||||
;-----------------------------------------------------
|
||||
; IV) tell BOCHS' BIOS length of our mem block @ 1mb.
|
||||
; This is for Int 15 / EAX=E820
|
||||
; 119mb = 0x77 00 00 00
|
||||
; (this is for 128mb of ram)
|
||||
; (FIXME: this value is currently hard coded)
|
||||
; (it should be being passed from LinuxBIOS )
|
||||
|
||||
; for WinFast 6300
|
||||
; 07 70 = 0770
|
||||
; 06 80 = 0770 - 00F0 << ALT (for unpatched bochs)
|
||||
|
||||
; for P6STMT - 10kb less ram
|
||||
; 077F - 10 = 07 6F
|
||||
; 07 6F - 00 F0 = 06 7F
|
||||
|
||||
mov al, #0x35 ;; cmos_reg
|
||||
out 0x70, al
|
||||
mov al, #0x06 ;; val
|
||||
out 0x71, al
|
||||
|
||||
mov al, #0x34 ;; cmos_reg
|
||||
out 0x70, al
|
||||
mov al, #0x7F ;; val
|
||||
out 0x71, al
|
||||
|
||||
mov al, #0x31 ;; cmos_reg
|
||||
out 0x70, al
|
||||
mov al, #0x00 ;; val
|
||||
out 0x71, al
|
||||
|
||||
mov al, #0x30 ;; cmos_reg
|
||||
out 0x70, al
|
||||
mov al, #0x00 ;; val
|
||||
out 0x71, al
|
||||
|
||||
;-----------------------------------------------------
|
||||
; V) tell BOCHS' BIOS we want to have LBA translation.
|
||||
; 0x00 - NONE
|
||||
; 0x01 - LBA <<<<
|
||||
; 0x02 - LARGE
|
||||
; 0x03 - R-CHS
|
||||
; In future there will be 'fd failover'option in bochs.
|
||||
|
||||
mov al, #0x39 ;; cmos_reg
|
||||
out 0x70, al
|
||||
mov al, #0x01 ;; val (LBA)
|
||||
out 0x71, al
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; G) the switch -- protected to real mode
|
||||
|
||||
; IASDM, Vol 3
|
||||
; (8-14) 8.8.2 Switching Back to Real-Address Mode
|
||||
|
||||
;=====================================================
|
||||
; 1) disable interrupts
|
||||
|
||||
cli
|
||||
|
||||
;=====================================================
|
||||
nop
|
||||
;=====================================================
|
||||
; 2) paging
|
||||
|
||||
;not enabled, so not applicable.
|
||||
|
||||
;=====================================================
|
||||
; 3) setup CS segment limit (64kb)
|
||||
; I)
|
||||
|
||||
lgdt [0x7C00+new_gdt]
|
||||
|
||||
;-----------------------------------------------------
|
||||
; II)
|
||||
|
||||
jmp 0x08:0x7C00+new64lim
|
||||
|
||||
new64lim: nop
|
||||
|
||||
;=====================================================
|
||||
nop
|
||||
;=====================================================
|
||||
; 4) setup all other segments
|
||||
|
||||
mov ax, #0x10
|
||||
mov ss, ax
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
;=====================================================
|
||||
nop
|
||||
;=====================================================
|
||||
; 5) LIDT
|
||||
; I)
|
||||
|
||||
; set up Real Mode IDT table (0...3FF)
|
||||
|
||||
; for BOCH's BIOS the address 0xF000:0xFF53
|
||||
; cantains value 0xCF which is IRET opcode.
|
||||
|
||||
; counter
|
||||
mov cx, #0xFF ;1024 bytes(255 interrupts)(4*255=0x3FF)
|
||||
|
||||
; destination - 0x00000 = ES:EDI
|
||||
mov ax, #0x10 ; dst-segment - 2nd entry in GDT
|
||||
mov es, ax
|
||||
mov eax, #0x00000 ; dst-offset - 0x00000
|
||||
mov edi, eax
|
||||
|
||||
; data to store -- 0xF000:FF53
|
||||
mov eax, #0xF000FF53
|
||||
|
||||
; clear direction flag
|
||||
cld
|
||||
|
||||
; the store
|
||||
rep
|
||||
stosd
|
||||
|
||||
;-----------------------------------------------------
|
||||
; II)
|
||||
; load interrupt descriptor table
|
||||
|
||||
lidt [0x7C00+new_idt]
|
||||
|
||||
;=====================================================
|
||||
nop
|
||||
nop
|
||||
;=====================================================
|
||||
; 6) clear the PE flag in CR0 register.
|
||||
; I)
|
||||
|
||||
; switch to 16 bit segments
|
||||
mov ax, #0x20
|
||||
mov ss, ax
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
;-----------------------------------------------------
|
||||
; II)
|
||||
|
||||
; switch to 16 bit CS
|
||||
|
||||
jmp 0x018:0x7C00+new16bit
|
||||
|
||||
USE16
|
||||
|
||||
new16bit: nop
|
||||
|
||||
;-----------------------------------------------------
|
||||
; III)
|
||||
; the switch
|
||||
|
||||
;xor eax, eax
|
||||
|
||||
mov eax, cr0
|
||||
and eax, #0xFFFFFFFE
|
||||
mov cr0, eax ;switch to RM
|
||||
|
||||
;=====================================================
|
||||
nop
|
||||
nop
|
||||
;=====================================================
|
||||
; 7) far jump -- (to real mode address)
|
||||
|
||||
jmp 0x0:0x7C00+realcs
|
||||
|
||||
realcs: nop
|
||||
|
||||
;=====================================================
|
||||
; 8) set all segment registers to 0's
|
||||
|
||||
mov ax, #0x0
|
||||
mov ss, ax
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
;=====================================================
|
||||
; 9) re-enable interrupts
|
||||
|
||||
sti
|
||||
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
; G) jump to BIOS.
|
||||
|
||||
jmp 0xFFFF:0x0000
|
||||
;jmp 0xF000:0xFFF0
|
||||
|
||||
;*****************************************************
|
||||
;*****************************************************
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
;*****************************************************
|
||||
;*****************************************************
|
||||
|
||||
USE32
|
||||
|
||||
new_idt:
|
||||
dw 0x03ff ;; limit 15:00
|
||||
dw 0x0000 ;; base 15:00
|
||||
dw 0x0000 ;; base 23:16
|
||||
|
||||
new_gdt:
|
||||
dw 0x0028 ;; limit 15:00
|
||||
dw 0x7C00+new_gdt_table ;; base 15:00
|
||||
dw 0x0000 ;; base 23:16
|
||||
|
||||
protected_gdt:
|
||||
dw 0x0018 ;; limit 15:00
|
||||
dw 0x7C00+pmode_gdt_table ;; base 15:00
|
||||
dw 0x0000 ;; base 23:16
|
||||
|
||||
;-----------------------------------------------------
|
||||
|
||||
new_gdt_table:
|
||||
;// 1 2 3 4
|
||||
;//0
|
||||
dd 0x00000000
|
||||
dd 0x00000000
|
||||
|
||||
;//8
|
||||
dd 0x0000ffff
|
||||
dd 0x00409E00
|
||||
|
||||
;//10
|
||||
dd 0x0000ffff
|
||||
dd 0x00409200
|
||||
|
||||
;//18
|
||||
dd 0x0000ffff
|
||||
dd 0x00009a00
|
||||
|
||||
;//20
|
||||
dd 0x0000ffff
|
||||
dd 0x00009200
|
||||
|
||||
;-------------------------
|
||||
|
||||
pmode_gdt_table:
|
||||
;// 1 2 3 4
|
||||
;//0
|
||||
dd 0x00000000
|
||||
dd 0x00000000
|
||||
|
||||
;//8
|
||||
dd 0x0000ffff
|
||||
dd 0x00CF9E00
|
||||
|
||||
;//10
|
||||
dd 0x0000ffff
|
||||
dd 0x00CF9200
|
||||
|
||||
;*****************************************************
|
||||
;*****************************************************
|
||||
; the file size must be 1024 bytes.
|
||||
|
||||
; -0x100 b/c we put $PIR table here.
|
||||
|
||||
.org 0x400-1-0x100
|
||||
; dd 0xdeadbeef
|
||||
db 0x0
|
||||
|
||||
;*****************************************************
|
24
util/ADLO/pirq/README
Normal file
24
util/ADLO/pirq/README
Normal file
|
@ -0,0 +1,24 @@
|
|||
EXPERIMENTAL
|
||||
|
||||
This directory contains PIRQ tables.
|
||||
|
||||
The PIRQ table is stored in the PC at are in between 0xF0000 and 0xFFFFF.
|
||||
It is distinguished by "$PIR" string at start of table is around 256 bytes
|
||||
long.
|
||||
|
||||
So just like video bios we attemtp to grab it and save it. The support for
|
||||
grabbing is not complete in the Makefile and resulting file still will
|
||||
have to be hand edited (if anyone want to hack 'grep' to have -A an -B
|
||||
return char count instead of line count while in binary mode, volunters
|
||||
are welcome).
|
||||
|
||||
--------------
|
||||
|
||||
PIRQ support is not complete yet.
|
||||
|
||||
--------------
|
||||
|
||||
More information on PIRQ can be found at :
|
||||
-http://www.microsoft.com/hwdev/archive/BUSBIOS/pciirq.asp
|
||||
-The red PCI book.
|
||||
|
BIN
util/ADLO/pirq/pirq-MS7308E.bin
Normal file
BIN
util/ADLO/pirq/pirq-MS7308E.bin
Normal file
Binary file not shown.
BIN
util/ADLO/pirq/pirq-P6STMT.bin
Normal file
BIN
util/ADLO/pirq/pirq-P6STMT.bin
Normal file
Binary file not shown.
BIN
util/ADLO/pirq/pirq-ThinkPad.T23.bin
Normal file
BIN
util/ADLO/pirq/pirq-ThinkPad.T23.bin
Normal file
Binary file not shown.
6
util/ADLO/video/README
Normal file
6
util/ADLO/video/README
Normal file
|
@ -0,0 +1,6 @@
|
|||
In this directory are the Video BIOS files which we use together
|
||||
with our open source bios.
|
||||
|
||||
Since those are copyrighted, we cannot include them and you need to
|
||||
obtain it on your own. See README in the main directory for details.
|
||||
|
Loading…
Add table
Reference in a new issue