Compare commits

...
16 Commits
Author SHA1 Message Date
Mark ZbikowskiandMicrosoft Open Source 2d04cacc53 MZ is back! 2024-04-25 22:32:27 +00:00
Jeff WilcoxandGitHub 8ee9712c74 Merge pull request #430 from jpbaltazar/typoptbr
Fix typo in README.pt-BR.md
2024-04-25 10:09:59 -07:00
José Mendes 3c389db6c3 Fix typo in README.pt-BR.md 2024-04-25 18:56:33 +02:00
Microsoft Open SourceandGitHub e9c48083eb Update SECURITY.md 2024-04-24 17:35:05 -07:00
Microsoft Open Source a5eb02a4d7 Moving localized READMEs
Thanks to everyone who took the time when this repository was originally released
to localize the README files. However, for simplicity, and recognizing the
historical reference nature of this repository, we have moved these now dated
files into a sub-folder.
2024-04-25 00:33:46 +00:00
Microsoft Open SourceandGitHub fd315d38ab Merge pull request #151 from jamespack/spelling-fix
Fixed minor spelling error in README.txt
2024-04-24 17:30:05 -07:00
Microsoft GitHub User 87678a3381 Updating template files 2024-04-13 23:33:14 +00:00
Rich TurnerandGitHub 04a3d20ff4 Merge pull request #103 from y-tsubuku/feature/add_readme_ja
Translated README to Japanese
2018-11-05 17:11:42 -08:00
Rich TurnerandGitHub 9b9d11a779 Merge pull request #104 from him1411/master
Creating a readme file written in hindi language
2018-11-05 17:10:53 -08:00
Rich TurnerandGitHub eaf2f2d812 Merge pull request #355 from Alexmnzlms/master
Accent fixed
2018-11-05 17:09:41 -08:00
Alejandro Manzanares LemusandGitHub fe85645e69 Accent fixed 2018-10-29 16:57:04 +01:00
James Pack 03c345ecb9 Fixed minor spelling error in README.txt 2018-10-06 19:49:05 -04:00
Himanshu GuptaandGitHub 320a50a6a7 Slight update on the translation
The bold font was not visible, markdown syntax had to be changed a little.
2018-10-04 23:08:42 +05:30
yohei 29a0f9c130 add README in Japanese 2018-10-05 02:01:28 +09:00
Himanshu GuptaandGitHub 6471d3ed53 Creating a hindi translation of the original readme file. 2018-10-04 21:30:00 +05:30
Himanshu GuptaandGitHub 806c259ca9 Translation of readme file to hindi 2018-10-04 21:12:52 +05:30
1366 changed files with 527814 additions and 22 deletions
+25
View File
@@ -0,0 +1,25 @@
<img width="150" height="150" align="left" style="float: left; margin: 0 10px 0 0;" alt="MS-DOS logo" src="https://github.com/Microsoft/MS-DOS/blob/master/msdos-logo.png">
# एमएस-डॉस v1.25 और v2.0 स्रोत कोड
इस रेपो में मूल स्रोत-कोड और एमएस-डॉस v1.25 और एमएस-डॉस v2.0 के लिए संकलित बाइनरी शामिल हैं।
ये वही फ़ाइलें हैं और इन रेपो में प्रकाशित होने के लिए उन्हें फिर से बनाने के लिए प्रकाशित किया जा रहा है [ मूल रूप से 25 मार्च, 2014 को कंप्यूटर इतिहास संग्रहालय में साझा किया गया]( http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/), बाहरी लेखन और कार्यों में संदर्भ, और शुरुआती पीसी ऑपरेटिंग सिस्टम में दिलचस्पी रखने वालों के लिए अन्वेषण और प्रयोग की अनुमति देना।
# लाइसेंस
इस रेपो के रूट में संग्रहीत के अनुसार इस रेपो के भीतर सभी फाइलें [एमआईटी (ओएसआई)]( https://en.wikipedia.org/wiki/MIT_License) [लाइसेंस](https://github.com/Microsoft/MS-DOS/blob/master/LICENSE.md) के तहत जारी की जाती हैं।
# योगदान!
इस रेपो में स्रोत फाइलें ऐतिहासिक संदर्भ के लिए हैं और स्थिर रहेंगी,तो कृपया स्रोत फ़ाइलों में किसी भी संशोधन का सुझाव देने वाले ***पुल अनुरोध*** न भेजें ,
लेकिन इस रेपो और प्रयोग को फोर्क करने के लिए स्वतंत्र महसूस करें।
यदि, हालांकि, आप गैर-स्रोत फ़ाइलों (उदा।, यह README) में अतिरिक्त गैर-स्रोत सामग्री या संशोधन सबमिट करना चाहते हैं, तो कृपया पीआर के माध्यम से सबमिट करें, और हम समीक्षा करेंगे और विचार करेंगे।
इस परियोजना ने माइक्रोसॉफ्ट ओपन सोर्स आचार संहिता [माइक्रोसॉफ्ट ओपन सोर्स आचार संहित] अपनाई है। (https://opensource.microsoft.com/codeofconduct/).
अधिक जानकारी के लिए [ आचरण संहिता ](https://opensource.microsoft.com/codeofconduct/faq/)पूछे जाने वाले प्रश्न या किसी भी अतिरिक्त प्रश्न या टिप्पणियों के साथ संपर्क [opencode@microsoft.com](mailto:opencode@microsoft.com) देखें।
+16
View File
@@ -0,0 +1,16 @@
<img width="150" height="150" align="left" style="float: left; margin: 0 10px 0 0;" alt="MS-DOS logo" src="https://github.com/Microsoft/MS-DOS/blob/master/msdos-logo.png">
# MS-DOS v1.2 及び v2.0 のソースコード
このリポジトリは、MS-DOS v1.25 及び MS-DOS v2.0 のオリジナルのソースコード及びコンパイルされたバイナリを含んでいます。
これらは、[元々、コンピューター歴史博物館に2014年3月25日に公開されたもの]( http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/)と同じであり、見つけやすいよう、外部の書物や作品に参照されやすいよう、そして初期のOSに興味を持つ人々に調査や実験を許可するよう、こちらのリポジトリに(再)公開されました。
# ライセンス
このリポジトリのすべてのファイルは、このリポジトリの最上層にある[LICENSE file](https://github.com/Microsoft/MS-DOS/blob/master/LICENSE.md) にあるように [MIT (OSI) ライセンス]( https://en.wikipedia.org/wiki/MIT_License)のもとリリースされています。
# コントリビュート!
このリポジトリのソースコードは歴史的な参考文献であり、変更されるものではありませんので、ソースコードを変更するようなプルリクエストは**送らないで下さい**。しかし、このリポジトリをforkして実験することは構いません😊
しかしながら、もしソースコードではないコンテンツ(例:このREADMEのような)の追加やファイルの変更を送信して下さるなら、PRを介して送信して頂ければ我々はレビューし、熟考します。
このプロジェクトは [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)に適合しています。詳しくは、[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)を見るか、追加の質問やコメントは[opencode@microsoft.com](mailto:opencode@microsoft.com)にお送り下さい。
+1 -1
View File
@@ -11,6 +11,6 @@ Todos os arquivos neste repositório estão publicados sob a [Licença do MIT (O
# Contribua! # Contribua!
Os arquivos neste repositório são referências históricas e continuarão estáticos, por gentileza, não envie Pull Requests sugerindo quaisquer modificações no código fonte, mas sinta-se a vontade para copiar esse repositório e experimentá-lo 😊. Os arquivos neste repositório são referências históricas e continuarão estáticos, por gentileza, não envie Pull Requests sugerindo quaisquer modificações no código fonte, mas sinta-se a vontade para copiar esse repositório e experimentá-lo 😊.
Se, no entanto, você quiser enviar conteúdos adicionais que não sejam conteúdos ou modificações no código fonte (como por exempo este LEIA-ME), por favor, envie via Pull Request e nós iremos revisar e considerar. Se, no entanto, você quiser enviar conteúdos adicionais que não sejam conteúdos ou modificações no código fonte (como por exemplo este LEIA-ME), por favor, envie via Pull Request e nós iremos revisar e considerar.
Esse projeto tem adotado o [Código de Conduta para Código Aberto da Microsoft](https://opensource.microsoft.com/codeofconduct/). Para mais informações, veja o [FAQ do Código de Conduta](https://opensource.microsoft.com/codeofconduct/faq/) ou entre em contato com [opencode@microsoft.com](mailto:opencode@microsoft.com) para quaisquer questões ou comentários adicionais. Esse projeto tem adotado o [Código de Conduta para Código Aberto da Microsoft](https://opensource.microsoft.com/codeofconduct/). Para mais informações, veja o [FAQ do Código de Conduta](https://opensource.microsoft.com/codeofconduct/faq/) ou entre em contato com [opencode@microsoft.com](mailto:opencode@microsoft.com) para quaisquer questões ou comentários adicionais.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

+7
View File
@@ -0,0 +1,7 @@
# Thank you
Thanks to everyone who took the time when this repository was originally released
to localize the README files. However, for simplicity, and recognizing the
historical reference nature of this repository, we have moved these now dated
files into a sub-folder.
+22
View File
@@ -0,0 +1,22 @@
MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
-12
View File
@@ -1,12 +0,0 @@
# MS-DOS v1.25 and v2.0 Source Code
Copyright (c) Microsoft Corporation.
All rights reserved.
## MIT License.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+18 -8
View File
@@ -1,16 +1,26 @@
<img width="150" height="150" align="left" style="float: left; margin: 0 10px 0 0;" alt="MS-DOS logo" src="https://github.com/Microsoft/MS-DOS/blob/master/msdos-logo.png"> <img width="150" height="150" align="left" style="float: left; margin: 0 10px 0 0;" alt="MS-DOS logo" src="https://github.com/Microsoft/MS-DOS/blob/main/.readmes/msdos-logo.png">
# MS-DOS v1.25 and v2.0 Source Code # MS-DOS v1.25, v2.0, v4.0 Source Code
This repo contains the original source-code and compiled binaries for MS-DOS v1.25 and MS-DOS v2.0.
These are the same files [originally shared at the Computer History Museum on March 25th, 2014]( http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/) and are being (re)published in this repo to make them easier to find, reference-to in external writing and works, and to allow exploration and experimentation for those interested in early PC Operating Systems. This repo contains the original source-code and compiled binaries for MS-DOS v1.25 and MS-DOS v2.0, plus the source-code for MS-DOS v4.00 jointly developed by IBM and
Microsoft.
The MS-DOS v1.25 and v2.0 files [were originally shared at the Computer History Museum on March 25th, 2014]( http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/) and are being (re)published in this repo to make them easier to find, reference-to in external writing and works, and to allow exploration and experimentation for those interested in early PC Operating Systems.
# License # License
All files within this repo are released under the [MIT (OSI) License]( https://en.wikipedia.org/wiki/MIT_License) as per the [LICENSE file](https://github.com/Microsoft/MS-DOS/blob/master/LICENSE.md) stored in the root of this repo.
# Contribute! All files within this repo are released under the [MIT License]( https://en.wikipedia.org/wiki/MIT_License) as per the [LICENSE file](https://github.com/Microsoft/MS-DOS/blob/main/LICENSE) stored in the root of this repo.
# For historical reference
The source files in this repo are for historical reference and will be kept static, so please **dont send** Pull Requests suggesting any modifications to the source files, but feel free to fork this repo and experiment 😊. The source files in this repo are for historical reference and will be kept static, so please **dont send** Pull Requests suggesting any modifications to the source files, but feel free to fork this repo and experiment 😊.
If, however, youd like to submit additional non-source content or modifications to non-source files (e.g., this README), please submit via PR, and well review and consider.
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
# Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.
+9
View File
@@ -0,0 +1,9 @@
## Security
**Since MS-DOS is historical reference software, this file is in place as a template only.**
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.**
You can learn more about the security reporting process with the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
+1 -1
View File
@@ -2,7 +2,7 @@
The 2.0 Release of MSDOS includes five 5 1/4 double density single sided The 2.0 Release of MSDOS includes five 5 1/4 double density single sided
diskettes or three 8 iinch CP/M 80 format diskettes. diskettes or three 8 inch CP/M 80 format diskettes.
The software/documentation on the five inch diskettes is arranged The software/documentation on the five inch diskettes is arranged
as follows: as follows:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5
View File
@@ -0,0 +1,5 @@
date
time
prompt $p$g
path a:\bin;a:\

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
View File
@@ -0,0 +1,3 @@
cd bin
pound 290 a:bbset.exe a:sm.exe

+4
View File
@@ -0,0 +1,4 @@
c:
cd \bin
pound 800 bbset.exe sm.exe

+7
View File
@@ -0,0 +1,7 @@
c:
cd \bin
cd a:\bin
detach pound 800 bbset.exe sm.exe
detach pound 290 a:bbset.exe a:sm.exe
basica a:prime

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+199
View File
@@ -0,0 +1,199 @@
Multi-Tasking MS-DOS
Beta Test Release 1.00
Command Guide
ARENA.EXE - Prints out arena assignments
arena
The system's memory arena is printed out. The
number listed under the owner field is the PID of
the process which owns the memory.
BBSET.EXE - Set and report on behavior bits
bbset [-o] [ {+|-}bitname ... ] fname ...
BBSET sets or clears behavior bits in an .EXE file
header. Multi-Tasking MS-DOS uses the behavior
bits to determine the level of special
compatibility support needed to run the
application.
BBSET will set (if +bitname) or clear (if -
bitname) the named behavior bit(s) from the
specified files. If the -o switch is specified,
BBSET writes a report on the current setting of
all the defined behavior bits to stdout after
making the requested changes.
For a list of behavior bits that BBSET knows
about, type BBSET without any arguments.
COUNTDOW.EXE - Count down a CPU loop
countdown number
Its argument is a number; it counts the number
down to 0, at about a 1hz rate. It prints out
the countdown. Another CPU loop program like
TEXT, but this one terminates when the count
reaches 0
DETACH.EXE - Detaches a child process
detach command [argument ...]
The command given is run as a background process.
Detach prints out the Command Subgroup ID (CSID)
which may be used as an argument to KILL to
terminate the process.
Multi-Tasking MS-DOS Command Guide - Page: 2
HE_DAEM.EXE - Hard error catcher
detach he_daem
Intercepts hard errors, reports them and requests
user action. This should always be run in the
background for now. Put the above command line in
your AUTOEXEC.BAT file if you're not going to use
the Session Manager (SM).
KILL.EXE - send a signal to a process
kill [-nn] [sig=nn] [disp=mm] pid ...
Sends signal nn with disposition mm to processes
mentioned in pid. Defaults to SIGTERM and process
tree disposition.
POUND.EXE - Exercise disk I/O system
pound [t]count filea fileb
Pound reads sequencially through filea and fileb,
reading 512 bytes at a time alternating between
the files on each read. When the end of file is
read the following read for that file begins at
the beginning of the file. If a count is
specified without the preceeding "t" then pound
reads 512 bytes, count number of times from each
file before the program terminates. If "t"
preceeds the count value then the files are read
for count number of seconds before the program
terminates.
SLEEP.EXE - Sleep for a while
sleep sec[.millisec]
Sleep will execute a sleep system call for the
number of seconds and milliseconds specified.
This might be useful in batch files to pause for
an interval as opposed to waiting for a user
response.
SM.EXE - Session manager
sm
Manages multiple processes running on different
screens. Uses initialization file SM.INI. This
Multi-Tasking MS-DOS Command Guide - Page: 3
program includes the hard error catcher, so don't
run HE_DAEM if you're going to use this. See the
file SM.DOC for more information.
TEXT.EXE - Loop and print text
text argument
CPU loops and prints its argument every 2 CPU
seconds or so
+3
View File
@@ -0,0 +1,3 @@
buffers = 40
files = 20
break=on
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+67
View File
@@ -0,0 +1,67 @@
Multi-Taking MS-DOS
Beta Test Release 1.00
Release Notes
Enclosed you will find Microsoft's first beta release
of Multi-tasking MS-DOS. This version is based upon MS-DOS
Version 2 sources, we will be reimplementing the multi-
tasking enhancements on top of Version 3 sources shortly.
Although we have distributed a bootable disk for the
IBM PC, this package can be adapted to any MS-DOS machine.
Those manufacturers who are designing IBM compatible ROMs,
would be wise to keep multi-tasking in mind. Specifically,
this IBM PC implementation has had to hook out the entire
disk (both floppy and hard disk) ROM code because after he
IBM code set's up the DMA transfer it simply loops in ROM
waiting for the interrupt to occur (routine WAIT_INT).
Problems you may wish to avoid within future ROMs are:
1) loading ES with the physical video RAM location
(label M3)
2) Looping in ROM on Cntrl-NumLock (label K40)
3) No way to add special detecting special key
strokes which a jump out into RAM after reading
the keystroke at KB_INT would avoid
4) Not being able to hook the loading of DS to point
to DATA (EQU 40H) in numerous routines.
Other than these deficiencies the ROM code developed should
be very usable.
By implementing the above suggestions, the size of your
BIOS can be reduced since it will not be necessary to
duplicate functionality in RAM.
More detailed specifications of the device driver
formats will be forth coming. For the time being you will
have to make use of the sample source code for the IBM PC.
If you have further questions please contact Microsoft OEM
customer support through Technical Assist Requests (TAR).
* * * WARNING * * * WARNING * * * WARNING * * *
Each copy of this software distribution has been
individually serialized to facilitate tracing of
unauthorized duplication.
* * * WARNING * * * WARNING * * * WARNING * * *
+199
View File
@@ -0,0 +1,199 @@
Multi-Tasking MS-DOS
Beta Test Release 1.00
Session Manager
User's Guide
Introduction
The Session Manager(SM) for Multi-Tasking MS-DOS
allows you to run up to six programs at one time and switch
between them with a couple of keystrokes. Each program's
screen is preserved so that it can be restored when you
switch back to it. SM also contains the system-wide, Int24
Handler.
Initialization
The first thing SM does when it is started is look for
any program initialization information you may have. SM
looks for the initialization information in a file named
SM.INI in the current directory. Although recommended, no
initialization information is needed.
There are two types of initialization lines:
1) define <program key> <program name> [program args]
<working directory>
2) start <program key>
"program key" - a printable ascii character, a control
character (^A thru ^^), or a function key (F1
- F10).
"working directory" - a well formed path; i.e., begins
with drive letter (d:\).
Each define line will associate a key with a program.
If there is more than one define line using the same key,
only the information in the last one is used.
A start line is optional. If one exists, the program
associated with the key on the start line is run as soon as
SM finishes initializing. If more than one start line is
given, the last one is used.
This is what a sample initialization file might look like:
define f1 a:\command.com c:\bin\src
define ^z z.exe foo.c a:\foo\bar
start f1
Running the Session Manager
To run Session Manager, just type SM. It does not
require any arguments. If there was a start line in the
Session Manager User's Guide - Page: 2
initialization file, the program associated with the start
key will be run. Otherwise, the SM screen will be displayed
and you will be prompted for input.
The SM screen contains a chart that describes each
defined program's key, status, arguments, and working
directory. There are 3 types of program status:
1) New - the program has never been run.
2) Active - the program has been started.
3) Dead - the program has terminated.
The input choices at this point are to either type a
program key or hit the <ESC> button to enter command mode.
If you hit a program key, the screen associated with that
program will be displayed and the program will
start/continue executing. If this is the first time the
program has been run, a chdir to the program's working
directory is made before it is started. If SM cannot start
the program you desired, the SM screen will reappear.
If the program you chose to run has died, its screen
will still be displayed so that you can check its output.
That is all you can do while in a dead programs screen
except switch back to SM.
To switch back to SM, hit Alt-F10. Alt-F10 is
currently the program key for SM and will be recognized no
matter what other programs are running. This is the only
program key that works this way. All of the others will
only be recognized if SM is running and the SM screen is
being displayed.
Whenever any of SM's children die, their status is
changed to dead. You will see the status change the next
time the SM screen is displayed. If the program using the
current screen dies, you will go back into SM.
Command Mode
When you enter SM's command mode the prompt "SM command or
HELP>" is displayed. The valid SM commands are:
1) INIT <program key>
Initialize the program associated with key so that
it can be run again. The program's status is
changed to "New" and its screen memory is freed.
If the program is active, it is killed before it
is initialized.
2) DEFINE <program key> <program name> [program args]
<working directory>
Define and run a new program using the supplied
information. If the key was previously defined,
redefine it.
Session Manager User's Guide - Page: 3
3) RUN <program key>
Run the program associated with key.
4) RESTART <program key>
Restart the program associated with key. This
like issuing an INIT and a RUN command.
5) KILL <program key>
Kill the program associated with key. Its status
is changed to dead.
6) HELP
Display a help screen.
7) EXIT
Kill all of SM's children and exit SM.
In all of the above commands, "key" is the printable
ascii representation of a programs key. If a command fails,
you will either be asked to enter a new command or placed in
SM's top level.
Session Manager's Int24 Handler
Whenever an Int24 occurs, SM's Int24 handler is called.
No matter what program is using the screen and no matter
which program caused the error, SM's Int24 screen is always
displayed. This screen will contain information on the type
of Int24 that happened, and the name and pid of the program
that caused the error. You will then be prompted for one of
the valid actions for this type of error. After the action
typed in has been taken, you are returned to the screen you
were using before the Int24.
+2
View File
@@ -0,0 +1,2 @@
define F7 a:\command.com a:\
define F8 a:\command.com c:\
+573
View File
@@ -0,0 +1,573 @@
; Termcap description of capabilities:
;ibmans4:mtcon:IBM PC with V4.0 ANSI driver:\
; :al=\E[L:am:bs:ce=\E[K:cl=\E[2J\E[H:cm=\E[%;%H:co#80:\
; :dl=\E[M:do=\E[B:ho=\E[H:li#24:mi:nd=\E[C:\
; :ms:pt:se=\E[m:so=\E[1;36m:up=\E[A:\
; :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:kh=\E[H:kn#8:\
; :k1=\ES:k2=\ET:k3=\EU:k4=\EV:k5=\EW:\
; :k6=\EP:k7=\EQ:k8=\ER:
CMDTABL DB 'A'
DW CUU ;CUrsor Up
DB 'B'
DW CUD ;CUrsor Down
DB 'C'
DW CUF ;CUrsor Forward
DB 'D'
DW CUB ;CUrsor Back
DB 'H'
DW CUP ;CUrsor Position
DB 'J'
DW ED ;Erase in Display
DB 'K'
DW EL ;Erase in Line
DB 'L'
DW IL ;Insert Line
DB 'M'
DW xDL ;Delete Line
;; DB 'R'
;; DW CPR ;Cursor Postion Report
DB 'f'
DW HVP ;Horizontal and Vertical Position
DB 'h'
DW SM ;Set Mode
DB 'l'
DW RM ;Reset Mode
DB 'm'
DW SGR ;Select Graphics Rendition
;; DB 'n'
;; DW DSR ;Device Status Report
DB 's'
DW SCP ;Save Cursor Position
DB 'u'
DW RCP ;Restore Cursor Position
DB 00
; Graphic Rendition modes: parameter, mask, set
GRMODE DB 00,00000000B,00000111B ; all off
DB 01,11111111B,00001000B ; bold (increased intensity)
DB 04,11111000B,00000001B ; underscore
DB 05,11111111B,10000000B ; blink
DB 07,11111000B,01110000B ; reverse video
DB 08,10001000B,00000000B ; concealed
DB 30,11111000B,00000000B ; foreground colors ...
DB 31,11111000B,00000100B
DB 32,11111000B,00000010B
DB 33,11111000B,00000110B
DB 34,11111000B,00000001B
DB 35,11111000B,00000101B
DB 36,11111000B,00000011B
DB 37,11111000B,00000111B
DB 40,10001111B,00000000B ; background colors ...
DB 41,10001111B,01000000B
DB 42,10001111B,00100000B
DB 43,10001111B,01100000B
DB 44,10001111B,00010000B
DB 45,10001111B,01010000B
DB 46,10001111B,00110000B
DB 47,10001111B,01110000B
DB 0FFH
; Set/Reset Modes: indexed by (SelChar-'<'*8) + (PARAM0 AND 7)
SRMODE DW 0,0,0,0,0,0,0,0 ; SelChar '<'
DW 1,1,1,1,1,1,1,WRAP ; SelChar '='
DW 0,EnaL25,0,0,0,0,0,0 ; SelChar '>'
DW 0,0,0,0,0,0,0,WRAP ; SelChar '?'
PAGE
; The following are duplicates of the same variables from the ROM
;
;* WARNING - the following two variables are accessed as a word
MODE DB 3
MAXCOL DB 79
IF LINE25 ; special treatment of line 25?
maxrow equ 24
ELSE
maxrow equ 25
ENDIF
;* WARNING - the following two variables are accessed as a word
COL DB 0 ; current column
ROW DB 0 ; current row
AnsiState LABEL BYTE ; the following must be saved on a screen swap
WRAP DB 1 ; 0 = NO WRAP, 1 = WRAP
EnaL25 DB 0 ; 0 = 25th line disabled, 1 = enabled
STATE DW S1
SAVCR DW 0 ; saved cursor position
;* WARNING - the following two variables are accessed as a word
SelChar DB 0 ; <,=,> or ? private use indicators
PRMCNT LABEL BYTE ; number of parameters for command
PRMCNTW DW 0
NUMPARAM equ 5 ; max. number of parameters
PARAM DB NUMPARAM DUP (?) ; buffer for command parameters
;* WARNING - the following two variables are accessed as a word
attrw LABEL WORD
ATTR DB 00000111B ;CHARACTER ATTRIBUTE
BPAGE DB 0 ;BASE PAGE
AnsiSize equ ($-AnsiState)
IF (AnsiSize GT TermSize)
.RADIX 0 ; ERROR - Terminal state not big enough
ENDIF
;-------------------------------------------------------------
;
; CHROUT - WRITE OUT CHAR IN AL USING CURRENT ATTRIBUTE
;
base dw 0b800h
screen_seg dw 00000h
chrout: cmp al,13 ; carriage return?
ja outchr
jnz trylf
mov [col],0
;; jmp short setit
jmp setit
trylf: cmp al,10 ; line feed?
jz lf
cmp al,7 ; bell?
jnz trytab
torom:
mov bx,[attrw]
and bl,7
mov ah,14
int 10h
ret5: ret
trytab:
cmp al,9 ; tab?
jnz tryback
mov al,[col]
add al,8
mov ah,al
and ah,7
sub al,ah
cmp al,[maxcol]
jb tunder
mov al,[maxcol]
tunder:
mov [col],al
jmp short setit
tryback:
cmp al,8 ; backspace?
jnz outchr
cmp [col],0
jz ret5
dec [col]
jmp short setit
outchr:
mov bx,[attrw]
mov cx,1
mov ah,9
int 10h
inc [col]
mov al,[col]
cmp al,[maxcol]
jbe setit
cmp [wrap],1
jz outchr1
dec [col]
ret
outchr1:
mov [col],0
lf: cmp [row],(maxrow-1)
ja setit ; on line 25, don't move
jz lf1 ; on 24th line, scroll
inc [row]
jmp short setit
lf1: call scroll
setit: mov dx,word ptr col
mov bh,[bpage]
mov ah,2
int 10h
ret
scroll: mov al,mode
cmp al,2
jz myscroll
cmp al,3
jz myscroll
IF LINE25
xor cx,cx ; from 0,0
mov dh,(maxrow-1) ; to maxrow-1,maxcol
mov dl,maxcol
mov bh,attr
mov ax,0601h ; scroll up one line
int 10h
ret
ELSE
mov al,10
jmp torom
ENDIF
myscroll:
mov bh,[attr]
mov bl,' '
mov bp,80
mov ax,[base]
add ax,[screen_seg]
mov es,ax
mov ds,ax
xor di,di
mov si,160
mov cx,(maxrow-1)*80
cld
; This code will never get executed since we get here when
; mode = 2 or 3 only.
;; cmp cs:[base],0b800h
;; jz colorcard
;; rep movsw
;; mov ax,bx
;; mov cx,bp
;; rep stosw
;; jmp short sret
;;colorcard:
mov dx,3dah
wait2: in al,dx
test al,8
jz wait2
mov al,25h
mov dx,3d8h
out dx,al ;turn off video
rep movsw
mov ax,bx
mov cx,bp
rep stosw
mov al,29h
mov dx,3d8h
out dx,al ;turn on video
sret: push cs
pop ds
ret
CharOut: PUSH AX ; Main entry point
PUSH BX
PUSH CX
PUSH DX
PUSH SI
PUSH DI
PUSH ES
PUSH BP
MOV [base],0B800H
XCHG AX,SI ; SAVE CHARACTER TO STUFF
MOV AX,40H ; POINT TO ROS BIOS
MOV DS,AX
MOV AX,DS:[49H] ; AL=MODE, AH=MAX COL
DEC AH ; ANSI NEEDS 0-79 OR 0-39
MOV WORD PTR CS:[MODE],AX ; SAVE MODE AND MAX COL
CMP AL,7
JNZ NOT_BW
MOV WORD PTR CS:[base],0B000H
NOT_BW: MOV AL,DS:[62H] ; GET ACTIVE PAGE
MOV CS:[BPAGE],AL
CBW
ADD AX,AX
MOV BX,AX
MOV AX,DS:[BX+50H] ; AL=COL, AH=ROW
MOV WORD PTR CS:[COL],AX ; SAVE ROW AND COLUMN
MOV AX,DS:[4EH] ; GET START OF SCREEN SEG
MOV CL,4
SHR AX,CL ; CONVERT TO A SEGMENT
PUSH CS
POP DS
MOV [screen_seg],AX
XCHG AX,SI ; GET BACK CHARACTER IN AL
CALL VIDEO
POP BP
POP ES
POP DI
POP SI
POP DX
POP CX
POP BX
POP AX
RET
;----------------------------------------------------------
;
; OUTPUT SINGLE CHAR IN AL TO VIDEO DEVICE
;
VIDEO: MOV SI,OFFSET STATE
JMP [SI]
S2: CMP AL,'['
JZ S22
JMP S1
S22: MOV WORD PTR [SI],OFFSET S30
XOR BX,BX
MOV WORD PTR SelChar,BX
MOV WORD PTR PARAM,BX
JMP SHORT S3B
S30: CMP AL,'?' ; experimental use selector (SM/RM)?
JA S7
mov SelChar,al
MOV WORD PTR [SI],OFFSET S3
cmp al,'<'
jae S3B
S3: CMP AL,';'
JNZ S3C
S3A: INC PRMCNT
S3B: CALL GETPTR
XOR AX,AX
MOV WORD PTR [BX],AX ;DEFAULT VALUE IS ZERO
RET
S3C: CMP AL,'0'
JB S3D
CMP AL,'9'
JA S7
CALL GETPTR
SUB AL,'0'
XCHG AL,BYTE PTR [BX]
MOV AH,10
MUL AH ;*10
ADD BYTE PTR [BX],AL ;MOVE IN DIGIT
RET
S3D:
;; CMP AL,'"' ;BEGIN QUOTED STRING
;; JZ S3E
;; CMP AL,"'"
JNZ S7
;;S3E: MOV WORD PTR [SI],OFFSET S4
;; MOV [INQ],AL
S3RET: RET
;
; ENTER QUOTED STRINGS
;
;;S4: CMP AL,[INQ] ;CHECK FOR STRING TERMINATOR
;; JNZ S4A
;; DEC PRMCNT ;TERMINATE STRING
;; MOV WORD PTR [SI],OFFSET S3
;; RET
;;S4A: CALL GETPTR
;; MOV BYTE PTR [BX],AL
;; MOV WORD PTR [SI],OFFSET S4
;; JMP S3A
;
; LOOK FOR ANSI COMMAND SPECIFIED IN AL
;
S7: MOV BX,OFFSET CMDTABL-3
;
S7A: ADD BX,3
CMP BYTE PTR [BX],0
JZ S1B
CMP BYTE PTR [BX],AL
JNZ S7A
;
S7B: MOV AX,WORD PTR [BX+1] ;AX = JUMP ADDRESS
MOV BX,OFFSET PARAM
MOV DL,BYTE PTR [BX]
XOR DH,DH ;DX = FIRST PARAMETER
MOV CX,DX
OR CX,CX
JNZ S7C
INC CX ; if DX=0, CX=1 else CX = DX
S7C: JMP AX ;AL = COMMAND
S1: CMP AL,1Bh ;ESCAPE SEQUENCE?
JNZ S1B
MOV WORD PTR [SI],OFFSET S2
RET
S1B: CALL CHROUT
S1A: MOV WORD PTR [STATE],OFFSET S1
RET
MOVCUR: CMP BYTE PTR [BX],AH
JZ SETCUR
ADD BYTE PTR [BX],AL
LOOP MOVCUR
SETCUR: MOV DX,WORD PTR COL
XOR BX,BX
MOV AH,2
int 10h ; call ROM
JMP S1A
HVP:
CUP:
IF LINE25
CMP CL,(maxrow+1)
jb cup3 ; new row is 24 or less
JA SETCUR ; error - 26 or greater
cmp EnaL25,0 ; else 25, is it allowed?
jz SETCUR
cup3:
ELSE
CMP CL,maxrow
JA SETCUR
ENDIF
MOV AL,MAXCOL
MOV CH,BYTE PTR [BX+1]
OR CH,CH
JZ CUP1
DEC CH
CUP1: CMP AL,CH
JA CUP2
MOV CH,AL
CUP2: XCHG CL,CH
DEC CH
MOV WORD PTR COL,CX
JMP SETCUR
CUF: MOV AH,MAXCOL
MOV AL,1
CUF1: MOV BX,OFFSET COL
JMP MOVCUR
CUB: MOV AX,00FFH
JMP CUF1
CUU: MOV AX,00FFH
CUU1: MOV BX,OFFSET ROW
JMP MOVCUR
CUD: MOV AX,(maxrow-1)*256+1
IF LINE25
cmp ah,[row] ; at bottom of screen?
ja SETCUR
ENDIF
JMP CUU1
SCP: MOV AX,WORD PTR COL
MOV SAVCR,AX
JMP SETCUR
RCP: MOV AX,SAVCR
IF LINE25
cmp ch,maxrow
jb rcp1
cmp EnaL25,0
jz rcp2
ENDIF
rcp1: MOV WORD PTR COL,AX
rcp2: JMP SETCUR
SGR: XOR CX,CX
XCHG CL,PRMCNT
CALL GETPTR
INC CX
SGR1: MOV AL,BYTE PTR [BX]
PUSH BX
MOV BX,OFFSET GRMODE
SGR2: MOV AH,BYTE PTR [BX]
ADD BX,3
CMP AH,0FFH
JZ SGR3
CMP AH,AL
JNZ SGR2
MOV AX,WORD PTR [BX-2]
AND ATTR,AL
OR ATTR,AH
SGR3: POP BX
INC BX
LOOP SGR1
JMP SETCUR
ED:
IF LINE25
cmp row,maxrow ; on 25th line?
je EL ; yes, treat like Erase in Line
ENDIF
xor cx,cx
mov dl,maxcol
mov dh,(maxrow-1)
cmp param,1 ; which subcommand?
ja el2 ; all
jb ed1
mov dh,row ; to beginning
dec dh
jle EL
jmp short ed2
ed1: mov ch,row ; to end
inc ch
cmp ch,dh
jae EL
ed2: mov bh,attr
MOV AX,0600H
int 10h ; call ROM
EL: MOV CX,WORD PTR COL
MOV dx,cx
mov al,param
inc al ; 0,1,2 => 1,2,3
test al,1 ; to end?
je el1
mov dl,maxcol
el1: test al,2 ; to beginning?
je el2
mov cl,0
el2: mov bh,attr
mov ax,0600H
int 10h
S1A_j: jmp S1A
IL: mov ah,7 ; scroll down
jmp short dl1
xDL: mov ah,6 ; scroll up
dl1: mov al,cl ; number of lines
mov ch,row
xor cl,cl
mov dh,(maxrow-1)
mov dl,maxcol
mov bh,attr
int 10h
jmp S1A_j
RM: XOR CL,CL
JMP SHORT SM1
SM: MOV CL,1
SM1: mov bl,SelChar ; get selection character
sub bl,'<' ; adjust
jb S1A_j ; less than '<'
cmp bl,4
jae S1A_j ; greater than '?'
xor bh,bh
shl bx,1
shl bx,1
shl bx,1
MOV AL,DL
CMP AL,7
JA S1A_j
or bl,al
shl bx,1
mov bx,SRMODE[bx] ; get function indicator
cmp bx,1 ; no or special function?
jb S1A_j
jz SM2 ; sets screen mode
MOV [bx],CL
JMP S1A_j
SM2: MOV AH,0
int 10h ; call ROM
JMP S1A_j
; GetPtr - get a pointer to the current parameter
GETPTR: MOV BX,PRMCNTW
CMP BX,NUMPARAM
JB GET1
DEC PRMCNT
JMP GETPTR
GET1: ADD BX,OFFSET PARAM
RET
+20
View File
@@ -0,0 +1,20 @@
ibmbio.obj: ibmbio.asm defdbug.inc bugcode.inc
masm ibmbio;
ibmmtcon.obj: ibmmtcon.asm ansi.inc defdbug.inc
masm ibmmtcon;
ibmdsk.obj: ibmdsk.asm defdbug.inc
masm ibmdsk;
sysini.obj: sysini.asm dossym.inc devsym.inc syscalls.inc
masm sysini;
sysimes.obj: sysimes.asm
masm sysimes;
ibmbio.exe: ibmbio.obj ibmmtcon.obj ibmdsk.obj sysini.obj sysimes.obj
link ibmbio ibmmtcon ibmdsk sysini sysimes,ibmbio,ibmbio/map;
ibmbio.com: ibmbio.exe
exe2bin ibmbio ibmbio.com
Binary file not shown.
+553
View File
@@ -0,0 +1,553 @@
;*** Bugcode.inc - Debug code for including into sysini.asm and ibmbio.asm
;
; Can't link in via buglib due to memory and relocation games played
; by these modules. Each gets a private, local-only copy of these
; modules.
IFDEF DEBUGFLG
;** DPRINTF _ Debug Printf
;
; Dprintf is a kernel debug print formatting package. It is intended
; to produce conviently formatted output.
;
; Dprintf is called, indirectly, by a macro:
;
; DEBUG n,m,"string",<a1,...,an>
;
; string = format string
; a1 = first argument
; an = last argument
;
; The format string is an ASCIZ string which can contain 2 types of
; specifications: data-format specifications and literal characters.
; Data format specifications always begin with a '$' character; all
; characters not part of a data format specification are treated as
; literal characters.
;
; Literal characters
; - any character not part of a format specification. Special
; non-printing characters are:
; \n - CRLF
; \t - tab
; \b - bell
; \\ - \
; \$ - $
;
; Format Specifications
;
; A format specification takes the form:
; $ [@] <char>
;
; where <char> =
;
; x - print argument as a hex word
; d - print argument as decimal word
; c - print argument as ascii character
; b - print argument as hex byte
; For each of the above formats, the supplied argument
; is a 16-bit word - the value to be printed. The optional @
; (described below) allows a segmented address to be supplied,
; instead.
;
; s[nn] - print argument as asciz string; if optional decimal
; argument follows the format character this specifys
; a maximum string length. Non printing characters are
; printed in the form \nnn where "nnn" is the octal byte
; value.
; Note that this format character cannot be directly
; followed by a digit unless that digit is to be taken
; as the start of a length argument.
;
; Bnn - print argument as hex bytes. The required following
; decimal argument is the number of bytes to print.
;
; Both of these formats take a long address as their argument.
; The '@' character is thus invalid for these formats.
;
; WARNINGS
; As befitting a debug routine, DPRINTF does not have a whole lot
; of "failsafe" code in it. Supplying screwed up formats can
; muck things up. Specifically:
; The @ argument must NOT be specified with the 's' or 'B'
; format
; A string/byte-length argument of 0 is taken as 65536
; The string "%% BAD FMT %%" appears in the output when
; 1) an illegal format specifier is given, or
; 2) the B format is given a 0 or missing length
;
; ENTRY (sp+n ) = address of format string (offset from return cs value)
; (sp+n-2) = first argument word
; (sp+n-4) = second argument word
; .
; (sp+4 ) = last argument word
; (sp+2 ) = seg of return address
; (sp ) = offset of return address
; (bp) = offset of format string on the stack
; EXIT none
; USES flags
PUBLIC DPRINTF
DPRINTF PROC near
push ds
push es
push bp
push di
push si
push dx
push cx
push bx
push ax ; save registers
cld
mov si,[bp] ; get address of format string
sub bp,2
mov bx,sp
mov ds,ss:20[bx] ; (ds:si) = address of format string
push cs
pop ds
; Scan format string for next character
;
; (ds:si) = address of format string
; (ss:bp) = address of next argument
dpf1: lodsb ; (al) = format string byte
and al,al
je dpf3 ; all done
cmp al,'$'
je dpf4 ; is data escape
cmp al,'\'
jnz dpf2 ; got the character
; it's an "\" escape code - crack the argument character
lodsb
and al,al
je dpf3 ; all done, ignore hanging \
xchg ah,al
mov al,0Ch
cmp ah,'n'
jne dpf1$5 ; not \n
mov al,0dH
call putchar
mov al,0aH
jmp SHORT dpf2 ; print LF
dpf1$5: cmp ah,'t'
mov al,9
je dpf2 ; is \t
cmp ah,'b'
mov al,7
je dpf2 ; is \b
xchg ah,al
dpf2: call putchar
jmp dpf1
; have the end of the format string - exit
dpf3: pop ax
pop bx
pop cx
pop dx
pop si
pop di
pop bp
pop es
pop ds
ret
;* Have a '$' character - is data format escape
;
; Get address of data into es:di
;
; (bp) = address of data value
dpf4: mov di,bp
push ss
pop es ; (es:di) = address of data value
sub bp,2 ; point to next argument
lodsb ; (al) = format specifier
cmp al,'@'
jne dpf5 ; not an indirect flag
les di,[bp]
sub bp,2 ; have an extra 2 for @
lodsb
dpf5: cmp al,'x'
jne dpfd1 ; not 'x'
; is 'x' format - print hex word
mov ax,es:[di]
call THW ; type hex word
jmp dpf1
dpfd1: cmp al,'d'
jnz dpfc1 ; not 'd'
; is 'd' format - print decimal word
mov ax,es:[di]
call TDW ; type decimal word
jmp dpf1
dpfc1: cmp al,'c'
jne dpfb1
; is 'c' format - print character
mov al,es:[di]
call putchar
jmp dpf1
dpfb1: cmp al,'b'
jne dpfs1
; is 'b' format - print hex byte
mov al,es:[di]
call THB ; type hex byte
jmp dpf1
dpfs1: cmp al,'s'
jne dpfbb1
; is 's' format - print ASCIZ string. First, check for
; optional decimal limit
public SSB
SSB: sub cx,cx ; set 65536 limit
les di,[bp] ; (es:DI) = fwa of string
sub bp,2 ; argument to 's' was two words
mov al,[si]
cmp al,'0'
jb dpfs2 ; not decimal
cmp al,'9'
ja dpfs2 ; not decimal
call atod ; (ax) = decimal value, (ds:si) updated
xchg cx,ax
; print asciz string at es:di, max of (cx) characters
; (cx) = 0 means max of 65536
;
; Other sections of code in dpf jump here to print strings
dpfs2: mov al,es:[di]
inc di
and al,al
je dpfs3
call putchar
loop dpfs2 ; continue if not at limit
dpfs3: jmp dpf1
dpfbb1: cmp al,'B'
je dpfbb2 ; is 'B' format
; error in format code - print message
dpferr: push cs
pop es
mov di,OFFSET dpfa ; (es:di) = error message
sub cx,cx
jmp dpfs2
dpfa: DB '%% BAD FMT %%',0
; have B format
dpfbb2: call atod ; (ax) = length specifier
jc dpferr ; number not there - error
xchg cx,ax
jcxz dpferr ; number is 0 - error
les di,[bp] ; (es:DI) = fwa of string
sub bp,2 ; argument to 's' was two words
dpfbb3: mov al,es:[di]
call THB ; type hex byte
mov al,' '
call putchar ; space em out
inc di
loop dpfbb3 ; do em all
jmp dpf1
DPRINTF ENDP
;** THB - Type Hex Byte
;
; THB types a hex byte (via "putchar")
;
; ENTRY (AL) = byte
; EXIT none
; USES ax, flags
THBA DB '0123456789abcdef'
PUBLIC THB
THB PROC near
push ax
shr al,1
shr al,1
shr al,1
shr al,1
and ax,0fH
xchg bx,ax
mov bl,CS:THBA[bx]
xchg ax,bx
call putchar ; put first character
pop ax
and ax,0fH
xchg bx,ax
mov bl,CS:THBA[bx]
xchg ax,bx
call putchar
ret
THB ENDP
;** THW - Type Hex Word
;
; THW types a word in hex (via "putchar")
;
; ENTRY (AX) = word
; EXIT none
; USES AX, flags
PUBLIC THW
THW PROC near
push ax
xchg ah,al
call THB
pop ax
call THB
ret
THW ENDP
;** TDW - Type Decimal Word
;
; TDW types (via "putchar") the unsigned decimal representation
; of a 16-bit unsigned integer. Only significant digits are
; printed; if the number is 0 a "0" is printed.
;
; ENTRY (AX) = number
; EXIT none
; USES AX, flags
PUBLIC TDW
TDW PROC near
push cx ; preserve registers
push dx
mov cx,10
call tdw$ ; recurse cracking digits
pop dx
pop cx
ret
TDW ENDP
;* tdw$ - crack number recursively
;
; tdw$ cracks the least significant decimal digit. If there
; are no higher-significant digits, print and return.
; else, recurse for higher digits
;
; (AX) = value
; (CX) = 10
tdw$ PROC NEAR
sub dx,dx
div cx ; (ax) = quotient, (dx) = remainder
and ax,ax
jz tdw$1 ; this is highest-order, do it
push dx
call tdw$
pop dx
tdw$1: xchg ax,dx
add al,'0'
call putchar
ret
TDW$ ENDP
;** ATOD - Convert ASCII string to decimal number
;
; ATOD is called to convert an ascii string of digits to a
; decimal number. Digits are converted until we run out of them.
;
; ENTRY (DS:SI) = address of first digit
; EXIT 'C' clear if OK
; (AX) = value
; (SI) updated to first non-digit
; 'C' set if error - no digits, or result >65535
; (DS:SI) points to error character
; USES AX, SI, FLAGS
PUBLIC ATOD
ATOD PROC near
push dx
push cx ; save registers
mov al,[si]
sub al,'0'
jc atod9 ; error - no digits
cmp al,10
cmc
jc atod9 ; error - no digits
sub ax,ax ; clear accumulator
mov cx,10 ; base 10
; crack next digit
;
; (AX) = number accumulated so near
; (CX) = 10
; (DS:SI) = next character
atod1: xchg dx,ax ; keep accum in dx for a while
lodsb ; (al) = character
sub al,'0'
jc atod7 ; not digit - all done
cmp al,9
ja atod7 ; not digit - all done
sub ah,ah ; (ax) = digit value (0 - 9)
push ax
xchg ax,dx
mul cx ; (ax) = 10*accum
pop dx ; (dx) = digit to add
jo atod8 ; overflow
add ax,dx
jmp atod1 ; go back for more
; Done with number, all OK
;
; (dx) = number
; (ds:si) = address+1 of first unused character
atod7: clc
; Done with number, error
; 'C' set
atod8: dec si ; backup over non-decimal (or error) char
atod9: pop cx
xchg ax,dx ; (ax) = number iff no error
pop dx ; restore registers
ret ; exit
ATOD ENDP
;** putchar - put a character on the console
;
; ENTRY (al) = character
; EXIT none
; USES ax,flags
UR_DAT = 02f8H ; COM1 = 03f8H, COM2 = 02f8H
UR_IEN = UR_DAT+1 ; Interrupt enable
UR_IER = UR_DAT+2 ; interrupt ID
UR_LCR = UR_DAT+3 ; line control registers
UR_MCR = UR_DAT+4 ; modem control register
UR_LSR = UR_DAT+5 ; line status register
UR_MSR = UR_DAT+6 ; modem status regiser
UR_DLL = UR_DAT ; divisor latch least sig
UR_DLM = UR_DAT+1 ; divisor latch most sig
iflag DB 0 ; != 0 when initialized 8250
;* inchr - input character
;
; EXIT 'z' set if no character
; 'z' clear if char
; (al) = char
inchr: mov dx,UR_LSR
in al,dx
and al,1
jz inchr1
mov dx,UR_DAT
in al,dx
and al,07fh
inchr1: ret
PUBLIC putchar
putchar PROC NEAR
pushf
cli
push dx
push cx
push bx
push ax ; (al) = character
test iflag,255
jnz putc1 ; is initialized
inc iflag
; program the usart
mov dx,UR_LCR
mov al,80h
out dx,al ; command it
sub al,al
mov dx,UR_DLM
out dx,al
mov dx,UR_DLL
mov al,12 ; 9600 baud = 12, 19.2 Kbaud = 6
out dx,al
mov al,3
mov dx,UR_LCR
out dx,al ; command normal mode
; see if CTL-Q or CTL-S
putc1: pushf
cli
call inchr
jz putc3 ; no characters incomming
cmp al,19 ; ctl-S?
jnz putc3 ; no, ignore
; have ctl-s. wait till we see ctl-Q
putc2: call inchr
jz putc2
cmp al,17
jnz putc2
putc3: popf
mov dx,UR_LSR
putc4: in al,dx
test al,020h
jz putc4
; ready. crank it out!
mov dx,UR_DAT
pop ax
out dx,al
pop bx
pop cx
pop dx
popf
ret
putchar ENDP
ENDIF
+122
View File
@@ -0,0 +1,122 @@
;** DEFDBUG.ASM - Debugging Macro Definitions
;
;
; DEBUG n,m,<format string>, <arg list>
;
;
.sall
DEBUG MACRO N,M,string,args
local b,c
IFDEF DEBUGFLG
pushf
DEBUGTST N,M
jz b
push ax
push bp
call c ;; push address of string
DB '&string',0
c: mov bp,sp
; IFNB <args>
IRP Y,<args>
IFIDN <Y>,<ax>
push 4[bp]
ELSE
IFIDN <Y>,<AX>
push 4[bp]
ELSE
IFIDN <Y>,<bp>
push 2[bp]
ELSE
IFIDN <Y>,<BP>
push 2[bp]
ELSE
mov ax,Y
push ax
ENDIF
ENDIF
ENDIF
ENDIF
ENDM
; ENDIF
call DPRINTF
mov sp,bp
pop ax ;; discard format string offset
pop bp
pop ax
b: popf
ENDIF
ENDM
;** ERRNZ - generate assembly error if arg != 0
;
ERRNZ MACRO EXPR
IF1
IFE expr
ELSE
RADIX 0 ; CONDITION NOT MET - ERROR
ENDIF
ENDIF
ENDM
;** DBBEG - Start debugging range
;
DBBEG MACRO N,M
LOCAL lab
IFDEF DEBUGFLG
pushf
DEBUGTST N,M
jnz lab ;; am to do it
DBJMP %DBCNT
lab:
ENDM
DBJMP MACRO N
jmp DBLAB&N
ENDM
;** DEBUGTST - Test Debug Flags
;
; DEBUGTST n,m
;
; Where N and M are bit masks.
;
; If one or more of the bits in N is set in the high byte
; of BUGBITS, and one or more of the bits in M is set in
; the low byte of BUGBITS then clear the Z flag.
;
; In other words:
;
; If both masks show a "hit" clear 'Z' else set 'Z'
;
; USES FLAGS
DEBUGTST MACRO N,M
LOCAL A
test BYTE PTR BUGBITS,n
jz A
test BYTE PTR BUGBITS+1,m
A:
ENDM
DBEND MACRO
DBLAB %DBCNT
DBCNT = DBCNT+1
popf
ENDM
DBLAB MACRO N
DBLAB&N:
ENDM
DBCNT = 1
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
+25
View File
@@ -0,0 +1,25 @@
29 May 1984
The object files given here are sufficient to create the BIOS
for the IBM system. Some sources are given as examples for
OEM supplied device drivers. These sources do not necessarily
implement all the features described in the device driver
documentation. They have evolved in parallel with the
documentation, so some features described in the documentation
may not yet be present in the drivers. Below is a summary of
the files supplied:
read_me This file.
ibmbio.asm Main body of the BIOS.
ibmdsk.asm Floppy and Hard disk drivers.
ibmmtcon.asm Multi-screen console driver.
ansi.inc ANSI X3.64 terminal emulation.
bugcode.inc Module which implements debugging
prints. The routine PUTC must be
modified for other devices. See
also the file DEFDBUG.INC.
sys*.obj The SYSINIT program. No source supplied.
biosobj.mak Contains instructions for building the
IBM BIOS.
bootpach.exe Modifies a V2.0 boot sector (on A:) for
the IBM to accomodate the larger BIOS.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) IBM and Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
+103
View File
@@ -0,0 +1,103 @@
%OUT BIOSTRUC.INC...
; SCCSID = @(#)BIOSTRUC.INC 1.0 86/09/30
; ROM BIOS CALL PACKET STRUCTURES
;*******************************
;System Service call ( Int 15h )
;*******************************
;Function AH = 0C0h, Return system configuration
;For PC and PCJR on return:
; (AH) = 80h
; (CY) = 1
;For PCXT, PC PORTABLE and PCAT on return:
; (AH) = 86h
; (CY) = 1
;For all others:
; (AH) = 0
; (CY) = 0
; (ES:BX) = pointer to system descriptor vector in ROS
; System descriptor :
; DW xxxx length of descriptor in bytes,
; minimum length = 8
; DB xx model byte
; 0FFh = PC
; 0FEh = PC/XT, Portable
; 0FDh = PC/JR
; 0FCh = PC/AT, 6Mhz PC/AT,
; 6Mhz PC/AT running coprocessor(?),
; PS/2 Model 50, 50 z
; 0FAh = PS/2 Model 25, 30
; 0F9h = PC Convertible
; 0F8h = PS/2 Model 80
; 0F7h = Nova
; 0E0 thru 0EFh = reserved
;
; DB xx secondary model byte
; 000h = PC1
; 000h = PC/XT, Portable
; 000h = PC/JR
; 000h = PC/AT
; 001h = 6Mhz PC/AT
; 003h = 6Mhz PC/AT running coprocessor(?)
; 004h = PS/2 Model 50, 50z
; 001h = PS/2 Model 25
; 000h = PC Convertible
; 000h = PS/2 Model 80
; 000h = Nova
;
; DB xx bios revision level
; 00 for first release, subsequent release
; of code with same model byte and
; secondary model byte require revison level
; to increase by one.
;
; DB xx feature information byte 1
; X0000000 = 1, bios use DMA channel 3
; = 0, DMA channel 3 not used
;
; 0X000000 = 1, 2nd Interrupt chip present
; = 0, 2nd Interrupt chip not present
;
; 00X00000 = 1, Real Time Clock present
; = 0, Real Time Clock not present
;
; 000X0000 = 1, Keyboard escape sequence(INT15h)
; called in keyboard interrupt
; (Int 09h).
; = 0, Keyboard escape sequence not
; called.
; 0000XXXX reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;
; DB xx feature information byte 2 - reserved
;
BIOS_SYSTEM_DESCRIPTOR struc
bios_SD_leng dw ?
bios_SD_modelbyte db ?
bios_SD_scnd_modelbyte db ?
db ?
bios_SD_featurebyte1 db ?
db 4 dup (?)
BIOS_SYSTEM_DESCRIPTOR ends
;FeatureByte1 bit map equates
DMAchannel3 equ 10000000b
ScndIntController equ 01000000b
RealTimeClock equ 00100000b
KeyEscapeSeq equ 00010000b
;
;Model Byte
MDL_PC1 EQU 0FFH
MDL_XT EQU 0FEH
MDL_JR EQU 0FDH
MDL_AT EQU 0FCH
MDL_CONVERT EQU 0F9H
mdl_ps2_30 equ 0fah
mdl_ps2_80 equ 0f8h
+78
View File
@@ -0,0 +1,78 @@
;
; date_verify loosely checks bcd date values to be in range in bin_date_time
;
date_verify: ;
assume ds:code,es:nothing
cmp byte ptr bin_date_time+0,20h ; century check
ja date_error ; jmp error
jz century_20 ; jmp in 20th century
cmp byte ptr bin_date_time+0,19h ; century check
jb date_error ; jmp error
cmp byte ptr bin_date_time+1,80h ; year check
jb date_error ; jmp error
century_20: ;
cmp byte ptr bin_date_time+1,99h ; year check
ja date_error ; jmp error
cmp byte ptr bin_date_time+2,12h ; month check
ja date_error ; jmp error
cmp byte ptr bin_date_time+2,00h ; month check
jbe date_error ; jmp error
cmp byte ptr bin_date_time+3,31h ; day check
ja date_error ; jmp error
cmp byte ptr bin_date_time+3,00h ; day check
jbe date_error ; jmp error
clc ; set success flag
ret ;
date_error: ;
stc ; set error flag
ret ;
;
; time_verify very loosely checks bcd date values to be in range in bin_date_time
;
time_verify:
assume ds:code,es:nothing
cmp byte ptr bin_date_time+0,24H
ja time_error
cmp byte ptr bin_date_time+1,59H
ja time_error
cmp byte ptr bin_date_time+2,59H
ja time_error
clc
ret
time_error:
stc
ret
;
; bcd_verify checks values in bin_date_time to be valid
; bcd numerals. carry set if any nibble out of range
;
bcd_verify: ;
assume ds:code,es:nothing
mov cx,4 ; 4 bytes to check
mov bx,offset bin_date_time ;
bv_loop: ;
mov al,[bx] ; get a bcd number (0..99)
mov ah,al ;
and ax,0f00fh ; 10's place in high ah, 1's in al
cmp al,10 ; is 1's place in range?
ja bv_error ; jmp out of range
shr ah,1 ; swap nibbles
shr ah,1 ; ...
shr ah,1 ; ...
shr ah,1 ; ...
and ah,0fh ; get rid of any erroneous bits
cmp ah,10 ; is 10's place in range
ja bv_error ; jmp out of range
inc bx ; next byte
dec cx ;
jnz bv_loop ;
clc ; set success flag
ret ;
bv_error: ;
stc ; set error flag
ret ;
;
; Dos 3.30 - The real time clock structures were moved to msbio2.asm
;
+50
View File
@@ -0,0 +1,50 @@
;;Rev 3.30 Modification
;Equates for CMOS.
;----------------------------------------
; CMOS EQUATES FOR THIS SYSTEM :
;-------------------------------------------------------------------------------
CMOS_PORT EQU 070H ; I/O ADDRESS OF CMOS ADDRESS PORT
CMOS_DATA EQU 071H ; I/O ADDRESS OF CMOS DATA PORT
NMI EQU 10000000B ; DISABLE NMI INTERRUPTS MASK -
; HIGH BIT OF CMOS LOCATION ADDRESS
;---------- CMOS TABLE LOCATION ADDRESS'S ## -----------------------------------
CMOS_SECONDS EQU 000H ; SECONDS
CMOS_SEC_ALARM EQU 001H ; SECONDS ALARM ## NOTE: ALL LOCATIONS
CMOS_MINUTES EQU 002H ; MINUTES | IN THE CMOS AREA
CMOS_MIN_ALARM EQU 003H ; MINUTES ALARM | ARE IBM USE ONLY
CMOS_HOURS EQU 004H ; HOURS | AND SUBJECT TO
CMOS_HR_ALARM EQU 005H ; HOURS ALARM | CHANGE. ONLY THE
CMOS_DAY_WEEK EQU 006H ; DAY OF THE WEEK | POST & BIOS CODE
CMOS_DAY_MONTH EQU 007H ; DAY OF THE MONTH | SHOULD DIRECTLY
CMOS_MONTH EQU 008H ; MONTH | ACCESS LOCATIONS
CMOS_YEAR EQU 009H ; YEAR (TWO DIGITS) | IN CMOS STORAGE.
CMOS_REG_A EQU 00AH ; STATUS REGISTER A '-----------------
CMOS_REG_B EQU 00BH ; STATUS REGISTER B ALARM
CMOS_REG_C EQU 00CH ; STATUS REGISTER C FLAGS
CMOS_REG_D EQU 00DH ; STATUS REGISTER D BATTERY
CMOS_DIAG EQU 00EH ; POST DIAGNOSTIC STATUS RESULTS BYTE
CMOS_SHUT_DOWN EQU 00FH ; SHUTDOWN STATUS COMMAND BYTE
CMOS_DISKETTE EQU 010H ; DISKETTE DRIVE TYPE BYTE ;
; EQU 011H ; - RESERVED ;C
CMOS_DISK EQU 012H ; FIXED DISK TYPE BYTE ;H
; EQU 013H ; - RESERVED ;E
CMOS_EQUIP EQU 014H ; EQUIPMENT WORD LOW BYTE ;C
CMOS_B_M_S_LO EQU 015H ; BASE MEMORY SIZE - LOW BYTE (X1024) ;K
CMOS_B_M_S_HI EQU 016H ; BASE MEMORY SIZE - HIGH BYTE ;S
CMOS_E_M_S_LO EQU 017H ; EXPANSION MEMORY SIZE - LOW BYTE ;U
CMOS_E_M_S_HI EQU 018H ; EXPANSION MEMORY SIZE - HIGH BYTE ;M
CMOS_DISK_1 EQU 019H ; FIXED DISK TYPE - DRIVE C EXTENSION ;E
CMOS_DISK_2 EQU 01AH ; FIXED DISK TYPE - DRIVE D EXTENSION ;D
; EQU 01BH ; - 1BH THROUGH 2DH - RESERVED ;
CMOS_CKSUM_HI EQU 02EH ; CMOS CHECKSUM - HIGH BYTE ;*
CMOS_CKSUM_LO EQU 02FH ; CMOS CHECKSUM - LOW BYTE ;*
CMOS_U_M_S_LO EQU 030H ; USABLE MEMORY ABOVE 1 MEG - LOW BYTE
CMOS_U_M_S_HI EQU 031H ; USABLE MEMORY ABOVE 1 MEG - HIGH BYTE
CMOS_CENTURY EQU 032H ; DATE CENTURY BYTE (BCD)
CMOS_INFO128 EQU 033H ; 128KB INFORMATION STATUS FLAG BYTE
; EQU 034H ; - 34H THROUGH 3FH - RESERVED
;
;;End of Modification

+33
View File
@@ -0,0 +1,33 @@
;J.K. This is a temporary version of EMS function definitions needed for
;IBMBIO SYSINIT.
EMS_INT equ 67h ;interrupt vector designated for EMS.
EMS_STATUS equ 40h ;status of memery manager
EQ_PAGES equ 42h ;get number of unallocated & total pages
E_GET_HANDLE equ 43h ;allocate pages
EMAP_L_TO_P equ 44h ;Map logical to physical page
EMAP_STATE equ 4Fh ;Mapping status
GET_MAP_STATE equ 00h
GET_MAP_SIZE equ 02h
SET_MAP_STATE equ 01h
EDE_ALLOCATE equ 45h ;deallocate pages
EMS_VERSION equ 46h ;Get EMM version number
GET_PAGE_FRAME equ 58h ;Get page frame address
GET_PAGEFRAME_TAB equ 00H
GET_NUM_PAGEFRAME equ 01H
EMS_HANDLE_NAME equ 53h
SET_HANDLE_NAME equ 01h
IBM_PAGE_ID equ 255 ;Physical page id that will be used by
;IBMBIO and IBMDOS for buffer manipulation.
;MAX_NUM_PAGEFRAME equ 12 ;maximum number of page frames IBMBIO can
;handle
MAX_NUM_PAGEFRAME equ 64 ;maximum number of page frames MSBIO can
;handle
EMSVERSION equ 40h ;4.0

+23
View File
@@ -0,0 +1,23 @@
;Structure, Equtes for DEVMARK for MEM command.
DEVMARK struc
DEVMARK_ID db 0
DEVMARK_SEG dw 0
DEVMARK_SIZE dw 0
DEVMARK_DUM db 3 dup (?)
DEVMARK_FILENAME db 8 dup (' ')
DEVMARK ends
DEVMARK_STK equ 'S'
DEVMARK_DEVICE equ 'D'
DEVMARK_IFS equ 'I'
DEVMARK_BUF equ 'B'
DEVMARK_CDS equ 'L' ;lastdrive
DEVMARK_FILES equ 'F'
DEVMARK_FCBS equ 'X'
DEVMARK_INST equ 'T' ;used for SYSINIT BASE for INSTALL= command.
DEVMARK_EMS_STUB equ 'E'
SETBRKDONE equ 00000001b
FOR_DEVMARK equ 00000010b
NOT_FOR_DEVMARK equ 11111101b
+31
View File
@@ -0,0 +1,31 @@
;;Rev 3.30 Modification
;
; given a label <lbl> either 2 byte jump to another label <lbl>_J
; if it is near enough or 3 byte jump to <lbl>
;
jump macro lbl
local a
.xcref
ifndef lbl&_j ;; is this the first invocation
a:
JMP lbl
ELSE
IF (lbl&_J GE $) OR ($-lbl&_J GT 126)
a:
JMP lbl ;; is the jump too far away?
ELSE
a:
JMP lbl&_J ;; do the short one...
ENDIF
ENDIF
lbl&_j = a
.cref
endm
.xcref jump
;REDEFINE THE ABOVE MACRO TO ALWAYS TRY A 3 BYTE NEAR JUMP
JUMP MACRO LBL
JMP LBL
ENDM ;;End of Modification

+1
View File
@@ -0,0 +1 @@
70
+167
View File
@@ -0,0 +1,167 @@
#************************** makefile for bios ***************************
dest =io
msg =..\messages
dos =..\dos
inc =..\inc
hinc =..\h
#
####################### dependencies begin here. #########################
#
all: $(dest).sys
msbio.cl1: msbio.skl \
$(msg)\$(COUNTRY).msg
msload.obj: msload.asm \
makefile \
msbio.cl1 \
$(inc)\bootform.inc \
$(inc)\versiona.inc \
msload.inc
msload.com: msload.obj
link msload.obj,msload,,;
exe2bin msload.exe msload.com
msbio1.obj: msbio1.asm \
makefile \
msbdata.inc \
msgroup.inc \
jumpmac.inc \
pushpop.inc \
$(inc)\devsym.inc \
msdskpr.inc \
msmacro.inc
mscon.obj: mscon.asm \
makefile \
msgroup.inc \
jumpmac.inc \
msmacro.inc
msaux.obj: msaux.asm \
makefile \
msgroup.inc \
jumpmac.inc \
msmacro.inc
mslpt.obj: mslpt.asm \
makefile \
msgroup.inc \
msequ.inc \
$(inc)\msbds.inc \
msmacro.inc \
$(inc)\devsym.inc \
$(inc)\ioctl.inc $(inc)\bpb.inc
msclock.obj: msclock.asm \
makefile \
msgroup.inc \
msmacro.inc
msdisk.obj: msdisk.asm \
makefile \
msgroup.inc \
msequ.inc \
$(inc)\msbds.inc \
pushpop.inc \
msmacro.inc \
$(inc)\devsym.inc \
msdskpr.inc \
msioctl.inc $(inc)\ioctl.inc $(inc)\bpb.inc
msinit.obj: msinit.asm \
makefile \
msgroup.inc \
msdskpr.inc \
msequ.inc $(inc)\msbds.inc \
$(inc)\cputype.inc \
msmacro.inc \
readcloc.inc \
clocksub.inc \
msextrn.inc
sysinit1.obj: sysinit1.asm \
makefile \
msstack.inc \
msbio.cl4 \
msbio.cl5 \
stkinit.inc \
devmark.inc \
$(inc)\smifssym.inc \
$(inc)\devsym.inc \
$(inc)\ioctl.inc \
$(inc)\cputype.inc \
$(inc)\smdossym.inc $(inc)\dosmac.inc $(inc)\bpb.inc $(inc)\buffer.inc \
$(inc)\sysvar.inc $(inc)\vector.inc $(inc)\dirent.inc \
$(inc)\dpb.inc $(inc)\curdir.inc \
$(inc)\pdb.inc $(inc)\exe.inc $(inc)\sf.inc $(inc)\arena.inc \
$(inc)\intnat.inc $(inc)\mi.inc \
$(inc)\syscall.inc
sysconf.obj: sysconf.asm \
makefile \
psoption.inc \
devmark.inc \
$(inc)\psdata.inc \
$(inc)\parse.asm \
$(inc)\smifssym.inc \
$(inc)\devsym.inc \
$(inc)\ioctl.inc \
$(inc)\smdossym.inc $(inc)\dosmac.inc $(inc)\bpb.inc $(inc)\buffer.inc \
$(inc)\sysvar.inc $(inc)\vector.inc $(inc)\dirent.inc \
$(inc)\dpb.inc $(inc)\curdir.inc \
$(inc)\pdb.inc $(inc)\exe.inc $(inc)\sf.inc $(inc)\arena.inc \
$(inc)\intnat.inc $(inc)\mi.inc \
$(inc)\syscall.inc
sysinit2.obj: sysinit2.asm \
makefile \
devmark.inc \
$(inc)\copyrigh.inc \
$(inc)\smifssym.inc \
$(inc)\devsym.inc \
$(inc)\ioctl.inc \
$(inc)\smdossym.inc $(inc)\dosmac.inc $(inc)\bpb.inc $(inc)\buffer.inc \
$(inc)\sysvar.inc $(inc)\vector.inc $(inc)\dirent.inc \
$(inc)\dpb.inc $(inc)\curdir.inc \
$(inc)\pdb.inc $(inc)\exe.inc $(inc)\sf.inc $(inc)\arena.inc \
$(inc)\intnat.inc $(inc)\mi.inc \
$(inc)\syscall.inc
sysimes.obj: sysimes.asm \
makefile \
msmacro.inc \
msbio.cl3 \
msequ.inc $(inc)\msbds.inc
msbio2.obj: msbio2.asm \
makefile \
msgroup.inc \
msequ.inc \
$(inc)\msbds.inc \
$(inc)\devsym.inc \
pushpop.inc \
msmacro.inc \
msbio.cl2 \
ms96tpi.inc msvolid.inc
mshard.obj: mshard.asm $(inc)\postequ.inc $(inc)\dseg.inc
$(dest).sys: msbio.cl1 msbio1.obj mscon.obj msaux.obj \
mslpt.obj msclock.obj msdisk.obj msbio2.obj \
msinit.obj mshard.obj sysinit1.obj sysconf.obj \
sysinit2.obj sysimes.obj \
msload.com \
makefile
link @msbio.lnk
exe2bin msbio.exe msbio.bin <locscr
copy /b msload.com+msbio.bin $(dest).sys
del msbio.bin
del msbio.exe
+536
View File
@@ -0,0 +1,536 @@
%OUT MS96TPI.INC...
;==============================================================================
;REVISION HISTORY:
;AN000 - New for DOS Version 4.00 - J.K.
;AC000 - Changed for DOS Version 4.00 - J.K.
;AN00x - PTM number for DOS Version 4.00 - J.K.
;==============================================================================
;AN001 - p2781 Changeline error behavior incompatibile with DOS 3.3 1/06/88 J.K.
;==============================================================================
;
; DISK OPEN/CLOSE ROUTINES ARR 2.41
;
DSK$OPEN: ;ARR 2.41
PUBLIC DSK$OPEN
MESSAGE FTESTDISK,<"DISK OPEN ">
MNUM FTESTDISK,AX
MESSAGE FTESTDISK,<CR,LF>
; AL IS LOGICAL DRIVE
CALL SETDRIVE ;GET BDS FOR DRIVE
INC WORD PTR DS:[DI].OPCNT
JMP EXIT ;ARR 2.41
DSK$CLOSE: ;ARR 2.41
PUBLIC DSK$CLOSE
MESSAGE FTESTDISK,<"DISK CLOSE ">
MNUM FTESTDISK,AX
MESSAGE FTESTDISK,<CR,LF>
; AL IS LOGICAL DRIVE
CALL SETDRIVE ;GET BDS FOR DRIVE
CMP WORD PTR DS:[DI].OPCNT,0
JZ EXITJX ; WATCH OUT FOR WRAP ARR 2.41
DEC WORD PTR DS:[DI].OPCNT
EXITJX:
JMP EXIT
; INPUT : DS:DI POINTS TO CURRENT BDS FOR DRIVE.
; RETURN : ZERO SET IF NO OPEN FILES
; ZERO RESET IF OPEN FILES
CHKOPCNT:
MESSAGE FTEST96,<"CHECK OPEN COUNT ">
MNUM FTEST96,AX
MESSAGE FTEST96,<CR,LF>
CMP WORD PTR DS:[DI].OPCNT,0
RET
;
; AT MEDIA CHECK TIME, WE NEED TO REALLY GET DOWN AND CHECK WHAT THE CHANGE IS.
; THIS IS GUARANTEED TO BE EXPENSIVE.
;
PUBLIC MEDIACHECK
MEDIACHECK:
CALL CHECKSINGLE ; MAKE SURE CORRECT DISK IS IN PLACE
XOR SI,SI
CALL HASCHANGE
JZ MEDIARET
CALL CHECKROMCHANGE
JNZ MEDIADOVOLID
PUSH AX
PUSH DX
;SB33001****************************************************************
mov DL, DS:[DI.drivenum] ;SB ; set logical drive number ;3.30*
mov AH, 16h ;SB ; get changeline status ;3.30*
int 13h ;SB ; call rom diskette routine ;3.30*
;SB33001****************************************************************
POP DX
POP AX
JC MEDIADOVOLID
MOV SI,1 ; SIGNAL NO CHANGE
; THERE ARE SOME DRIVES WITH CHANGELINE THAT "LOSE" THE CHANGELINE INDICATION
; IF A DIFFERENT DRIVE IS ACCESSED AFTER THE CURRENT ONE. IN ORDER TO AVOID
; MISSING A MEDIA CHANGE, WE RETURN AN "I DON'T KNOW" TO DOS IF THE CHANGELINE
; IS NOT ACTIVE AND WE ARE ACCESSING A DIFFERENT DRIVE FROM THE LAST ONE.
; IF WE ARE ACCESSING THE SAME DRIVE, THEN WE CAN SAFELY RELY ON THE CHANGELINE
; STATUS.
PUBLIC LOSECHNG
LOSECHNG:
MOV BL,CS:[TIM_DRV] ; GET LAST DRIVE ACCESSED
CMP BYTE PTR [DI].DRIVENUM,BL
JZ MEDIARET
; DO THE 2 SECOND TWIDDLE. IF TIME >= 2 SECONDS, DO A VOLID CHECK.
; OTHERWISE RETURN "I DON'T KNOW" (STRICTLY SPEAKING, WE SHOULD RETURN A
; "NOT CHANGED" HERE SINCE THE 2 SECOND TEST SAID NO CHANGE.) - RS.
SAVEREG <AX,CX,DX>
CALL CHECK_TIME_OF_ACCESS
RESTOREREG <DX,CX,AX>
OR SI,SI
JZ MEDIADOVOLID ; CHECK_TIME SAYS ">= 2 SECS PASSED"
XOR SI,SI ; RETURN "I DON'T KNOW"
PUBLIC MEDIARET
MEDIARET:
RET
;
; SOMEHOW THE MEDIA WAS CHANGED. LOOK AT VID TO SEE. WE DO NOT LOOK AT FAT
; BECAUSE THIS MAY BE DIFFERENT SINCE WE ONLY SET MEDBYT WHEN DOING A READ
; OR WRITE.
;
MEDIADOVOLID:
CALL GETBP ; BUILD A NEW BPB IN CURRENT BDS
JC MEDIARET
CALL CHECK_VID
JNC MEDIARET
CALL MAPERROR ; FIX UP AL FOR RETURN TO DOS
RET
;
; SIMPLE, QUICK CHECK OF LATCHED CHANGE. IF NO INDICATION, THEN RETURN
; OTHERWISE DO EXPENSIVE CHECK. IF THE EXPENSIVE TEST FAILS, POP OFF THE
; RETURN AND SET AL = 15 (FOR INVALID MEDIA CHANGE) WHICH WILL BE RETURNED TO
; DOS.
;J.K. 9/16/86 For DOS 3.3, this will work only for the drive that has
;J.K. 9/16/86 changeline.
PUBLIC CHECKLATCHIO
CHECKLATCHIO:
; IF RETURNING FAKE BPB THEN ASSUME THE DISK HAS NOT CHANGED
; TEST WORD PTR DS:[DI].FLAGS, RETURN_FAKE_BPB
; JNZ CHECKRET
;J.K. 9/16/86
; call HasChange ;change line supported?
; jz CheckRet ;No. Just return
CALL CHKOPCNT
JNZ CHECKROM
CHECKRET:
RET
;
; CHECK FOR PAST ROM INDICATIONS. IF NO ROM CHANGE INDICATED, THEN RETURN OK.
;
PUBLIC CHECKROM
CHECKROM:
CALL CHECKROMCHANGE
JZ CHECKRET ; NO CHANGE
;
; WE NOW SEE THAT A CHANGE LINE HAS BEEN SEEN IN THE PAST. LET'S DO THE
; EXPENSIVE VERIFICATION.
;
MESSAGE FTEST96,<"CHECKROMCHANGE SAYS YES...",CR,LF>
CALL GETBP ; BUILD BPB IN CURRENT BDS
JC RET_NO_ERROR_MAP ; GETBP HAS ALREADY CALLED MAPERROR
CALL CHECK_VID
JC CHECKLATCHRET ; DISK ERROR TRYING TO READ IN.
OR SI,SI ; IS CHANGED FOR SURE?
JNS CHECKRET
CALL RETURNVID
CHECKLATCHRET:
CALL MAPERROR ; FIX UP AL FOR RETURN TO DOS
RET_NO_ERROR_MAP:
STC
POP SI ; POP OFF RETURN ADDRESS
RET
;
; CHECK THE FAT AND THE VID. RETURN IN DI -1 OR 0. RETURN WITH CARRY SET
; ONLY IF THERE WAS A DISK ERROR. RETURN THAT ERROR CODE IN AX.
;
PUBLIC CHECKFATVID
CHECKFATVID:
MESSAGE FTEST96,<"CHECK FAT",CR,LF>
CALL FAT_CHECK
OR SI,SI
JS CHANGED_DRV
;
; THE FAT WAS THE SAME. HOW ABOUT THE VOLUME ID?
;
CHECK_VID:
;J.K. Now with the extended BOOT record, the logic should be enhanced.
;If it is the extended BOOT record, then we check the volume serial
;number instead of volume id. If it is different, then set SI to -1.
;If it is same, then SI= 1 (No change).
;If it is not the extended BOOT record, then just follows the old
;logic. DOS 4.00 will check if the # of FAT in the boot record BPB
;is not 0. If it is 0 then it must be Non_FAT based system and
;should have already covered by extended boot structure checking.
;So, we will return "I don't know" by setting SI to 0.
;This routine assume the newest valid boot record is in CS:[DISKSECTOR].
;(This will be gauranteed by a successful GETBP call right before this
;routine.)
MESSAGE FTEST96,<"CHECK VID",CR,LF>
;SB34MS96TPI001*********************************************************
;SB check the EXT_Boot_Sig variable for the Extended boot signature
;SB if it is set then go to do the extended ID check otherwise continue
;SB with code below
;SB 2 LOCS
cmp cs:[Ext_Boot_Sig],Ext_Boot_Signature
jz Do_Ext_Check_Id
;SB34MS96TPI001*********************************************************
call HasChange ;AN000;
jz CheckRet ;AN000;
xor si,si ;AN000; assume I don't know.
cmp byte ptr cs:[SECPERCLUSINSECTOR]+3,0 ;AN000; Don't read vol id from
je CHECKFATRET ;AN000; the directory if not FAT system
CALL READ_VOLUME_ID
JC CHECKFATRET
CALL CHECK_VOLUME_ID
OR SI,SI
JNZ CHANGED_DRV
MESSAGE FTEST96,<"VID NOT CHANGED",CR,LF>
VID_NO_Changed:
CALL RESETCHANGED
clc ;AN000;
CHECKFATRET:
RET
CHANGED_DRV:
MOV CS:[TIM_DRV],-1 ; ENSURE THAT WE ASK ROM FOR MEDIA
RET ; CHECK NEXT TIME ROUND
;
; extended ID check
;
Do_Ext_Check_ID: ;AN000;
push ax ;AN000;
;SB34MS96TPI002**************************************************************
;SB The code to check extended ID is basically a check to see if the
;Sb volume serial number is still the same. The volume serial number
;SB previously read is in cs:[Boot_Serial_H] and cs:[Boot_Serial_L]
;SB high and low words respectively. DS:DI points to the BDS of the
;SB drive under consideration. The BDS has fields containing the
;SB high and low words of the volume serial number of the media in the
;SB drive. Compare these fields to the fields mentioned above. If these
;SB fields do not match the media has changed and so we should jump
;SB to the code starting at Ext_Changed else return "I don't know" status
;SB in the register used for the changeline status and continue executing
;SB the code given below. For temporary storage use the register which
;SB has been saved and restored around this block.
;SB 7 LOCS
;SB BDS fields in inc\msbds.inc
mov ax,cs:[Boot_Serial_L]
cmp ax,word ptr ds:[di+VOL_SERIAL]
jnz Ext_Changed
mov ax,cs:[Boot_Serial_H]
cmp ax,word ptr ds:[di+VOL_SERIAL+2]
jnz Ext_Changed
xor si,si ; don't know
;SB34MS96TPI002**************************************************************
pop ax ;AN000;
; jmp CheckFatRet ;AN000;
jmp VID_NO_Changed ;AN001;Reset the flag
Ext_Changed: ;AN000; Serial number is different!
pop ax ;AN000;
mov si, -1 ;AN000; disk changed!
clc ;AN000; clear carry. Only SI is meaningful here.
jmp Changed_Drv ;AN000;
;
; AT I/O TIME, WE DETECTED THE ERROR. NOW WE NEED TO DETERMINE WHETHER THE
; MEDIA WAS TRULY CHANGED OR NOT. WE RETURN NORMALLY IF MEDIA CHANGE UNKNOWN.
; AND WE POP OFF THE CALL AND JMP TO HARDERR IF WE SEE AN ERROR.
;
PUBLIC CHECKIO
CHECKIO:
CMP AH,06
JNZ CHECKFATRET
CALL CHKOPCNT
JZ CHECKFATRET ; NO OPEN FILES
; IF RETURNING FAKE BPB THEN IGNORE DISK CHANGES
; TEST WORD PTR DS:[DI].FLAGS, RETURN_FAKE_BPB
; JNZ IGNORECHANGE
CALL GETBP ; BUILD UP A NEW BPB IN CURRENT BDS
JC NO_ERROR_MAP ; GETBP HAS ALREADY CALLED MAPERROR
CALL CHECKFATVID
JC CHECKIORET ; DISK ERROR TRYING TO READ IN.
OR SI,SI ; IS CHANGED FOR SURE?
JS CHECKIOERR ; YES CHANGED
IGNORECHANGE:
INC BP ; ALLOW A RETRY
RET
CHECKIOERR:
CALL RETURNVID
CHECKIORET:
; POP SI ; POP OFF RETURN
STC ; MAKE SURE CARRY GETS PASSED THROUGH
JMP HARDERR
NO_ERROR_MAP:
JMP HARDERR2
;
; RETURN VID SETS UP THE VID FOR A RETURN TO DOS.
;
PUBLIC RETURNVID
RETURNVID:
MESSAGE FTEST96,<"RETURN VID",CR,LF>
PUSH DS ; SAVE POINTER TO CURRENT BDS
PUSH DI
PUSH CX
CALL INIT_VID_LOOP ; SETS ES:DI -> VID
LDS BX,CS:[PTRSAV]
MOV [BX.EXTRA],DI
MOV [BX.EXTRA+2],ES
POP CX
POP DI ; RESTORE CURRENT BDS
POP DS
MOV AH,6 ; INVALID MEDIA CHANGE
STC
RET
;
; MUNGE THE TIME OF LAST SUCCESSFUL ACCESS FOR TWEEKED DRIVES
;
; DON'T NEED ANY MORE
; TWEEKCHECK:
; PUSH AX
; MOV AX,WORD PTR DS:[DI].FLAGS
; TEST AL,FCHANGED_BY_FORMAT
; JZ TWEEKDONE
; MOV CS:[TIM_DRV],-1
; TWEEKDONE:
; POP AX
; RET
;
; DRIVE IS THE LOGICAL DRIVE TO USE
;
; FORMAT_MEDIA_CHECK: ;ARR 2.42
; PUSH AX
; MOV AX,WORD PTR DS:[DI].FLAGS
; TEST AL,FCHANGED_BY_FORMAT
; JZ RETF1 ; MEDIA NOT CHANGED VIA FORMAT
; AND AL,NOT FCHANGED_BY_FORMAT
; MOV WORD PTR [DI].FLAGS,AX ; RESET CHANGED_BY_FORMAT BIT
; MOV SI,-1 ; MEDIA CHANGED VIA FORMAT
; RETF1:
; POP AX
; RET
;
; MOVES THE POINTER TO THE VOLID FOR THE DRIVE INTO THE ORIGINAL REQUEST PACKET
; ON ENTRY, DS:BX POINTS TO THE ORIGINAL PACKET.
; NO ATTEMPT IS MADE TO PRESERVE REGISTERS.
;
MEDIA_SET_VID: ; ARR 2.42
PUBLIC MEDIA_SET_VID
CALL INIT_VID_LOOP ; SETS ES:DI -> VID
LDS BX,CS:[PTRSAV] ; GET POINTER TO PACKET
MOV WORD PTR [BX.TRANS+1],DI
MOV WORD PTR [BX.TRANS+3],ES
RET
;
; HIDENSITY - EXAMINE A DRIVE/MEDIA DESCRIPTOR TO SET THE MEDIA TYPE. IF
; THE MEDIA DESCRIPTOR IS NOT F9 (NOT 96TPI OR 3 1/2), WE RETURN AND LET THE
; CALLER DO THE REST. OTHERWISE, WE POP OFF THE RETURN AND JUMP TO THE TAIL
; OF GETBP. FOR 3.5" MEDIA, WE JUST RETURN.
;
; INPUTS: DS:DI POINT TO CORRECT BDS FOR THIS DRIVE
; AH HAS MEDIA BYTE
;
; OUTPUTS: CARRY CLEAR
; NO REGISTERS MODIFIED
; CARRY SET
; AL = SECTORS/FAT
; BH = NUMBER OF ROOT DIRECTORY ENTRIES
; BL = SECTORS PER TRACK
; CX = NUMBER OF SECTORS
; DH = SECTORS PER ALLOCATION UNIT
; DL = NUMBER OF HEADS
;
HIDENSITY:
PUBLIC HIDENSITY
;
; CHECK FOR CORRECT DRIVE
;
TEST WORD PTR DS:[DI].FLAGS,FCHANGELINE ; IS IT SPECIAL?
JZ DOFLOPPY ; NO, DO NORMAL FLOPPY TEST
;
; WE HAVE A MEDIA BYTE THAT IS PRETTY COMPLEX. EXAMINE DRIVE INFORMATION
; TABLE TO SEE WHAT KIND IT IS.
;
CMP BYTE PTR DS:[DI].FORMFACTOR,FFSMALL; IS IT SINGLE-MEDIA?
JZ DOFLOPPY ; YES, USE FATID...
;
; 96 TPI DRIVE
;
CMP AH,0F9H
JNZ DOFLOPPY
MOV AL,7 ; SEVEN SECTORS / FAT
MOV BX,224*256+0FH ; 224 ROOT DIR ENTRIES & 0F SECTOR MAX
MOV CX,80*15*2 ; 80 TRACKS, 15 SECTORS/TRACK, 2 SIDES
MOV DX,01*256+2 ; SECTORS/ALLOCATION UNIT & HEAD MAX
POPR:
ADD SP,2 ; POP OFF RETURN ADDRESS
JMP HAS1 ; RETURN TO TAIL OF GETBP
DOFLOPPY:
RET
PATHSTART 001,TPI96
;
; CERTAIN BOGUS PROGRAMS AVOID DOS ALTOGETHER AND USE INT 13 DIRECTLY. THESE
; PROGRAMS EVEN RETRY OPERATIONS AND, THUS, WILL IGNORE THE DISK CHANGE LOGIC.
;
; WE HOOK INT 13 AND NOTE ALL ERRORS.
;
ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
PUBLIC REAL13
REAL13 DD ?
OLDINT DD ?
DMY DW ?
PATHEND 001,TPI96
PUBLIC INT13
INT13 PROC FAR
POP WORD PTR OLDINT
POP WORD PTR OLDINT+2
POP DMY
MESSAGE FTEST13,<"*">
PUSHF
CALL REAL13 ; SIMULATE ANOTHER INT 13
JC ERR13 ; DID AN ERROR OCCUR?
JMP OLDINT ; NO, RETURN AND POP OFF FLAGS
ERR13:
MESSAGE FTEST13,<"INT 13 ERROR ">
MNUM FTEST13,AX
MESSAGE FTEST13,<CR,LF>
PUSHF ; SAVE STATE
CMP AH,06H ; DID I SEE A CHANGE EVENT?
JZ GOTERR ; YES
B: POPF ; NO, SOME OTHER ERROR, IGNORE IT
JMP OLDINT ; RETURN AND POP OFF FLAGS
GOTERR: OR DL,DL ; IS THIS FOR THE HARD DISK?
JS B ; YES, IGNORE
MOV WORD PTR CS:[FLAGBITS],FCHANGED
CALL SET_CHANGED_DL
JMP B
INT13 ENDP
;
; SET_CHANGED_DL - SETS FLAG BITS ACCORDING TO BITS SET IN [FLAGBITS].
; ESSENTIALLY USED TO INDICATE CHANGELINE, OR FORMAT.
;
; INPUTS: DL CONTAINS PHYSICAL DRIVE NUMBER
; [FLAGBITS] CONTAINS BITS TO SET IN THE FLAG FIELD IN THE BDSS
; OUTPUTS: NONE
; REGISTERS MODIFIED: FLAGS
;
SET_CHANGED_DL:
PUBLIC SET_CHANGED_DL
MESSAGE FTEST96,<"SET CHANGED",CR,LF>
PUSH BX
PUSH DX
MOV BL,DL
ALL_SET:
MOV DX,CS:[FLAGBITS] ; GET BITS TO SET IN FLAG FIELD
XOR BH,BH
;
; IN THE VIRTUAL DRIVE SYSTEM WE *MUST* FLAG THE OTHER DRIVES AS BEING CHANGED
;
; ASSUME FIRST BDS IS IN THIS SEGMENT
PUSH AX
PUSH DS ; SAVE CURRENT BDS
PUSH DI
LDS DI,DWORD PTR CS:[START_BDS]
SCAN_BDS:
CMP DI,-1
JZ SKIPSET
CMP BYTE PTR [DI].DRIVENUM,BL
JNZ GET_NEXT_BDS
;
; SOMEONE MAY COMPLAIN, BUT THIS *ALWAYS* MUST BE DONE WHEN A DISK CHANGE IS
; NOTED. THERE ARE *NO* OTHER COMPROMISING CIRCUMSTANCES.
;
SETCHANGED:
OR WORD PTR DS:[DI].FLAGS,DX ; SIGNAL CHANGE ON OTHER DRIVE
GET_NEXT_BDS:
MOV AX,WORD PTR [DI].LINK+2 ; GO TO NEXT BDS
MOV DI,WORD PTR [DI].LINK
MOV DS,AX
JMP SHORT SCAN_BDS
SKIPSET:
POP DI ; RESTORE CURRENT BDS
POP DS
POP AX
POP DX
POP BX
RET
;
; CHECKROMCHANGE - SEE IF EXTERNAL PROGRAM HAS DIDDLED ROM CHANGE LINE.
;
; INPUTS: DS:DI POINTS TO CURRENT BDS.
; OUTPUTS: ZERO SET - NO CHANGE
; ZERO RESET - CHANGE
; REGISTERS MODIFIED: NONE
CHECKROMCHANGE:
MESSAGE FTEST13,<"CHECKROM ">
MNUM FTEST13
MESSAGE FTEST13,<CR,LF>
TEST WORD PTR [DI].FLAGS,FCHANGED
RET
;
; RESETCHANGED - RESTORE VALUE OF CHANGE LINE
;
; INPUTS: DS:DI POINTS TO CURRENT BDS
; OUTPUTS: NONE
; REGISTERS MODIFIED: NONE
public ResetChanged
RESETCHANGED:
MESSAGE FTEST13,<"RESETCHANGED ">
MNUM FTEST13
MESSAGE FTEST13,<CR,LF>
AND WORD PTR DS:[DI].FLAGS,NOT FCHANGED
RET
;
; HASCHANGE - SEE IF DRIVE CAN SUPPLY CHANGE LINE
;
; INPUTS: DS:DI POINTS TO CURRENT BDS
; OUTPUTS: ZERO SET - NO CHANGE LINE AVAILABLE
; ZERO RESET - CHANGE LINE AVAILABLE
; REGISTERS MODIFIED: NONE
PUBLIC HASCHANGE
HASCHANGE:
MESSAGE FTEST13,<"HASCHANGE ">
MNUM FTEST13
MESSAGE FTEST13,<CR,LF>
TEST WORD PTR [DI].FLAGS,FCHANGELINE
RET
ASSUME DS:CODE
INCLUDE MSVOLID.INC
PUBLIC END96TPI
END96TPI LABEL BYTE
+281
View File
@@ -0,0 +1,281 @@
TITLE MSAUX - DOS 3.3
;----------------------------------------------------------------
; :
; A U X - AUXILARY DEVICE DRIVER :
; :
; :
; This file contains the Auxilary Device Driver. The :
; auxilary driver handles calls to and from the RS-232 port. :
; Three devices uses this code: AUX, COM1, and COM2. AUX and :
; COM1 talk to the zero RS-232 card and COM2 talks to the :
; 'one' RS-232 card. The beginning of the interrupt entry :
; point for these devices sets the variable AUXNUM in the :
; msbio.asm module. If the value is 0 the routines in this :
; file will talk to the the 'zero' card. If the value in :
; AUXNUM is 1 the routines will talk to the 'one' card. :
; The procedure GETDX is called to put the value 0 or 1 in :
; the DX register depending on the value in AUXBUF. :
; :
; The routines in this files are: :
; :
; routine function :
; ------- -------- :
; AUX$READ Read characters from the :
; specified device. :
; AUX$RDND Non-desrucrtive read with :
; no waiting. :
; AUX$FLSH Flush specified device input :
; buffer. :
; AUX$WRIT Write characters to the :
; specified device. :
; AUX$WRST Get status of specified :
; device :
; :
; These routines are not called directly. Call are made via :
; the strategy and interrupt entry point (see Device Header). :
; :
; Data structure: :
; The Aux Device has a two byte buffer called AUXBUF. The :
; first byte is for the zero card, the second byte is for the :
; one card. A zero value in the byte indicates the buffer is :
; empty. The routines use GETBX to get the address of the :
; buffer. :
; :
;----------------------------------------------------------------
;;Ver 3.30 modification ---------------------------
itest=0
INCLUDE MSGROUP.INC ;DEFINE CODE SEGMENT
INCLUDE JUMPMAC.INC
INCLUDE MSMACRO.INC
EXTRN ERR$CNT:NEAR ;MSBIO1
EXTRN GETDX:NEAR ;MSBIO1
EXTRN RDEXIT:NEAR ;MSCON
EXTRN EXIT:NEAR ;MSBIO1
EXTRN BUS$EXIT:NEAR ;MSBIO1
;DATA
EXTRN AUXBUF:BYTE ;MSDATA
; VALUES IN AH, REQUESTING FUNCTION OF INT 14H IN ROM BIOS
AUXFUNC_SEND EQU 1 ;TRANSMIT
AUXFUNC_RECEIVE EQU 2 ;READ
AUXFUNC_STATUS EQU 3 ;REQUEST STATUS
; ERROR FLAGS, REPORTED BY INT 14H
; THESE FLAGS REPORTED IN AH:
FLAG_DATA_READY EQU 01H ;DATA READY
FLAG_OVERRUN EQU 02H ;OVERRUN ERROR
FLAG_PARITY EQU 04H ;PARITY ERROR
FLAG_FRAME EQU 08H ;FRAMING ERROR
FLAG_BREAK EQU 10H ;BREAK DETECT
FLAG_TRANHOL_EMP EQU 20H ;TRANSMIT HOLDING REGISTER EMPTY
FLAG_TRANSHF_EMP EQU 40H ;TRANSMIT SHIFT REGISTER EMPTY
FLAG_TIMEOUT EQU 80H ;TIMEOUT
; THESE FLAGS REPORTED IN AL:
FLAG_DELTA_CTS EQU 01H ;DELTA CLEAR TO SEND
FLAG_DELTA_DSR EQU 02H ;DELTA DATA SET READY
FLAG_TRAIL_RING EQU 04H ;TRAILING EDGE RING INDICATOR
FLAG_DELTA_SIG EQU 08H ;DELTA RECEIVE LINE SIGNAL DETECT
FLAG_CTS EQU 10H ;CLEAR TO SEND
FLAG_DSR EQU 20H ;DATA SET READY
FLAG_RING EQU 40H ;RING INDICATOR
FLAG_REC_SIG EQU 80H ;RECEIVE LINE SIGNAL DETECT
;;End of modification ------------------
;----------------------------------------------------------------
; :
; Read zero or more characters from Auxilary Device :
; :
; input:es:[di] points to area to receive aux data :
; cx has number of bytes to be read :
; "auxnum" first byte has number of aux device (rel 0):
; :
;----------------------------------------------------------------
PUBLIC AUX$READ
AUX$READ PROC NEAR
ASSUME DS:CODE ; SET BY AUX DEVICE DRIVER ENTRY ROUTINE
jcxz EXVEC2 ; if no characters, get out
call GETBX ; put address of AUXBUF in BX
xor AX,AX ; clear AX register
xchg AL,[BX] ; Get character , if any, from
; buffer and clear buffer
or AL,AL ; if AL is nonzero there was a
; character in the buffer
jnz AUX2 ; if so skip AUXIN call
AUX1: ;
call AUXIN ; get character from port
AUX2: ;
stosb ; store character
loop AUX1 ; if more character, go around again
EXVEC2: ;
Jump EXIT ; all done, successful exit
AUX$READ ENDP
;
; AUXIN: make a call on ROM BIOS to read character from
; the auxilary device, then do some error checking.
; If an error occurs then AUXIN jumps to ERR$CNT and
; does NOT return to where it was called from.
;
AUXIN PROC NEAR
mov ah,AUXFUNC_RECEIVE
call AUXOP
;check for Frame, Parity, or Overrun errors
;WARNING: these error bits are unpredictable
; if timeout (bit 7) is set
test ah,FLAG_FRAME or FLAG_PARITY or FLAG_OVERRUN
jz AROK ;No error if all bits are clear
;Error getting character
add sp,+2 ;Remove rtn address (near call)
xor al,al
or al,FLAG_REC_SIG or FLAG_DSR or FLAG_CTS
JUMP ERR$CNT
AROK:
RET ;CHAR JUST READ IS IN AL, STATUS IS IN AH
AUXIN ENDP
;----------------------------------------------------------------
; :
; Aux non-destructive read with no waiting :
; :
; input: es:[di] points to area to receive aux data :
; :
;----------------------------------------------------------------
;
PUBLIC AUX$RDND
AUX$RDND PROC NEAR
ASSUME DS:CODE ; SET BY AUX DEVICE DRIVER ENTRY ROUTINE
call GETBX ; have BX point to AUXBUF
mov AL,[BX] ; copy contents of buffer to AL
or AL,AL ; if AL is non-zero (char in buffer)
jnz AUXRDX ; then return character
call AUXSTAT ; if not, get status of AUX device
TEST AH,FLAG_DATA_READY ;TEST DATA READY
jz AUXBUS ; then device is busy (not ready)
TEST AL,FLAG_DSR ;TEST DATA SET READY
jz AUXBUS ; then device is busy (not ready)
call AUXIN ; else aux is ready, get character
call GETBX ; have bx point to AUXBUF
mov [BX],AL ; save character in buffer
AUXRDX: ;
Jump RDEXIT ; return character
AUXBUS: ;
Jump BUS$EXIT ; jump to device busy exit
AUX$RDND ENDP
;----------------------------------------------------------------
; :
; Aux Output Status :
; :
;----------------------------------------------------------------
PUBLIC AUX$WRST
AUX$WRST PROC NEAR
ASSUME DS:CODE ; SET BY AUX DEVICE DRIVER ENTRY ROUTINE
call AUXSTAT ; get status of AUX in AX
; now test to see if device is busy
; if this bit is not set,
;;Ver 3.30 modification -----------------------
TEST AL,FLAG_DSR ;TEST DATA SET READY
jz AUXBUS ; then device is busy (not ready)
TEST AH,FLAG_TRANHOL_EMP ;TEST TRANSMIT HOLD REG EMPTY
;;End of modification -------------------------
jz AUXBUS ; then device is busy (not ready)
Jump Exit
AUX$WRST ENDP
;
; AUXSTAT makes a call on the ROM-BIOS to determine the status
; of the auxilary device
; Outputs:
; AX is filled with status of port.
; DX is changes to specify which card - either 0, 1 (, 2, 3) ;ba
; NO other registers are modified
;
AUXSTAT proc near
mov ah,AUXFUNC_STATUS
call AUXOP
ret
AUXSTAT endp
AUXOP PROC NEAR
;AH=FUNCTION CODE
;0=INIT, 1=SEND, 2=RECEIVE, 3=STATUS
call GETDX ; have DX point to proper card
int 14h ; call rom-bios for status
ret
AUXOP ENDP
;----------------------------------------------------------------
; :
; Flush AUX Input buffer - set contents of AUXBUF to zero :
; :
;----------------------------------------------------------------
PUBLIC AUX$FLSH
AUX$FLSH PROC NEAR
ASSUME DS:CODE ; SET BY AUX DEVICE DRIVER ENTRY ROUTINE
call GETBX ; get BX to point to AUXBUF
mov BYTE PTR [BX],0 ; zero out buffer
Jump Exit ; all done, successful return
AUX$FLSH ENDP
;----------------------------------------------------------------
; :
; Write to Auxilary Device :
; :
;----------------------------------------------------------------
PUBLIC AUX$WRIT
AUX$WRIT PROC NEAR
ASSUME DS:CODE ; SET BY AUX DEVICE DRIVER ENTRY ROUTINE
jcxz EXVEC2 ; if CX is zero, no characters
; to be written, jump to exit
AUX$LOOP:
mov AL,ES:[DI] ; get character to be written
inc DI ; move DI pointer to next character
;;Ver 3.30 modification ---------------------------
MOV AH,AUXFUNC_SEND ;VALUE=1, INDICATES A WRITE
CALL AUXOP ;SEND CHARACTER OVER AUX PORT
TEST AH,FLAG_TIMEOUT ;CHECK FOR ERROR
;;End of modification ---------------------------
jz AWOK ; then no error
mov AL,10 ; else indicate write fault
Jump ERR$CNT ; call error routines
; if CX is non-zero, still more
AWOK:
loop AUX$LOOP ; more characrter to print
Jump Exit ; all done, successful return
AUX$WRIT ENDP
;
; GETBX puts the address of AUXBUF (the Auxilary Device buffer)
; in BX. After calling GETBX, a routine can get to AUXBUF
; with [BX].
;
; NOTE: The getdx routine is in msbio1 and looks like:
; mov dx,word ptr cs:[auxnum]
;
GETBX PROC NEAR
call GETDX
mov BX,DX
add BX,OFFSET AUXBUF
ret
GETBX ENDP
CODE ENDS
END
+722
View File
@@ -0,0 +1,722 @@
;==============================================================================
;REVISION HISTORY:
;AN000 - New for DOS Version 3.4 - J.K.
;AC000 - Changed for DOS Version 3.4 - J.K.
;ANxxx - PTR, DCRs
;==============================================================================
;AN001 - d9 Double word MOV instruction for 80386 based machine. 7/1/87 J.K.
;AN002 - d25 Change DASD ERP to that recommended by Storage Systems. 7/29/87 J.K.
;AN003; d304 Boot record structure change for OS2 11/9/87 J.K.
;==============================================================================
EXTRN INIT:NEAR
PUBLIC START$
START$:
JMP INIT ;START$ PATCH BY INIT TO POINT TO
;HDRIVE BPB
; PUBLIC FORMAT_PATCH
;FORMAT_PATCH: ;ARR 2.42
; JMP FMTSET ;MJB001 DISPATCH FOR CALL FROM FORMAT UTILITY
PATHSTART 001,BIO
; DB 20 DUP (0) ;IBM WANTS SOME ZEROED AREA (DELETED)
;HEADER DB "Ver 2.45"
;--------------------------------------------------------------
;
; COMMAND JUMP TABLES
;
; BEWARE - THESE TABLES OVERLAP SOMEWHAT! -C.P.
;
ODD
DSKTBL LABEL BYTE
DB 24 ; THIS IS THE SIZE OF THE TABLE YUK!!!!
DW DSK$INIT
DW MEDIA$CHK
DW GET$BPB
DW CMDERR ;RS
DW DSK$READ
DW BUS$EXIT
DW EXIT
DW EXIT
DW DSK$WRIT
DW DSK$WRITV
DW EXIT ;ARR 2.41
DW EXIT ;ARR 2.41
DW CMDERR ;RS
PUBLIC TABLE_PATCH
TABLE_PATCH LABEL WORD ;ARR 2.42
DW DSK$OPEN ;ARR 2.41
DW DSK$CLOSE ;ARR 2.41
DW DSK$REM ;ARR 2.41
DW EXIT
DW EXIT
DW EXIT
DW GENERIC$IOCTL ; KGS 3.20
DW EXIT
DW EXIT
DW EXIT
DW IOCTL$GETOWN ; RS 3.20
DW IOCTL$SETOWN ; RE 3.20
ODD
CONTBL LABEL BYTE
DB 10
DW EXIT
DW EXIT
DW EXIT
DW CMDERR
DW CON$READ
DW CON$RDND
DW EXIT
DW CON$FLSH
DW CON$WRIT
DW CON$WRIT
DW EXIT ;ARR 2.41
; DW CMDERR ;J.K. 4/29/86 for CON$GENIOCTL support
; DW CMDERR ;J.K. 4/29/86
; DW CMDERR ;J.K. 4/29/86
; DW CMDERR ;J.K. 4/29/86
; DW CMDERR ;J.K. 4/29/86
; DW CMDERR ;J.K. 4/29/86
; DW CMDERR ;J.K. 4/29/86
; DW CMDERR ;J.K. 4/29/86
; DW CON$GENIOCTL ;J.K. 4/29/86
ODD
AUXTBL LABEL BYTE
DB 10
DW EXIT
DW EXIT
DW EXIT
DW CMDERR
DW AUX$READ
DW AUX$RDND
DW EXIT
DW AUX$FLSH
DW AUX$WRIT
DW AUX$WRIT
DW AUX$WRST
ODD
TIMTBL LABEL BYTE
DB 9
DW EXIT
DW EXIT
DW EXIT
DW CMDERR
DW TIM$READ
DW BUS$EXIT
DW EXIT
DW EXIT
DW TIM$WRIT
DW TIM$WRIT
ODD
PRNTBL LABEL BYTE
DB 24
DW EXIT ;INIT
DW EXIT
DW EXIT
DW CMDERR
DW EXIT$ZER ;INDICATE ZERO CHARS READ
DW BUS$EXIT
DW EXIT
DW EXIT
DW PRN$WRIT
DW PRN$WRIT
DW PRN$STAT
DW EXIT
DW EXIT ;ARR 2.41
DW EXIT ;ARR 2.41
DW EXIT ;ARR 2.41
DW EXIT ;ARR 2.41
DW PRN$TILBUSY
DW EXIT ;RS 3.20
DW EXIT ;RS 3.20
DW PRN$GENIOCTL ;RS 3.20
DW EXIT ;RS 3.20
DW EXIT ;RS 3.20
DW EXIT ;RS 3.20
DW CMDERR ;RS 3.20
DW CMDERR ;RS 3.20
EVENB
PUBLIC OLD13 ;(MOVED HERE FROM IBMBIO2)
OLD13 label DWORD
db '5986' ;J.K. 11/7/86 Secrete Code for DOS 3.30 IBMBIO.
PUBLIC ORIG13
ORIG13 label DWORD
db '21',0,0 ;J.K. 11/8/86 This is my employee serial # !!!
EVENB
PUBLIC PTRSAV
PTRSAV DD 0
PUBLIC AUXBUF
AUXBUF DB 0,0,0,0 ;SET OF 1 BYTE BUFFERS FOR COM 1,2,3, AND 4
EVENB
PUBLIC PREVOPER,NUMBER_OF_SEC
PREVOPER DW ? ; HOLDS INT 13 REQUEST (I.E. REGISTER AX).
NUMBER_OF_SEC DB ? ; HOLDS NUMBER OF SECTORS TO READ ON AN ECC ERROR
IF ($-CODE) GT 100H
%OUT VDISK BUFFER NOT CORRECTLY LOCATED
ELSE
ORG 100H
ENDIF
PUBLIC VDISK_AREA
VDISK_AREA DB 108 DUP(0) ;FOR USE BY VDISK
EVENB
; WARNING!!! THESE ARE ADDRESSED TOGETHER IN GETDX
AUXNUM DB 0 ;WHICH AUX DEVICE WAS REQUESTED
DB 0
EVENB
PUBLIC CONHEADER
CONHEADER LABEL WORD ;HEADER FOR DEVICE "CON"
DD AUXDEV2
DW 1000000000010011B ;CON IN AND CON OUT + SPECIAL
DW STRATEGY
DW CON$IN
DB 'CON '
EVENB
PUBLIC AUXDEV2
AUXDEV2 LABEL WORD ;HEADER FOR DEVICE "AUX"
DD PRNDEV2
DW 1000000000000000B
DW STRATEGY
DW AUX0$IN
DB 'AUX '
EVENB
PUBLIC PRNDEV2
PRNDEV2 LABEL WORD ;HEADER FOR DEVICE "PRN"
DD TIMDEV
DW CHARDEV + OUTTILBUSY + DEV320
DW STRATEGY
DW PRN0$IN
DB 'PRN '
EVENB
PUBLIC TIMDEV
TIMDEV LABEL WORD
DD DSKDEV
DW 1000000000001000B
DW STRATEGY
DW TIM$IN
DB 'CLOCK$ '
EVENB
PUBLIC DSKDEV
DSKDEV LABEL WORD
DD COM1DEV
DW 0000100001000010B ;J.K.I1. 32 bit sector calculation
DW STRATEGY
DW DSK$IN
DRVMAX DB 4
PUBLIC DRVMAX
PUBLIC STEP_DRV
STEP_DRV DB -2 ; ARR 2.20 LAST DRIVE ACCESSED
PUBLIC PHYS_DRV
PHYS_DRV DB 0 ; USED BY SETDRIVE FOR GETTING BDS FOR
; LOGICAL DRIVE, OR PHYSICAL DRIVE.
PUBLIC FHAVE96
FHAVE96 DB 0 ; FLAG TO INDICATE PRESENCE OF
; 96TPI SUPPORT
PUBLIC SINGLE
SINGLE DB 0 ; USED TO DETECT SINGLE DRIVE SYSTEMS
PUBLIC FHAVEK09
FHAVEK09 DB 0 ;INDICATES IF THIS IS A K09 OR NOT
; USED BY CONSOLE DRIVER.
PUBLIC NEW_ROM
NEW_ROM DB 0 ;SET TO 1 IF WE HAVE A ROM THAT CAN
; HANDLE STRANGE MEDIA LAYOUTS.
PUBLIC FSETOWNER
FSETOWNER DB ? ;=1 IF WE ARE SETTING THE OWNER OF A
;DRIVE. (EXAMINED BY CHECKSINGLE).
public Secrete_Code
Secrete_Code dw 'jk' ;J.K. 11/7/86 Secrete code for DOS 3.30 IBMBIO.
EVENB
PUBLIC COM1DEV
COM1DEV LABEL WORD
DD LPT1DEV
DW 1000000000000000B
DW STRATEGY
DW AUX0$IN
DB 'COM1 '
EVENB
PUBLIC LPT1DEV
LPT1DEV LABEL WORD
DD LPT2DEV
DW CHARDEV + OUTTILBUSY + DEV320
DW STRATEGY
DW PRN1$IN
DB 'LPT1 '
EVENB
PUBLIC LPT2DEV
LPT2DEV LABEL WORD
DD LPT3DEV
DW CHARDEV + OUTTILBUSY + DEV320
DW STRATEGY
DW PRN2$IN
DB 'LPT2 '
EVENB
PUBLIC LPT3DEV
LPT3DEV LABEL WORD
DD COM2DEV
DW CHARDEV + OUTTILBUSY + DEV320
DW STRATEGY
DW PRN3$IN
DB 'LPT3 '
EVENB
PUBLIC COM2DEV
COM2DEV LABEL WORD
DD COM3DEV
DW 1000000000000000B
DW STRATEGY
DW AUX1$IN
DB 'COM2 '
EVENB
PUBLIC COM3DEV
COM3DEV LABEL WORD ;EDK
DD COM4DEV
DW 1000000000000000B
DW STRATEGY
DW AUX2$IN
DB 'COM3 '
EVENB
PUBLIC COM4DEV
COM4DEV LABEL WORD ;EDK
DW -1,CODE
DW 1000000000000000B
DW STRATEGY
DW AUX3$IN
DB 'COM4 '
; HARD-WIRE THE LINK TO THE NEXT INT2F HANDLER.
EVENB
PUBLIC NEXT2F_13
NEXT2F_13 LABEL WORD
EXTRN INT2F_DISK:FAR ;IBMBIO2
DD INT2F_DISK
EVENB
PUBLIC START_BDS
START_BDS LABEL WORD
DD BDS1 ;START OF BDS LINKED LIST.
PUBLIC ACCESSCOUNT
ACCESSCOUNT DB 0 ; NUMBER OF TIMES MEDIA CHECK CALLED
PUBLIC TIM_DRV
TIM_DRV DB -1 ; TIME WHEN LAST DISK I/O PERFORMED
PUBLIC FLAGBITS
FLAGBITS DW 0 ; BITS TO SET IN FLAG FIELD WHEN DOING
; A SET_CHANGED_DL
PUBLIC MEDBYT
MEDBYT DB ?
EVENB
PUBLIC WRTVERIFY
WRTVERIFY LABEL WORD
PUBLIC RFLAG
RFLAG DB ROMREAD ;2 FOR READ, 3 FOR WRITE
VERIFY DB 0 ;1 IF VERIFY AFTER WRITE
PUBLIC SECCNT
SECCNT DW 0
PUBLIC HARDNUM
HARDNUM DB 99 ;LOGICAL DRIVE NUMBER OF FIRST HARDFILE
PUBLIC MOTORSTARTUP,SETTLECURRENT,SETTLESLOW
MOTORSTARTUP DB ? ; VALUE FROM TABLE
SETTLECURRENT DB ? ; VALUE FROM TABLE
SETTLESLOW DB ? ; SLOW SETTLE VALUE
NEXTSPEED DB ? ; VALUE OF SPEED TO BE USED
public save_head_sttl
Save_head_sttl db ? ;used by READ_SECTOR routine
PUBLIC EOT
EOT DB 9
EVENB
PUBLIC DPT
DPT DD ?
;KEEP THE NEXT TWO ITEMS CONTIGUOUS - SEE IOCTL_BLOCK FOR REASON
PUBLIC CURSEC,CURHD,CURTRK,SPSAV
CURSEC DB 0 ;CURRENT SECTOR
CURHD DB 0 ;CURRENT HEAD
CURTRK DW 0 ;CURRENT TRACK
SPSAV DW 0 ;SAVE THE STACK POINTER
; THE FOLLOWING ARE USED FOR IOCTL FUNCTION CALLS
PUBLIC FORMT_EOT,HDNUM,TRKNUM,GAP_PATCH
FORMT_EOT DB 8 ; EOT USED FOR FORMAT
HDNUM DB 0 ; HEAD NUMBER
TRKNUM DW 0 ; TRACK BEING MANIPULATED
GAP_PATCH DB 50H ; FORMAT GAP PATCHED INTO DPT
;DISK ERRORS RETURNED FROM THE IBM ROM
PUBLIC ERRIN
ERRIN LABEL BYTE
db 0cch ;AN002; Write Fault error
DB 80H ;NO RESPONSE
DB 40H ;SEEK FAILURE
DB 10H ;BAD CRC
DB 8 ;DMA OVERRUN
DB 6 ; MEDIA CHANGE
DB 4 ;SECTOR NOT FOUND
DB 3 ;WRITE ATTEMPT TO WRITE-PROTECT DISK
PUBLIC LSTERR
LSTERR DB 0 ;ALL OTHER ERRORS
;RETURNED ERROR CODES CORRESPONDING TO ABOVE
PUBLIC ERROUT
ERROUT LABEL BYTE
db 10 ;AN002; Write Fault error
DB 2 ;NO RESPONSE
DB 6 ;SEEK FAILURE
DB 4 ;BAD CRC
DB 4 ;DMA OVERRUN
DB 15 ; INVALID MEDIA CHANGE
DB 8 ;SECTOR NOT FOUND
DB 0 ;WRITE ATTEMPT ON WRITE-PROTECT DISK
DB 12 ;GENERAL ERROR
PUBLIC NUMERR
NUMERR = ERROUT-ERRIN
;-------------------------------------------------------------
; READ IN BOOT SECTOR HERE, READ DONE IN READBOOT.
; ALSO READ SECTOR FOR DMA CHECK FOR HARD DISK.
;J.K. The buffer for a disk sector is going to be at a double word boundary
; for 80386 machine.
IF ($-CODE) Mod 4 ;AN001;
Org ($-CODE)+4-(($-CODE) Mod 4) ;AN001;
ENDIF ;AN001;
PUBLIC DISKSECTOR
DiskSector DB 11 DUP(?) ; TAKE CARE OF 3 JUMP BYTES PLUS OEM NAME.
PUBLIC BPB_IN_SECTOR
Bpb_In_Sector DW ?
PUBLIC SECPERCLUSINSECTOR
SecPerClusInSector DB ?
DW ?
public NumberOfFats
NumberOfFats DB ?
DW ?
DW ?
PUBLIC MEDIABYTE
MediaByte DB ?
DW ?
DW ?
DW ?
DW ?
DW ? ;AN000; Extended Hidden sector (high)
DW ? ;AN000; Extended Total sector (low)
DW ? ;AN000; Extended Total sector (high)
db ? ;AN003; PHYDRV in boot record.
db ? ;AN003; CURRENT HEAD in boot record.
public Ext_Boot_Sig
Ext_Boot_Sig DB ? ;AN000; Extended Boot record sig. (=90h)
public Boot_Serial_L
Boot_Serial_L DW ? ;AN000; Boot volume serial number (Low)
public Boot_Serial_H
Boot_Serial_H DW ? ;AN000; Boot volume serial number (High)
public Boot_Volume_Label
Boot_Volume_Label DB 11 dup (' ') ;AN000; Volume label
public Boot_System_ID
Boot_System_ID DB 8 dup (' ') ;AN000; File system Id.
DB 512-($-DISKSECTOR) DUP (?)
;*********************************************************************
; "BDS" CONTAINS INFORMATION FOR EACH DRIVE IN THE SYSTEM.
; VARIOUS VALUES ARE PATCHED WHENEVER ACTIONS ARE PERFORMED.
; SECTORS/ALLOC. UNIT IN BPB INITIALLY SET TO -1 TO SIGNIFY THAT
; THE BPB HAS NOT BEEN FILLED. LINK ALSO SET TO -1 TO SIGNIFY END
; OF LIST. # OF CYLINDERS IN MAXPARMS INITIALIZED TO -1 TO INDICATE
; THAT THE PARAMETERS HAVE NOT BEEN SET.
;
EVENB
BDS1 LABEL WORD
DD BDS2 ;LINK TO NEXT STRUCTURE
DB 0 ;INT 13 DRIVE NUMBER
DB 0 ;LOGICAL DRIVE LETTER
PUBLIC FDRIVE1
FDRIVE1 DW 512 ;PHYSICAL SECTOR SIZE IN BYTES
DB -1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 64 ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 00000000B ;MEDIA DESCRIPTOR, INITIALLY 00H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 1 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT (low word)
dw 0 ;J.K. Hidden sector (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 0 ; TRUE => LARGE FATS
OPCNT1 DW 0 ;OPEN REF. COUNT
DB 3 ;FORM FACTOR
FLAGS1 DW 0020H ;VARIOUS FLAGS
; DB 9 DUP (0) ;RESERVED FOR FUTURE USE
DW 40 ; NUMBER OF CYLINDERS
; RECOMMENDED BPB FOR DRIVE.
RECBPB1 DW 512 ;BYTES PER SECTOR
DB 1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 0E0H ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 0F0H ;MEDIA DESCRIPTOR, INITIALLY F0H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 2 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT(low)
dw 0 ;J.K. Hidden sector count (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 6 DUP (?)
TRACK1 DB -1 ;LAST TRACK ACCESSED ON THIS DRIVE
TIM_LO1 DW -1 ;KEEP THESE TWO CONTIGUOUS (?)
TIM_HI1 DW -1
VOLID1 DB "NO NAME ",0 ;VOLUME ID FOR THIS DISK
VOLSER1 dd 0 ;Current volume serial number from Boot record
SYSID1 db "FAT12 ",0 ;Current file system id from Boot record
EVENB
BDS2 LABEL WORD
DD BDS3 ;LINK TO NEXT STRUCTURE
DB 0 ;INT 13 DRIVE NUMBER
DB 0 ;LOGICAL DRIVE LETTER
PUBLIC FDRIVE2
FDRIVE2 DW 512 ;PHYSICAL SECTOR SIZE IN BYTES
DB -1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 64 ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 00000000B ;MEDIA DESCRIPTOR, INITIALLY 00H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 1 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT (low word)
dw 0 ;J.K. Hidden sector (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 0 ; TRUE => LARGE FATS
OPCNT2 DW 0 ;OPEN REF. COUNT
DB 3 ;FORM FACTOR
FLAGS2 DW 0020H ;VARIOUS FLAGS
; DB 9 DUP (0) ;RESERVED FOR FUTURE USE
DW 40 ; NUMBER OF CYLINDERS
; RECOMMENDED BPB FOR DRIVE.
RECBPB2 DW 512 ;BYTES PER SECTOR
DB 1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 0E0H ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 0F0H ;MEDIA DESCRIPTOR, INITIALLY F0H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 2 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT(low)
dw 0 ;J.K. Hidden sector count (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 6 DUP (?)
TRACK2 DB -1 ;LAST TRACK ACCESSED ON THIS DRIVE
TIM_LO2 DW -1 ;KEEP THESE TWO CONTIGUOUS (?)
TIM_HI2 DW -1
VOLID2 DB "NO NAME ",0 ;VOLUME ID FOR THIS DISK
VOLSER2 dd 0 ;Current volume serial number from Boot record
SYSID2 db "FAT12 ",0 ;Current file system id from Boot record
EVENB
BDS3 LABEL WORD
DD BDS4 ;LINK TO NEXT STRUCTURE
DB 0 ;INT 13 DRIVE NUMBER
DB 0 ;LOGICAL DRIVE LETTER
PUBLIC FDRIVE3
FDRIVE3 DW 512 ;PHYSICAL SECTOR SIZE IN BYTES
DB -1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 64 ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 00000000B ;MEDIA DESCRIPTOR, INITIALLY 00H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 1 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT (low word)
dw 0 ;J.K. Hidden sector (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 0 ; TRUE => LARGE FATS
OPCNT3 DW 0 ;OPEN REF. COUNT
DB 3 ;FORM FACTOR
FLAGS3 DW 0020H ;VARIOUS FLAGS
; DB 9 DUP (0) ;RESERVED FOR FUTURE USE
DW 40 ; NUMBER OF CYLINDERS
; RECOMMENDED BPB FOR DRIVE.
RECBPB3 DW 512 ;BYTES PER SECTOR
DB 1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 0E0H ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 0F0H ;MEDIA DESCRIPTOR, INITIALLY F0H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 2 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT(low)
dw 0 ;J.K. Hidden sector count (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 6 DUP (?)
TRACK3 DB -1 ;LAST TRACK ACCESSED ON THIS DRIVE
TIM_LO3 DW -1 ;KEEP THESE TWO CONTIGUOUS (?)
TIM_HI3 DW -1
VOLID3 DB "NO NAME ",0 ;VOLUME ID FOR THIS DISK
VOLSER3 dd 0 ;Current volume serial number from Boot record
SYSID3 db "FAT12 ",0 ;Current file system id from Boot record
EVENB
BDS4 LABEL WORD
DW -1 ;LINK TO NEXT STRUCTURE
DW CODE
DB 0 ;INT 13 DRIVE NUMBER
DB 0 ;LOGICAL DRIVE LETTER
PUBLIC FDRIVE4
FDRIVE4 DW 512 ;PHYSICAL SECTOR SIZE IN BYTES
DB -1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 64 ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 00000000B ;MEDIA DESCRIPTOR, INITIALLY 00H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 1 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT (low word)
dw 0 ;J.K. Hidden sector (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 0 ; TRUE => LARGE FATS
OPCNT4 DW 0 ;OPEN REF. COUNT
DB 3 ;FORM FACTOR
FLAGS4 DW 0020H ;VARIOUS FLAGS
; DB 9 DUP (0) ;RESERVED FOR FUTURE USE
DW 40 ; NUMBER OF CYLINDERS
; RECOMMENDED BPB FOR DRIVE.
RECBPB4 DW 512 ;BYTES PER SECTOR
DB 1 ;SECTORS/ALLOCATION UNIT
DW 1 ;RESERVED SECTORS FOR DOS
DB 2 ;NO. ALLOCATION TABLES
DW 0E0H ;NUMBER DIRECTORY ENTRIES
DW 9*40 ;NUMBER SECTORS (AT 512 BYTES EA.)
DB 0F0H ;MEDIA DESCRIPTOR, INITIALLY F0H.
DW 2 ;NUMBER OF FAT SECTORS
DW 9 ;SECTOR LIMIT
DW 2 ;HEAD LIMIT
DW 0 ;HIDDEN SECTOR COUNT(low)
dw 0 ;J.K. Hidden sector count (high)
dw 0 ;J.K. Number sectors (low)
dw 0 ;J.K. Number sectors (high)
DB 6 DUP (?)
TRACK4 DB -1 ;LAST TRACK ACCESSED ON THIS DRIVE
TIM_LO4 DW -1 ;KEEP THESE TWO CONTIGUOUS (?)
TIM_HI4 DW -1
VOLID4 DB "NO NAME ",0 ;VOLUME ID FOR THIS DISK
VOLSER4 dd 0 ;Current volume serial number from Boot record
SYSID4 db "FAT12 ",0 ;Current file system id from Boot record
BPBTYPE STRUC
SPF DB ?
SPT DB ?
CDIRE DB ?
CSEC DW ?
SPA DB ?
CHEAD DB ?
BPBTYPE ENDS
PUBLIC SM92
SM92 BPBTYPE <3,9,70H,2*9*80,2,2>
;-----------------------------------------------
;
; C O N - CONSOLE DEVICE DRIVER
;
PUBLIC ALTAH
ALTAH DB 0 ;SPECIAL KEY HANDLING
public KEYRD_Func
KEYRD_Func DB 0 ;AN000; Default is conventional keyboard read
public KEYSTS_Func
KEYSTS_Func DB 1 ;AN000; Defualt if conventional keyboard status check.
; PUBLIC SAV_SC_INFO ;J.K. 4/29/86 FOR CON$GENIOCTL
; PUBLIC SAV_SC_MODE
; PUBLIC SAV_SC_COLORS
; PUBLIC SAV_SC_WIDTH
; PUBLIC SAV_SC_LENGTH
;SAV_SC_INFO LABEL BYTE
;SAV_SC_MODE DB 0
;SAV_SC_COLORS DW 0
;SAV_SC_WIDTH DW 0
;SAV_SC_LENGTH DW 0 ;J.K. 4/29/86 FOR CON$GENIOCTL
;-------------------------------------------------------------
;
; P R N - PRINTER DEVICE
;
PUBLIC PRINTDEV
PRINTDEV DB 0 ; INDEX INTO ABOVE ARRAY
; THE FOLLOWING VARIABLE CAN BE MODIFIED VIA IOCTL SUB-FUNCTION 16. IN THIS
; WAY, THE WAIT CAN BE SET TO SUIT THE SPEED OF THE PARTICULAR PRINTER BEING
; USED. ONE FOR EACH PRINTER DEVICE.
EVENB
PUBLIC WAIT_COUNT
WAIT_COUNT DW 4 DUP (50H) ; ARRAY OF RETRY COUNTS FOR PRINTER
EVENB
PUBLIC DAYCNT
DAYCNT DW 0
IF iTEST ;Testing Mode for IBMBIO.
PUBLIC NUMBUF
NUMBUF DB 5 DUP (?)
PUBLIC DIGITS
DIGITS DB "0123456789ABCDEF"
PUBLIC FTESTBITS
;FTESTBITS DW FTESTDISK+FTESTINIT
FTESTBITS DW fTestDISK
;ftestbits dw ftestclock
ENDIF
PATHEND 001,BIO

+14
View File
@@ -0,0 +1,14 @@
msbio1+
msCON+
msAUX+
msLPT+
msCLOCK+
msDISK+
msBIO2+
mshard+
msinit+
sysinit1+
sysconf+
sysinit2+
sysimes,msbio,msBIO/M;

+139
View File
@@ -0,0 +1,139 @@
;==============================================================================
;REVISION HISTORY:
;AN000 - New for DOS Version 4.0 - J.K.
;AC000 - Changed for DOS Version 4.0 - J.K.
;AN00x - PTM number for DOS Version 4.0 - J.K.
;==============================================================================
;==============================================================================
;AN001 D246, P976 Show "Bad command or parameters - ..." msg 9/22/87 J.K.
;AN002 D274 Take "file" out from "Incorrect order..." msg 10/07/87 J.K.
;AN003 D486 Share installation for large media 02/24/88 J.K.
;==============================================================================
;===================
:class 1
;===================
; MESSAGES FOR THE IBM BOOT SECTOR. NUL Terminated.
; This is used by IBMBOOT and IBMLOAD program and it stays in IBMBOOT directory.
;For IBMLOAD program
;SYSMSG DB 13,10,"Non-System disk or disk error",13,10
; DB "Replace and strike any key when ready",13,10,0
:use 001 BOOT SYSMSG
;===================
:class 2
;===================
; SCCSID = @(#)biomes.asm 1.2 85/07/25
; SINGLE DRIVE MESSAGE FOR IBMBIO.COM. NUL TERMINATED.
;IFNDEF PATHSTART
;PATHSTART MACRO INDEX,ABBR
; IFDEF PATHGEN
; PUBLIC ABBR&INDEX&S,ABBR&INDEX&E
; ABBR&INDEX&S LABEL BYTE
; ENDIF
; ENDM
;ENDIF
;
;IFNDEF PATHEND
;PATHEND MACRO INDEX,ABBR
; IFDEF PATHGEN
; ABBR&INDEX&E LABEL BYTE
; ENDIF
; ENDM
;ENDIF
; PATHSTART 001,BIOMS
:def 20 SNGMSG DB 13,10,"Insert diskette for drive "
:def 21 DRVLET DB "A: and strike",13,10,"any key when ready",13,10,10,0
; PATHEND 001,BIOMS
;==================
:class 3
;==================
; PRINTED when there is a bad command in CONFIG.SYS. '$' TERMINATED, note
; that this message includes crlfm!
;PATHSTART 001,SYSMES
:def 03 BADOPM DB 13,10,"Unrecognized command in CONFIG.SYS"
;BADSIZ_POST LABEL BYTE
;BADLD_POST LABEL BYTE
:def 04 CRLFM DB 13,10,'$'
:def 22 BadParm db 13,10,"Bad command or parameters - $" ;AN001;
;PRINTED when installed device specifies too large a sector size.'$' terminated.
; FORM: <BADSIZ_PRE>device name<BADSIZ_POST>
:def 05 BADSIZ_PRE DB 13,10,"Sector size too large in file $"
;PRINTED when installed device cannot be found. '$' terminated.
; FORM: <BADLD_PRE>device name<BADLD_POST>
:def 06 BADLD_PRE DB 13,10,"Bad or missing $"
;PRINTED when command interpreter is not found. NUL terminated.
; FORM: <BADLD_PRE><BADCOM><BADLD_POST>
:def 07 BADCOM DB "Command Interpreter",0
;PRINTED when country code, code page combination was not found in country.sys file. '$' terminated.
; FORM: <BADCOUNTRY>
:def 08 BADCOUNTRY DB 13,10,"Invalid country code or code page",13,10,"$"
;PRINTED when code page id is missing or wrong syntax. - J.K.
; FORM: <BADCOUNTRYCOM>
:def 09 BADCOUNTRYCOM DB 13,10,"Error in COUNTRY command",13,10,"$"
;PRINTED when the memory left is not sufficient to handle COUTRY.SYS file
; FORM: <INSUFMEMORY>
:def 10 INSUFMEMORY DB 13,10, "Insufficient memory for COUNTRY.SYS file",13,10,"$"
; PRINTED when there is insufficient memory. '$' TERMINATED, note
; that this message includes crlfm!
:def 11 BADMEM DB 13,10,"Configuration too large for memory",13,10,"$"
; PRINTED when the attempt is made to install a block device which would
; have a drive letter > 'Z'
:def 12 BADBLOCK DB 13,10,"Too many Block Devices",13,10,"$"
; PRINTED when the attempt is made to install a stack with invalid
; combinations of # of stacks, stack size. - J.K. 5/23/86
:def 13 BADSTACK DB 13,10,"Invalid STACK parameters",13,10,"$"
;AN000; - PRINTED when encountering a command that is not "install=" after
; we had a "Install=" command. - J.K.I1.
; Translation::: Please leave the last blank space at the end of the line
; as it is.
:def 14 BADORDER DB 13,10,"Incorrect order in CONFIG.SYS line ","$"
;AN000; - PRINTED when the command failed.
; Translation::: Please leave the last blank space at the end of the line
; as it is.
:def 15 ERRORCMD DB "Error in CONFIG.SYS line ","$"
;AN003; - PRINTED when SHARE.EXE is not loaded and has a large media > 32 MB.
:def 23 SHAREWARNMSG db "WARNING! SHARE should be loaded for large media",13,10,"$"
;==================
:class 4
;==================
;IBMBIO SYSINIT
;Message for SYSINIT_BASE program.
:def 16 Mem_alloc_err db 13,10,"Memory allocation error","$"
;==================
:class 5
;==================
; %OUT STKMES.INC...
; SCCSID = @(#)stkmes.inc 1.0 86/10/21
; PUBLIC FATAL_MSG
:def 17 FATAL_MSG DB 0DH,0AH,7,0DH,0AH
DB "Internal stack overflow",0DH,0AH
DB "System halted",0DH,0AH,"$"
;
:END
+645
View File
@@ -0,0 +1,645 @@
PAGE ,132 ;
TITLE MSBIO1.asm - BIOS
;==============================================================================
;REVISION HISTORY:
;AN000 - New for DOS Version 4.00 - J.K.
;AC000 - Changed for DOS Version 4.00 - J.K.
;AN00x - PTM number for DOS Version 4.00 - J.K.
;==============================================================================
COMMENT *
THE LINK STEP IS PERFORMED BY USING THE FOLLOWING "NEW.ARF" FILE:
msbio1+
msSTACK+
MsCON+
msAUX+
msLPT+
msCLOCK+
msdISK+
msBIO2+
C:\BIO2\OLDOBJ\disk+
C:\BIO2\OLDOBJ\msinit+
C:\BIO2\OLDOBJ\sysinit1+
C:\BIO2\OLDOBJ\sysinit2+
C:\BIO2\OLDOBJ\sysimes,msbio,/M;
THE FOLLOWING IS A BATCH FILE THAT CAN BE USED TO CREATE THE IBMBIO.COM
WHERE "LOCSCR" IS A FILE THAT JUST HAS THE NUMBER, 70:
link @NEW.ARF
exe2bin ibmbio ibmbio.com <C:\BIO2\Locscr
del ibmbio.exe
(END OF COMMENT)*
;***For testing purposes, set the TEST flag to 1. Otherwise reset it.
iTEST=0
PATHGEN = 1
.SALL
%OUT ...MSBIO1.ASM
; THIS IS A DOSMAC MACRO WHICH IS USED IN DEVSYM WHICH IS INCLUDED LATER
BREAK MACRO SUBTITLE
SUBTTL SUBTITLE
PAGE
ENDM
POPFF MACRO
JMP $+3
IRET
PUSH CS
CALL $-2
ENDM
INCLUDE MSGROUP.INC ;DEFINE CODE SEGMENT
SYSINITSEG SEGMENT PUBLIC 'SYSTEM_INIT'
SYSINITSEG ENDS
INCLUDE JUMPMAC.INC
PATHSTART MACRO INDEX,ABBR
IFDEF PATHGEN
PUBLIC ABBR&INDEX&S,ABBR&INDEX&E
ABBR&INDEX&S LABEL BYTE
ENDIF
ENDM
PATHEND MACRO INDEX,ABBR
IFDEF PATHGEN
ABBR&INDEX&E LABEL BYTE
ENDIF
ENDM
INCLUDE PUSHPOP.INC
INCLUDE DEVSYM.INC ;MJB001
; REV 2.1 5/1/83 ARR ADDED TIMER INT HANDLER AND CHANGED ORDER OF AUX
; PRN INIT FOR HAL0
;
; REV 2.15 7/13/83 ARR BECAUSE IBM IS FUNDAMENTALY BRAIN DAMAGED, AND
; BASCOM IS RUDE ABOUT THE 1CH TIMER INTERRUPT, THE TIMER
; HANDLER HAS TO GO BACK OUT!!!!! IBM SEEMS UNWILLING TO
; BELIEVE THE PROBLEM IS WITH THE BASCOM RUNTIME, NOT THE
; DOS. THEY HAVE EVEN BEEN GIVEN A PATCH FOR BASCOM!!!!!
; THE CORRECT CODE IS COMMENTED OUT AND HAS AN ARR 2.15
; ANNOTATION. THIS MEANS THE BIOS WILL GO BACK TO THE
; MULTIPLE ROLL OVER BUG.
; REV 2.20 8/5/83 ARR IBM MAKES HARDWARE CHANGE. NOW WANTS TO USE HALF
; HIGHT DRIVES FOR HAL0, AND BACK FIT FOR PC/PC XT. PROBLEM
; WITH HEAD SETTLE TIME. PREVIOUS DRIVES GOT BY ON A 0
; SETTLE TIME, 1/2 HIGHT DRIVES NEED 15 HEAD SETTLE WHEN
; DOING WRITES (0 OK ON READ) IF THE HEAD IS BEING STEPPED.
; THIS REQUIRES A LAST TRACK VALUE TO BE KEPT SO THAT BIOS
; KNOWS WHEN HEAD IS BEING MOVED. TO HELP OUT STUPID
; PROGRAMS THAT ISSUE INT 13H DIRECTLY, THE HEAD SETTLE WILL
; NORMALLY BE SET TO 15. IT WILL BE CHANGED TO 0 ON READS,
; OR ON WRITES WHICH DO NOT REQUIRE HEAD STEP.
; REV 2.21 8/11/83 MZ IBM WANTS WRITE WITH VERIFY TO USE HEAD SETTLE 0.
; USE SAME TRICK AS ABOVE.
; REV 2.25 6/20/83 MJB001 ADDED SUPPORT FOR 96TPI AND SALMON
; REV 2.30 6/27/83 MJB002 ADDED REAL-TIME CLOCK
; REV 2.40 7/8/83 MJB003 ADDED VOLUME-ID CHECKING AND INT 2F MACRO
; DEFINITIONS PUSH* AND POP*
; REV 2.41 7/12/83 ARR MORE 2.X ENHANCEMENTS. OPEN/CLOSE MEDIA CHANGE
; REV 2.42 11/3/83 ARR MORE 2.X ENHANCEMENTS. DISK OPEN/CLOSE, FORMAT
; CODE AND OTHER MISC HOOKED OUT TO SHRINK BIOS. CODE FOR
; DISK OPEN/CLOSE, FORMAT INCLUDED ONLY WITH 96TPI DISKS.
; REV 2.43 12/6/83 MZ EXAMINE BOOT SECTORS ON HARD DISKS FOR 16-BIT FAT
; CHECK. EXAMINE LARGE FAT BIT IN BPB FOR WALK OF MEDIA FOR
; DOS
; REV 2.44 12/9/83 ARR CHANGE TO ERROR REPORTING ON INT 17H
; REV 2.45 12/22/83 MZ MAKE HEAD SETTLE CHANGE ONLY WHEN DISK PARM IS 0.
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;
; IBM ADDRESSES FOR I/O
;
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
INCLUDE MSDSKPR.INC
LF = 10 ;LINE FEED
CR = 13 ;CARRIAGE RETURN
BACKSP = 8 ;BACKSPACE
BRKADR = 1BH * 4 ;006C 1BH BREAK VECTOR ADDRESS
TIMADR = 1CH * 4 ;0070 1CH TIMER INTERRUPT
DSKADR = 1EH * 4 ;ADDRESS OF PTR TO DISK PARAMETERS
SEC9 = 522H ;ADDRESS OF DISK PARAMETERS
HEADSETTLE = SEC9+9 ; ARR 2.20 ADDRESS OF HEAD SETTLE TIME
NORMSETTLE = 15 ; ARR 2.20 NORMAL HEAD SETTLE
SPEEDSETTLE = 0 ; ARR 2.20 SPEED UP SETTLE TIME
INITSPOT = 534H ; ARR IBM WANTS 4 ZEROS HERE
AKPORT = 20H
EOI = 20H
ASSUME CS:CODE,DS:NOTHING,ES:NOTHING
EXTRN MEDIA$CHK:NEAR
EXTRN GET$BPB:NEAR
EXTRN DSK$INIT:NEAR
EXTRN DSK$READ:NEAR
EXTRN DSK$WRIT:NEAR
EXTRN DSK$WRITV:NEAR
EXTRN DSK$OPEN:NEAR
EXTRN DSK$CLOSE:NEAR
EXTRN DSK$REM:NEAR
EXTRN GENERIC$IOCTL:NEAR
EXTRN IOCTL$GETOWN:NEAR
EXTRN IOCTL$SETOWN:NEAR
EXTRN CON$READ:NEAR
EXTRN CON$RDND:NEAR
EXTRN CON$FLSH:NEAR
EXTRN CON$WRIT:NEAR
; EXTRN CON$GENIOCTL:NEAR ;J.K. 4/29/86
EXTRN AUX$READ:NEAR
EXTRN AUX$WRIT:NEAR
EXTRN AUX$FLSH:NEAR
EXTRN AUX$RDND:NEAR
EXTRN AUX$WRST:NEAR
EXTRN TIM$READ:NEAR
EXTRN TIM$WRIT:NEAR
EXTRN PRN$WRIT:NEAR
EXTRN PRN$STAT:NEAR
EXTRN PRN$TILBUSY:NEAR
EXTRN PRN$GENIOCTL:NEAR
EXTRN WRMSG:NEAR
;DATA AREAS
extrn Start_Sec_H:word ;AN000; Starting sector high word for
;disk I/O request. IBMDISK.ASM
INCLUDE MSBDATA.INC
IF iTEST
PUBLIC MSGNUM
MSGNUM:
PUSHF
TEST FTESTBITS,AX
JZ MRET
PUSH SI
PUSH BX
PUSH CX
PUSH ES
PUSH DI
MOV DI,OFFSET NUMBUF
PUSH CS
POP ES
MOV CX,4
NUMLOOP:
PUSH CX
MOV CL,4
ROL BX,CL
POP CX
PUSH BX
AND BX,0FH
MOV AL,DIGITS[BX]
STOSB
POP BX
LOOP NUMLOOP
POP DI
POP ES
POP CX
POP BX
MOV SI,OFFSET NUMBUF
CALL MSGOUT
POP SI
POPF
RET
PUBLIC MSGOUT
MSGOUT:
PUSHF
TEST FTESTBITS,AX
JZ MRET
PUSH DS
PUSH AX
PUSH BX
PUSH CS
POP DS
CALL WRMSG
POP BX
POP AX
POP DS
MRET:
POPF
RET
PUBLIC DUMPBYTES ;J.K. 4/9/86
;Dumpbytes will dump the bytes in memory in hex. Space will be put in between
;the bytes and CR, LF will be put at the end. - J.K.
;Input: DS:SI -> buffer to dump in Hex.
; CX -> # of bytes (Length of the buffer)
;
DUMPBYTES proc near
pushf
push ax
dumploops:
lodsb
mov ah, al
shr ah, 1
shr ah, 1
shr ah, 1
shr ah, 1
call hex_to_ascii
push ax
mov al, ah
call outchar
pop ax
call outchar
mov al, ' '
call outchar
loop dumploops
mov al, 0dh
call outchar
mov al, 0ah
call outchar
pop ax
popf
ret
DUMPBYTES endp
PUBLIC Hex_to_ascii
Hex_to_ascii proc near ;J.K. - 4/9/86
and ax, 0f0fh
add ah, 30h
cmp ah, 3ah
jb hta_$1
add ah, 7
hta_$1:
add al, 30h
cmp al, 3ah
jb hta_$2
add al, 7
hta_$2:
ret
Hex_to_ascii endp
PUBLIC outchar
Outchar proc near
PUSH AX
PUSH SI
PUSH DI
PUSH BP
PUSH BX
;SB33002*******************************************************
MOV AH, 0Eh ;SET COMMAND TO WRITE A CHAR ;SB;3.30*
MOV BX, 7 ;SET FOREGROUND COLOR ;SB;3.30*
INT 10h ;CALL ROM-BIOS ;SB;3.30*
;SB33002*******************************************************
POP BX
POP BP
POP DI
POP SI
POP AX
RET
Outchar endp
ENDIF
INCLUDE MSMACRO.INC
;---------------------------------------------------
;
; DEVICE ENTRY POINT
;
CMDLEN = 0 ;LENGTH OF THIS COMMAND
UNIT = 1 ;SUB UNIT SPECIFIER
CMD = 2 ;COMMAND CODE
STATUS = 3 ;STATUS
MEDIA = 13 ;MEDIA DESCRIPTOR
TRANS = 14 ;TRANSFER ADDRESS
COUNT = 18 ;COUNT OF BLOCKS OR CHARACTERS
START = 20 ;FIRST BLOCK TO TRANSFER
EXTRA = 22 ;USUALLY A POINTER TO VOL ID FOR ERROR 15
START_L = 26 ;AN000; Extended start sector (Low)
START_H = 28 ;AN000; Extended start sector (High)
PUBLIC STRATEGY
STRATEGY PROC FAR
MOV WORD PTR CS:[PTRSAV],BX
MOV WORD PTR CS:[PTRSAV+2],ES
RET
STRATEGY ENDP
PUBLIC CON$IN
CON$IN PROC FAR
PUSH SI
MOV SI,OFFSET CONTBL
JMP SHORT ENTRY
CON$IN ENDP
PUBLIC AUX0$IN
AUX0$IN PROC FAR
PUSH SI
PUSH AX
XOR AL,AL
JMP SHORT AUXENT
AUX0$IN ENDP
PUBLIC AUX1$IN
AUX1$IN PROC FAR
PUSH SI
PUSH AX
MOV AL,1
JMP short AUXENT ;J.K. 4/15/86
AUX1$IN ENDP
;SB33102****************************************************************
;SB Add code to handle two more COM Ports
;boban
PUBLIC AUX2$IN
AUX2$IN proc far
push si
push ax
mov al,2
jmp short AUXENT
AUX2$IN endp
PUBLIC AUX3$IN
AUX3$IN proc far
push si
push ax
mov al,3
jmp short AUXENT
;SB33102****************************************************************
AUXENT:
MOV SI,OFFSET AUXTBL
JMP SHORT ENTRY1
AUX3$IN ENDP
PRN0$IN PROC FAR
PUBLIC PRN0$IN
PUSH SI
PUSH AX
XOR AX,AX
JMP SHORT PRNENT
PRN0$IN ENDP
PUBLIC PRN1$IN
PRN1$IN PROC FAR
PUSH SI
PUSH AX
XOR AL,AL
MOV AH,1
JMP SHORT PRNENT
PRN1$IN ENDP
PUBLIC PRN2$IN
PRN2$IN PROC FAR
PUSH SI
PUSH AX
MOV AL,1
MOV AH,2
JMP SHORT PRNENT
PRN2$IN ENDP
PUBLIC PRN3$IN
PRN3$IN PROC FAR
PUSH SI
PUSH AX
MOV AL,2
MOV AH,3
PRNENT:
MOV SI,OFFSET PRNTBL
MOV CS:[PRINTDEV],AH ;SAVE INDEX INTO ARRAY OF RETRY COUNTS
JMP SHORT ENTRY1
PRN3$IN ENDP
PUBLIC TIM$IN
TIM$IN PROC FAR
PUSH SI
MOV SI,OFFSET TIMTBL
JMP SHORT ENTRY
TIM$IN ENDP
PUBLIC DSK$IN
DSK$IN PROC FAR
PUSH SI
MOV SI,OFFSET DSKTBL
ENTRY:
PUSH AX
ENTRY1:
PUSH CX
PUSH DX
PUSH DI
PUSH BP
PUSH DS
PUSH ES
PUSH BX
MOV CS:[AUXNUM],AL ;SAVE CHOICE OF AUX/PRN DEVICE
LDS BX,CS:[PTRSAV] ;GET POINTER TO I/O PACKET
ASSUME DS:NOTHING
MOV AL,BYTE PTR DS:[BX].UNIT ;AL = UNIT CODE
MOV AH,BYTE PTR DS:[BX].MEDIA ;AH = MEDIA DESCRIP
MOV CX,WORD PTR DS:[BX].COUNT ;CX = COUNT
MOV DX,WORD PTR DS:[BX].START ;DX = START SECTOR
;SB34MSB100*********************************************************************
;SB
;SB The disk device driver can now handle 32 bit start sector number.
;SB So we should check to see if a 32 bit sector number has been specified
;SB and if so get it. Whether a 32 bit sector has been specified or not
;SB the disk driver expects a 32 bit sector number with the high word
;SB in cs:Start_Sec_H and the low word in dx.
;SB
;SB Algorithm:
;SB 1. Check to see if the request is for the disk driver by
;SB checking to see if SI points to DSKTBL.
;SB
;SB 2. If request not for the disk nothing special needs to be done.
;SB
;SB 3. If request for the disk then check to see if a 32 bit
;SB sector number has been specified by seeing whether the
;SB the conventional sector number specified is -1. If so
;SB we need to pick the 32 bit sector number from the new
;SB fields in the request packet. See the request header
;SB struc for the fields you need. If the conventional
;SB sector field is not -1 then a 16 bit sector number
;SB has been specified and we just need to initalise the
;SB high word in cs:Start_Sec_H to 0
;SB
;SB NOTE: START_L and START_H are the offsets withing the IO_REQUEST packet
;SB which contain the low and hi words of the 32 bit start sector if
;SB it has been used.
;SB
;SB NOTE:Remember not to destroy the registers which have been set up before
CMP SI,OFFSET DSKTBL
JNZ DSK_REQ_CONT ; Not Disk Req
CMP DX,-1
JNZ DSK_REQ_16
MOV DX,DS:[BX].START_H ; 32 bits DSK REQ
MOV CS:START_SEC_H,DX ; CS:Start_sec_H = Packet.Start_H
MOV DX,DS:[BX].START_L ; DX = Packet.Start_L
JMP SHORT DSK_REQ_CONT
DSK_REQ_16:
MOV CS:START_SEC_H,0
DSK_REQ_CONT:
;SB34MSB100*********************************************************************
XCHG DI,AX
MOV AL,BYTE PTR DS:[BX].CMD
CMP AL,CS:[SI] ;ARR 2.41
JA CMDERR
CBW ; NOTE THAT AL <= 15 MEANS OK
SHL AX,1
ADD SI,AX
XCHG AX,DI
LES DI,DWORD PTR DS:[BX].TRANS
PUSH CS
POP DS
ASSUME DS:CODE
CLD
JMP WORD PTR [SI+1] ;GO DO COMMAND
DSK$IN ENDP
PAGE
;=====================================================
;=
;= SUBROUTINES SHARED BY MULTIPLE DEVICES
;=
;=====================================================
;----------------------------------------------------------
;
; EXIT - ALL ROUTINES RETURN THROUGH THIS PATH
;
PUBLIC BUS$EXIT
BUS$EXIT PROC FAR
ASSUME DS:NOTHING
MOV AH,00000011B
JMP SHORT ERR1
PUBLIC CMDERR
CMDERR:
MOV AL,3 ;UNKNOWN COMMAND ERROR
PUBLIC ERR$CNT
ERR$CNT:
LDS BX,CS:[PTRSAV]
ASSUME DS:NOTHING
SUB WORD PTR [BX].COUNT,CX ;# OF SUCCESSFUL I/O'S
PUBLIC ERR$EXIT
ERR$EXIT:
MOV AH,10000001B ;MARK ERROR RETURN
JMP SHORT ERR1
BUS$EXIT ENDP
EXITP PROC FAR
ASSUME DS:CODE ; WE ARE NOT SURE THIS IS CORRECT 3/18/86
EXIT$ZER:
LDS BX,[PTRSAV]
ASSUME DS:NOTHING
XOR AX,AX
MOV WORD PTR [BX].COUNT,AX ;INDICATE NO CHARS READ
PUBLIC EXIT
EXIT:
ASSUME DS:NOTHING
MOV AH,00000001B
ERR1:
ASSUME DS:NOTHING
LDS BX,CS:[PTRSAV]
MOV WORD PTR [BX].STATUS,AX ;MARK OPERATION COMPLETE
POP BX
POP ES
POP DS
POP BP
POP DI
POP DX
POP CX
POP AX
POP SI
RET ;RESTORE REGS AND RETURN
EXITP ENDP
;-------------------------------------------------------------
;
; CHROUT - WRITE OUT CHAR IN AL USING CURRENT ATTRIBUTE
;
; CALLED VIA INT 29H
;
PUBLIC CHROUT
CHROUT = 29H
PUBLIC OUTCHR
OUTCHR PROC FAR
PUSH AX
PUSH SI
PUSH DI
PUSH BP
;SB33002a*******************************************************
push bx ; ;SB ;3.30
mov AH, 0Eh ; set command to write a character;SB;3.30
mov BX, 7 ; set foreground color ;SB ;3.30
int 10h ; call rom-bios ;SB ;3.30
pop bx ; ;SB ;3.30
;SB33002a*******************************************************
POP BP
POP DI
POP SI
POP AX
IRET
OUTCHR ENDP
;----------------------------------------------
;
; SET DX TO AUXNUM
;
PUBLIC GETDX
GETDX PROC NEAR
MOV DX,WORD PTR CS:[AUXNUM]
RET
GETDX ENDP
PAGE
;************************************************** ARR 2.15
;-----------------------------------------------
;
; TIMER INTERRUPT HANDLER
;
;TIMER_LOW DW 0
;TIMER_HIGH DW 0
;
;TIMER:
; STI
; PUSH AX
; PUSH CX
; PUSH DX
; PUSH DS
; PUSH CS
; POP DS
; XOR AX,AX
; INT 1AH ; GET ROM TIME AND ZAP ROLL OVER
; MOV [TIMER_HIGH],CX
; MOV [TIMER_LOW],DX
; OR AL,AL
; JZ T5
; INC WORD PTR [DAYCNT] ; ONE DAY GONE BY
;T5:
; POP DS
; POP DX
; POP CX
; POP AX
; IRET
;************************************************** ARR 2.15
CODE ENDS
END

Some files were not shown because too many files have changed in this diff Show More