diff --git a/.cproject b/.cproject
new file mode 100644
index 0000000..fe70397
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.project b/.project
new file mode 100644
index 0000000..38b48c0
--- /dev/null
+++ b/.project
@@ -0,0 +1,26 @@
+
+
+ uBix-Retro
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
new file mode 100644
index 0000000..9b4679b
--- /dev/null
+++ b/.settings/language.settings.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dump/oa-2.0.9/COPYING b/dump/oa-2.0.9/COPYING
new file mode 100644
index 0000000..a43ea21
--- /dev/null
+++ b/dump/oa-2.0.9/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C) 19yy
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/dump/oa-2.0.9/Makefile b/dump/oa-2.0.9/Makefile
new file mode 100644
index 0000000..2d9d047
--- /dev/null
+++ b/dump/oa-2.0.9/Makefile
@@ -0,0 +1,27 @@
+
+version="2.0.9"
+
+all:
+ (cd apps; ${MAKE};)
+
+clean:
+ (cd arch; ${MAKE} clean;)
+ (cd apps; ${MAKE} clean;)
+ (cd sysapps; ${MAKE} clean;)
+ (cd kernel; ${MAKE} clean;)
+
+tars:
+ tar czhvf ../oa-${version}.lib.tar.gz apps \
+ include/lib6502.i65 include/kdefs.i65 include/inet.i65
+ (cd ..; \
+ tar czhvf oa-${version}.base.tar.gz \
+ --exclude oa-${version}/arch/csa65 \
+ --exclude oa-${version}/arch/gecko \
+ --exclude oa-${version}/sysapps/basic \
+ --exclude oa-${version}/sysapps/irtx \
+ oa-${version} ;\
+ tar czhvf oa-${version}.tar.gz \
+ oa-${version} ;\
+ )
+
+
diff --git a/dump/oa-2.0.9/README.1st b/dump/oa-2.0.9/README.1st
new file mode 100644
index 0000000..d193fb2
--- /dev/null
+++ b/dump/oa-2.0.9/README.1st
@@ -0,0 +1,27 @@
+
+This is the OS/A65 source.
+(c) 1989-2013 A. Fachat (afachat@gmx.de)
+
+This comes of course with no warranty in any form. See
+the file COPYING for the GNU public license.
+
+The doc directory contains all necessary documentation (in html mostly).
+I propose reading doc/index.html with your favourite html browser first.
+
+kernel, lib6502, oldlib, devices and include are general source directories.
+
+apps holds pure lib6502 applications, like a shell, mkdir, etc.
+They should also assemble for other lib6502 operating systems.
+
+sysapps holds OS/A65 specific programs, like the monitor, slipd, or the
+filesystem servers.
+
+The arch directory holds the architecture specific part. Almost everything
+in here is pretty system independent. The arch directory contains a directory
+for each supported architecture. "proto" holds a prototype architecture
+that can be used for porting.
+
+Have fun!
+
+26jan1998 A. Fachat
+
diff --git a/dump/oa-2.0.9/apps/Makefile b/dump/oa-2.0.9/apps/Makefile
new file mode 100644
index 0000000..b03c8c1
--- /dev/null
+++ b/dump/oa-2.0.9/apps/Makefile
@@ -0,0 +1,14 @@
+
+# appdirs= lsh file inet
+# appdirs= $(wildcard [a-z]*)
+
+all:
+ (for i in * ; do\
+ (if test -d $$i; then cd $$i; ${MAKE}; fi;); \
+ done)
+
+clean:
+ (for i in * ; do\
+ (if test -d $$i; then cd $$i; ${MAKE} clean; fi;); \
+ done)
+
diff --git a/dump/oa-2.0.9/apps/README b/dump/oa-2.0.9/apps/README
new file mode 100644
index 0000000..ff2c1be
--- /dev/null
+++ b/dump/oa-2.0.9/apps/README
@@ -0,0 +1,8 @@
+
+The "apps" directory contains the source for stdlib programs, i.e.
+programs that do _not_ use the kernel and do _not_ use hardware specifics.
+
+lsh: lib6502 shell interpreter
+
+file: lib6502 file utilities, like rmdir, mkdir, ls, rm
+
diff --git a/dump/oa-2.0.9/apps/file/Makefile b/dump/oa-2.0.9/apps/file/Makefile
new file mode 100644
index 0000000..1eb717a
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/Makefile
@@ -0,0 +1,23 @@
+
+files= mkdir rmdir rm chkdsk format ls cat mv
+
+all: ${files}
+
+${files}: %: %.a65
+ xa -I../../include -R -LLIB6502 $@.a65 -o $@
+
+clean:
+ rm -f ${files}
+
+rmdir.a65: mkdir.a65
+ cat mkdir.a65 | sed -e "s/mkdir/rmdir/g" -e "s/FC_MKDIR/FC_RMDIR/g" > rmdir.a65
+
+rm.a65: mkdir.a65
+ cat mkdir.a65 | sed -e "s/mkdir/rm/g" -e "s/FC_MKDIR/FC_DELETE/g" > rm.a65
+
+chkdsk.a65: mkdir.a65
+ cat mkdir.a65 | sed -e "s/mkdir/chkdsk/g" -e "s/FC_MKDIR/FC_CHKDSK/g" > chkdsk.a65
+
+format.a65: mkdir.a65
+ cat mkdir.a65 | sed -e "s/mkdir/format/g" -e "s/FC_MKDIR/FC_FORMAT/g" > format.a65
+
diff --git a/dump/oa-2.0.9/apps/file/cat.a65 b/dump/oa-2.0.9/apps/file/cat.a65
new file mode 100644
index 0000000..1d7a1a9
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/cat.a65
@@ -0,0 +1,171 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 cat program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#include "lib6502.i65"
+
+#define BUFLEN 1024
+
+main .(
+ .zero
+argp .word 0
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+ ldx #STDIN
+ jmp docopy
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ lda argp
+ ldy argp+1
+
+ jsr docat
+ bcs ende
+ /* TODO: print error code */
+
+ ldy #0
+l2 lda (argp),y
+ beq next
+ iny
+ bne l2
+next
+ iny
+ lda (argp),y
+ bne ok
+
+ lda #0
+ende
+ rts
+
+etxtout
+ .zero
+tp .word 0
+ .text
+
+ sta tp
+ sty tp+1
+ ldx #STDERR
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+ .bss
+fileno .byt 0
+frdat .word 0,0
+buf .dsb BUFLEN
+ .text
+
+docat ldx #OPEN_RD
+ jsr fopen
+ bcc docopy
+ rts
+docopy stx fileno
+rdloop
+ lda #buf
+ sta frdat+1
+ lda #BUFLEN
+ sta frdat+3
+ lda #frdat
+ ldx fileno
+ sec
+ jsr fread
+ pha
+ php
+
+ lda #BUFLEN
+ sbc frdat+3
+ sta frdat+3
+ lda #buf
+ sta frdat+1
+wrloop lda #frdat
+ ldx #STDOUT
+ sec
+ jsr fwrite
+ bcs wrerr
+ lda frdat+2
+ ora frdat+3
+ bne wrloop
+ pla
+ plp
+ bcs rderr
+ jmp rdloop
+
+wrerr pha
+ ldx fileno
+ cpx #STDIN
+ beq w1
+ jsr fclose
+w1 pla
+ tay
+ pla
+ pla
+ tya
+ sec
+ rts
+rderr cmp #E_EOF
+ bne rde2
+ lda #E_OK
+rde2 pha
+ ldx fileno
+ cpx #STDIN
+ beq r1
+ jsr fclose
+r1 pla
+ clc
+ rts
+ .)
+
diff --git a/dump/oa-2.0.9/apps/file/chkdsk.a65 b/dump/oa-2.0.9/apps/file/chkdsk.a65
new file mode 100644
index 0000000..ac617a3
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/chkdsk.a65
@@ -0,0 +1,100 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 chkdsk program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * Warning: automatically generated from chkdsk.a65!
+ */
+
+#include "lib6502.i65"
+
+main .(
+ .zero
+argp .word 0
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+usage lda #usagetxt
+ jmp etxtout
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ lda argp
+ ldy argp+1
+ ldx #FC_CHKDSK
+ jsr fcmd
+
+ /* TODO: print error code */
+
+ ldy #0
+l2 lda (argp),y
+ beq next
+ iny
+ bne l2
+next
+ iny
+ lda (argp),y
+ bne ok
+
+ lda #0
+ rts
+
+etxtout
+ .zero
+tp .word 0
+ .text
+
+ sta tp
+ sty tp+1
+ ldx #STDERR
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+usagetxt
+ .byt 13,10,"Usage:",13,10," chkdsk dir1 [dir2 ...]",13,10,0
+
+ .)
+
diff --git a/dump/oa-2.0.9/apps/file/format.a65 b/dump/oa-2.0.9/apps/file/format.a65
new file mode 100644
index 0000000..a35e1a8
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/format.a65
@@ -0,0 +1,100 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 format program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * Warning: automatically generated from format.a65!
+ */
+
+#include "lib6502.i65"
+
+main .(
+ .zero
+argp .word 0
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+usage lda #usagetxt
+ jmp etxtout
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ lda argp
+ ldy argp+1
+ ldx #FC_FORMAT
+ jsr fcmd
+
+ /* TODO: print error code */
+
+ ldy #0
+l2 lda (argp),y
+ beq next
+ iny
+ bne l2
+next
+ iny
+ lda (argp),y
+ bne ok
+
+ lda #0
+ rts
+
+etxtout
+ .zero
+tp .word 0
+ .text
+
+ sta tp
+ sty tp+1
+ ldx #STDERR
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+usagetxt
+ .byt 13,10,"Usage:",13,10," format dir1 [dir2 ...]",13,10,0
+
+ .)
+
diff --git a/dump/oa-2.0.9/apps/file/ls.a65 b/dump/oa-2.0.9/apps/file/ls.a65
new file mode 100644
index 0000000..0b3f425
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/ls.a65
@@ -0,0 +1,126 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 ls program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#include "lib6502.i65"
+
+main .(
+ .zero
+argp .word 0
+ .bss
+fileno .byt 0
+entry .dsb FD_NAME+MAX_FILENAME
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+;usage lda #usagetxt
+; jmp etxtout
+
+ lda #joker
+ sta argp+1 ; always not null
+ bne l1
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ jsr crlfout
+
+ lda argp
+ ldy argp+1
+
+ jsr fopendir
+ bcc opened
+ rts
+
+opened stx fileno
+rd ldx fileno
+ lda #entry
+ jsr freaddir
+ bcs eof
+
+ lda #entry+FD_NAME
+ jsr txtout
+
+ jsr crlfout
+ jmp rd
+
+eof ldx fileno
+ jsr fclose
+ lda #0
+ rts
+
+crlfout lda #13
+ sec
+ ldx #STDOUT
+ jsr fputc
+ lda #10
+ sec
+ jmp fputc
+
+txtout
+ .zero
+tp .word 0
+ .text
+
+ ldx #STDOUT
+ .byt $2c
+etxtout
+ ldx #STDERR
+ sta tp
+ sty tp+1
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+joker .asc "*", 0
+
+;usagetxt
+; .byt 13,10,"Usage:",13,10," ls dir1", 13,10,0
+
+ .)
+
diff --git a/dump/oa-2.0.9/apps/file/mkdir.a65 b/dump/oa-2.0.9/apps/file/mkdir.a65
new file mode 100644
index 0000000..530093b
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/mkdir.a65
@@ -0,0 +1,100 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 mkdir program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * Warning: automatically generated from mkdir.a65!
+ */
+
+#include "lib6502.i65"
+
+main .(
+ .zero
+argp .word 0
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+usage lda #usagetxt
+ jmp etxtout
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ lda argp
+ ldy argp+1
+ ldx #FC_MKDIR
+ jsr fcmd
+
+ /* TODO: print error code */
+
+ ldy #0
+l2 lda (argp),y
+ beq next
+ iny
+ bne l2
+next
+ iny
+ lda (argp),y
+ bne ok
+
+ lda #0
+ rts
+
+etxtout
+ .zero
+tp .word 0
+ .text
+
+ sta tp
+ sty tp+1
+ ldx #STDERR
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+usagetxt
+ .byt 13,10,"Usage:",13,10," mkdir dir1 [dir2 ...]",13,10,0
+
+ .)
+
diff --git a/dump/oa-2.0.9/apps/file/mv.a65 b/dump/oa-2.0.9/apps/file/mv.a65
new file mode 100644
index 0000000..6e4c66e
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/mv.a65
@@ -0,0 +1,102 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 mv program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#include "lib6502.i65"
+
+main .(
+ .zero
+argp .word 0
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+usage lda #usagetxt
+ jmp etxtout
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ ldy #0
+c0 lda (argp),y
+ beq c1
+ iny
+ bne c0
+c1 iny
+ lda (argp),y
+ beq usage
+c2 lda (argp),y
+ beq c3
+ iny
+ bne c2
+c3 iny
+ lda (argp),y
+ bne usage
+
+ lda argp
+ ldy argp+1
+ ldx #FC_RENAME
+ jsr fcmd
+
+ /* TODO: print error code */
+
+ rts
+
+etxtout
+ .zero
+tp .word 0
+ .text
+
+ sta tp
+ sty tp+1
+ ldx #STDERR
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+usagetxt
+ .byt 13,10,"Usage:",13,10," mv oldfilename newfilename",13,10,0
+
+ .)
+
diff --git a/dump/oa-2.0.9/apps/file/rm.a65 b/dump/oa-2.0.9/apps/file/rm.a65
new file mode 100644
index 0000000..66a4926
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/rm.a65
@@ -0,0 +1,100 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 rm program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * Warning: automatically generated from rm.a65!
+ */
+
+#include "lib6502.i65"
+
+main .(
+ .zero
+argp .word 0
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+usage lda #usagetxt
+ jmp etxtout
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ lda argp
+ ldy argp+1
+ ldx #FC_DELETE
+ jsr fcmd
+
+ /* TODO: print error code */
+
+ ldy #0
+l2 lda (argp),y
+ beq next
+ iny
+ bne l2
+next
+ iny
+ lda (argp),y
+ bne ok
+
+ lda #0
+ rts
+
+etxtout
+ .zero
+tp .word 0
+ .text
+
+ sta tp
+ sty tp+1
+ ldx #STDERR
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+usagetxt
+ .byt 13,10,"Usage:",13,10," rm dir1 [dir2 ...]",13,10,0
+
+ .)
+
diff --git a/dump/oa-2.0.9/apps/file/rmdir.a65 b/dump/oa-2.0.9/apps/file/rmdir.a65
new file mode 100644
index 0000000..04a6150
--- /dev/null
+++ b/dump/oa-2.0.9/apps/file/rmdir.a65
@@ -0,0 +1,100 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 rmdir program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * Warning: automatically generated from rmdir.a65!
+ */
+
+#include "lib6502.i65"
+
+main .(
+ .zero
+argp .word 0
+ .text
+
+ sta argp
+ sty argp+1
+
+ ldy #0
+l0 lda (argp),y
+ beq first
+ iny
+ bne l0
+
+first iny
+ lda (argp),y
+ bne ok
+
+usage lda #usagetxt
+ jmp etxtout
+
+ok tya
+ clc
+ adc argp
+ sta argp
+ bcc l1
+ inc argp+1
+l1
+ lda argp
+ ldy argp+1
+ ldx #FC_RMDIR
+ jsr fcmd
+
+ /* TODO: print error code */
+
+ ldy #0
+l2 lda (argp),y
+ beq next
+ iny
+ bne l2
+next
+ iny
+ lda (argp),y
+ bne ok
+
+ lda #0
+ rts
+
+etxtout
+ .zero
+tp .word 0
+ .text
+
+ sta tp
+ sty tp+1
+ ldx #STDERR
+ ldy #0
+t0 lda (tp),y
+ beq te
+ sec
+ jsr fputc
+ iny
+ bne t0
+te rts
+
+usagetxt
+ .byt 13,10,"Usage:",13,10," rmdir dir1 [dir2 ...]",13,10,0
+
+ .)
+
diff --git a/dump/oa-2.0.9/apps/inet/Makefile b/dump/oa-2.0.9/apps/inet/Makefile
new file mode 100644
index 0000000..a15d8d3
--- /dev/null
+++ b/dump/oa-2.0.9/apps/inet/Makefile
@@ -0,0 +1,12 @@
+
+files= tlogin telnet httpd
+
+all: ${files}
+
+${files}: %: %.a65
+ xa -I../../include -R -LLIB6502 $@.a65 -o $@
+
+clean:
+ rm -f ${files}
+
+
diff --git a/dump/oa-2.0.9/apps/inet/httpd.a65 b/dump/oa-2.0.9/apps/inet/httpd.a65
new file mode 100644
index 0000000..b362dcc
--- /dev/null
+++ b/dump/oa-2.0.9/apps/inet/httpd.a65
@@ -0,0 +1,465 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ lib6502 httpd program
+
+ Copyright (C) 1997-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * This is a horribly simple www server to show how listen/accept
+ * should be used.
+ * It can only serve one file at a time, accepting other connections
+ * after finishing a file.
+ *
+ * The server built into OS/A65 slipd is much better worked out, although
+ * it also has its flues...
+ */
+
+#include "lib6502.i65"
+
+#define WWWPORT 8080
+#define BUFLEN 100
+#define FBUFLEN 128
+
+#define DEBUG
+
+ .(
+ .zero
+p .word 0
+ .bss
+lport .byt 0
+netfn .byt 0
+filefn .byt 0
+buf .dsb BUFLEN
+ .text
+
++main .(
+ sta p
+ sty p+1
+
+ lda #0
+ sta lport
+
+ lda #wwwpath
+ jsr chdir
+
+ jsr parsepar
+ bcs ret
+
+ lda #txt1
+ jsr txtout
+#ifdef DEBUG
+ ldx #STDIN
+ sec
+ jsr fgetc
+#endif
+ lda #listenarg
+ ldx #IPV4_TCP
+ clc
+ jsr listen
+ bcs ret
+ stx lport
+
+ lda #txt2
+ jsr txtout
+#ifdef DEBUG
+ ldx #STDIN
+ sec
+ jsr fgetc
+#endif
+aloop
+ sec
+ lda #BUFLEN
+ sta abuf
+ lda #abuf
+ ldx lport
+ jsr accept
+ bcc gotone
+ende
+ ldx lport
+ sec
+ jsr listen
+
+ret rts
+
+gotone stx netfn
+ jsr getline
+ bcs doclose
+ jsr parsereq
+ bcs doclose
+ jsr dofile
+ ldx filefn
+ jsr fclose
+doclose
+ ldx netfn
+ jsr fclose
+ jmp aloop
+ .)
+
+ .data
+txt1 .asc "^m^jhttpd: start listening",0
+txt2 .asc "^m^jhttpd: start accepting",0
+
+/***********************************************************************/
+
+getline .(
+ ldy #0
+ ldx netfn
+l0 sec
+ jsr fgetc
+ bcs ferr
+ cmp #13
+ beq eol
+ sta buf,y
+ iny
+ cpy #BUFLEN
+ bcc l0
+ferr
+ ; file error or buffer overflow error
+ ldx netfn
+ jsr fclose
+ sec
+ rts
+
+eol ; end of line
+ lda #0
+ sta buf,y
+
+#ifdef DEBUG
+ lda #lt
+ jsr txtout
+ lda #buf
+ jsr txtout
+ jsr crlfout
+
+ .data
+lt .asc "httpd: got request: ",0
+ .text
+
+#endif
+ clc
+ rts
+ .)
+
+/**************************************************************************/
+
+dofile .(
+ .bss
+fpars .dsb 4
+fbuf .dsb FBUFLEN
+ .text
+
+ ; drain network input, in case it blocks otherwise
+ ldx netfn
+drain clc
+ jsr fgetc
+ bcc drain
+
+ jsr yield
+
+ ; read a block from file
+ lda #fbuf
+ sta fpars+1
+ lda #FBUFLEN
+ sta fpars+3
+
+ lda #fpars
+ ldx filefn
+ clc
+ jsr fread
+ bcs d1
+ lda #E_OK
+d1 pha
+
+ lda #FBUFLEN
+ sbc fpars+3
+ sta fpars+3
+ ora fpars+2
+ beq empty
+
+ lda #fbuf
+ sta fpars+1
+
+ lda #fpars
+ ldx netfn
+ sec
+ jsr fwrite
+empty
+ pla
+ cmp #E_EOF
+ bne dofile
+ rts
+ .)
+
+/**************************************************************************/
+
+parsereq .(
+ .zero
+fp .word 0
+ .text
+
+ ldy #<-1
+n0 iny
+ lda buf,y
+ cmp #" "
+ beq n0
+
+ lda buf,y
+ cmp #"G"
+ bne malformed
+ iny
+ lda buf,y
+ cmp #"E"
+ bne malformed
+ iny
+ lda buf,y
+ cmp #"T"
+ bne malformed
+
+n1 iny
+ lda buf,y
+ cmp #" "
+ beq n1
+
+ ; here we have the address of the filename
+ tya
+ clc
+ adc #buf
+ sta fp+1
+
+ ldy #<-1
+n2 iny
+ lda (fp),y
+ beq ende
+ cmp #" "
+ bne n2 ; check for extensions...
+ lda #0
+ sta (fp),y
+ende
+ lda fp
+ ldy fp+1
+ ldx #OPEN_RD
+ jsr fopen
+ bcs notopen
+ stx filefn
+ rts
+
+notopen ldx #0
+ .byt $2c
+malformed
+ ldx #1
+
+ txa
+ asl
+ asl
+ tay
+ ldx #0
+ll lda eaddrs,y
+ sta fwpars,x
+ iny
+ inx
+ cpx #4
+ bcc ll
+ lda #fwpars
+ ldx filefn
+ sec
+ jsr fwrite
+
+ ldx filefn
+ jsr fclose
+ sec
+ rts
+
+ .bss
+fwpars .dsb 4
+ .data
+eaddrs .word err0, err1-err0
+ .word err1, err2-err1
+
+err0 .byt "HTTP/1.0 400^m^jContent-Type: text/html^m^j^m^j"
+ .asc "^m^j^m^jError^m^j^m^j"
+ .asc "^m^j
+In 1989 I started this little computer project, building an own 6502
+computer. After a long break I started working on it again in 1996.
+I wrote an own operating system for it which I have also ported to the
+Commodore 64.
+In the meantime it has grown a lot, featuring a standard library,
+relocatable files, multithreading/multitasking and much more.
+
+However, this is a test file, so please go to the real
+GeckOS/A65
+page.
+
+
diff --git a/dump/oa-2.0.9/arch/c64/boot/loader b/dump/oa-2.0.9/arch/c64/boot/loader
new file mode 100644
index 0000000..32da34b
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/boot/loader
Binary files differ
diff --git a/dump/oa-2.0.9/arch/c64/boot/loader11 b/dump/oa-2.0.9/arch/c64/boot/loader11
new file mode 100644
index 0000000..767fc11
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/boot/loader11
Binary files differ
diff --git a/dump/oa-2.0.9/arch/c64/boot/mkdisk b/dump/oa-2.0.9/arch/c64/boot/mkdisk
new file mode 100755
index 0000000..ddfd9b8
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/boot/mkdisk
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+echo "set tmpfile"
+tmpfile=/tmp/mkdisk.$user.$$
+
+#echo "get files"
+#files=`ls *`
+
+files="$*"
+
+echo "files=$files"
+
+echo "format osa,65 x64 osa.x64" > $tmpfile
+
+for i in $files; do
+ if test "$i" != "mkdisk" -a "$i" != "osa.d64" ; then
+ echo "write $i" >> $tmpfile
+ fi
+done
+
+cat $tmpfile | c1541 > /dev/null
+
+rm -f $tmpfile
+
diff --git a/dump/oa-2.0.9/arch/c64/boot/term9600 b/dump/oa-2.0.9/arch/c64/boot/term9600
new file mode 100644
index 0000000..7112739
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/boot/term9600
Binary files differ
diff --git a/dump/oa-2.0.9/arch/c64/c64def.i65 b/dump/oa-2.0.9/arch/c64/c64def.i65
new file mode 100644
index 0000000..594db2d
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/c64def.i65
@@ -0,0 +1,34 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * These are the C64 specific defines
+ */
+
+#define C64CIA1 $dc00
+#define C64CIA2 $dd00
+#define C64VIC $d000
+
+#include "chips/vicii.i65"
+#include "chips/cia6526.i65"
+
diff --git a/dump/oa-2.0.9/arch/c64/c64rom.a65 b/dump/oa-2.0.9/arch/c64/c64rom.a65
new file mode 100644
index 0000000..ac8fac4
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/c64rom.a65
@@ -0,0 +1,304 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+/* #define C64 */
+
+/* These are necessary for C64 kernel **************************************/
+
+#define NOMMU
+#define NOSYSPORT
+#undef CLK2MHZ /* we only have approx. 1 MHz ... */
+#undef CMOSCPU /* ... and no CMOS cpu */
+#define VIDPAGE 14
+#define SHORTLINE /* prepare for 40 col screen */
+#define RAMTEST
+#define NOMIRRORMEM
+
+#define OSA_CPU "6510"
+#define OSA_ARCH "C64"
+
+/* These are changeable ****************************************************/
+
+#undef ANDRE /* my personal configuration... :-) */
+#undef EMUSLIP /* my personal configuration... :-) */
+
+#define ROMSTART $7800 /* where the ROM starts */
+
+#define RAMSTART 1
+
+#define RAMEND >ROMSTART /* The size of the RAM we allow to be used.
+ Size in pages (256 bytes). Must be below
+ ROMSTART */
+
+#define MIN_MEM >ROMSTART /* minimum memory we need in system env. to
+ work ok, in pages */
+
+
+ /* if you have a 16550A UART with FIFO */
+#undef UARTBASE $d600
+#define ACIABASE $d600
+/* #define ACIABASE $df00 */
+
+#define UARTXTAL 4 /* xtal is 4 times 1.8324 MHz */
+
+#define MEMINIVAL 0 /* Clear memory to 0 on boot */
+
+#define STACKCOPY /* if defined, save stack area in memory
+ when context switching, otherwise divide
+ stack area and give each task a part.
+ It's faster without, but allows more
+ tasks with */
+
+#define NMIDEV /* necessary for fast RS232 */
+
+/*#define C64NEEDCIA1*/ /* disables reading CIA1 ICR in kernel -
+ needs to be done in device then, as
+ kernel enables timer irq!! (reading
+ it causes all flags to be reset!)
+ If you use the plain C64 9600 baud RS232
+ interface (ds3), this must not be defined! */
+
+#undef PARALLEL /* for IEEE488 interface from Commodore
+ disables serial bus interface! */
+
+#define C64_BGND_COL 0 /* console background color */
+#define C64_TEXT_COL 13 /* console text color */
+#define C64_BORDER_COL 13 /* console border color */
+
+#define C64SWITCH 4 /* terminal switch key number (61= C=,
+ 4= F1) */
+
+/*#define C64NMIRESET*/ /* restore button becomes reset
+ (doesn't work with NMIDEV and the
+ plain C64 9600 baud RS232 interface) */
+
+#define NEED_CHECKCHLD /* this is necessary if using "init" or
+ lib6502 */
+#define NEED_GETINFO
+#define NEED_SLOCK
+#define NEED_RENICE
+
+#define BOOTDRV "c" /* where are the boot files */
+
+#define ROOTPATH "c:" /* where lsh chdirs into on boot */
+
+#define WWWDRV BOOTDRV
+
+#undef INETSTART /* start INET server from init - customization
+ below */
+
+/***************************************************************************/
+/* Better not change anything below */
+/* */
+
+#ifdef ANDRE /* C64 with parallel IEEE488, UART and booting from CS/A
+ computer at IEEE id 10, mapping its fsibm drive there */
+
+#define PARALLEL
+#define OLDHACK
+
+#undef ACIABASE
+#define UARTBASE $d600
+#undef UARTXTAL
+#define UARTXTAL 1
+
+#undef BOOTDRV
+#define BOOTDRV "e"
+
+#undef WWWDRV
+#define WWWDRV "c"
+
+#endif /* ANDRE */
+
+/***************************************************************************/
+
+#ifdef EMUSLIP /* C64 emulator VICE with parallel IEEE488, ACIA emulation
+ and a nullmodem cable between /dev/modem (VICE) and
+ a slip line */
+
+#undef PARALLEL
+#undef OLDHACK
+
+#undef UARTBASE
+#undef ACIABASE
+#undef UARTXTAL
+
+#undef BOOTDRV
+
+#undef WWWDRV
+
+#endif /* EMUSLIP */
+
+/***************************************************************************
+ *
+ * Here comes the ROM content
+ */
+
+#include "config.i65"
+#include "kdefs.i65"
+#include "fdefs.i65"
+#include "c64def.i65"
+
+#include "kernel.i65"
+
+#define STDIOADDR $d000
+
+ .word $1800 /* load address */
+
+.(
+
+/************* ROM entries */
+
+/************* devices */
+
+#include "devices/c64dev.a65"
+
+/************* init process */
+
+#define INIT_VERBOSE
+#define INIT_RESTART
+#define INIT_MERGE
+#define INIT_LIB6502
+/* #define INIT_USE_STDLIB */
+/* #define INIT_OUTDEV 2*/
+#include "sysapps/init/init.a65"
+
+/************* fsdev - converts devices into files */
+
+#include "sysapps/fs/fsdev.a65"
+
+/************* fsiec - IEEE488/IEC bus filesystem */
+
+/* both, the parallel and serial iec bus use the same timer */
+#define SEM_CIA2TB SEM_SERIEC
+#undef SEM_PARIEC
+#undef SEM_SERIEC
+
+#define NOLOOP
+#ifdef PARALLEL
+#define FSIEC_DEVICE "devices/piec_c64.a65"
+#else
+#define FSIEC_DEVICE "devices/siec_c64.a65"
+#endif
+#include "sysapps/fs/fsiec.a65"
+#undef FSIEC_DEVICE
+#print *
+
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+#define MON_SHEXE $c0 /* ROM executable flag */
+#define MON_MONEXE 0 /* ROM executable flag */
+#define MON_SHDEV 1 /* start on device 0 = video1 */
+#define SHORTMON /* no assembler/disassembler */
+#undef NOSH
+#include "sysapps/mon/mon.a65"
+
+
+/************* boot slipd from BOOTDRV, wwwdrv c and stderr to video3 */
+
+#ifdef INETSTART
+
+ /* add autostart of lib6502 program 'slipd' */
+
+ .(
+ .word end_slipd
+ .byt PK_LIB+PK_AUTOEXEC ; is lib6502 program
+ .word 0 ; P_ADDR ignored
+ .byt 128 ; P_RAM
+ .byt 128 ; P_SHARED
+ .byt 0 ; P_PRIORITY
+ .byt 7,7 ; P_DEV
+ ; wwwsrv drive is WWWDRV, login prg is "BOOTDRV:tlogin",
+ ; debug output to 4th console
+ .byt BOOTDRV,":slipd", 0
+ .byt "a:video4", 0
+ .byt WWWDRV, ":", 0
+ .byt BOOTDRV, ":tlogin", 0
+ .byt 0 ; end of parameter list
+end_slipd
+ .)
+
+#endif
+
+/************* boot lsh from BOOTDRV */
+
+#ifdef BOOTDRV
+
+ /* add autostart of lib6502 program 'lsh' */
+
+ .(
+ .word end_auto
+ .byt PK_LIB+PK_AUTOEXEC+PK_RESTART ; is lib6502 program
+ .word 0 ; P_ADDR ignored
+ .byt 16 ; P_RAM
+ .byt 128 ; P_SHARED
+ .byt 0 ; P_PRIORITY
+ .byt 0,0 ; P_DEV
+ .byt BOOTDRV,":lsh",0,"-d",0,ROOTPATH, 0,0
+end_auto
+ .)
+
+#endif
+
+/************* end of ROM executables */
+
+ .word -1
+
+/************* lib6502 code */
+
+#echo "lib6502 starts at"
+#print *
+
+/* lib6502 jmp table is below STDIOADDR */
+
+#include "lib6502/lib6502.a65"
+
+/************* fill not used area (I/O, screens) */
+
+#if $d000-* < 0
+#echo "Error after lib6502"
+#print *
+#endif
+
+.dsb $d000-*,<-1
+.dsb $2000, <-1 /* from d000 to f000 */
+
+/************* Kernel */
+
+#include "kernel\kernel.a65"
+
+/************* Constants for lib6502 memory handling */
+
+Memstart =$1600
+Memend =ROMSTART
+Zerostart =$70
+
+.)
+
diff --git a/dump/oa-2.0.9/arch/c64/config.i65 b/dump/oa-2.0.9/arch/c64/config.i65
new file mode 100644
index 0000000..f5407d5
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/config.i65
@@ -0,0 +1,73 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#ifndef _C64CONFIG_
+#define _C64CONFIG_
+
+#echo ******** c64 config **********
+
+
+/* StreamData */
+
+#define ANZSTRM 16 /* number of streams */
+
+/* SemaphoreData */
+
+#define ANZSEM 8 /* number of semaphores - multiple of 8 */
+#define SYSSEM 8 /* multiple of 8, no of system semaphores
+ i.e. sems from -SYSSEM to -1 */
+
+/* DeviceData */
+
+#define MAXDEV 16 /* maximum number of devices */
+
+/* EnvData */
+
+#define MAXENVS 1 /* one environment only */
+
+#ifndef STACKCOPY
+#define MAXNTHREADS 5 /* (Stackpage-56)/40 */
+#define MAXNTASKS 5
+#define STACKSIZE 40 /* (TH_SLEN * 5) */
+#else
+#define MAXNTHREADS 12 /* (up to 16 is possible, if enough memory) */
+#define MAXNTASKS 12
+#define STACKSIZE 64 /* (TH_SLEN * 8) */
+#endif
+#define ANZXENV 5 /* number of redirectable task IDs */
+
+/* TaskData */
+
+#define IRQCNT 3 /* default priority for ROM-started tasks */
+
+/* FileManager */
+
+#define MAXFS 4 /* maximum number of fileserver tasks */
+
+/* we don't map any of these memory areas */
+#undef MAP_ZERO
+#undef MAP_STACK
+#undef MAP_MEM
+
+#endif /* _C64CONFIG_ */
+
diff --git a/dump/oa-2.0.9/arch/c64/devices/c64dev.a65 b/dump/oa-2.0.9/arch/c64/devices/c64dev.a65
new file mode 100644
index 0000000..1fc195f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/devices/c64dev.a65
@@ -0,0 +1,91 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef ROM
+
+#include "kdefs.def"
+#include "kernel.i65"
+
+ ;.word $700
+ *=$700
+
+/*#define NOPRG*/
+
+#endif
+
+
+/* Device-Block */
+
+ .(
+
+#if 0 /*ndef NOMMU*/
+-sysmem =$300 /* werte um mit OS/A 1.33 nicht zu kollidieren */
+-syszp =$d0
+#endif
+
+#ifdef ROM
+ .word endd
+ .byt PK_DEV+$80
+ .word devstart
+ .dsb P_NAME - P_RAM, $ff
+ .asc "devices",0
+#else
+#ifndef NOPRG
+ .word 0
+ .byt PK_DEV
+ .byt 0
+ .word 0
+ .word devstart
+ .byt 0,0,<-1
+#endif
+#endif
+
+devstart
+
+-sernr = "1"
+
+#define CONSOLE_DEVICE "devices/con_c64.a65"
+#include "devices/console.a65" ; video device is merged with OS/A now...
+
+#include "devices/nulldev.a65" ; null device
+#include "devices/spooler.a65" ; spooler device
+#include "devices/ser_9600.a65" ; fast serial interface by Daniel Dallmann
+
+#ifdef ACIABASE
+#print ACIABASE
+#include "devices/ser_acia.a65"
+#endif
+
+#ifdef UARTBASE
+#include "devices/ser_uart.a65" ; standard UART 16550A driver
+#endif
+ .word $ffff
+
+#if 0
+#print sysmem
+#print syszp
+#endif
+
+endd .)
+
diff --git a/dump/oa-2.0.9/arch/c64/devices/con_c64.a65 b/dump/oa-2.0.9/arch/c64/devices/con_c64.a65
new file mode 100644
index 0000000..e9da08c
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/devices/con_c64.a65
@@ -0,0 +1,319 @@
+
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#define MAX_SCREEN 4 /* hard maximum number of screens */
+
+#define MAX_ASCREEN #4 /* soft maximum number of screens */
+
+#define SWITCHKEY C64SWITCH
+
+#define SET_MMU
+
+#define BELLIRQ
+
+#define TRIGBELL
+
+#define MAXSPAL #40
+
+#define MAXZEIL #25
+
+#define KEY_START 20 /* when does key repetition start */
+
+ /* screen# -> hi byte of base address in AC */
+#define HI_VID asl:asl:clc:adc #VIDPAGE<<4
+
+#define ACT_HI_VID lda hivid
+
+#define SCR_SPACE 32
+
+#define SCR2ASC
+
+#define ASC2SCR
+
+&console_init .(
+ jsr inivid
+ jsr inicrsr
+ jsr inikbd
+ rts
+ .)
+
+/*
+ * For the C64 we put the video screen memory to $e000-$ec00, i.e.
+ * we have three possible screens only. We need $ec00-$efff for the
+ * stdlib. We use the std charom at $d000 in the RAM under I/O that
+ * the VIC doesn't see. The boot loader has to copy the charom there.
+ * Then we have all the memory below the I/O relatively free.
+ */
+
+inivid .(
+ lda #0
+ sta C64VIC+VIC_IRR ; no interrupts
+ sta C64VIC+VIC_SPRITE_EN ; sprites off
+ lda #27
+ sta C64VIC+VIC_CR1 ; 25 lines
+ lda #8
+ sta C64VIC+VIC_CR2 ; 40 cols
+; lda #(($10 & %001110000)>>3)+(($20 & %00111100)<<2)
+ lda #%10000100
+ sta C64VIC+VIC_BASE ; character and screen base
+
+ lda C64CIA2+CIA_DDRA ; set upper two video address bits
+ ora #3 ; via CIA2, PRA Bit 0 and 1
+ sta C64CIA2+CIA_DDRA ; set bits to output mode
+ lda C64CIA2+CIA_PRA
+ and #%11111100
+ sta C64CIA2+CIA_PRA ; change to uppermost page ($c000-)
+
+ lda #C64_TEXT_COL ; set the screen (text) color
+ ldy #0
+coloop sta $d800,y
+ sta $d900,y
+ sta $da00,y
+ sta $db00,y
+ iny
+ bne coloop
+
+ lda #C64_BGND_COL ; set the border and background color
+ sta C64VIC+VIC_BGND_COL0
+ lda #C64_BORDER_COL
+ sta C64VIC+VIC_EXT_COL
+ rts
+ .)
+
+&setact .(
+ asl
+ asl
+ asl
+ asl
+ ora #%10000100
+ sta C64VIC+VIC_BASE
+ rts
+ .)
+
+/**************************************************************************
+ * Cursor handling
+ */
+
+ .(
+ .data
+crsrfl .byt 0
+crsrcnt .byt 0
+ .text
+
+&inicrsr
+ lda #0
+ sta crsrfl
+ sta crsrcnt
+ rts
+
+&&crsroff .( ; disable cursor
+ bit crsrfl
+ bpl ret ; not enabled
+
+ bit crsrfl
+ bvc clr ; not inversed
+ ldy spalte
+ lda (vzei),y
+ eor #$80
+ sta (vzei),y
+clr lda #0
+ sta crsrfl
+&ret rts
+ .)
+
+&&crsron .( ; enable cursor
+ bit crsrfl
+ bmi irq ; already enabled
+ lda #0 ; inverse cursor next crsrirq
+ sta crsrcnt
+ lda #128 ; enabled, but not invers
+ sta crsrfl
+
+&irq
+ dec crsrcnt
+ bpl ret ; not this time
+ lda #10
+ sta crsrcnt
+
+ ldy spalte
+ lda (vzei),y
+ eor #$80
+ sta (vzei),y
+ lda crsrfl
+ eor #$40
+ sta crsrfl
+
+ rts
+ .)
+
+ .)
+
+/**************************************************************************/
+
+ .(
+
+kcnt =zei2
+ .data
+rcnt .byt 0
+shiftfl .byt 0
+prev .byt 0
+ .zero
+tzei .word 0
+ .text
+
+&inikbd .(
+ lda #0
+ sta C64CIA1+CIA_DDRB
+ lda #$ff
+ sta C64CIA1+CIA_DDRA
+ sta C64CIA1+CIA_PRA
+ lda #4
+
+ sta rcnt
+ sta rspd
+ rts
+ .)
+
+&&getkey .(
+ lda #0
+ sta shiftfl
+ ldy #$ff
+ sty kcnt
+
+ sta C64CIA1+CIA_PRA
+l0 lda C64CIA1+CIA_PRB
+ cmp C64CIA1+CIA_PRB
+ bne l0
+ cmp #$ff
+ beq nokey
+
+ lda #%11111110
+ sta C64CIA1+CIA_PRA
+ pha ; we need to save this, as more pressed
+ ; keys can change the value read back!
+ ldx #0
+
+l1 lda C64CIA1+CIA_PRB
+ cmp C64CIA1+CIA_PRB
+ bne l1
+ ldy #8
+
+nextbit lsr
+ bcs nobit
+ pha
+ lda ktab,x
+ cmp #5
+ bcs realkey
+ cmp #3
+ beq realkey
+ ora shiftfl
+ sta shiftfl
+ bpl l3
+realkey stx kcnt
+l3 pla
+nobit inx
+ cpx #65
+ bcs endkey
+ dey
+ bne nextbit ; test next bit
+ pla
+ sec
+ rol
+ sta C64CIA1+CIA_PRA
+ pha
+ bne l1 ; always
+
+endkey pla
+ lda kcnt
+ cmp #$ff
+ beq nokey
+ cmp prev
+ bne lx
+
+ dec rcnt
+ bne nkret
+ ldx rspd
+ .byt $2c
+
+lx ldx #KEY_START
+ stx rcnt
+
+ sta prev
+
+ tay
+ lda shiftfl
+ and #3
+ asl
+ tax
+ lda ttab,x
+ sta tzei
+ lda ttab+1,x
+ sta tzei+1
+
+ lda (tzei),y
+ ldx shiftfl
+ clc
+ rts
+
+nokey ldx #<-1
+ stx prev
+ ldx #KEY_START
+ stx rcnt
+nkret ldx shiftfl
+ sec
+ rts
+ .)
+
+ttab .word ktab, stab, ctab, sctab
+
+ktab .byt TC_BS, TC_CR, TC_CRGT, 0, 6 /* F1 */, 0, 0, TC_CDWN
+ .byt "3wa4zse", 1 /* shift */
+ .byt "5rd6cftx7yg8bhuv"
+ .byt "9ij0mkon+pl-.:@,"
+ .byt "\*;", TC_HOME, 1 /* shift */, "=^^/"
+ .byt "1_", 2 /* control */, "2 ", 6 /* C= */, "Q", 3 /* stop */
+
+stab .byt TC_INS, TC_LF, TC_CLFT, 0, 6 /* F1 */, 0, 0, TC_CUP
+ .byt "#WA$ZSE", 1 /* shift */
+ .byt "%RD&CFTX'YG(BHUV"
+ .byt ")IJ0MKON+PL->[@<"
+ .byt "\*]", TC_CLR, 1 /* shift */, "=^^?"
+ .byt "!", TC_ESC, 2 /* control */, 34," ", 6 /* C= */, "Q", 3 /*stop*/
+
+ctab .byt TC_DEL, TC_EOL, TC_WRU, 0, 6 /* F1 */, 0, 0, TC_WLO
+ .byt "3^w^a4^z^s^e", 1 /* shift */
+ .byt "5^r^d6^c^f^t^x7^y^g8^b^h^u^v"
+ .byt "9^i^j0^m^k^o^n+^p^l-.:@,"
+ .byt "\*;", TC_WCLS, 1 /* shift */, "=^^/"
+ .byt "1", TC_CLL, 2 /* control */, "2 ", 6 /* C= */, "Q", 3 /*stop*/
+
+sctab .byt TC_INS, TC_LF, TC_CLFT, 0, 6 /* F1 */, 0, 0, TC_CUP
+ .byt "3^W^A4^Z^S^E", 1 /* shift */
+ .byt "5^R^D6^C^F^T^X7^Y^G8^B^H^U^V"
+ .byt "9^I^J0^M^K^O^N+^P^L-.:@,"
+ .byt "\*;", TC_CLR, 1 /* shift */, "=^^/"
+ .byt "1_", 2 /* control */, "2 ", 6 /* C= */, "Q", 3 /* stop */
+
+ .)
+
diff --git a/dump/oa-2.0.9/arch/c64/devices/piec_c64.a65 b/dump/oa-2.0.9/arch/c64/devices/piec_c64.a65
new file mode 100644
index 0000000..1e89826
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/devices/piec_c64.a65
@@ -0,0 +1,460 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * C64 parallel IEC bus
+ * hardware routines for fsiec
+ *
+ */
+
+
+#define TPI $df00
+#define CIA2 $dd00
+
+#include "chips/tpi6525.i65"
+#include "chips/cia6526.i65"
+
+ .data
+byte .byt 0
+bytfl .byt 0
+eoifl .byt 0
+ .text
+
+ /* when we get the IEC semaphore, we have nothing to do left,
+ assuming that no other program changes the I/O lines.
+ The timer is configured correctly in setti every time it
+ is needed. We also assume that any timer interrupt is
+ disabled by other devices when releasing the interface. */
+&getif .(
+ clc
+ ldx #SEM_CIA2TB
+ jsr PSEM
+#ifdef NMIDEV
+ lda #NMI_OFF
+ jmp CTRLNMI
+#else
+ rts
+#endif
+ .)
+
+&freif .(
+#ifdef NMIDEV
+ lda #NMI_ON
+ jsr CTRLNMI
+#endif
+ ldx #SEM_CIA2TB
+ jmp VSEM
+ .)
+
+&IECINIT .(
+ jsr getif
+ ; the following lines are from the original code
+ lda #%00011100
+ sta TPI+TPI_DDPC
+ cmp TPI+TPI_DDPC
+ bne inix
+ lda #0
+ sta TPI+TPI_PC
+
+ sta TPI+TPI_DDPB
+ cmp TPI+TPI_DDPB
+ bne inix
+
+ lda #%00111010
+ sta TPI+TPI_PA
+ lda #%00111111
+ sta TPI+TPI_DDPA
+ cmp TPI+TPI_DDPA
+ bne inix
+
+ lda TPI+TPI_PC
+ and #%11111110
+ sta TPI+TPI_PC
+ ldy #255
+l0 dey
+ nop
+ bne l0
+ lda TPI+TPI_PC
+ ora #1
+ sta TPI+TPI_PC
+
+ lda #%00111001
+ sta TPI+TPI_PA
+
+ lda #0
+ sta byte
+ sta bytfl
+ sta eoifl
+ clc
+ .byt $24
+inix sec
+ php
+ jsr freif
+ plp
+ rts
+ .)
+
+/* Blocktiefe 2 */
+
+aout=atnout
+/*
+aout
+ sei
+ pha
+ jsr iecsetoutput
+ lda #0
+ sta status
+; jsr nrfdhi
+; jsr ndachi
+;jsr eoilo
+
+ lda bytfl
+ beq oo1
+ sec
+ ror eoifl
+ jsr iecout
+ lda #0
+ sta bytfl
+;jsr eoihi
+
+oo1
+ pla
+ sta byte
+*/
+iec0out
+ jsr iecsetoutput
+ jsr waitdavhi
+ jsr atnlo
+
+iecout .(
+ sei
+; jsr davhi
+lda #%00010010
+ora TPI+TPI_PA
+sta TPI+TPI_PA
+; jsr iecsetoutput
+ jsr tstdev ;nrfdhi & ndachi = z
+ beq devnotpr
+ lda byte
+ jsr out
+ox1 JSR setti
+ox1a JSR fragti
+ BNE XTO
+ ;lda VIA1+VIA_DRB
+ lda TPI+TPI_PA
+ bpl ox1a ; wait nrfd hi
+ lda eoifl
+ bpl o0
+ jsr eoilo
+o0 jsr davlo
+ jsr setti
+o1 jsr fragti
+ bne timeout
+ jsr fragndac ; wait ndac hi
+ bcc o1
+ jsr davhi
+ jsr eoihi
+ lsr eoifl
+ jsr clrdata ; alle data hi
+ox2 ;lda VIA1+VIA_DRB
+ lda TPI+TPI_PA
+ ;lsr
+ ;bcs ox2 ; wait ndaclo
+ asl
+ bmi ox2
+ clc
+ cli
+ rts
+
+XTO JSR YIELD
+ SEI
+ JMP ox1
+ .)
+
+&seclisten sta byte
+ jsr iecout
+ jsr atnhi
+ cli
+ rts
+
+timeout lda #1
+ .byt $2c
+devnotpr lda #128
+ jsr seterror
+ jsr eoihi
+ jsr davhi
+ jsr ndachi
+ sec
+ cli
+ rts
+
+§alk sta byte
+ jsr iecout
+; jsr nrfdlo
+; jsr ndaclo
+; jsr atnhi
+; jsr iecsetinput
+sectalkend
+lda #%00111101
+and TPI+TPI_PA
+sta TPI+TPI_PA
+lda #%11000011
+sta TPI+TPI_DDPA
+lda #0
+sta TPI+TPI_DDPB
+jmp atnhi
+ rts
+
+/*
++IECOUT bit bytfl
+ bmi oo2
+ dec bytfl
+ clc
+ bne oo3
+oo2 pha
+ jsr iecout
+ pla
+oo3 sta byte
+ lda status
+ cmp #1 ; ungleich 0 = c
+ rts
+*/
+
+&UNTALK jsr atnlo
+ lda #95
+ .byt $2c
+&UNLISTEN lda #63
+ jsr aout
+; jsr atnhi
+jsr sectalkend
+/*
+.(
+lda TPI+TPI_PA
+cmp #$38
+bne err
+lda TPI+TPI_PB
+beq ok
+err .byt 2
+ok
+.)
+*/
+lda #%11111101
+ora TPI+TPI_PA
+sta TPI+TPI_PA
+
+; lda #%00111111
+; sta TPI+TPI_DDPA
+; lda #%00111001
+; sta TPI+TPI_PA
+
+ cli
+ rts
+
+timeoutx jmp timeout
+
+&IECIN .(
+ sei
+ jsr ndaclo
+ jsr nrfdhi
+i1 ;lda VIA1+VIA_DRB
+ ;cmp VIA1+VIA_DRB
+ lda TPI+TPI_PA
+ cmp TPI+TPI_PA
+ bne i1
+ asl
+ bcc i1 ; wait nrfd hi
+ jsr setti
+o11 jsr fragti
+ bne timeoutx ; c= abgelaufen
+ jsr fragdav ; wait dav lo
+ bcs o11
+ jsr nrfdlo
+ jsr frageoi
+ bcs o12
+ lda #64
+ jsr seterror
+o12 jsr bytin
+ pha
+ jsr ndachi
+o12a jsr fragdav
+ bcc o12a
+ jsr ndaclo
+ lda status
+ bne o12c
+ pla
+ clc
+ cli
+ rts
+o12c pla
+ sec
+ cli
+ rts
+ .)
+
+iecsetinput
+ lda TPI+TPI_PA
+ and #%00111101 ;61
+ sta TPI+TPI_PA
+ lda #%11000011 ;195
+ sta TPI+TPI_DDPA
+ lda #0
+ sta TPI+TPI_DDPB
+ rts
+
+iecsetoutput
+ lda #%00111011
+ sta TPI+TPI_DDPA
+ lda #$ff
+ sta TPI+TPI_PB
+ sta TPI+TPI_DDPB
+ lda #%11111010 ; ?
+ sta TPI+TPI_PA ; ?
+ rts
+
+atnhi lda TPI+TPI_PA
+ ora #%00001000
+ sta TPI+TPI_PA
+ rts
+atnlo lda TPI+TPI_PA
+ and #%11110111
+ sta TPI+TPI_PA
+ rts
+
+eoihi lda TPI+TPI_PA
+ ora #%00100000
+ sta TPI+TPI_PA
+ rts
+eoilo lda TPI+TPI_PA
+ and #%11011111
+ sta TPI+TPI_PA
+ rts
+
+ndachi lda TPI+TPI_PA
+ ora #%01000000
+ sta TPI+TPI_PA
+ rts
+ndaclo lda TPI+TPI_PA
+ and #%10111111
+ sta TPI+TPI_PA
+ rts
+
+nrfdhi lda TPI+TPI_PA
+ ora #%10000000
+ sta TPI+TPI_PA
+ rts
+nrfdlo lda TPI+TPI_PA
+ and #%01111111
+ sta TPI+TPI_PA
+ rts
+
+davhi lda TPI+TPI_PA
+ ora #%00010000
+ sta TPI+TPI_PA
+ rts
+davlo lda TPI+TPI_PA
+ and #%11101111
+ sta TPI+TPI_PA
+ rts
+
+waitdavhi lda TPI+TPI_PA
+ cmp TPI+TPI_PA
+ bne waitdavhi
+ and #%00010000
+ beq waitdavhi
+ rts
+
+tstdev lda TPI+TPI_PA
+ cmp TPI+TPI_PA
+ bne tstdev
+ and #%11000000
+ cmp #%11000000
+ rts
+
+clrdata lda #<-1
+ sta TPI+TPI_PB
+ rts
+
+out eor #$ff
+ sta TPI+TPI_PB
+ rts
+
+waitnrfdhi
+ lda TPI+TPI_PA
+ cmp TPI+TPI_PA
+ bne waitnrfdhi
+ asl
+ bcc waitnrfdhi
+ rts
+
+fragndac lda TPI+TPI_PA
+ cmp TPI+TPI_PA
+ bne fragndac
+ ;lsr
+ asl
+ asl
+ rts
+
+fragdav lda TPI+TPI_PA
+ cmp TPI+TPI_PA
+ bne fragdav
+ asl
+ asl
+ asl
+ asl
+ rts
+
+bytin lda TPI+TPI_PB
+ eor #$ff
+ rts
+
+&setti lda CIA2+CIA_CRB
+ and #%11111110
+ sta CIA2+CIA_CRB
+ lda #<65000
+ ;sta VIA1+VIA_T1CL
+ sta CIA2+CIA_TBL
+ lda #>65000
+ ;sta VIA1+VIA_T1CH
+ sta CIA2+CIA_TBH
+ lda CIA2+CIA_ICR ; clear overflow flag
+ lda #%00010001
+ sta CIA2+CIA_CRB
+ rts
+
+&fragti lda CIA2+CIA_ICR
+ and #%00000010
+ rts
+
+frageoi lda TPI+TPI_PA
+ cmp TPI+TPI_PA
+ bne frageoi
+ asl
+ asl
+ asl
+ rts
+
+#undef TPI
+#undef CIA2
+
+
diff --git a/dump/oa-2.0.9/arch/c64/devices/ser_9600.a65 b/dump/oa-2.0.9/arch/c64/devices/ser_9600.a65
new file mode 100644
index 0000000..aa5690c
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/devices/ser_9600.a65
@@ -0,0 +1,558 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * This is a driver for the newly developed 9600 baud RS232 interface
+ * for the C64 and the C128. It uses the shift registers of the two
+ * CIA 6526 for receiving and transmitting bytes.
+ * Currently it runs on 1MHz CPU clock (i.e. C64) only.
+ *
+ * When sending, it shifts the data byte out through the CIA1 SR,
+ * adding a start bit at the beginning and 7 stopbits at the end,
+ * which makes up two bytes for the SR. It should be possible to compress
+ * the stuff, but not now...
+ * When receiving, we wait for an NMI at Flag2, that comes with the
+ * received start bit. Then C64CIA2 TimerB is started and gives pulses
+ * at PB7, which are routed to CNT2 at the userport. The C64CIA2 shifts
+ * the incoming data bits to the SR and generates an NMI when the SR
+ * is full.
+ * This procedure slows down sending, but enables us to receive at
+ * 9600 baud. It has to be guaranteed that the NMI routine is done
+ * within a bit's time (i.e. about 100 CPU cycles @ 1MHz) at 9600 baud.
+ *
+ * Only 9600 Baud are supported now. Timer values etc are taken from
+ * the miniterm program by Daniel Dallmann
+ */
+
+ .(
+ .word devend2
+ jmp prg1
+ .asc "ser",sernr, 0
+-sernr += 1
+
+/*
+ * status: Bit 0 = 1= handshake enabled
+ * 1 : 1= no ACIA found
+ * 4 : 1= we want to process NMIs
+ * 5 : 1= set RTS hi
+ * 6 : 1= we are transmitting
+ * 7 : 1= we are receiving
+ *
+ */
+
+ .data
+dev .byt 0
+div .byt 0
+status .byt 0
+instr .byt 0
+outstr .byt 0
+brkkey .byt 0
+smode .byt 0
+inp .byt 0
+outp .byt 0
+nmistate .byt 0
+
+ .zero
+rmode .byt 0
+oldnmi .word 0
+
+ .bss
+bytetab .dsb 256
+inbuf .dsb 256
+
+ .text
+
+prg1 ldx #0
+
+ stx dev
+ cmp #DC_RES
+ beq devini
+ pha
+ lda status
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+prgok pla
+ cmp #DC_IRQ
+ beq devirq1
+ jmp others
+devirq1 jmp devirq
+
+/*****************************************************************/
+
+devini .(
+ lda #0
+ sta status
+ sta instr
+ sta outstr
+
+ lda #3
+ sta brkkey
+
+ lda #$80
+ sta smode ; sending mode
+ sta rmode ; receiving <0 = wait stop bit; >0 = wait SR
+
+ lda #0
+ sta inp
+ sta outp
+
+ ; generate bit reversed data field
+ ldx #0
+l1 stx div
+ ldy #8
+ txa
+l0 lsr
+ rol div
+ dey
+ bne l0
+ lda div
+ sta bytetab,x
+ inx
+ bne l1
+
+ php
+ sei
+
+ ; program CIA1 timer A for sending
+
+ lda C64CIA2+CIA_DDRA ; pa2 input
+ and #%11111011
+ sta C64CIA2+CIA_DDRA
+ lda #%00000001
+ sta C64CIA1+CIA_ICR ; disable IRQ for CIA1 timer A
+ lda #%10001000
+ sta C64CIA1+CIA_ICR ; enable IRQ for CIA1 SR full
+ lda #<50
+ sta C64CIA1+CIA_TAL
+ lda #>50
+ sta C64CIA1+CIA_TAH
+ lda #%01010001 ; start timer A, force load, cont mode, SR out
+ sta C64CIA1+CIA_CRA
+
+ lda #$df
+ sta C64CIA1+CIA_SDR ; send byte $ff
+ lda #$ff
+ sta C64CIA1+CIA_SDR ;
+
+ lda C64CIA1+CIA_ICR ; clear actual irqs
+
+ ; program CIA2 for receiving
+
+ lda #%01111111
+ sta C64CIA2+CIA_ICR ; disable all NMI
+ lda C64CIA2+CIA_CRA
+ and #%10111111
+ sta C64CIA2+CIA_CRA ; set SDR for input
+
+ ; program CIA2 for I/O
+ lda #%10000110
+ sta C64CIA2+CIA_PRB
+ lda C64CIA2+CIA_DDRB
+ and #%10000110
+ ora #%10000110
+ sta C64CIA2+CIA_DDRB
+
+ lda #$80
+ sta rmode
+
+ sec
+ lda #NMIserial
+ jsr SETNMI ; old NMIvector is saved by SETNMI
+
+ plp
+ clc
+ rts
+ .)
+
+/*****************************************************************/
+
+devirq .(
+ lda C64CIA1+CIA_ICR
+ bpl noirq
+ and #%00001000
+ bne notmyirq ; due to the 6526 design, all irq flags are lost now
+
+ lda smode
+ ora #$80
+ sta smode
+
+notmyirq
+ lda #E_OK
+ .byt $2c
+noirq lda #E_NOIRQ
+ pha
+
+ ; try to send something
+ lda smode
+ bpl endtx
+
+ bit status
+ bvc endtx ; we don't send
+
+ bit C64CIA2+CIA_PRB
+ bvc endtx ; CTS hi
+
+ ldx instr ; send new data byte
+ jsr GETC
+ bcs test2
+
+ tax
+ lda bytetab,x
+ lsr
+ sta C64CIA1+CIA_SDR ; 7 data bits, 1 start bit
+ ror
+ ora #$7f
+ sta C64CIA1+CIA_SDR ; 1 data bit, 7 stop bits
+
+ lda #0
+ sta smode
+ beq endtx
+
+test2 cmp #E_EOF
+ bne endtx
+ jsr txoff
+
+ ; now let's see if there's something to receive
+endtx
+ bit status
+ bpl endirq
+
+ ldx outp
+ cpx inp
+ beq nobyt ; no byte to fetch
+
+fetch lda inbuf,x
+ ldx outstr
+
+ cmp brkkey
+ bne nobrk
+ lda #SC_SSTAT
+ ldy #SCE_BRK
+ jsr STRCMD
+ lda brkkey
+nobrk
+ jsr PUTC
+ bcs test
+
+ inc outp
+
+nobyt ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+test bcc rx2end
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp endirq
+tstwater
+ cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ bne nofull
+ jsr rtshi
+ jmp endirq
+nofull
+ cmp #E_SHWM
+ bne twl
+wh ldx #0
+ jsr rtshi
+ jmp rx2end
+twl cmp #E_SLWM
+ bne rx2end
+wl ldx #0
+ jsr rtslo
+
+rx2end ldx outp
+ cpx inp
+ bne fetch
+
+endirq pla
+ lda #E_NOIRQ
+ rts
+
+ .)
+
+/*****************************************************************/
+
+ctrlnmi .(
+ sta nmistate
+ cmp #NMI_ON
+ bne off
+ lda status
+ and #%00100000
+ bne norts
+ jsr rts_lo
+norts lda status
+ and #%00010000
+ beq nonmi
+ jsr nmi_on
+nonmi rts
+
+off
+ jsr rts_hi
+ jsr nmi_off
+ rts
+ .)
+
+ ; structure before NMI routine as required by SETNMI
+ .word oldnmi
+ .word ctrlnmi
+NMIserial .(
+ pha
+ cld
+ bit rmode
+ bmi startbit
+databyte
+ txa
+ pha
+
+ lda #%00010010
+ sta C64CIA2+CIA_CRB ; stop timer
+ lsr
+ sta C64CIA2+CIA_ICR ; disable SDR NMI
+ lda #%10010000
+ sta C64CIA2+CIA_ICR ; enable Flag2 NMI
+
+ inc rmode ; $7f -> $80
+
+ lda C64CIA2+CIA_SDR ; only SDR NMI should be set
+
+ tax
+ lda bytetab,x
+ ldx inp
+ sta inbuf,x
+ inc inp
+
+ pla
+ tax
+ pla
+ bit C64CIA2+CIA_ICR
+ jmp (oldnmi)
+
+startbit
+ dec rmode ; $80 -> $7f
+ lda C64CIA2+CIA_SDR
+ lda #%00010011
+ sta C64CIA2+CIA_CRB ; start timer
+ sta C64CIA2+CIA_ICR ; disable Flag2 NMI
+ lda #%10001000
+ sta C64CIA2+CIA_ICR ; enable SR NMI
+ pla
+ bit C64CIA2+CIA_ICR
+ jmp (oldnmi)
+
+ .)
+
+nmion .(
+ lda status
+ ora #%00010000
+ sta status
+ lda nmistate
+ cmp #NMI_ON
+ bne nonmi
+&nmi_on
+ lda #<100
+ sta C64CIA2+CIA_TBL
+ lda #>100
+ sta C64CIA2+CIA_TBH
+
+ lda #%00010010
+ sta C64CIA2+CIA_CRB ; Timer B force load, stop, pulse PB7
+
+ lda C64CIA2+CIA_ICR ; clear NMI
+ lda #%10011000 ; enable IRQ for Flag2
+ sta C64CIA2+CIA_ICR
+nonmi
+ rts
+ .)
+
+nmioff .(
+ lda status
+ and #%11101111
+ sta status
+&nmi_off
+ lda #%00011000
+ bit rmode
+ bpl nmi_off ; wait for char received
+ sta C64CIA2+CIA_ICR
+ lda C64CIA2+CIA_ICR
+ rts
+ .)
+
+/*****************************************************************/
+
+rtshi
+ lda status
+ ora #%00100000
+ sta status
+rts_hi
+ lda C64CIA2+CIA_PRB
+ and #%11111101
+ sta C64CIA2+CIA_PRB
+ rts
+
+rtslo
+ lda status
+ and #%11011111
+ sta status
+ lda nmistate
+ cmp #NMI_ON
+ bne nolo
+rts_lo
+ lda C64CIA2+CIA_PRB
+ ora #%00000010
+ sta C64CIA2+CIA_PRB
+nolo
+ rts
+
+/*****************************************************************/
+
+others cmp #DC_GS ; set stream to get data from
+ bne o1
+ lda status
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS ; set stream to put data to
+ bne o2
+ lda status
+ and #DC_SW_RX
+ bne devonx
+ tya
+ sta outstr
+okx jmp ok
+o2 cmp #DC_RX_ON ; switch receiver on
+ bne o3
+ ; lda #3
+ ; sta brkkey
+ jsr nmion
+ jsr rtslo
+ ;jsr dtrlo
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON ; switch sender on
+ bne o4
+ ;jsr dtrlo
+ lda #DC_SW_TX
+o2a ora status
+ sta status
+ bne okx
+o4 cmp #DC_RX_OFF ; switch receiver off, send eof to stream
+ bne o5
+rxoff ldx dev
+ lda status
+ and #DC_SW_RX
+ beq devoffx
+ jsr rtshi
+ jsr nmioff
+ lda outstr
+ tax
+ lda #SC_EOF
+ jsr STRCMD
+ ldx dev
+ lda status
+ and #255-DC_SW_RX
+ sta status
+ jmp checkdtr
+
+devoffx jmp devoff
+
+o5 cmp #DC_TX_OFF ; switch sender off, send nul to stream
+ bne o6
+txoff ldx dev
+ lda status
+ and #DC_SW_TX
+ beq devoffx
+ lda instr
+ tax
+ lda #SC_NUL
+ jsr STRCMD
+ ldx dev
+ lda status
+ and #255-DC_SW_TX
+ sta status
+checkdtr
+ and #DC_SW_TX+DC_SW_RX
+ bne active
+ ;jsr dtrhi
+active jmp ok
+
+o6 cmp #DC_HS ; set handshake -- currently ignored (TODO)
+ bne o6a
+ lda status
+ and #255-1
+ sta status
+ tya
+ and #1
+ ora status
+ sta status
+ jmp ok
+
+o6a cmp #DC_SPD ; set speed - currently ignored here
+ bne o7
+ jmp ok
+
+o7 cmp #DC_ST ; get status...
+ beq ok
+ cmp #DC_EXIT ; disable everything
+ bne o8 ; onotimp
+ jsr rxoff
+ jsr txoff
+ ldx dev
+ lda status
+ ora #2
+ sta status
+ bne ok
+o8
+ cmp #DC_BRKKEY
+ bne onotimp
+ lda brkkey
+ sty brkkey
+ tay
+ ; jmp ok
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+devend2 .)
+
diff --git a/dump/oa-2.0.9/arch/c64/devices/ser_acia1.a65 b/dump/oa-2.0.9/arch/c64/devices/ser_acia1.a65
new file mode 100644
index 0000000..eea51d0
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/devices/ser_acia1.a65
@@ -0,0 +1,324 @@
+/****************************************************************************
+
+ OS/A65 Version 1.3.3
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+ *
+ * This device is still in the old 1.3 source format.
+ * It also lacks the BRKKEY feature of the 1.4 kernel
+ *
+ * To use it, you have to convert it to 1.4 source format and
+ * implement the brkkey feature!
+ */
+
+/*
+ * This is a ACIA 6551 serial line driver for CS/A65. It uses the
+ * hardware installed in my personal C64. The 6551 is at address $d600.
+ *
+ * The ACIA 6551 has a real bad 'feature'. The RTS/CTS lines are not
+ * independent from the transmitter and receiver. Instead, making
+ * RTS high automatically disables receiver _and_ transmitter!
+ * Also an incoming CTS high immediately disables the transmitter.
+ * That's why I use the DSR input for the CTS modem line. This line
+ * can be checked independently.
+ */
+
+#ifdef ACIABASE
+#define ACIA ACIABASE
+#else
+#define ACIA $d600
+#endif
+
+#print ACIA
+
+#define Anzdev 1
+
+ .(
+ .word devend2
+ jmp prg1
+ .asc "ser", sernr ,0
+-sernr += 1
+
+/*
+ * status: Bit 0 = 1= handshake enabled
+ * 1 : 1= no ACIA found
+ * 5 : 1= set RTS hi
+ * 6 : 1= we are transmitting
+ * 7 : 1= we are receiving
+ *
+ */
+
+dev =sysmem
+div =sysmem+1
+status =sysmem+2
+instr =sysmem+Anzdev*1+2
+outstr =sysmem+Anzdev*2+2
+-sysmem +=Anzdev*3+2
+
+prg1 ldx #0
+
+ stx dev
+ cmp #DC_RES
+ beq devini
+ pha
+ lda status,x
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini lda #0
+ sta status,x
+ sta instr,x
+ sta outstr,x
+
+ STA ACIA+ACIA_SR ; programmed reset
+ LDA #%00011000 ; 1200 BAUD, 1 stop bit, 8 data bits
+ STA ACIA+ACIA_CTRL
+ cmp ACIA+ACIA_CTRL
+ bne devx
+ LDA #%00000101 ; no parity, normal receiver mode,
+ ; RTS low, Tx interrupt enabled
+ STA ACIA+ACIA_CMD
+ cmp ACIA+ACIA_CMD
+ bne devx
+ LDA ACIA+ACIA_SR ; clear interrupt
+
+ clc
+ rts
+
+devx lda status,x
+ ora #2
+ sta status,x
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq
+ .(
+ lda ACIA+ACIA_SR
+ bpl irqend ; not this ACIA
+ tay
+ bit status ; check if receiving
+ bpl tx ; no -> tx
+ and #%00001000 ; Rx data register full?
+ beq nobyt ; no -> nobyt
+ ldx outstr
+ lda ACIA
+ jsr PUTC
+ bcs test
+
+nobyt ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+tstwater cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh ldx #0
+ jsr rtshi
+ jmp tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+wl ldx #0
+ jsr rtslo
+
+tx bit status
+ bvc irqhs
+ tya
+ and #%00010000 ; transmit data register empty?
+ beq irqhs ; no then -> irqhs
+
+ lda #32
+ bit status
+ bne endsend ; do not send any more to make RTS high.
+
+ tya
+ and #%01000000 ; DSR high?
+ bne irqhs ; -> irqhs
+
+ ldx instr ; send new data byte
+ jsr GETC
+ bcs test2
+ sta ACIA
+ bcc irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs lda ACIA+ACIA_SR
+ lda #E_OK ; irq source removed
+ rts
+irqend lda #E_NOIRQ ; no irq source found
+ rts
+
+endsend
+ lda ACIA+ACIA_CMD
+ and #%11110011
+ sta ACIA+ACIA_CMD
+ jmp irqhs
+
+ .)
+
+rtshi
+ lda status,x
+ ora #%00100000
+ sta status,x
+ rts
+
+rtslo
+ lda ACIA+ACIA_CMD
+ ora #%00000100
+ sta ACIA+ACIA_CMD
+ lda status,x
+ and #%11011111
+ sta status,x
+ rts
+
+others cmp #DC_GS
+ bne o1
+ lda status,x
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr,x
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS
+ bne o2
+ lda status,x
+ and #DC_SW_RX
+ bne devonx
+ tya
+ sta outstr,x
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+ jsr rtslo
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+ lda #DC_SW_TX
+o2a ora status,x
+ sta status,x
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+rxoff ldx dev
+ lda status,x
+ and #DC_SW_RX
+ beq devoffx
+ lda outstr,x
+ tax
+ lda #SC_EOF
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_RX
+ sta status,x
+
+rx1off ;jsr rts1hi
+ ;bcc okx
+ jmp okx
+devoffx jmp devoff
+o5 cmp #DC_TX_OFF
+ bne o6
+txoff ldx dev
+ lda status,x
+ and #DC_SW_TX
+ beq devoffx
+ lda instr,x
+ tax
+ lda #SC_NUL
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_TX
+ sta status,x
+ jmp ok
+o6 cmp #DC_HS
+ bne o6a
+ lda status,x
+ and #255-1
+ sta status,x
+ tya
+ and #1
+ ora status,x
+ sta status,x
+ jmp ok
+o6a cmp #DC_SPD
+ bne o7
+ tya
+ and #%00001111
+ sta div
+
+ lda ACIA+ACIA_CTRL
+ and #%11110000
+ ora div
+ sta ACIA+ACIA_CTRL
+ jmp ok
+
+o7 cmp #DC_ST
+ beq ok
+ cmp #DC_EXIT
+ bne onotimp
+ jsr rxoff
+ jsr txoff
+ ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+ sta ACIA+ACIA_SR ; programmed reset
+ bne ok
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+devend2 .)
+
diff --git a/dump/oa-2.0.9/arch/c64/devices/siec_c64.a65 b/dump/oa-2.0.9/arch/c64/devices/siec_c64.a65
new file mode 100644
index 0000000..784927b
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/devices/siec_c64.a65
@@ -0,0 +1,415 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * C64 serial IEC bus
+ * hardware routines for fsiec
+ *
+ */
+
+#define CIA2 $dd00
+
+#include "chips/cia6526.i65"
+
+ .zero
+cnt2 .byt 0
+byte .byt 0
+bytfl .byt 0
+eoifl .byt 0
+ .text
+
+ /* when we get the IEC semaphore, we have nothing to do left,
+ assuming that no other program changes the I/O lines.
+ The timer is configured correctly in setti every time it
+ is needed. We also assume that any timer interrupt is
+ disabled by other devices when releasing the interface. */
+&getif .(
+ clc
+ ldx #SEM_CIA2TB
+ jsr PSEM
+#ifdef NMIDEV
+ lda #NMI_OFF
+ jmp CTRLNMI
+#else
+ rts
+#endif
+ .)
+
+&freif .(
+#ifdef NMIDEV
+ lda #NMI_ON
+ jsr CTRLNMI
+#endif
+ ldx #SEM_CIA2TB
+ jmp VSEM
+ .)
+
+&IECINIT .(
+ jsr getif
+ /* init i/o */
+
+ lda CIA2+CIA_DDRA
+ and #%00111111
+ ora #%00111000
+ sta CIA2+CIA_DDRA
+ lda CIA2+CIA_PRA
+ and #%11000111
+ sta CIA2+CIA_PRA
+
+ lda %00000010
+ sta CIA2+CIA_ICR ; clean timer b irq mask
+
+ lda #0
+ sta status
+ sta cnt2
+ sta bytfl
+ sta eoifl
+ clc
+ .byt $24
+inix sec
+ php
+ jsr freif
+ plp
+ rts
+ .)
+
+&IECIN .(
+ sei
+ lda #0
+ sta eoifl
+ lda #8
+ sta cnt2
+ jsr clkhi
+; jsr datalo
+
+l14 ; jsr testatn
+ ; bcs atnin
+ lda CIA2+CIA_PRA ; wait clkhi
+ cmp CIA2+CIA_PRA
+ bne l14
+ and #$40
+ beq l14
+
+l19 jsr setti
+ jsr datahi
+
+l16 jsr fragti
+ bne l15 ; abgelaufen
+ ; jsr testatn
+ ; bcs atnin
+ bit CIA2+CIA_PRA ; wait clklo
+ bvs l16
+ bvc l17
+
+l15 lda eoifl
+ beq l18
+ lda #2
+ jmp error
+l18 dec eoifl
+ jsr datalo
+jsr clkhi
+ jsr waitus
+ lda #$40 ; EOF
+ jsr seterror
+ bne l19
+
+l17
+l20
+ lda CIA2+CIA_PRA
+ asl
+ bpl l20
+ ror byte
+
+l21
+ bit CIA2+CIA_PRA
+ bvs l21
+
+ dec cnt2
+ bne l20
+
+ jsr datalo
+
+ bit status
+ bvc l22
+ jsr endhndshk
+ lda byte
+ sec
+ cli
+ rts
+
+l22 lda byte
+ clc
+ cli
+ rts
+
+ .)
+
+/*
+atnin jsr datalo
+ jsr clkhi
+ sec
+ rts
+*/
+
+nodev lda #$80
+;inc $d020
+error jsr seterror
+ jsr atnhi
+endhndshk jsr waitus
+; jsr datahi
+ jsr clkhi
+jsr datahi
+ sec
+ cli
+ rts
+
+iec0out .(
+ sei
+ jsr datahi
+
+cmp #$3f
+bne l1xxx
+jsr clkhi
+l1xxx
+
+ jsr atnlo
+&iec2out sei
+ jsr clklo
+ jsr datahi
+ jsr waitms
+&iecout sei
+ jsr datahi
+l0
+ jsr checkin
+ bcs nodev
+
+ jsr clkhi
+ bit eoifl
+ bpl l3
+ ; eoi senden
+l4
+ jsr checkin
+ bcc l4
+l5
+ jsr checkin
+ bcs l5
+l3
+ jsr checkin
+ bcc l3
+
+ jsr clklo
+ lda #8
+ sta cnt2
+l6
+ lda CIA2+CIA_PRA
+ cmp CIA2+CIA_PRA
+ bne l6
+ asl
+ bcc timexout
+
+ ror byte ; bit setzen
+ bcs l7
+ jsr datalo
+ bne l8
+l7 jsr datahi
+
+l8 jsr clkhi
+; jsr waitus
+nop:nop:nop:nop
+; jsr dhiclo
+lda CIA2+CIA_PRA
+and #%11011111
+ora #%00010000
+sta CIA2+CIA_PRA
+ dec cnt2
+ bne l6
+
+ jsr waitdlo
+ bcs timeout
+; cli
+ rts
+timeout lda #3
+ .byt $2c
+timexout lda #4
+; cli
+ jmp error
+ .)
+
+/**************************************************************************/
+
+clklo
+ lda CIA2+CIA_PRA
+ ora #%00010000
+ sta CIA2+CIA_PRA
+ rts
+clkhi
+ lda CIA2+CIA_PRA
+ and #%11101111
+ sta CIA2+CIA_PRA
+ rts
+datalo
+ lda CIA2+CIA_PRA
+ ora #%00100000
+ sta CIA2+CIA_PRA
+ rts
+datahi
+ lda CIA2+CIA_PRA
+ and #%11011111
+ sta CIA2+CIA_PRA
+ rts
+atnlo
+ lda CIA2+CIA_PRA
+ ora #%00001000
+ sta CIA2+CIA_PRA
+ rts
+atnhi
+ lda CIA2+CIA_PRA
+ and #%11110111
+ sta CIA2+CIA_PRA
+ rts
+
+;dhiclo
+; lda CIA2+CIA_PRA
+; and #%11011111
+; ora #%00010000
+; sta CIA2+CIA_PRA
+; rts
+
+checkin .(
+ lda CIA2+CIA_PRA
+ cmp CIA2+CIA_PRA
+ bne checkin
+ asl
+ rts
+ .)
+
+/*
+testatn .(
+ lda VIA1+VIA_DRA
+ bmi tstatn
+ and #%00100000
+ beq c
+s sec
+ rts
+tstatn and #%00100000
+ beq s
+c clc
+ rts
+ .)
+*/
+
+
+waitdlo .(
+ jsr setti
+w1 jsr fragti
+ bne w2
+ lda CIA2+CIA_PRA
+ cmp CIA2+CIA_PRA
+ bne w1
+ asl
+ bcs w1
+ rts
+w2 sec
+ rts
+ .)
+
+&setti
+lda CIA2+CIA_CRB ; stop timer
+and #%11111110
+sta CIA2+CIA_CRB
+ lda #<1000
+ sta CIA2+CIA_TBL
+ lda #>1000
+ sta CIA2+CIA_TBH
+lda CIA2+CIA_ICR ; clear irq flag
+; lda CIA2+CIA_CRB
+; and #%10011111 ; count Phi2
+; ora #%00011001 ; start, force load and single shot.
+lda #%00010001
+ sta CIA2+CIA_CRB
+ rts
+&fragti
+ lda CIA2+CIA_ICR
+ and #%00000010
+ rts
+
+waitms txa
+ ldx #$b6
+ bne w4
+waitus txa
+ ldx #8
+w4 dex
+ bne w4
+ tax
+ rts
+
+sectalk .(
+ sei
+ sta byte
+ jsr iec2out
+ bcs st1
+ jsr datalo
+ jsr atnhi
+ jsr clkhi
+st2 ;bit VIA1+VIA_DRA
+ bit CIA2+CIA_PRA
+ bvs st2
+st1 cli
+ rts
+ .)
+
+seclisten .(
+ sei
+ sta byte
+ jsr iec2out
+ jsr atnhi
+ cli
+ rts
+ .)
+
+&UNTALK .(
+ sei
+ jsr clklo
+ lda #$5f
+ jsr atnout
+ jsr atnhi
+ jsr clkhi
+ jsr datahi
+ cli
+ rts
+ .)
+
+&UNLISTEN .(
+ lda #$3f
+ sei
+ jsr atnout
+ jsr atnhi
+ jsr clkhi
+ cli
+ rts
+ .)
+
+#undef CIA2
+
+
diff --git a/dump/oa-2.0.9/arch/c64/kernel/kenv.a65 b/dump/oa-2.0.9/arch/c64/kernel/kenv.a65
new file mode 100644
index 0000000..ec219e1
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/kernel/kenv.a65
@@ -0,0 +1,406 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/* TODO: make stack addr computation a table lookup, which is faster */
+
+/* Struct Task Environment Entry */
+
+/* we have three structs now:
+ * TE_* for task environment handling - not needed for system without
+ * memory management
+ * TT_* task table, contains STD streams, etc
+ * TH_* thread table, has stack info and state
+ */
+
+#define TE_SLEN 0 /* we don't have envs */
+
+/************************************************************************
+ * These routines are needed in the env section!
+ * inienv
+ * setthread
+ * initsp
+ * push
+ * pull
+ * memtask
+ * memsys
+ *
+ * sbrk
+ * getenv
+ * freenv
+ */
+
+&&enmem = notimp ; to enable memory blocks to the kernel
+&&setblk = notimp ; to set memory blocks in MMU mapping
+
+#ifdef STACKCOPY
+ .zero
+zp .word 0
+
+ .data
+
+Stacks .dsb MAXNTHREADS * STACKSIZE
+
+ .text
+#endif
+
+
+&inienv .(
+ lda #<-1
+ sta actThread
+ sta actTask
+ lda #1
+ sta Syscnt
+ clc
+ rts
+ .)
+
+setthread .(
+ .data
+newThread .byt 0
+ .text
+
+ cmp actThread
+ bne doit
+ rts
+doit
+ sta newThread
+
+ ldx actThread
+ cpx #<-1
+ beq nosave
+
+ lda THREADSAVE
+ sta threadTab + TH_LIBSAVE,x
+ lda THREADSAVE+1
+ sta threadTab + TH_LIBSAVE+1,x
+
+#ifdef STACKCOPY
+ txa ; stack is 8 * TH_SLEN = 64
+ ldy #0
+ sty zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ clc
+ adc #Stacks
+ adc zp+1
+ sta zp+1
+ ;bcc l1
+ ;inc zp+1
+;l1
+ lda threadTab + TH_SP,x
+ tay
+ iny
+l2 cpy #STACKSIZE
+ bcs savetask
+ lda $100,y
+ sta (zp),y
+ iny
+ bne l2
+#endif
+savetask
+ ldy threadTab + TH_TASK,x
+ lda TASKSAVE
+ sta taskTab + TT_LIBSAVE,y
+ lda TASKSAVE + 1
+ sta taskTab + TT_LIBSAVE + 1,y
+nosave
+loadtask
+ ldx newThread
+ stx actThread
+ cpx #<-1
+ bne load
+ stx actTask
+ beq noload
+load
+ ldy threadTab + TH_TASK,x
+ sty actTask
+
+ lda taskTab + TT_LIBSAVE,y
+ sta TASKSAVE
+ lda taskTab + TT_LIBSAVE + 1,y
+ sta TASKSAVE + 1
+
+loadthread
+ lda threadTab + TH_LIBSAVE,x
+ sta THREADSAVE
+ lda threadTab + TH_LIBSAVE+1,x
+ sta THREADSAVE+1
+
+#ifdef STACKCOPY
+ txa
+ ldy #0
+ sty zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ clc
+ adc #Stacks
+ adc zp+1
+ sta zp+1
+ ;bcc l3
+ ;inc zp+1
+;l3
+ lda threadTab + TH_SP,x
+ tay
+ iny
+l4 cpy #STACKSIZE
+ bcs endset
+ lda (zp),y
+ sta $100,y
+ iny
+ bne l4
+#endif
+noload
+endset rts
+ .)
+
+initsp .(
+#ifdef STACKCOPY
+ lda #STACKSIZE-1
+ ;ldx actThread
+ sta threadTab + TH_SP,x
+ rts
+#else
+ .data
+divsp .byt 0
+ .text
+
+ ;ldx actThread
+ txa
+ clc
+ adc #TH_SLEN
+ sta divsp
+ asl
+ asl ; split stack
+ clc
+ adc divsp
+ sta threadTab + TH_SP,x
+ dec threadTab + TH_SP,x
+ rts
+#endif
+ .)
+
+pull .(
+ ldx actThread
+ inc threadTab + TH_SP,x
+ lda threadTab + TH_SP,x
+ tay
+ lda $0100,y
+ rts
+ .)
+
+&push .(
+ pha
+ ldx actThread
+ lda threadTab + TH_SP,x
+ tay
+ pla
+ sta $0100,y
+ dec threadTab + TH_SP,x
+ rts
+ .)
+
+ .(
+ .zero
+AC .byt 0
+XR .byt 0
+YR .byt 0
+SR .byt 0
+ADR .word 0
+&SSP .byt 0
+ .text
+
+/*
+ * this one is used to return from an interrupt. We do not need to save
+ * any registers. so for brevity, we do it as macro
+ * This doesn't check for interrupted devices, as we do not have them
+ * without MMU (so far).
+ */
+
+#define MEMTASK2() \
+ .( :\
+ sei :\
+ dec Syscnt :\
+ bne mtask :\
+ tsx :\
+ stx SSP :\
+ ldy actThread :\
+ ldx threadTab+TH_SP,y :\
+ txs :\
+mtask .)
+
+/*
+ * This is the standard return to user space. the kernel jumps here,
+ * so we need not save any return address, but use the one on the
+ * user stack.
+ */
+&&memtask .(
+ php
+ sei
+ dec Syscnt ; wieder in Task
+ bne mtask ; nein dann Ende
+#ifndef NO_DEVICE
+ bit adev ; Ruecksprung in Device
+ bpl mtask ; ja dann Ende
+#endif
+ sty YR ; sonst Task-Env setzen
+ stx XR
+ sta AC
+ pla ; SR
+
+ tsx
+ stx SSP
+
+ ldy actThread
+ ldx threadTab+TH_SP,y
+ txs
+
+ pha ; SR
+ lda AC
+ ldy YR
+ ldx XR
+mtask
+ plp
+ rts
+ .)
+
+/*
+ * This is the kernel entry routine. It leaves all registers as they
+ * are, except for the stack pointer, which is set to the system stack.
+ * also the return address is moved from user stack to system stack,
+ * to allow "JSR"-ing to memsys.
+ */
+&&memsys php
+ sei
+ pha
+ lda Syscnt
+ inc Syscnt
+ cmp #0
+#ifdef NO_DEVICE
+ beq msys
+#else
+ bne mse
+ bit adev ; called by device
+ bmi msys ; no then save stack
+#endif
+mse pla
+ plp
+ rts
+
+msys pla
+ sta AC
+ pla
+ sta SR
+ stx XR
+ ; sty YR
+ pla
+ sta ADR
+ pla
+ sta ADR+1
+ tsx
+ txa
+ ldx actThread
+ sta threadTab+TH_SP,x
+ ldx SSP
+ txs
+ lda ADR+1
+ pha
+ lda ADR
+ pha
+ lda SR
+ pha
+ lda AC
+ ldx XR
+ ; ldy YR
+ plp
+ cld
+ rts
+ .)
+
+
+&&sbrk .(
+ bcc ok
+ sec
+ lda #E_NOMEM
+ rts
+ok lda #>ROMSTART ; return available memory
+ clc
+ rts
+ .)
+
+kgetenv .(
+ ldx #0
+ clc
+ rts
+ .)
+
+freenv .(
+ clc
+ rts
+ .)
+
+/*
+ * MAPSYSBUF() maps the PCBUF of the active task into the system memory
+ * at address SYSBUF. It's not needed in a C64...
+ */
+#undef MAPSYSBUF
+#define SYSBUF $200
+
+/*
+ * MAPENV() maps the address given in a/y in env x to somewhere in the
+ * kernel map. returns mapped address in a/y
+ * MAPAENV() does the same but for the actual task (env)
+ */
+#define MAPENV()
+#define MAPAENV()
+
+
+/*
+ * needed for GETINFO, gives RAM available for task
+ */
+#define GETTASKMEM lda #>ROMSTART
+
+/*
+ * copy routines for SEND/RECEIVE and FORK
+ */
+#undef CPPCBUFRX
+#undef CPPCBUFTX
+#define CPFORKBUF()
+
+/*
+ * needed in device code to get active environment in AC
+ */
+#define GETACTENV() lda #<-1
+
+
diff --git a/dump/oa-2.0.9/arch/c64/kernel/kinit.a65 b/dump/oa-2.0.9/arch/c64/kernel/kinit.a65
new file mode 100644
index 0000000..9b5779d
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/kernel/kinit.a65
@@ -0,0 +1,141 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * This file is included in the RESET routine of the kernel,
+ * after the "sei:cld". The routine starting at the bginning
+ * of this file must initialize the hardware to the system RAM
+ * in the beginning and the system ROM in the end of the memory
+ * map. Also the system stack (pointer) is setup.
+ *
+ * In addition to that the system interrupt timer (needed for
+ * task preemtion) must be setup.
+ *
+ * After that the file must define the following macros:
+ *
+ * GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ * LEDPORT address of LED port to signal hardware failures
+ * LED_LED bit of LED bit in LEDPORT address
+ * H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ * the LED toggle routine if needed.
+ * CLRTIMER() clear the system interrupt timer interrupt
+ * KERNELIRQ() returns if an interrupt occured in the kernel
+ * or outside. Is checked by "BNE IRQ_in_Kernel"
+ * SAVEMEM() save system mem config for interrupt
+ * RESTOREMEM() restore system mem config after interrupt
+ * STARTMEM() This is used to alloc/enable memory pages found
+ * during kernel init. Takes mem size in AC as given
+ * by the kernel init. It is called _after_ inimem!
+ */
+
+/* Kernel routines for C64 hardware */
+
+/*
+ * init stack pointer for system stack
+ */
+ ldx #<-1
+ txs
+
+/*
+ * init memory configuration
+ */
+ lda #7
+ sta 0 /* CPU data direction register */
+ lda #5
+ sta 1 /* Memory configuration */
+
+/*
+ * C64 specific irq timer init, irq every 20ms
+ * We assume that the reset - or a loader program has disabled all irq
+ */
+ lda #<20000
+ sta C64CIA1+CIA_TBL ; load low byte
+ lda #>20000
+ sta C64CIA1+CIA_TBH ; load hi byte of counter value
+ lda #%00010001
+ sta C64CIA1+CIA_CRB ; start counter, counting system pulses
+ lda #%10000010
+ sta C64CIA1+CIA_ICR ; allow irq
+
+/*
+ * check zeropage RAM, jump to he_zero if failure
+ */
+#include "kernel/zerotest.a65"
+
+/*
+ * check system RAM up to ROMSTART, jump to he_ram if failure
+ * returns available RAM in 256 byte blocks in AC
+ */
+ .zero
+cnt .byt 0
+ .text
+#include "kernel/ramtest.a65"
+ cmp #MIN_MEM
+ bcc he_ram
+
+/*
+ * originally SYSPORT specific, they have a value for the C64 also...
+ */
+#define GETFREQ() lda #0
+
+#define LEDPORT $d020
+#define LED_LED 1
+
+/*
+ * as we have set the CIA1 TB irq in the kernel, we have to clear the
+ * CIA interrupt flag. This is done with reading the ICRegister.
+ * With C64NEEDCIA1 one can disable reading the ICR here. But then you
+ * have to have a device that does it!
+ */
+#ifndef C64NEEDCIA1
+#define CLRTIMER() lda C64CIA1+CIA_ICR
+#else
+#define CLRTIMER()
+#endif
+
+/*
+ * MMU systems may map task pages into kernel mem to make copying
+ * easier. This mapping has to be preserved during interrupt.
+ * SAVEMEM() saves the memory configuration, while RESTOREMEM()
+ * restores it, obviously.
+ * These routines are called _after_ "jsr memsys", so this routine
+ * has to preserve this mapping when called from kernel space,
+ * and so must memtask.
+ */
+
+#undef SAVEMEM
+#undef RESTOREMEM
+
+/*
+ * Check if we have an interrupt in the kernel
+ */
+
+#define KERNELIRQ() lda Syscnt:cmp #1
+
+/*
+ * no memory management...
+ */
+#define STARTMEM()
+
+
diff --git a/dump/oa-2.0.9/arch/c64/test/Makefile b/dump/oa-2.0.9/arch/c64/test/Makefile
new file mode 100644
index 0000000..6fdeccc
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/test/Makefile
@@ -0,0 +1,75 @@
+
+apps = lsh
+sysapps = mon slipd
+files = mkdir rmdir rm format chkdsk ls cat mv
+inet = tlogin telnet httpd
+
+XA=xa
+
+all: boot c64rom ${files} ${apps} ${sysapps} ${inet}
+
+c64 c64rom:
+ (cd ..; ${MAKE};)
+
+boot: boot.a65
+ ${XA} boot.a65 -o boot
+
+clean:
+ rm -f c64rom boot slip test test2 ktest test osa.d64 tstenv
+ rm -f ${files} ${sysapps} ${apps} ${inet}
+ rm -f vice.trace reltest
+
+tar ../boot.tgz: boot c64rom loader charom index.html slip howto.boot
+ tar czvf ../boot.tgz boot c64rom loader charom index.html slip howto.boot
+
+ktest: ktest.a65
+ (XAINPUT=../../../; export XAINPUT; ${XA} -DSTDIOADDR=53248 -DKERNEL=61440 ktest.a65 -o ktest)
+
+ttest2: test2.a65
+ (XAINPUT=../../../; export XAINPUT; ${XA} -DSTDIOADDR=53248 -DKERNEL=61440 test2.a65 -o test2)
+
+test: test.a65
+ (XAINPUT=../../../include; export XAINPUT; ${XA} -R -DSTDIOADDR=53248 test.a65 -o test)
+
+tstenv: tstenv.a65
+ ${XA} -R -I ../../../include -DSTDIOADDR=53248 tstenv.a65 -o tstenv
+
+reltest: reltest.a65
+ ${XA} -R reltest.a65 -LOSA2KERNEL -LLIB6502 -o reltest
+
+##############################################################################
+#
+# d64 emulator disk image + run
+#
+
+osa.d64: ${files} ${sysapps} ${apps} ${inet} c64rom boot loader charom index.html
+ ./mkdisk ${files} ${sysapps} ${apps} ${inet} c64rom boot loader charom index.html
+
+emurun: osa.d64
+ x64+rs232 -1541 -8 osa.d64
+
+emuslip: all
+ x64+rs232 -kernal ~/csa/tmp/kernalb -speed 200
+
+##############################################################################
+#
+# lib6502 programs
+#
+
+${apps}:
+ (cd ../../../apps/lsh; make lsh;)
+ (if test ! -r lsh; then ln -s ../../../apps/lsh/lsh lsh; fi)
+
+${sysapps}:
+ (cd ../../../sysapps/$@; make $@;)
+ (if test ! -r $@; then ln -s ../../../sysapps/$@/$@ $@; fi)
+
+${files}:
+ (cd ../../../apps/file; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/file/$@ $@; fi)
+
+${inet}:
+ (cd ../../../apps/inet; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/inet/$@ $@; fi)
+
+
diff --git a/dump/oa-2.0.9/arch/c64/test/ktest.a65 b/dump/oa-2.0.9/arch/c64/test/ktest.a65
new file mode 100644
index 0000000..25ba796
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/test/ktest.a65
@@ -0,0 +1,66 @@
+
+#include "include/kdefs.i65"
+#include "include/kernel.i65"
+
+ .word $2000
+ *=$2000
+
+/* TEST1
+ lda #thread1
+ jsr FORKT
+ rts
+
+thread1 inc $d020
+ jsr YIELD
+ jmp thread1
+*/
+
+/* TEST2 */
+ ldx #SEM_SENDBUF
+ clc
+ jsr PSEM
+
+ lda #STDIN
+ sta PCBUF+FORK_STDIN
+ lda #STDOUT
+ sta PCBUF+FORK_STDOUT
+ lda #STDERR
+ sta PCBUF+FORK_STDERR
+
+ lda #forkaddr
+ sta PCBUF+FORK_ADDR+1
+
+ jsr FORK
+ rts
+forkaddr
+ lda #sigaddr
+ sec
+ jsr SETSIG
+ lda #$81
+ clc
+ jsr SETSIG
+
+ /* if not commented, keep thread in kernel call */
+/*
+repeat ldx #SEM_SENDBUF
+ clc
+ jsr PSEM
+ bcc task1
+ cmp #E_INT
+ beq ok
+ brk
+ok inc $d021
+ jmp repeat
+*/
+task1
+ jsr YIELD
+ jmp task1
+
+sigaddr inc $d020
+ pla
+ rti
+
diff --git a/dump/oa-2.0.9/arch/c64/test/reltest.a65 b/dump/oa-2.0.9/arch/c64/test/reltest.a65
new file mode 100644
index 0000000..757c883
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/test/reltest.a65
@@ -0,0 +1,10 @@
+
+ .byt 2 ; jam if start from the beginning of the file
+foo
+main ; not at the beginning
+ lda LIB6502
+ lda OSA2KERNEL
+ inc $d020
+ rts
+
+
diff --git a/dump/oa-2.0.9/arch/c64/test/test.a65 b/dump/oa-2.0.9/arch/c64/test/test.a65
new file mode 100644
index 0000000..feed51b
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/test/test.a65
@@ -0,0 +1,41 @@
+
+#include "kdefs.i65"
+#include "lib6502.i65"
+
+ .zero
+z .byt 0
+
+ .text
+
+ll inc $d020
+ jmp ll
+/*
+ ldy #0
+
+l0 sty z
+ lda text,y
+
+ sta bss,y
+ beq ende
+
+ ldx #STDOUT
+ jsr fputc
+ bcs ende
+
+ ldy z
+ iny
+ bne l0
+ende
+ rts
+
+
+ .data
+
+text .asc "the quick brown fox jumps over the lazy dog",0
+
+ .bss
+
+bss .dsb 100
+
+*/
+
diff --git a/dump/oa-2.0.9/arch/c64/test/test2.a65 b/dump/oa-2.0.9/arch/c64/test/test2.a65
new file mode 100644
index 0000000..8007806
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/test/test2.a65
@@ -0,0 +1,52 @@
+
+ *=$2000
+
+#include "include/kdefs.i65"
+#include "include/fdefs.i65"
+
+ ldx #SEM_SENDBUF
+ sec
+ jsr PSEM
+
+ ldy #0
+
+ lda #5
+ sta PCBUF,y
+ iny
+
+ jsr GETSTR
+ bcs err
+ stx str
+ txa
+ sta PCBUF,y
+
+ iny
+ lda #0
+ sta PCBUF,y
+
+l0 iny
+ lda name-FS_OPEN_NAME,y
+ sta PCBUF,y
+ bne l0
+
+ iny
+ lda #FS_OPEN_RD
+ ldx #SEND_FM
+ jsr SEND
+
+ jsr XRECEIVE
+
+ cmp #1
+ bcs err
+
+ ldx str
+ jsr Loader
+err
+ rts
+
+str .byt 0
+name .asc "test",0
+
+#include "stdlib/stdio.a65"
+#include "include/kernel.i65"
+
diff --git a/dump/oa-2.0.9/arch/c64/test/tstenv.a65 b/dump/oa-2.0.9/arch/c64/test/tstenv.a65
new file mode 100644
index 0000000..278ae5f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/c64/test/tstenv.a65
@@ -0,0 +1,47 @@
+
+#include "lib6502.i65"
+
++main .(
+.byt 2
+ lda #t1
+ jsr getenv
+.byt 2
+ lda #t2
+ jsr putenv
+
+ lda #t1
+ jsr getenv
+
+ lda #t3
+ jsr putenv
+
+ lda #t4
+ jsr getenv
+
+.byt 2
+
+ lda #forkx
+; jsr forkto
+
+ lda #0
+ rts
+
+ .data
+t1 .asc "AVAR",0
+t2 .asc "BVAR=test",0
+t3 .asc "AVAR2=foo",0
+t4 .asc "BVAR",0
+
+forkx .byt STDIN, STDOUT, STDERR, "tstenv",0,0
+ .zero
+ .byt 0
+
+ .text
+ .)
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/Makefile b/dump/oa-2.0.9/arch/cbm8x96/Makefile
new file mode 100644
index 0000000..b1ec28b
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/Makefile
@@ -0,0 +1,20 @@
+
+TRG=boot/rom
+
+XAINPUT=../../include,..,../..
+XA=xa
+FILE=file65
+RELOC=reloc65
+
+pet ${TRG}: # $(wildcard *.a65)
+ ${XA} -I../../include -I../.. -R -bt 2814 -bd 768 -bz 8 -bb 61440 rom.a65 -o rom.o65 -l rom.lab;
+ # ${XA} -I../../include -I../.. -R -bt 2046 -bd 30720 -bz 8 -bb 61440 rom.a65 -o rom.o65 -l rom.lab;
+ ${FILE} rom.o65;
+ ${RELOC} -xt -o ${TRG} rom.o65;
+
+
+clean:
+ rm -f ${TRG} rom.lab rom.o65 boot.tgz
+ (cd boot; ${MAKE} clean;)
+ # (cd apps; ${MAKE} clean;)
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/boot/Makefile b/dump/oa-2.0.9/arch/cbm8x96/boot/Makefile
new file mode 100644
index 0000000..c75c387
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/boot/Makefile
@@ -0,0 +1,58 @@
+
+apps = lsh
+sysapps = mon # slipd
+files = mkdir rmdir rm format chkdsk ls cat mv
+inet = # tlogin telnet httpd
+
+XA=xa
+
+all: rom ${files} ${apps} ${sysapps} ${inet}
+
+rom:
+ (cd ..; ${MAKE};)
+
+clean:
+ rm -f rom osa.d64 osa.x64
+ rm -f ${files} ${sysapps} ${apps} ${inet}
+ rm -f vice.trace reltest
+
+tar ../boot.tgz: rom loader howto.boot
+ tar czvf ../boot.tgz rom loader howto.boot
+
+##############################################################################
+#
+# d64 emulator disk image + run
+#
+
+osa.d64: ${files} ${sysapps} ${apps} ${inet} rom loader
+ ./mkdisk ${files} ${sysapps} ${apps} ${inet} rom loader
+ dd if=osa.x64 of=osa.d64 bs=64 skip=1
+
+emurun: osa.d64
+ xpet -model 8096 -8 osa.d64
+
+emuslip: all
+ x64+rs232 -kernal ~/csa/tmp/kernalb -speed 200
+
+##############################################################################
+#
+# lib6502 programs
+#
+
+${apps}:
+ (cd ../../../apps/lsh; make lsh;)
+ (if test ! -r lsh; then ln -s ../../../apps/lsh/lsh lsh; fi)
+
+${sysapps}:
+ (cd ../../../sysapps/$@; make $@;)
+ (if test ! -r $@; then ln -s ../../../sysapps/$@/$@ $@; fi)
+
+${files}:
+ (cd ../../../apps/file; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/file/$@ $@; fi)
+
+${inet}:
+ (cd ../../../apps/inet; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/inet/$@ $@; fi)
+
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/boot/howto.boot b/dump/oa-2.0.9/arch/cbm8x96/boot/howto.boot
new file mode 100644
index 0000000..e40a827
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/boot/howto.boot
@@ -0,0 +1,13 @@
+
+Howto Boot the GeckOS/A65 on 8x96
+-------------------------------------
+
+1) transfer all files in this directory to a (1541) disk. (osa.d64)
+
+2) put this disk to a CBM2031/CBM4040 or other IEEE488 disk drive
+ connected with to the 8x96.
+
+3) load the file "loader" on the 8x96 and run it
+ After a while the new OS should come up and running
+ (Repeat switches between virtual terminals)
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/boot/index.html b/dump/oa-2.0.9/arch/cbm8x96/boot/index.html
new file mode 100644
index 0000000..81d49b0
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/boot/index.html
@@ -0,0 +1,20 @@
+
+ OS/A65 Operating System
+
+
+In 1989 I started this little computer project, building an own 6502
+computer. After a long break I started working on it again in 1996.
+I wrote an own operating system for it which I have also ported to the
+Commodore 64.
+In the meantime it has grown a lot, featuring a standard library,
+relocatable files, multithreading/multitasking and much more.
+
+However, this is a test file, so please go to the real
+GeckOS/A65
+page.
+
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/boot/loader b/dump/oa-2.0.9/arch/cbm8x96/boot/loader
new file mode 100644
index 0000000..b051480
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/boot/loader
Binary files differ
diff --git a/dump/oa-2.0.9/arch/cbm8x96/boot/loader11 b/dump/oa-2.0.9/arch/cbm8x96/boot/loader11
new file mode 100644
index 0000000..204dd6a
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/boot/loader11
Binary files differ
diff --git a/dump/oa-2.0.9/arch/cbm8x96/boot/loaderm b/dump/oa-2.0.9/arch/cbm8x96/boot/loaderm
new file mode 100644
index 0000000..c545c4f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/boot/loaderm
Binary files differ
diff --git a/dump/oa-2.0.9/arch/cbm8x96/boot/mkdisk b/dump/oa-2.0.9/arch/cbm8x96/boot/mkdisk
new file mode 100755
index 0000000..ddfd9b8
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/boot/mkdisk
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+echo "set tmpfile"
+tmpfile=/tmp/mkdisk.$user.$$
+
+#echo "get files"
+#files=`ls *`
+
+files="$*"
+
+echo "files=$files"
+
+echo "format osa,65 x64 osa.x64" > $tmpfile
+
+for i in $files; do
+ if test "$i" != "mkdisk" -a "$i" != "osa.d64" ; then
+ echo "write $i" >> $tmpfile
+ fi
+done
+
+cat $tmpfile | c1541 > /dev/null
+
+rm -f $tmpfile
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/config.i65 b/dump/oa-2.0.9/arch/cbm8x96/config.i65
new file mode 100644
index 0000000..61042db
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/config.i65
@@ -0,0 +1,73 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#ifndef _PETCONFIG_
+#define _PETCONFIG_
+
+#echo ******** PET config **********
+
+
+/* StreamData */
+
+#define ANZSTRM 16 /* number of streams */
+
+/* SemaphoreData */
+
+#define ANZSEM 8 /* number of semaphores - multiple of 8 */
+#define SYSSEM 8 /* multiple of 8, no of system semaphores
+ i.e. sems from -SYSSEM to -1 */
+
+/* DeviceData */
+
+#define MAXDEV 16 /* maximum number of devices */
+
+/* EnvData */
+
+#define MAXENVS 1 /* one environment only */
+
+#ifndef STACKCOPY
+#define MAXNTHREADS 5 /* (Stackpage-56)/40 */
+#define MAXNTASKS 5
+#define STACKSIZE 40 /* (TH_SLEN * 5) */
+#else
+#define MAXNTHREADS 12 /* (up to 16 is possible, if enough memory) */
+#define MAXNTASKS 12
+#define STACKSIZE 64 /* (TH_SLEN * 8) */
+#endif
+#define ANZXENV 5 /* number of redirectable task IDs */
+
+/* TaskData */
+
+#define IRQCNT 3 /* default priority for ROM-started tasks */
+
+/* FileManager */
+
+#define MAXFS 4 /* maximum number of fileserver tasks */
+
+/* we don't map any of these memory areas */
+#undef MAP_ZERO
+#undef MAP_STACK
+#undef MAP_MEM
+
+#endif /* _PETCONFIG_ */
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/devices/con_pet.a65 b/dump/oa-2.0.9/arch/cbm8x96/devices/con_pet.a65
new file mode 100644
index 0000000..b204d3f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/devices/con_pet.a65
@@ -0,0 +1,222 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#define PIO $e810
+#define VIA1 $e840
+#define vdc $e880
+#define VIDPAGE 4
+
+#define MAX_SCREEN 4 /* hard limit for tables */
+
+#define MAX_ASCREEN #4 /* soft limit */
+
+#define SWITCHKEY 23
+
+#define SET_MMU
+
+#define BELLIRQ jsr bellirq
+
+#define TRIGBELL jsr trigbell
+
+#define MAXSPAL #80
+
+#define MAXZEIL #25
+
+#define KEY_START 16 /* when does key repetition start */
+
+ /* screen# -> hi byte of base address in AC */
+/* #define HI_VID asl:asl:bit freq:bpl l1:asl:l1 clc:adc #VIDPAGE<<4 */
+#define HI_VID asl:asl:asl:clc:adc #$90
+
+#define ACT_HI_VID .( :\
+ lda screen :\
+ cmp actscr :\
+ beq orig :\
+ asl:asl:asl :\
+ clc:adc #$90 :\
+ .byt $2c :\
+orig lda #$80 :\
+ .)
+
+#define SCR_SPACE " " /* screencode space */
+
+ /* ASCII to PET screen code */
+#define ASC2SCR .( :\
+ and #$7f :\
+ cmp #64 :\
+ bcc ok :\
+ beq zero :\
+ cmp #91 :\
+ bcc ok :\
+ cmp #97 :\
+ bcc tab1 :\
+ cmp #123 :\
+ bcs tab2 :\
+ sbc #95 :\
+ bne ok :\
+tab2 tay :\
+ lda ctab2-123,y :\
+ bne ok :\
+tab1 tay :\
+ lda ctab1-91,y :\
+ .byt $2c :\
+zero lda #0 :\
+ok .)
+
+#define SCR2ASC .( :\
+ and #$7f :\
+ beq at :\
+ cmp #27 :\
+ bcs x1 :\
+ adc #96 :\
+ bne ok :\
+x1 cmp #32 :\
+ bcc tab1 :\
+ cmp #91 :\
+ bcc ok :\
+ tay :\
+ lda atab2-91,y :\
+ bcs ok :\
+tab1 tay :\
+ lda atab1-27,y :\
+ .byt $2c :\
+at lda #64 :\
+ok .) :\
+
+&ctab1 .byt 27, 28, 29, 30, 100, 124
+&ctab2 .byt 115, 93, 107, 112, 122
+&atab1 .byt 91, 0, 93, 94, 0
+&atab2 .byt 0,0,124,0,0,0,0,0,0,95,0,0,0,0,0,0,125,0,0,0,0,126,0,0,123
+ .byt 0,0,0,0,0,0,127,0,96,0,0,0
+
+#define DO_IRQ .( :\
+ bit actchange :\
+ bpl ok :\
+ cpy actscr :\
+ bne ok :\
+ ldx zeile :\
+ jsr setzei :\
+ ldy screen :\
+ok .)
+
+ .data
+&actchange .byt 0
+ .text
+
+&console_init .(
+ jsr inimem
+ jsr inivid
+ jsr inikbd
+ jsr inicrsr
+ jsr inibell
+ rts
+ .)
+
+inimem .(
+ clc
+ rts
+ .)
+
+&inivid .(
+ lda screen
+ bne ix
+
+/* we assume the CRTC to be initialized...
+ ldx #0
+i1 bit freq
+ lda vdc4tab,x
+ stx vdc
+ sta vdc+1
+ inx
+ cpx #16
+ bcc i1
+*/
+ix
+ rts
+
+/* vdc8tab .byt $7e,$50,$64,6,$29,0,$19,$21,0,7,$60,7,0,0,0,0 */
+
+/* vdc4tab .byt $3f,$28,$32,3,$29,0,$19,$21,0,7,$60,7,0,0,0,0 */
+
+ .)
+
+&setact .(
+
+scrbuf =$9000
+
+ .zero
+p1 .word 0
+p2 .word 0
+ .text
+
+ sec
+ ror actchange
+ pha
+ txa
+ jsr getp1
+ sta p1
+ sty p1+1
+ lda #00
+ sta p2
+ lda #$80
+ sta p2+1
+ jsr cp2to1
+ pla
+ jsr getp1
+ sta p2
+ sty p2+1
+ lda #00
+ sta p1
+ lda #$80
+ sta p1+1
+ jsr cp2to1
+ ldx zeile
+ jmp setzei
+
+cp2to1 ldx #8
+ ldy #0
+cp1 lda (p2),y
+ sta (p1),y
+ iny
+ bne cp1
+ inc p2+1
+ inc p1+1
+ dex
+ bne cp1
+ rts
+getp1
+ asl
+ asl
+ asl
+ clc
+ adc #>scrbuf
+ tay
+ lda #BC",0,"2",0,0,"0^B^C",0,"2",0,0,"0<^N^V^Z"
+ .asc "1?",0,TC_CLR,"^M ^X",0,0,0,"*",0,")_"
+
+
+#else /* graphics keyboard */
+
+ktab .asc TC_CRGT,TC_HOME,"~(&%#!",TC_BS,TC_CDWN,"^@)\'$":.byt $22
+ .asc "97^^outeq/8^@piyrw"
+ .asc "64^@ljgda*5^@:khfs"
+ .asc "31",TC_CR,";mbcz+2^@?,nvx"
+ .asc "-0^@>^@]@^@=.^@",3,"< [",1
+
+stab .asc TC_CLFT,TC_CLR,"|(&%#!",TC_INS,TC_CUP,"^@)\'$":.byt $22
+ .asc "97^^OUTEQ/8^@PIYRW"
+ .asc "64^@LJGDA*5^@:KHFS"
+ .asc "31",TC_LF,";MBCZ+2^@?,NVX"
+ .asc "-0^@>^@}@^@=.^@",TC_ESC,"< {^@"
+
+ctab .asc TC_WRU,TC_WCLS,"~(&%#!",TC_DEL,TC_WLO,"^@)\'$",$22
+ .asc "97^^^o^u^t^e^q/8^@^p^i^y^r^w"
+ .asc "64^@^l^j^g^d^a*5^@:^k^h^f^s"
+ .asc "31",TC_EOL,";^m^b^c^z+2^@?,^n^v^x"
+ .asc "-0^@>^@]@^@=.^@",TC_CLL,"< [^@"
+
+sctab .asc "^@^@|(&%#!^H^@^@)\'$":.byt $22
+ .asc "97^^O^U^T^E^Q/8^@^P^I^Y^R^W"
+ .asc "64^@^L^J^G^D^A*5^@:^K^H^F^S"
+ .asc "31^m;^M^B^C^Z+2^@?,^N^V^X"
+ .asc "-0^@>^@}@^@=.^@@< {^@"
+
+#endif
+
+ .)
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/devices/piec_pet.a65 b/dump/oa-2.0.9/arch/cbm8x96/devices/piec_pet.a65
new file mode 100644
index 0000000..815195a
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/devices/piec_pet.a65
@@ -0,0 +1,366 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#define VIA1 $e840
+#define PIA2 $e820
+#define PIA1 $e810
+
+#include "chips/via6522.i65"
+#include "chips/pia6521.i65"
+
+#ifdef FSIEC_USE_STDLIB
+#define CHDIR Chdir
+#define ASSIGN Assign
+#endif
+
+ .data
+byte .byt 0
+bytfl .byt 0
+eoifl .byt 0
+ .text
+
+&getif clc
+ ldx #SEM_VIAE840_T1
+ jmp PSEM
+&freif ldx #SEM_VIAE840_T1
+ jmp VSEM
+
+&IECINIT .(
+ lda #%00111000
+ sta PIA2+PIA_CRA
+ lda #0
+ sta PIA2+PIA_PA ; DDRA
+ cmp PIA2+PIA_PA
+ bne inix
+ lda #%00111100 ; CA2 = NDAC hi
+ sta PIA2+PIA_CRA
+
+ lda #%00111000
+ sta PIA2+PIA_CRB
+ lda #$ff
+ sta PIA2+PIA_PB ; DDRB
+ cmp PIA2+PIA_PB
+ bne inix
+ lda #%00111100 ; CB2 = DAV hi
+ sta PIA2+PIA_CRB
+ lda #<-1 ; DRB
+ sta PIA2+PIA_PB
+
+ lda #%00111000
+ sta PIA2+PIA_CRA
+ lda PIA2+PIA_PA ; DDRA
+ and #%10111111
+ sta PIA2+PIA_PA ; DDRA
+ cmp PIA2+PIA_PA
+ bne inix
+ lda #%00111100 ; CA2 = NDAC hi
+ sta PIA2+PIA_CRA
+
+ lda PIA1+PIA_CRA
+ ora #%00111100 ; CA2 = EOI hi
+ sta PIA1+PIA_CRA
+
+ lda VIA1+VIA_DDRB
+ and #%00111110
+ ora #%00000110
+ sta VIA1+VIA_DDRB
+ cmp VIA1+VIA_DDRB
+ bne inix
+ lda VIA1+VIA_DRB
+ ora #%00000110
+ sta VIA1+VIA_DRB ; alle ausgaenge hi
+
+ lda VIA1+VIA_ACR
+ and #%00111101 ; PB2 Latch off, T1 timed IRQ
+ sta VIA1+VIA_ACR
+ lda VIA1+VIA_PCR
+ ora #%11100000 ; cb2 hi out (Piezo)
+ sta VIA1+VIA_PCR
+ lda #%01011000 ; T1, CB1, CB2 -IRQ off
+ sta VIA1+VIA_IER
+ lda #0
+ sta byte
+ sta bytfl
+ sta eoifl
+ clc
+ rts
+inix sec
+ rts
+ .)
+
+/* Blocktiefe 2 */
+
+#ifndef NOFS
+
+aout =atnout
+/*
+aout pha
+ lda #0
+ sta status
+ jsr nrfdhi
+ jsr ndachi
+
+ lda bytfl
+ beq oo1
+ sec
+ ror eoifl
+ jsr iecout
+ lda #0
+ sta bytfl
+
+oo1 pla
+ sta byte
+*/
+iec0out sei
+ jsr waitdavhi
+ jsr atnlo
+
+iecout .(
+ sei
+jsr nrfdhi
+jsr ndachi
+ jsr davhi
+ jsr tstdev ;nrfdhi & ndachi = z
+ beq devnotpr
+ lda byte
+ jsr out
+ox1 JSR setti
+ox1a JSR fragti
+ BNE XTO
+ bit VIA1+VIA_DRB
+ bvc ox1a ; wait nrfd hi
+ lda eoifl
+ bpl o0
+ jsr eoilo
+o0 jsr davlo
+ jsr setti
+o1 jsr fragti
+ bne timeout
+ jsr fragndac ; wait ndac hi
+ bcc o1
+ jsr davhi
+ jsr eoihi
+ lsr eoifl
+ jsr clrdata ; alle data hi
+ox2 lda VIA1+VIA_DRB
+ lsr
+ bcs ox2 ; wait ndaclo
+ clc
+; cli
+ rts
+
+XTO JSR YIELD
+ SEI
+ JMP ox1
+ .)
+
+&seclisten sta byte
+ jsr iecout
+ jsr atnhi
+ cli
+ rts
+#endif
+
+timeout lda #1
+ .byt $2c
+devnotpr lda #128
+ jsr seterr
+ jsr eoihi
+ jsr davhi
+ jsr ndachi
+ sec
+ cli
+ rts
+
+#ifndef NOFS
+
+§alk sta byte
+ jsr iecout
+ jsr nrfdlo
+ jsr ndaclo
+ jsr atnhi
+ cli
+ rts
+
+&UNTALK jsr atnlo
+ lda #95
+ .byt $2c
+&UNLISTEN lda #63
+ jsr aout
+ jsr atnhi
+ cli
+ rts
+
+timeoutx jmp timeout
+
+&IECIN .(
+ sei
+ jsr ndaclo
+ jsr nrfdhi
+i1 lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne i1
+ asl
+ asl
+ bcc i1
+ jsr setti
+o11 jsr fragti
+ bne timeoutx ; c= abgelaufen
+ jsr fragdav ; wait dav lo
+ bcs o11
+ jsr nrfdlo
+ jsr frageoi
+ bcs o12
+ lda #64
+ jsr seterr
+o12 jsr bytin
+ pha
+ jsr ndachi
+o12a jsr fragdav
+ bcc o12a
+ jsr ndaclo
+ lda status
+ bne o12c
+ pla
+ clc
+ cli
+ rts
+o12c pla
+ sec
+ cli
+ rts
+ .)
+
+atnhi lda VIA1+VIA_DRB
+ ora #%00000100
+ sta VIA1+VIA_DRB
+ rts
+atnlo lda VIA1+VIA_DRB
+ and #%11111011
+ sta VIA1+VIA_DRB
+ rts
+#endif
+
+eoihi lda #60
+ sta PIA1+PIA_CRA
+ rts
+eoilo lda #52
+ sta PIA1+PIA_CRA
+ rts
+
+ndachi lda #60
+ sta PIA2+PIA_CRA
+ rts
+ndaclo lda #52
+ sta PIA2+PIA_CRA
+ rts
+
+nrfdhi lda VIA1+VIA_DRB
+ ora #%00000010
+ sta VIA1+VIA_DRB
+ rts
+nrfdlo lda VIA1+VIA_DRB
+ and #%11111101
+ sta VIA1+VIA_DRB
+ rts
+
+davhi lda #60
+ sta PIA2+PIA_CRB
+ rts
+davlo lda #52
+ sta PIA2+PIA_CRB
+ rts
+
+waitdavhi lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne waitdavhi
+ and #$80
+ beq waitdavhi
+ rts
+
+tstdev lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne tstdev
+ and #%01000001
+ cmp #%01000001
+ rts
+
+clrdata lda #<-1
+ sta PIA2+PIA_PB
+ rts
+
+out eor #$ff
+ sta PIA2+PIA_PB
+ rts
+
+waitnrfdhi
+ lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne waitnrfdhi
+ asl
+ asl
+ bcc waitnrfdhi
+ rts
+
+fragndac lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne fragndac
+ lsr
+ rts
+
+fragdav lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne fragdav
+ asl
+ rts
+
+seterr ora status
+ sta status
+ rts
+
+bytin lda PIA2+PIA_PA
+ eor #$ff
+ rts
+
+&setti lda #<65000
+ sta VIA1+VIA_T1CL
+ lda #>65000
+ sta VIA1+VIA_T1CH
+ rts
+&fragti lda VIA1+VIA_IFR
+ and #%01000000
+ rts
+
+frageoi lda PIA1+PIA_PA
+ cmp PIA1+PIA_PA
+ bne frageoi
+ asl
+ asl
+ rts
+
+
+#undef PIA1
+#undef PIA2
+#undef VIA1
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/kernel/kenv.a65 b/dump/oa-2.0.9/arch/cbm8x96/kernel/kenv.a65
new file mode 100644
index 0000000..4cd93b3
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/kernel/kenv.a65
@@ -0,0 +1,424 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/* TODO: make stack addr computation a table lookup, which is faster */
+
+/* Struct Task Environment Entry */
+
+/* we have three structs now:
+ * TE_* for task environment handling - not needed for system without
+ * memory management
+ * TT_* task table, contains STD streams, etc
+ * TH_* thread table, has stack info and state
+ */
+
+#define TE_SLEN 0 /* we don't have envs */
+
+/************************************************************************
+ * These routines are needed in the env section!
+ * inienv
+ * setthread
+ * initsp
+ * push
+ * pull
+ * memtask
+ * memsys
+ *
+ * sbrk
+ * getenv
+ * freenv
+ */
+
+&&enmem = notimp ; to enable memory blocks to the kernel
+&&setblk = notimp ; to set memory blocks in MMU mapping
+
+#ifdef STACKCOPY
+ .zero
+zp .word 0
+
+ .data
+
+Stacks .dsb MAXNTHREADS * STACKSIZE
+
+ .text
+#endif
+
+
+&inienv .(
+ lda #<-1
+ sta actThread
+ sta actTask
+ lda #1
+ sta Syscnt
+ clc
+ rts
+ .)
+
+setthread .(
+ .data
+newThread .byt 0
+ .text
+
+ cmp actThread
+ bne doit
+ rts
+doit
+ sta newThread
+
+ ldx actThread
+ cpx #<-1
+ beq nosave
+
+ lda THREADSAVE
+ sta threadTab + TH_LIBSAVE,x
+ lda THREADSAVE+1
+ sta threadTab + TH_LIBSAVE+1,x
+
+#ifdef STACKCOPY
+ txa ; stack is 8 * TH_SLEN = 64
+ ldy #0
+ sty zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ clc
+ adc #Stacks
+ adc zp+1
+ sta zp+1
+ ;bcc l1
+ ;inc zp+1
+;l1
+ lda threadTab + TH_SP,x
+ tay
+ iny
+l2 cpy #STACKSIZE
+ bcs savetask
+ lda $100,y
+ sta (zp),y
+ iny
+ bne l2
+#endif
+savetask
+ ldy threadTab + TH_TASK,x
+ lda TASKSAVE
+ sta taskTab + TT_LIBSAVE,y
+ lda TASKSAVE + 1
+ sta taskTab + TT_LIBSAVE + 1,y
+nosave
+loadtask
+ ldx newThread
+ stx actThread
+ cpx #<-1
+ bne load
+ stx actTask
+ beq noload
+load
+ ldy threadTab + TH_TASK,x
+ sty actTask
+
+ lda taskTab + TT_LIBSAVE,y
+ sta TASKSAVE
+ lda taskTab + TT_LIBSAVE + 1,y
+ sta TASKSAVE + 1
+
+loadthread
+ lda threadTab + TH_LIBSAVE,x
+ sta THREADSAVE
+ lda threadTab + TH_LIBSAVE+1,x
+ sta THREADSAVE+1
+
+#ifdef STACKCOPY
+ txa
+ ldy #0
+ sty zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ clc
+ adc #Stacks
+ adc zp+1
+ sta zp+1
+ ;bcc l3
+ ;inc zp+1
+;l3
+ lda threadTab + TH_SP,x
+ tay
+ iny
+l4 cpy #STACKSIZE
+ bcs endset
+ lda (zp),y
+ sta $100,y
+ iny
+ bne l4
+#endif
+noload
+endset rts
+ .)
+
+initsp .(
+#ifdef STACKCOPY
+ lda #STACKSIZE-1
+ ;ldx actThread
+ sta threadTab + TH_SP,x
+ rts
+#else
+ .data
+divsp .byt 0
+ .text
+
+ ;ldx actThread
+ txa
+ clc
+ adc #TH_SLEN
+ sta divsp
+ asl
+ asl ; split stack
+ clc
+ adc divsp
+ sta threadTab + TH_SP,x
+ dec threadTab + TH_SP,x
+ rts
+#endif
+ .)
+
+pull .(
+ ldx actThread
+ inc threadTab + TH_SP,x
+ lda threadTab + TH_SP,x
+ tay
+ lda $0100,y
+ rts
+ .)
+
+&push .(
+ pha
+ ldx actThread
+ lda threadTab + TH_SP,x
+ tay
+ pla
+ sta $0100,y
+ dec threadTab + TH_SP,x
+ rts
+ .)
+
+ .(
+ .zero
+AC .byt 0
+XR .byt 0
+YR .byt 0
+SR .byt 0
+ADR .word 0
+&SSP .byt 0
+ .text
+
+/*
+ * this one is used to return from an interrupt. We do not need to save
+ * any registers. so for brevity, we do it as macro
+ * This doesn't check for interrupted devices, as we do not have them
+ * without MMU (so far).
+ */
+
+#define MEMTASK2() \
+ .( :\
+ sei :\
+ dec Syscnt :\
+ bne mtask :\
+ tsx :\
+ stx SSP :\
+ ldy actTask :\
+ ldx taskTab+TT_ENV,y :\
+ beq system :\
+;.byt 2 :\
+ ldx #%10001100 :\
+ stx $fff0 :\
+system :\
+ ldy actThread :\
+ ldx threadTab+TH_SP,y :\
+ txs :\
+mtask .)
+
+/*
+ * This is the standard return to user space. the kernel jumps here,
+ * so we need not save any return address, but use the one on the
+ * user stack.
+ */
+&&memtask .(
+ php
+ sei
+ dec Syscnt ; wieder in Task
+ bne mtask ; nein dann Ende
+
+ bit adev ; Ruecksprung in Device
+ bpl mtask ; ja dann Ende
+
+ sty YR ; sonst Task-Env setzen
+ stx XR
+ sta AC
+ pla ; SR
+
+ tsx
+ stx SSP
+
+ ldy actThread
+ ldx threadTab+TH_SP,y
+ txs
+
+ ldy actTask
+ ldx taskTab+TT_ENV,y
+ beq system
+ ldx #%10001100 ; map alternate 8x96 memory bank
+ stx $fff0
+system
+
+ pha ; SR
+ lda AC
+ ldy YR
+ ldx XR
+mtask
+ plp
+ rts
+ .)
+
+/*
+ * This is the kernel entry routine. It leaves all registers as they
+ * are, except for the stack pointer, which is set to the system stack.
+ * also the return address is moved from user stack to system stack,
+ * to allow "JSR"-ing to memsys.
+ */
+&&memsys php
+ sei
+ pha
+
+ lda #%11100000 ; map system memory
+ sta $fff0
+
+ lda Syscnt
+ inc Syscnt
+ cmp #0
+ bne mse
+ bit adev ; called by device
+ bmi msys ; no then save stack
+mse pla
+ plp
+ rts
+
+msys pla
+ sta AC
+ pla
+ sta SR
+ stx XR
+ ; sty YR
+ pla
+ sta ADR
+ pla
+ sta ADR+1
+ tsx
+
+ txa
+ ldx actThread
+ sta threadTab+TH_SP,x
+ ldx SSP
+ txs
+ lda ADR+1
+ pha
+ lda ADR
+ pha
+ lda SR
+ pha
+ lda AC
+ ldx XR
+ ; ldy YR
+ plp
+ cld
+ rts
+ .)
+
+
+&&sbrk .(
+ bcc ok
+ sec
+ lda #E_NOMEM
+ rts
+ok lda #>ROMSTART ; return available memory
+ clc
+ rts
+ .)
+
+kgetenv .(
+ ldx #0
+ tya
+ bne system
+ inx
+system clc
+ rts
+ .)
+
+freenv .(
+ clc
+ rts
+ .)
+
+/*
+ * MAPSYSBUF() maps the PCBUF of the active task into the system memory
+ * at address SYSBUF. It's not needed in a C64...
+ */
+#undef MAPSYSBUF
+#define SYSBUF $200
+
+/*
+ * MAPENV() maps the address given in a/y in env x to somewhere in the
+ * kernel map. returns mapped address in a/y
+ * MAPAENV() does the same but for the actual task (env)
+ */
+#define MAPENV()
+#define MAPAENV()
+
+
+/*
+ * needed for GETINFO, gives RAM available for task
+ */
+#define GETTASKMEM lda #>ROMSTART
+
+/*
+ * copy routines for SEND/RECEIVE and FORK
+ */
+#undef CPPCBUFRX
+#undef CPPCBUFTX
+#define CPFORKBUF()
+
+/*
+ * needed in device code to get active environment in AC
+ */
+#define GETACTENV() lda #<-1
+
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/kernel/kinit.a65 b/dump/oa-2.0.9/arch/cbm8x96/kernel/kinit.a65
new file mode 100644
index 0000000..7fc020a
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/kernel/kinit.a65
@@ -0,0 +1,147 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * This file is included in the RESET routine of the kernel,
+ * after the "sei:cld". The routine starting at the bginning
+ * of this file must initialize the hardware to the system RAM
+ * in the beginning and the system ROM in the end of the memory
+ * map. Also the system stack (pointer) is setup.
+ *
+ * In addition to that the system interrupt timer (needed for
+ * task preemtion) must be setup.
+ *
+ * After that the file must define the following macros:
+ *
+ * GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ * LEDPORT address of LED port to signal hardware failures
+ * LED_LED bit of LED bit in LEDPORT address
+ * H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ * the LED toggle routine if needed.
+ * CLRTIMER() clear the system interrupt timer interrupt
+ * KERNELIRQ() returns if an interrupt occured in the kernel
+ * or outside. Is checked by "BNE IRQ_in_Kernel"
+ * SAVEMEM() save system mem config for interrupt
+ * RESTOREMEM() restore system mem config after interrupt
+ * STARTMEM() This is used to alloc/enable memory pages found
+ * during kernel init. Takes mem size in AC as given
+ * by the kernel init. It is called _after_ inimem!
+ */
+
+/* Kernel routines for C64 hardware */
+
+/*
+ * init stack pointer for system stack
+ */
+ ldx #<-1
+ txs
+
+/*
+ * init memory configuration
+ */
+
+ /* check if it's really a 8x96 */
+ lda #%10001100 ; memory config plain bank 1
+ sta $fff0 ; no I/O and screen peek through (prg bank)
+
+ ldx #11
+ll0 lda eok_addr,x ; set interrupt etc vectors
+ sta $fff4,x
+ dex
+ bpl ll0
+
+ lda #%11100000 ; memory config plain bank 0
+ sta $fff0 ; I/O and screen peek through (system bank)
+
+ ldx #11
+ll1 lda eok_addr,x ; set interrupt etc vectors
+ sta $fff4,x
+ dex
+ bpl ll1
+/*
+ * C64 specific irq timer init, irq every 20ms
+ * We assume that the reset - or a loader program has disabled all irq
+ */
+
+ lda #%00000001 ; enable PIA1 CB1 screen retrace timer
+ sta PETPIA1+PIA_CRA
+
+/*
+ * check zeropage RAM, jump to he_zero if failure
+ * clears zeropage - at least 2-7 is a _must_!
+ */
+#include "kernel/zerotest.a65"
+
+/*
+ * check system RAM from RAMSTAT up to RAMEND, jump to he_ram if failure
+ * returns available RAM in 256 byte blocks in AC
+ */
+ .zero
+cnt .byt 0
+ .text
+#include "kernel/ramtest.a65"
+ cmp #MIN_MEM
+ bcs ok
+ lda #0
+ sta $fff0
+ jmp ($fffc)
+ok
+/*
+ * originally SYSPORT specific, they have a value for the C64 also...
+ */
+#define GETFREQ() lda #0
+
+#undef LEDPORT
+#undef LED_LED
+
+/*
+ * We have to clear the interrupt timer
+ */
+
+#define CLRTIMER() lda PETPIA1+PIA_PA
+
+/*
+ * MMU systems may map task pages into kernel mem to make copying
+ * easier. This mapping has to be preserved during interrupt.
+ * SAVEMEM() saves the memory configuration, while RESTOREMEM()
+ * restores it, obviously.
+ * These routines are called _after_ "jsr memsys", so this routine
+ * has to preserve this mapping when called from kernel space,
+ * and so must memtask.
+ */
+
+#undef SAVEMEM
+#undef RESTOREMEM
+
+/*
+ * Check if we have an interrupt in the kernel
+ */
+
+#define KERNELIRQ() lda Syscnt:cmp #1
+
+/*
+ * no memory management...
+ */
+#define STARTMEM()
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/petdef.i65 b/dump/oa-2.0.9/arch/cbm8x96/petdef.i65
new file mode 100644
index 0000000..2fe226b
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/petdef.i65
@@ -0,0 +1,34 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * These are the C64 specific defines
+ */
+
+#define PETPIA1 $e810
+#define PETPIA2 $e820
+#define PETVIA $e840
+
+#include "chips/pia6521.i65"
+#include "chips/via6522.i65"
+
diff --git a/dump/oa-2.0.9/arch/cbm8x96/rom.a65 b/dump/oa-2.0.9/arch/cbm8x96/rom.a65
new file mode 100644
index 0000000..c4ba131
--- /dev/null
+++ b/dump/oa-2.0.9/arch/cbm8x96/rom.a65
@@ -0,0 +1,186 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+#undef EMUTEST
+
+/* These are necessary for PET kernel **************************************/
+
+#define NOMMU
+#define NOSYSPORT
+#undef CLK2MHZ /* we only have approx. 1 MHz ... */
+#undef CMOSCPU /* ... and no CMOS cpu */
+#define VIDPAGE 8
+#undef SHORTLINE /* prepare for 80 col screen */
+
+#define RAMTEST
+#define RAMSTART 128
+#define RAMEND $e8
+#define NOMIRRORMEM
+
+#define MIN_MEM $e8 /* RAM up to I/O -> 8x96 */
+
+#undef NMIDEV /* there is no NMI in the PET machine */
+#define EOK_NOFILL /* do not fill kernel to end of mem */
+
+#define LIB6502_SHAREDZERO /* lib6502 fork sets FORK_SHARED to 0 */
+
+#define OSA_CPU "6502"
+#define OSA_ARCH "PET"
+
+/* These are changeable ****************************************************/
+
+#define ROMSTART $0b03 /* where the ROM starts */
+
+#define MEMINIVAL $0 /* Clear memory to 0 on boot */
+
+#define STACKCOPY /* if defined, save stack area in memory
+ when context switching, otherwise divide
+ stack area and give each task a part.
+ It's faster without, but allows more
+ tasks with */
+
+#define NEED_CHECKCHLD /* this is necessary if using "init" or
+ lib6502 */
+#define NEED_GETINFO
+#define NEED_SLOCK
+#define NEED_RENICE
+
+#define BOOTDRV "c" /* where are the boot files (IEC device 8) */
+
+#define ROOTPATH "c:" /* where lsh chdirs into on boot */
+
+
+/***************************************************************************
+ *
+ * Here comes the ROM content
+ */
+
+#include "config.i65"
+#include "kdefs.i65"
+#include "fdefs.i65"
+#include "petdef.i65"
+
+#include "kernel.i65"
+
+#define SEM_VIAE840_T1 SEM_SERIEC
+#undef SEM_SERIEC
+#undef SEM_PARIEC
+
+ .word *+2 /* load address */
+ jmp RESET
+ ; ROMSTART is here!
+.(
+
+/************* ROM entries */
+
+/************* devices */
+
+#include "devices/devices.a65"
+
+/************* init process */
+
+
+#define INIT_VERBOSE
+#define INIT_RESTART
+#define INIT_MERGE
+#define INIT_LIB6502
+/* #define INIT_USE_STDLIB */
+/* #define INIT_OUTDEV 2*/
+#include "sysapps/init/init.a65"
+
+
+/************* fsdev - converts devices into files */
+
+
+#include "sysapps/fs/fsdev.a65"
+
+
+/************* fsiec - IEEE488/IEC bus filesystem */
+
+/* both, the parallel and serial iec bus use the same timer */
+#define SEM_CIA2TB SEM_SERIEC
+#undef SEM_PARIEC
+#undef SEM_SERIEC
+
+#define NOLOOP
+#define FSIEC_DEVICE "devices/piec_pet.a65"
+#include "sysapps/fs/fsiec.a65"
+#undef FSIEC_DEVICE
+#print *
+
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+#define MON_SHEXE $c0 /* ROM executable flag */
+#define MON_MONEXE 0 /* ROM executable flag */
+#define MON_SHDEV 1 /* start on device 0 = video1 */
+#define SHORTMON /* no assembler/disassembler */
+#undef NOSH
+#include "sysapps/mon/mon.a65"
+
+
+/************* boot lsh from BOOTDRV */
+
+#if 1
+ /* add autostart of lib6502 program 'lsh' */
+
+ .(
+ .word end_auto
+ .byt PK_LIB+PK_AUTOEXEC+PK_RESTART ; is lib6502 program
+ .word 0 ; P_ADDR ignored
+ .byt 16 ; P_RAM
+ .byt 128 ; P_SHARED
+ .byt 0 ; P_PRIORITY
+ .byt 0,0 ; P_DEV
+ .byt BOOTDRV,":lsh",0,"-d",0,ROOTPATH,0,0
+end_auto
+ .)
+
+#endif
+
+/************* end of ROM executables */
+
+ .word -1
+
+/************* lib6502 code */
+
+#include "lib6502/lib6502.a65"
+
+/************* Kernel */
+
+#include "kernel\kernel.a65"
+
+/************* Constants for lib6502 memory handling */
+
+Memstart =$6800
+Memend =$ff00
+Zerostart =$70
+
+.)
+
diff --git a/dump/oa-2.0.9/arch/csa65/Makefile b/dump/oa-2.0.9/arch/csa65/Makefile
new file mode 100644
index 0000000..ab1e287
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/Makefile
@@ -0,0 +1,33 @@
+
+
+XA=xa #-2.1.4h
+
+FILE=file65
+RELOC=reloc65
+
+all: boot/csarom boot/csarom2
+
+redo:
+ rm -f boot/csarom
+ make
+ cp boot/csarom /site/mystuff/var/lptiec
+ cat foo
+
+boot/csaold: csarom.old
+ ${XA} -I../.. -I../../include -bt 32768 \
+ csarom.old -o boot/csaold -l csaold.lab
+
+csa boot/csarom: csarom.a65
+ ${XA} -I../.. -I../../include -bt 32768 \
+ csarom.a65 -o boot/csarom -l csarom.lab
+
+boot/csarom2: csarom2.a65
+ ${XA} -I../.. -I../../include -bt 32768 \
+ csarom2.a65 -o boot/csarom2 -l csarom2.lab
+
+clean:
+ rm -f csarom.lab csarom2.lab csaold.lab
+ (cd boot; ${MAKE} clean ;)
+ (cd apps; ${MAKE} clean ;)
+ (cd sysapps; ${MAKE} clean ;)
+
diff --git a/dump/oa-2.0.9/arch/csa65/apps/Makefile b/dump/oa-2.0.9/arch/csa65/apps/Makefile
new file mode 100644
index 0000000..2548acc
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/apps/Makefile
@@ -0,0 +1,16 @@
+
+
+XAINPUT=../../../include,../../..
+XA=xa
+
+irtx.o65: irtx.a65
+ xa -I../../../include -I../../.. -R -LLIB6502 -LOSA2KERNEL $< -o $@
+
+# irtx.o65: irtx.a65
+# (XAINPUT=${XAINPUT}; export XAINPUT;\
+# ${XA} -DKERNEL=61440 -c irtx.a65 -o irtx.o65 ;\
+# if [ $$? -ne 0 ]; then rm -f irtx.o65; fi; )
+
+clean:
+ rm -f irtx.o65
+
diff --git a/dump/oa-2.0.9/arch/csa65/apps/irtx.a65 b/dump/oa-2.0.9/arch/csa65/apps/irtx.a65
new file mode 100644
index 0000000..6debeef
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/apps/irtx.a65
@@ -0,0 +1,7 @@
+
+#define CLK1MHZ
+#define VIA $e830
+
+#include "sysapps/irtx/irtx.a65"
+
+
diff --git a/dump/oa-2.0.9/arch/csa65/boot/Makefile b/dump/oa-2.0.9/arch/csa65/boot/Makefile
new file mode 100644
index 0000000..af40e4f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/boot/Makefile
@@ -0,0 +1,20 @@
+
+XAINPUT=../../../include
+XA=xa
+
+all: inirom csarom csarom2
+
+csarom:
+ (cd ..; ${MAKE} boot/csarom;)
+
+csarom2:
+ (cd ..; ${MAKE} boot/csarom2;)
+
+inirom: inirom.a65
+ (XAINPUT=${XAINPUT}; export XAINPUT;\
+ ${XA} -DOSA2KERNEL=61440 inirom.a65 -o inirom;\
+ if [ $$? -ne 0 ]; then rm -f inirom; fi)
+
+clean:
+ rm -f csarom csarom2 inirom
+
diff --git a/dump/oa-2.0.9/arch/csa65/boot/README b/dump/oa-2.0.9/arch/csa65/boot/README
new file mode 100644
index 0000000..c608b57
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/boot/README
@@ -0,0 +1,5 @@
+
+When using the patched-up VICE xcsa emulator, use the commandline:
+
+ ~/vice/src/vice-0.12.0.16-csa-22/src/xcsa -kernal ./csaold -speed 200
+
diff --git a/dump/oa-2.0.9/arch/csa65/boot/charom b/dump/oa-2.0.9/arch/csa65/boot/charom
new file mode 100644
index 0000000..834938e
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/boot/charom
Binary files differ
diff --git a/dump/oa-2.0.9/arch/csa65/boot/csaold b/dump/oa-2.0.9/arch/csa65/boot/csaold
new file mode 100644
index 0000000..8599ace
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/boot/csaold
Binary files differ
diff --git a/dump/oa-2.0.9/arch/csa65/boot/fsibm b/dump/oa-2.0.9/arch/csa65/boot/fsibm
new file mode 120000
index 0000000..931cf6d
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/boot/fsibm
@@ -0,0 +1 @@
+../sysapps/fsibm
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/csa65/boot/inirom.a65 b/dump/oa-2.0.9/arch/csa65/boot/inirom.a65
new file mode 100644
index 0000000..cd4c613
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/boot/inirom.a65
@@ -0,0 +1,80 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+
+#include "kdefs.i65"
+#include "kernel.i65"
+#include "../csa65.i65"
+
+ .word $400
+ *=$400
+
+l1 =$0
+ ; exit all devices
+ lda #0
+ sta l1
+l2 ldx l1
+ lda #DC_EXIT
+; jsr DEVCMD
+;.byt 2
+ inc l1
+ lda l1
+ cmp #16
+ bcc l2
+ ; disable timer interrupt
+
+ lda SYSPORT
+ and #$ff-SYS_IRQEN
+ sta SYSPORT
+
+ sei ; remap MMU pages 8-15 with values from
+ ldx #7 ; 4 to b
+l3 lda $eff2,x
+ sta $eff8,x
+ dex
+ bpl l3
+
+ ldx #1 ; set MMU pages 1-7 to 1-7
+l4 txa
+ sta $eff0,x
+ inx
+ cpx #$8
+ bcc l4
+
+ ldx #0 ; copy program to valid RAM
+l5 lda data,x
+ sta $1000,x
+ inx
+ bne l5
+
+ lda SYSPORT
+ and #$ff-SYS_LED
+ sta SYSPORT
+
+ jmp $1000 ; and jump there
+
+data lda #0 ; remap page 0
+ sta $eff0
+ jmp RESET
+
diff --git a/dump/oa-2.0.9/arch/csa65/boot/ramdisk b/dump/oa-2.0.9/arch/csa65/boot/ramdisk
new file mode 120000
index 0000000..1567a03
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/boot/ramdisk
@@ -0,0 +1 @@
+/m/sdb8/tmp/dev.image
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/csa65/config.i65 b/dump/oa-2.0.9/arch/csa65/config.i65
new file mode 100644
index 0000000..a419307
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/config.i65
@@ -0,0 +1,72 @@
+/****************************************************************************
+
+ OS/A65 Version 1.3.9
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1996 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#ifndef ANZSTRM
+
+#include "csa65.i65"
+
+/************************* Daten for Computer mit MMU *********************/
+
+/* StreamData */
+
+#define ANZSTRM 18
+
+/* SemaphoreData */
+
+#define ANZSEM 16 /* multiple of 8 */
+#define SYSSEM 16 /* multiple of 8, sem-nr von -SYSSEM bis -1 */
+
+/* DeviceData */
+
+#define MAXDEV 32
+
+/* EnvData */
+
+#define MAXENVS 15
+#define MAXNTASKS 15
+#define MAXNTHREADS 16
+
+#define ANZXENV 16 /* Anzahl umleitbarer Tasks */
+
+/* TaskData */
+
+#define IRQCNT 3
+
+/* FileManager */
+
+#define MAXFS 8
+
+#define BLKSIZ $1000
+
+/*
+ * this is the address of the task's remapped PCBUF in kernel memory
+ * see also MAPSYSBUF() in kenv.a65
+ */
+/* #define SYSBUF BLKSIZ+PCBUF*/
+
+#define MAP_ZERO
+#define MAP_STACK
+#define MAP_MEM
+
+#endif
+
diff --git a/dump/oa-2.0.9/arch/csa65/csa65.i65 b/dump/oa-2.0.9/arch/csa65/csa65.i65
new file mode 100644
index 0000000..54fa646
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/csa65.i65
@@ -0,0 +1,65 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef _CSA65_H_
+#define _CSA65_H_
+
+#include "chips/via6522.i65"
+#include "chips/pia6521.i65"
+
+/* System-Defs */
+
+#ifndef SYSPORT
+#define SYSPORT $efe0
+#endif
+#ifndef NOMMU
+#define MMU $eff0
+#endif
+#define BLKSIZ $1000
+#define BLKLOG 12 /* number of addressbits valid in one BLKSIZ */
+
+#ifndef SYSPAGE
+#define SYSPAGE $0 /* $12 zum testen, wenn System nicht startet */
+#endif
+
+
+/*********************** Hardware structs *******************************/
+/* SysIO */
+
+#define SYS_TIRQ %10000000 /* bmi/bpl */
+#define SYS_KEY %01000000
+#define SYS_IOINH %00100000
+#define SYS_EXTIO %00010000
+#define SYS_LED %00001000
+#define SYS_RTS %00000100
+#define SYS_IRQEN %00000010
+#define SYS_IRQ %00000001
+
+#ifndef LEDPORT
+#define LEDPORT SYSPORT
+#define LED_LED SYS_LED
+#endif
+
+#endif
+
diff --git a/dump/oa-2.0.9/arch/csa65/csarom.a65 b/dump/oa-2.0.9/arch/csa65/csarom.a65
new file mode 100644
index 0000000..84952d1
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/csarom.a65
@@ -0,0 +1,381 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+
+/* These are necessary for CS/A65 kernel ***********************************/
+
+#define OSA_ARCH "CS/A65"
+
+/* These are changeable ****************************************************/
+
+#define DEBUGFS /* FSIBM debug */
+#define FSIBM_SECTOR24BIT
+
+#define CSA_CONSOLE 0 /* device to output debug/log messages */
+
+#undef FSIEC_PARALLEL
+#undef FSIEC_SERIAL
+#define FSIBM
+#undef MONSH
+#define USE_LIB6502
+
+#define NEED_CHECKCHLD /* this is necessary if using "init" or
+ lib6502 */
+#define NEED_GETINFO
+
+#undef ROMTEST /* debug option */
+/* #define EMUTEST */ /* debug option */
+/* #define SYSPAGE $12 */ /* debug option */
+
+#define NOMIRRORMEM /* ramtest kernel options */
+#define SHORTRAMTEST
+
+#define NMIRESET
+
+#undef CMOSCPU
+#undef NOSYSPORT
+
+#define RAMEND $80 /* 32k in bank 0 */
+
+#define CLK2MHZ
+
+#undef BOOTDRV "c"
+
+
+/***************************************************************************
+ *
+ * Better not change anything below
+ */
+
+#ifdef CMOSCPU
+#define OSA_CPU "6502"
+#else
+#define OSA_CPU "65C02"
+#endif
+
+/***************************************************************************
+ *
+ * Here comes the ROM content
+ */
+
+#include "config.i65"
+#include "kdefs.i65"
+#include "fdefs.i65"
+#include "kernel.i65"
+
+#define SEM_VIAE840_T1 SEM_SERIEC
+#undef SEM_SERIEC
+#undef SEM_PARIEC
+
+#define ROMSTART $8000
+#define RAMSIZE (ROMSTART>>8)
+#define MIN_MEM $20 /* 8 kbyte */
+
+ .(
+; .word $2000 ; load address
+ *=ROMSTART
+
+/************* ROM entries */
+/*
+
+ The lib6502 needs to use addresses in each of the environments.
+ Devices (normally) use the kernel address space.
+ All other tasks, including the kernel have their own environment.
+ Therefore they all get their own zero, data and bss addresses.
+
+*/
+
+
+#echo ############ magic
+
+/* so that init recognizes a ROM */
+#include "sysapps/magic/magic.a65"
+
+/************* devices */
+
+#echo ############ devices
+.data:*=$f00:.zero:*=$d0:.bss:*=$400:.text
+.zero
+#echo zero:
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#include "devices/csadev.a65"
+.zero
+#echo zero:
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* init process */
+
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
+#define INIT_VERBOSE
+#define INIT_OUTDEV CSA_CONSOLE
+#define INIT_MERGE
+#define INIT_RESTART
+#define INIT_LIB6502
+#define INIT_MMU
+#define INIT_MMU_BANK 3
+#ifdef ROMTEST
+#define INIT_ROM2TEST /* $0-$7 instead of $8-$f in INIT_MMU_BANK */
+#endif
+
+#echo ############ init:
+#include "sysapps/init/init.a65"
+.data
+#echo data (<1024):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* fsdev - converts devices into files */
+
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
+#echo ############ fsdev:
+#include "sysapps/fs/fsdev.a65"
+.data
+#echo data (<=1024):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* fsiec - as IEEE488 bus filesystem */
+
+#ifdef FSIEC_PARALLEL
+
+#undef NOLOOP
+#undef NOFS
+#undef NOCMD
+
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
+#echo ############ fsiec (parallel):
+
+#undef FSIEC_AS_INIT
+#define FSIEC_DEVICE "devices/piec_csa.a65"
+
+#include "sysapps/fs/fsiec.a65"
+
+.data
+#echo data (<=1280):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* fsiec - as IEC bus filesystem */
+
+#ifdef FSIEC_SERIAL
+
+#define NOLOOP
+#undef NOFS
+#undef NOCMD
+
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
+#echo ############ fsiec (serial):
+
+#undef FSIEC_AS_INIT
+#define FSIEC_DEVICE "devices/siec_csa.a65"
+
+#include "sysapps/fs/fsiec.a65"
+
+.data
+#echo data (<=1024):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* fsibm - PC-style disks filesystem */
+
+#ifdef FSIBM
+
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
+#echo ############ fsibm:
+
+#define FSIBM_OUTDEV CSA_CONSOLE
+/* #define FSIBM_DEVICE_DRV "arch/csa65/devices/drv_wd1770.a65" */
+#define FSIBM_DEVICE_DRV "devices/scsi.a65"
+/* #define FSIBM_DEVICE_DRV "sysapps/fs/fsibm/drv_ramd1.a65" */
+#include "sysapps/fs/fsibm.a65"
+
+.data
+#echo data (<=1280):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+#ifdef MONSH
+
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
+#echo ############ shell:
+
+#ifdef CLK1MHZ
+#define SHORTMON
+#else
+#undef SHORTMON
+#endif
+
+#undef NOSH
+#undef NOSYSFKT
+
+#define MON_SHDEV 0
+#define MON_MONDEV 7
+#define MON_SHEXE $c0
+#define MON_MONEXE $c0
+#include "sysapps/mon/mon.a65"
+
+.zero
+#echo zero
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* boot lsh from BOOTDRV */
+
+#ifdef BOOTDRV
+
+#echo ************ lsh
+
+ /* add autostart of lib6502 program 'lsh' */
+
+ .(
+ .word end_auto
+ .byt PK_LIB+PK_AUTOEXEC+PK_RESTART ; is lib6502 program
+ .word 0 ; P_ADDR ignored
+ .byt 16 ; P_RAM
+ .byt 128 ; P_SHARED
+ .byt 0 ; P_PRIORITY
+ .byt 1,1 ; P_DEV
+ .byt BOOTDRV,":lsh",0,"-d",0,0
+end_auto
+ .)
+
+#endif
+
+/************* end of ROM executables */
+
+ .word -1
+
+/************* lib6502 code */
+
+#ifdef USE_LIB6502
+
+/* lib6502 jmp table is below STDIOADDR */
+
+#echo "############ lib6502"
+.data:*=$300:.zero:*=8:.bss:*=$400:.text
+
+#include "lib6502/lib6502.a65"
+/* #include "stdlib/stdio.a65" */
+
+.zero
+#echo zero:
+#print *
+/* Zerostart must keep save the sh/mon and init variables */
+Zerostart =$40 ; * ; only lib6502 and prg - that's it
+#print Zerostart
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+/* Memstart must keep save the sh/mon and init variables */
+Memstart =$500 ; * ; only lib6502 and prg
+#print Memstart
+.text
+
+Memend = $3000
+
+#endif
+
+/************* fill not used area (I/O, screens) */
+
+#if *>$e7ff
+#echo "program too long!, should be $e800 (59392), is"
+#print *
+ldx ,x
+#endif
+ .dsb $f000-*,<-1
+
+/************* Kernel */
+
+.data:*=$300:.zero:*=8:.bss:*=$600:.text
+#echo ############ kernel:
+
+#include "kernel/kernel.a65"
+
+.zero
+#echo zero:
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+ .)
+
+
diff --git a/dump/oa-2.0.9/arch/csa65/csarom.old b/dump/oa-2.0.9/arch/csa65/csarom.old
new file mode 100644
index 0000000..8afb322
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/csarom.old
@@ -0,0 +1,362 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+
+/* These are necessary for CS/A65 kernel ***********************************/
+
+#define OSA_ARCH "CS/A65"
+
+/* These are changeable ****************************************************/
+
+#define FSIEC_PARALLEL
+#undef FSIEC_SERIAL
+#undef FSIBM
+#define USE_LIB6502
+
+#define NEED_CHECKCHLD /* this is necessary if using "init" or
+ lib6502 */
+#define NEED_GETINFO
+
+#undef ROMTEST /* debug option */
+/* #define EMUTEST */ /* debug option */
+/* #define SYSPAGE $12 */ /* debug option */
+
+#define NOMIRRORMEM /* ramtest kernel options */
+#define SHORTRAMTEST
+
+#define NMIRESET
+
+#undef CMOSCPU
+#undef NOSYSPORT
+
+#define RAMEND $80 /* 32k in bank 0 */
+
+#define CLK1MHZ
+
+#undef BOOTDRV "c"
+
+/***************************************************************************
+ *
+ * Better not change anything below
+ */
+
+#ifdef CMOSCPU
+#define OSA_CPU "6502"
+#else
+#define OSA_CPU "65C02"
+#endif
+
+/***************************************************************************
+ *
+ * Here comes the ROM content
+ */
+
+#include "config.i65"
+#include "kdefs.i65"
+#include "fdefs.i65"
+#include "kernel.i65"
+
+#define SEM_VIAE840_T1 SEM_SERIEC
+#undef SEM_SERIEC
+#undef SEM_PARIEC
+
+#define ROMSTART $8000
+#define RAMSIZE (ROMSTART>>8)
+#define MIN_MEM $20 /* 8 kbyte */
+
+ .(
+; .word $2000 ; load address
+ *=ROMSTART
+
+/************* ROM entries */
+/*
+
+ The lib6502 needs to use addresses in each of the environments.
+ Devices (normally) use the kernel address space.
+ All other tasks, including the kernel have their own environment.
+ Therefore they all get their own zero, data and bss addresses.
+
+*/
+
+#echo ############ magic
+
+/************* devices */
+
+#include "sysapps/magic/magic.a65"
+
+#echo ############ devices
+.data:*=$f00:.zero:*=$d0:.bss:*=$400:.text
+.zero
+#echo zero:
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#include "devices/csadev.a65"
+.zero
+#echo zero:
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* init process */
+
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
+#define INIT_VERBOSE
+#define INIT_MERGE
+#define INIT_RESTART
+#define INIT_LIB6502
+#define INIT_MMU
+#define INIT_MMU_BANK 2
+#echo ############ init:
+#include "sysapps/init/init.a65"
+.data
+#echo data (<1024):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* fsdev - converts devices into files */
+
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
+#echo ############ fsdev:
+#include "sysapps/fs/fsdev.a65"
+.data
+#echo data (<=1024):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* fsiec - as IEEE488 bus filesystem */
+
+#ifdef FSIEC_PARALLEL
+
+#undef NOLOOP
+#undef NOFS
+#undef NOCMD
+
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
+#echo ############ fsiec (parallel):
+
+#undef FSIEC_AS_INIT
+#define FSIEC_DEVICE "devices/piec_csa.a65"
+
+#include "sysapps/fs/fsiec.a65"
+
+.data
+#echo data (<=1280):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* fsiec - as IEC bus filesystem */
+
+#ifdef FSIEC_SERIAL
+
+#define NOLOOP
+#undef NOFS
+#undef NOCMD
+
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
+#echo ############ fsiec (serial):
+
+#undef FSIEC_AS_INIT
+#define FSIEC_DEVICE "devices/siec_csa.a65"
+
+#include "sysapps/fs/fsiec.a65"
+
+.data
+#echo data (<=1024):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* fsibm - PC-style disks filesystem */
+
+#ifdef FSIBM
+
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
+#echo ############ fsibm:
+
+#define FSIBM_DEVICE_DRV "arch/csa65/devices/drv_wd1770.a65"
+#include "sysapps/fs/fsibm.a65"
+
+.data
+#echo data (<=1280):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
+#echo ############ shell:
+
+#ifdef CLK1MHZ
+#define SHORTMON
+#else
+#undef SHORTMON
+#endif
+
+/*
+#define NOSH
+#define NOSYSFKT
+*/
+
+#define MON_SHDEV 0
+#define MON_MONDEV 1 /* 7 */
+#define MON_SHEXE $c0
+#define MON_MONEXE $80
+#include "sysapps/mon/mon.a65"
+
+.zero
+#echo zero
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* boot lsh from BOOTDRV */
+
+#ifdef BOOTDRV
+
+#echo ************ lsh
+
+ /* add autostart of lib6502 program 'lsh' */
+
+ .(
+ .word end_auto
+ .byt PK_LIB+PK_AUTOEXEC+PK_RESTART ; is lib6502 program
+ .word 0 ; P_ADDR ignored
+ .byt 16 ; P_RAM
+ .byt 128 ; P_SHARED
+ .byt 0 ; P_PRIORITY
+ .byt 1,1 ; P_DEV
+ .byt BOOTDRV,":lsh",0,"-d",0,0
+end_auto
+ .)
+
+#endif
+
+/************* end of ROM executables */
+
+ .word -1
+
+/************* lib6502 code */
+
+#ifdef USE_LIB6502
+
+/* lib6502 jmp table is below STDIOADDR */
+
+#echo "############ lib6502"
+.data:*=$300:.zero:*=8:.bss:*=$400:.text
+
+#include "lib6502/lib6502.a65"
+/* #include "stdlib/stdio.a65" */
+
+.zero
+#echo zero:
+#print *
+/* Zerostart must keep save the sh/mon and init variables */
+Zerostart =$40 ; * ; only lib6502 and prg - that's it
+#print Zerostart
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+/* Memstart must keep save the sh/mon and init variables */
+Memstart =$500 ; * ; only lib6502 and prg
+#print Memstart
+.text
+
+Memend = $3000
+
+#endif
+
+/************* fill not used area (I/O, screens) */
+
+#if *>$e7ff
+#echo "program too long!, should be $e800 (59392), is"
+#print *
+ldx ,x
+#endif
+ .dsb $f000-*,<-1
+
+/************* Kernel */
+
+.data:*=$300:.zero:*=8:.bss:*=$600:.text
+#echo ############ kernel:
+
+#include "kernel/kernel.a65"
+
+.zero
+#echo zero:
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+ .)
+
+
diff --git a/dump/oa-2.0.9/arch/csa65/csarom2.a65 b/dump/oa-2.0.9/arch/csa65/csarom2.a65
new file mode 100644
index 0000000..c50e5f5
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/csarom2.a65
@@ -0,0 +1,266 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+
+/* These are necessary for CS/A65 kernel ***********************************/
+
+#define OSA_ARCH "CS/A65"
+
+#define OSA2KERNEL $f000
+
+#ifdef CMOSCPU
+#define OSA_CPU "6502"
+#else
+#define OSA_CPU "65C02"
+#endif
+
+/* These are changeable ****************************************************/
+
+#define FSIEC_PARALLEL
+#undef FSIEC_SERIAL
+#undef FSIBM
+#define USE_LIB6502
+
+#define CLK2MHZ
+
+#undef BOOTDRV "c"
+
+
+/***************************************************************************
+ *
+ * Better not change anything below
+ */
+
+/***************************************************************************
+ *
+ * Here comes the ROM content
+ */
+
+#include "config.i65"
+#include "kdefs.i65"
+#include "fdefs.i65"
+#include "kernel.i65"
+
+#define SEM_VIAE840_T1 SEM_SERIEC
+#undef SEM_SERIEC
+#undef SEM_PARIEC
+
+#define ROMSTART $8000
+
+ .(
+; .word $2000 ; load address
+ *=ROMSTART
+
+/************* ROM entries */
+/*
+
+ The lib6502 needs to use addresses in each of the environments.
+ Devices (normally) use the kernel address space.
+ All other tasks, including the kernel have their own environment.
+ Therefore they all get their own zero, data and bss addresses.
+
+*/
+
+#echo ############ magic
+
+/* so that init recognizes this as second ROM */
+#include "sysapps/magic/magic.a65"
+
+/************* fsiec - as IEEE488 bus filesystem */
+
+#ifdef FSIEC_PARALLEL
+
+#undef NOLOOP
+#undef NOFS
+#undef NOCMD
+
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
+#echo ############ fsiec (parallel):
+
+#undef FSIEC_AS_INIT
+#define FSIEC_DEVICE "devices/piec_csa.a65"
+
+#include "sysapps/fs/fsiec.a65"
+
+.data
+#echo data (<=1280):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* fsiec - as IEC bus filesystem */
+
+#ifdef FSIEC_SERIAL
+
+#define NOLOOP
+#undef NOFS
+#undef NOCMD
+
+.data:*=$300:.zero:*=$10:.bss:*=$400:.text
+#echo ############ fsiec (serial):
+
+#undef FSIEC_AS_INIT
+#define FSIEC_OUTDEV 7
+#define FSIEC_DEVICE "devices/siec_csa.a65"
+
+#include "sysapps/fs/fsiec.a65"
+
+.data
+#echo data (<=1024):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* fsibm - PC-style disks filesystem */
+
+#ifdef FSIBM
+
+.data:*=$300:.zero:*=$10:.bss:*=$500:.text
+#echo ############ fsibm:
+
+#define FSIBM_OUTDEV 7
+#define FSIBM_DEVICE_DRV "arch/csa65/devices/drv_wd1770.a65"
+#include "sysapps/fs/fsibm.a65"
+
+.data
+#echo data (<=1280):
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+#endif
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+.data:*=$3c0:.zero:*=$20:.bss:*=$400:.text
+#echo ############ shell:
+
+#ifdef CLK1MHZ
+#define SHORTMON
+#else
+#undef SHORTMON
+#endif
+
+#undef NOSH
+#undef NOSYSFKT
+
+#define MON_SHDEV 0
+#define MON_MONDEV 7
+#define MON_SHEXE $c0
+#define MON_MONEXE $c0
+#include "sysapps/mon/mon.a65"
+
+.zero
+#echo zero
+#print *
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+.text
+
+/************* boot lsh from BOOTDRV */
+
+#ifdef BOOTDRV
+
+#echo ************ lsh
+
+ /* add autostart of lib6502 program 'lsh' */
+
+ .(
+ .word end_auto
+ .byt PK_LIB+PK_AUTOEXEC+PK_RESTART ; is lib6502 program
+ .word 0 ; P_ADDR ignored
+ .byt 16 ; P_RAM
+ .byt 128 ; P_SHARED
+ .byt 0 ; P_PRIORITY
+ .byt 1,1 ; P_DEV
+ .byt BOOTDRV,":lsh",0,"-d",0,0
+end_auto
+ .)
+
+#endif
+
+/************* end of ROM executables */
+
+ .word -1
+
+/************* lib6502 code */
+
+#ifdef USE_LIB6502
+
+/* lib6502 jmp table is below STDIOADDR */
+
+#echo "############ lib6502"
+.data:*=$300:.zero:*=8:.bss:*=$400:.text
+
+#include "lib6502/lib6502.a65"
+/* #include "stdlib/stdio.a65" */
+
+.zero
+#echo zero:
+#print *
+/* Zerostart must keep save the sh/mon and init variables */
+Zerostart =$40 ; * ; only lib6502 and prg - that's it
+#print Zerostart
+.data
+#echo data:
+#print *
+.bss
+#echo bss:
+#print *
+/* Memstart must keep save the sh/mon and init variables */
+Memstart =$500 ; * ; only lib6502 and prg
+#print Memstart
+.text
+
+Memend = $3000
+
+#endif
+
+/************* fill not used area (I/O, screens) */
+
+
+ .dsb $fffe-*,<-1
+
+ .word -1
+ .)
+
+
diff --git a/dump/oa-2.0.9/arch/csa65/devices/con_csa.a65 b/dump/oa-2.0.9/arch/csa65/devices/con_csa.a65
new file mode 100644
index 0000000..d8efe2a
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/devices/con_csa.a65
@@ -0,0 +1,384 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#define PIO $e810
+#define VIA1 $e840
+#define vdcctrl $e888
+#define vdc $e880
+#define VIDPAGE 4
+
+#define MAX_SCREEN 4 /* hard limit for tables */
+
+#define MAX_ASCREEN maxscr /* soft limit */
+
+#define SWITCHKEY $46
+
+#define SET_MMU ldy #$10:sty MMU+VIDPAGE
+
+#define BELLIRQ jsr bellirq
+
+#define TRIGBELL jsr trigbell
+
+#define MAXSPAL maxspal
+
+#define MAXZEIL #25
+
+#define KEY_START 16 /* when does key repetition start */
+
+#define SCR_SPACE " "
+
+ /* screen# -> hi byte of base address in AC */
+#define HI_VID asl:asl:bit freq:bpl l1:asl:l1 clc:adc #VIDPAGE<<4
+
+#define ACT_HI_VID lda hivid
+
+ .data
+&maxspal .byt 0
+&maxscr .byt 0
+ .text
+
+&console_init .(
+ ldx #4
+ bit freq
+ bpl c1mhz
+ ldx #2
+c1mhz stx maxscr
+
+ jsr inimem
+ jsr inivid
+ jsr inikbd
+ jsr inibell
+ rts
+ .)
+
+inimem .(
+#ifdef ROM
+ ldx #$11
+l1m stx maxspal
+ stx MMU+1
+
+ lda #16
+ sta zei2+1
+ ldy #0
+ sty zei2
+ ldx #>BLKSIZ
+im1 lda (zei2),y
+ pha
+ lda #$55
+ sta (zei2),y
+ cmp (zei2),y
+ bne next
+ asl
+ sta (zei2),y
+ cmp (zei2),y
+ bne next
+ lda #0
+ sta (zei2),y
+ cmp (zei2),y
+ bne next
+ pla
+ sta (zei2),y
+ inc zei2+1
+ dex
+ bne im1
+
+ ldx maxspal
+ jsr ENMEM
+ pha
+next pla
+ ldx maxspal
+ inx
+#ifndef ROMTEST
+ cpx #$20
+#else
+ cpx #$18
+#endif
+ bcc l1m
+#endif /* ROM */
+ clc
+ rts
+ .)
+
+&inivid .(
+ lda screen
+ bne ix
+
+ lda #$0c ; set charrom and video base
+ sta vdcctrl
+
+ ldx #0
+i1 bit freq
+ bpl onemhz
+ lda vdc8tab,x
+ jmp nex
+onemhz lda vdc4tab,x
+nex stx vdc
+ sta vdc+1
+ inx
+ cpx #16
+ bcc i1
+ix
+ lda #40
+ bit freq
+ bpl i2
+ lda #80
+i2 sta maxspal
+ rts
+
+vdc8tab .byt $7e,$50,$64,6,$29,0,$19,$21,0,7,$60,7,0,0,0,0
+
+vdc4tab .byt $3f,$28,$32,3,$29,0,$19,$21,0,7,$60,7,0,0,0,0
+
+ .)
+
+&setact .(
+ sta actscr
+ asl
+ asl
+ bit freq
+ bpl s1
+ asl
+s1 and #%00001111
+ ldx #12
+ stx vdc
+ sta vdc+1
+ rts
+ .)
+
+/**************************************************************************
+ * Cursor handling
+ */
+
+&crsron .(
+ ldx #15
+ lda spalte
+ clc
+ adc vzei
+ stx vdc
+ sta vdc+1
+ lda vzei+1
+ adc #0
+ dex
+ stx vdc
+ and #%00001111
+ sta vdc+1
+&&crsroff rts
+ .)
+
+/**************************************************************************
+ * Bell handling
+ */
+
+ .(
+
+ .data
+pnt .byt 0
+cnt .byt 0
+ .text
+
+&inibell
+ lda #%00100100
+ sta VIA1+VIA_IER
+ lda VIA1+VIA_ACR
+ and #%11000011
+ ora #%00010000
+ sta VIA1+VIA_ACR
+&&trigbell
+ lda #0
+ sta pnt
+ sta cnt
+ lda #15
+ sta VIA1+VIA_SR
+&&bellirq
+ lda cnt
+ bne endirq
+ ldy pnt
+ lda tcnt,y
+ beq endbell
+ sta cnt
+ lda tfrq,y
+ sta VIA1+VIA_T2CL
+ lda #0
+ sta VIA1+VIA_T2CH
+ inc pnt
+endirq dec cnt
+ rts
+endbell lda #0
+ sta VIA1+VIA_SR
+ rts
+
+tcnt .byt 2,2,2,2,2,2,2,0
+tfrq .byt 32,64,128,32,64,128,32
+
+ .)
+
+/**************************************************************************/
+
+ .(
+
+kcnt =zei2
+ .data
+rcnt .byt 0
+shiftfl .byt 0
+prev .byt 0
+ .zero
+tzei .word 0
+ .text
+
+&inikbd .(
+ lda PIO+PIA_CRA
+ and #255-4
+ sta PIO+PIA_CRA
+ ldx #15
+ stx PIO+PIA_PA
+ ora #4
+ sta PIO+PIA_CRA
+ lda PIO+PIA_CRB
+ and #255-4
+ sta PIO+PIA_CRB
+ ldx #0
+ stx PIO+PIA_PB
+ ora #4
+ sta PIO+PIA_CRB
+ lda #4
+ sta rcnt
+ sta rspd
+ rts
+ .)
+
+&&getkey .(
+ lda PIO
+ and #$f0
+ ora #8
+ sta PIO
+ix1
+ lda PIO+2
+ cmp PIO+2
+ bne ix1
+ ldy #0
+ and #%00100001
+ cmp #%00100001
+ beq nshift
+ iny
+nshift inc PIO
+x0 lda PIO+2
+ cmp PIO+2
+ bne x0
+ and #%00000001
+ bne nctrl
+ iny
+ iny
+nctrl sty shiftfl
+
+ tya
+ asl
+ tax
+ lda ttab+1,x
+ tay
+ lda ttab,x
+ sta tzei
+ sty tzei+1
+ ldy #0
+ ldx #0
+lx1 stx kcnt
+ lda PIO
+ and #$f0
+ ora kcnt
+ sta PIO
+ ldx #8
+l2 lda PIO+2
+ cmp PIO+2
+ bne l2
+l3 asl
+ bcs lc
+ pha
+ lda (tzei),y
+ bne le
+ pla
+lc iny
+ dex
+ bne l3
+ ldx kcnt
+ inx
+ cpx #10
+ bcc lx1
+
+ ldy #<-1
+ sty prev
+nokey
+/* TODO: check keyboard code - C64 works different */
+; ldx #KEY_START
+; stx rcnt
+ ldx shiftfl
+ sec
+ rts
+
+le tax
+ pla
+ txa
+ cpy prev
+ sty prev
+ bne lx
+
+ dec rcnt
+ bne nokey
+ ldx rspd
+ .byt $2c
+
+lx ldx #KEY_START
+ stx rcnt
+
+ ldx shiftfl
+ clc
+ rts
+ .)
+
+ttab .word ktab,stab,ctab,sctab
+
+ktab .asc TC_CRGT,TC_HOME,"~(&%#!",TC_BS,TC_CDWN,"^@)\'$":.byt $22
+ .asc "97^^outeq/8^@piyrw"
+ .asc "64^@ljgda*5^@:khfs"
+ .asc "31",TC_CR,";mbcz+2^@?,nvx"
+ .asc "-0^@>^@]@^@=.^@@< [^@"
+
+stab .asc TC_CLFT,TC_CLR,"|(&%#!",TC_INS,TC_CUP,"^@)\'$":.byt $22
+ .asc "97^^OUTEQ/8^@PIYRW"
+ .asc "64^@LJGDA*5^@:KHFS"
+ .asc "31",TC_LF,";MBCZ+2^@?,NVX"
+ .asc "-0^@>^@}@^@=.^@",TC_ESC,"< {^@"
+
+ctab .asc TC_WRU,TC_WCLS,"~(&%#!",TC_DEL,TC_WLO,"^@)\'$",$22
+ .asc "97^^^o^u^t^e^q/8^@^p^i^y^r^w"
+ .asc "64^@^l^j^g^d^a*5^@:^k^h^f^s"
+ .asc "31",TC_EOL,";^m^b^c^z+2^@?,^n^v^x"
+ .asc "-0^@>^@]@^@=.^@",TC_CLL,"< [^@"
+
+sctab .asc "^@^@|(&%#!^H^@^@)\'$":.byt $22
+ .asc "97^^O^U^T^E^Q/8^@^P^I^Y^R^W"
+ .asc "64^@^L^J^G^D^A*5^@:^K^H^F^S"
+ .asc "31^m;^M^B^C^Z+2^@?,^N^V^X"
+ .asc "-0^@>^@}@^@=.^@@< {^@"
+
+
+ .)
+
diff --git a/dump/oa-2.0.9/arch/csa65/devices/csadev.a65 b/dump/oa-2.0.9/arch/csa65/devices/csadev.a65
new file mode 100644
index 0000000..55028a9
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/devices/csadev.a65
@@ -0,0 +1,66 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef ROM
+
+#include "kdefs.def"
+#include "kernel.i65"
+
+ ;.word $700
+ *=$700
+
+/*#define NOPRG*/
+
+#endif
+
+
+/* Device-Block */
+
+ .(
+
+ .word endd
+ .byt PK_DEV+$80
+ .word devstart
+ .dsb P_NAME - P_RAM, $ff
+ .asc "devices",0,0
+
+devstart
+
+#define CONSOLE_DEVICE "devices/con_csa.a65"
+#include "devices/console.a65"
+
+#include "devices/par.a65"
+#include "devices/nulldev.a65"
+#include "devices/spooler.a65"
+
+-sernr = "1"
+#include "devices/oa1ds.a65"
+
+#define UARTBASE $e830
+/*#include "devices/ser_uart.a65"*/
+
+ .word $ffff
+
+endd .)
+
diff --git a/dump/oa-2.0.9/arch/csa65/devices/drv_wd1770.a65 b/dump/oa-2.0.9/arch/csa65/devices/drv_wd1770.a65
new file mode 100644
index 0000000..4ed58e1
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/devices/drv_wd1770.a65
@@ -0,0 +1,1296 @@
+/****************************************************************************
+
+ OS/A65 Version 2.1.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/*
+ * Driver for a memory-mapped WD1770
+ *
+ * Exports
+ *
+ * GETDPB
+ * DLOOP
+ * DINIT
+ * RWSEC
+ * DFORMAT
+ *
+ * Imports (calls):
+ *
+ * dchanged
+ */
+
+ .(
+
+#include "chips/wd1770.i65"
+#include "chips/via6522.i65"
+
+#define WD1770 $e8e0
+#define WDVIA $e8f0
+
+#define ERRCNT 4
+
+ .zero
+zei .word 0
+zeid .word 0
+ddzei .word 0
+divers .byt 0
+sect .byt 0
+tr .byt 0
+errcnt .byt 0
+actdrv .byt 0
+side .byt 0
+cmd .byt 0
+data .dsb 6
+drvst .dsb ANZDRV ; drivestatus z.b. Step-Zeit
+tracks .dsb ANZDRV ; Track, auf dem jeweiliges Laufwerk steht
+hd .dsb ANZDRV ; High-Density-Flag =bit7 , 6= motor an flag
+ ; bit0=1 disk changed, bit1=1 double stepping
+mcnt .dsb ANZDRV ; motor-aus-zaehler
+blen .dsb ANZDRV ; Anzahl 256-Byte-Bloecke in einem Sektor
+
+ .text
+
+/*
+ jmp DINIT
+ jmp exit
+ jmp seldrv ; a=drv
+ jmp desel
+ jmp selside ; a=side
+ jmp go2track ; a=track
+ jmp setadr ; a/y=adr
+ jmp read ; a=sect
+ jmp write ; "
+ jmp verify ; "
+ jmp DREAD ; a/y=*Struct
+ jmp DWRITE ; "
+ ;jmp DVERIFY ; "
+ jmp ftrack ; a=virgin, zeid=*seclist
+ jmp DFORMAT ; a/y=*Struct
+*/
+
+#if D_SLEN=32
+setddzei /* AC=Drv-Nr */
+ asl
+ asl
+ asl
+ asl
+ asl
+ clc
+ adc #dpb
+ sta ddzei+1
+ clc
+ rts
+#endif
+
+INVDPB .( ; x ist Drive
+ txa
+ jsr setddzei
+ ldy #D_ST
+ lda #DS_INV
+ sta (ddzei),y
+ clc
+ rts
+ .)
+
+INIDPB .(
+ ldx #0
+il stx zei
+ jsr INVDPB
+ ldx zei
+ inx
+ cpx #ANZDRV
+ bcc il
+ clc
+ rts
+ .)
+
+&GETDPB .( ; x is drive number
+ jsr setdzei
+
+ jsr boot2dpb
+ bcs er
+
+ ldx drive
+ lda hd,x
+ and #255-2
+ sta hd,x
+
+ ldy #D_SECS
+ lda (dzei),y
+ sta ar1
+ iny
+ lda (dzei),y
+ sta ar1+1
+ ldy #D_SPTS+1
+ lda (dzei),y
+ tax
+ dey
+ lda (dzei),y
+ jsr div
+ cmp #41
+ bcs ge
+ txa
+ bne ge
+#ifdef SHOWD
+ lda #"d"
+ jsr SEROUT
+ lda drive
+ jsr HEXOUT
+#endif
+ ldx drive
+ lda hd,x
+ ora #2
+ sta hd,x
+ge
+ ldy #D_ST
+ lda #DS_OK
+ sta (dzei),y
+ ldy #D_BFLAG
+ lda #0 ; 0 -> 12 bit FAT
+ sta (dzei),y
+ clc
+er
+ rts
+ .)
+
+
+sec2rw .(
+ ldy #RW_DRV
+ lda (zei),y
+ jsr setddzei
+
+ ldy #RW_TRCK+1
+ lda (zei),y
+ sta ar1+1
+ dey
+ lda (zei),y
+ sta ar1
+ ora ar1+1
+ bne notboot
+
+ ;lda #0
+ ldy #RW_SIDE
+s2rl sta (zei),y
+ iny
+ cpy #RW_ADR
+ bcc s2rl
+ ldy #RW_SEC
+ lda #1
+ sta (zei),y
+ clc
+ rts
+
+notboot ldy #D_SECS+1
+ txa
+ cmp (ddzei),y
+ bcc sok
+ bne serr
+ dey
+ lda ar1
+ cmp (ddzei),y
+ bcs serr
+sok
+ ldy #D_SPTS+1
+ lda (ddzei),y
+ tax
+ dey
+ lda (ddzei),y
+ jsr div
+ bcs serr
+ ldy #RW_TRCK
+ sta (zei),y
+ iny
+ txa
+ sta (zei),y
+ ldy #D_SPT+1
+ lda (ddzei),y
+ tax
+ dey
+ lda (ddzei),y
+ jsr div
+ bcs serr
+ ldy #RW_SIDE
+ sta (zei),y
+ txa
+ bne serr
+ clc
+ lda ar1
+ adc #1
+ ldy #RW_SEC
+ sta (zei),y
+ iny
+ lda ar1+1
+ adc #0
+ sta (zei),y
+ rts
+serr sec
+ rts
+ .)
+
+#ifndef SHOWD
+&RWSEC bcs DWRITE
+#endif
+
+DREAD ldx #1
+ .byt $2c
+DWRITE ldx #2
+ stx cmd
+ .(
+ sta zei
+ sty zei+1
+
+ jsr sec2rw ; change from sector number to track/side/sector
+
+ ldy #RW_ADR
+ lda (zei),y
+ pha
+ iny
+ lda (zei),y
+ tay
+ pla
+ jsr setadr
+ ldy #RW_DRV
+ lda (zei),y
+ jsr seldrv
+ bcs rx
+ ldy #RW_SIDE
+ lda (zei),y
+ jsr selside
+ ldy #RW_TRCK
+ lda (zei),y
+ jsr go2track
+ bcs rx
+ ldx actdrv
+ lda blen,x
+ tax ; Anzahl 256-Byte-Blocks (wird bei seldrv gesetzt)
+ ldy #RW_SEC
+ lda (zei),y
+ dec cmd
+ bne r2
+ jmp read
+r2 dec cmd
+ bne r3
+ jmp write
+r3 sec
+ lda #E_CMD
+rx rts
+ .)
+
+&DFORMAT .(
+ .data
+fpar .byt 0
+ .text
+
+ cmp #ANZFORM
+ bcc f1
+ lda #E_ILLPAR
+ sec
+ rts
+f1 sta fpar
+ asl
+ tay
+ lda fadr,y
+ sta zei
+ lda fadr+1,y
+ sta zei+1
+ txa ; x= drive
+ pha
+ jsr desel
+ pla
+ sta actdrv
+
+ jsr setdrv ; a=drive
+
+ ldy #FMT_HDFL
+ lda (zei),y
+ ldx actdrv
+ sta hd,x
+ jsr setdens
+
+ jsr motoron
+
+ ldy #FMT_BLEN
+ lda (zei),y
+ sta data+5
+ tax
+ lda POT2-1,x
+ ldx actdrv
+ sta blen,x
+
+ jsr restore
+ bcs fx
+
+ lda #0
+ sta tr
+ lda #FMT_SCLST
+ clc
+ adc zei
+ pha
+ lda zei+1
+ adc #0
+ tay
+ pla
+ jsr setadr ; sektor-Liste setzen
+
+floop lda #0
+ sta side
+
+sideloop jsr selside
+
+ ldx data+5 ; Block-L�nge 0=128,1=256,2=512,3=1024
+ ldy #FMT_VIRG
+ lda (zei),y
+ jsr ftrack
+ bcs fx
+
+ inc side
+ lda side
+ ldy #FMT_SIDES
+ cmp (zei),y
+ bcc sideloop
+
+ inc tr
+ lda tr
+ ldy #FMT_TRCKS
+ cmp (zei),y
+ bcs wrboot
+
+ ldx actdrv
+ lda hd,x
+ and #2
+ beq fnd
+
+ jsr lowdens
+
+ lda #$50
+ jsr setstep
+ bcs fx
+fnd
+ lda #$50 ; step-in ohne verify
+ jsr setstep
+ bcs fx
+ jsr highdens
+ jmp floop
+
+fx pha
+ jsr highdens
+ pla
+ ldx #<-1
+ stx actdrv
+ sec
+ rts
+
+wrboot lda #0
+ jsr selside
+ lda #0
+ jsr go2track
+ bcs fx
+ lda fpar ; Format mal 32 als Zeiger f�r
+ asl ; Boot-Sektor-Daten
+ asl
+ asl
+ asl
+ asl
+ clc
+ adc #bootsektor
+ tay
+ pla
+ jsr setadr
+
+ ldx actdrv
+ lda blen,x
+ tax
+ lda #1
+ jsr write
+ ldx #<-1
+ stx actdrv
+ rts
+
+ANZFORM =6
+fadr .word ssdd,dsdd,dshd3,dshd5,dshh5,dsdd40
+
+ ; single sided double density
+ssdd .byt $e5,1,80,$01,2,10, 1,3,5,7,9,2,4,6,8
+ ; double sided double density
+dsdd .byt $e5,2,80,$01,2,10, 1,3,5,7,9,2,4,6,8
+ ; double sided high density 3 1/2 zoll
+dshd3 .byt $e5,2,80,$81,2,19, 1,3,5,7,9,11,13,15,17,2,4,6,8,10,12,14,16,18
+ ; double sided high density 5.25"
+dshd5 .byt $e5,2,80,$81,2,16, 1,3,5,7,9,11,13,15,2,4,6,8,10,12,14
+ ; double sided higher density 5.25"
+dshh5 .byt $e5,2,80,$81,3,9, 1,3,5,7,2,4,6,8
+ ; double sided double density 40 Tracks (360k)
+dsdd40 .byt $e5,2,40,$03,2,10, 1,3,5,7,9,2,4,6,8
+
+bootsektor ; single sided double density
+ .byt $eb,$34,$90,"OS/A 1.2"
+ .word $200 ; BPS
+ .byt 2 ; SPC
+ .word 1 ; RES
+ .byt 2 ; FATs
+ .word 112 ; DIR
+ .word 720 ; SECs
+ .byt 248 ; Media
+ .word 3 ; SPF
+ .word 9 ; SPT
+ .word 1 ; Side
+ .word 0 ; Hidden
+ .word 0 ; (Dummy)
+ ; double sided double density
+ .byt $eb,$34,$90,"OS/A 1.2"
+ .word $200 ; BPS
+ .byt 2 ; SPC
+ .word 1 ; RES
+ .byt 2 ; FATs
+ .word 112 ; DIR
+ .word 1440 ; SECs
+ .byt 249 ; Media
+ .word 3 ; SPF
+ .word 9 ; SPT
+ .word 2 ; Side
+ .word 0 ; Hidden
+ .word 0 ; (Dummy)
+ ; double sided high density 3.5 zoll
+ .byt $eb,$34,$90,"OS/A 1.2"
+ .word $200 ; BPS
+ .byt 1 ; SPC
+ .word 1 ; RES
+ .byt 2 ; FATs
+ .word 224 ; DIR
+ .word 2880 ; SECs
+ .byt 240 ; Media
+ .word 9 ; SPF
+ .word 18 ; SPT
+ .word 2 ; Side
+ .word 0 ; Hidden
+ .word 0 ; (Dummy)
+ ; double sided high density 5.25 zoll
+ .byt $eb,$34,$90,"OS/A 1.2"
+ .word $200 ; BPS
+ .byt 1 ; SPC
+ .word 1 ; RES
+ .byt 2 ; FATs
+ .word 224 ; DIR
+ .word 2400 ; SECs
+ .byt 249 ; Media
+ .word 7 ; SPF
+ .word 15 ; SPT
+ .word 2 ; Side
+ .word 0 ; Hidden
+ .word 0 ; (Dummy)
+ ; double sided higher density 5.25 zoll (BPS=1024)
+ .byt $eb,$34,$90,"OS/A 1.2"
+ .word $400 ; BPS
+ .byt 1 ; SPC
+ .word 1 ; RES
+ .byt 2 ; FATs
+ .word 128 ; DIR
+ .word 1280 ; SECs
+ .byt 255 ; Media
+ .word 2 ; SPF
+ .word 8 ; SPT
+ .word 2 ; Side
+ .word 0 ; Hidden
+ .word 0 ; (Dummy)
+ ; double sided double density 5.25 zoll 40 Tracks (360k)
+ .byt $eb,$34,$90,"OS/A 1.2"
+ .word $200 ; BPS
+ .byt 1 ; SPC
+ .word 1 ; RES
+ .byt 2 ; FATs
+ .word 112 ; DIR
+ .word 720 ; SECs
+ .byt 255 ; Media
+ .word 3 ; SPF
+ .word 9 ; SPT
+ .word 2 ; Side
+ .word 0 ; Hidden
+ .word 0 ; (Dummy)
+ .)
+
+&DINIT .(
+ jsr INIDPB
+
+ lda #%00001111
+ sta WDVIA+VIA_DRA ;
+
+ lda #0
+ sta WDVIA+VIA_DDRA ;Ertmal testen ob IC da
+ cmp WDVIA+VIA_DDRA
+ bne xini
+ lda #%00101111
+ sta WDVIA+VIA_DDRA
+ cmp WDVIA+VIA_DDRA
+ bne xini
+
+ lda WDVIA+VIA_ACR
+ and #%11011110 ;t2 timed irq, pa latch disabled
+ sta WDVIA+VIA_ACR
+ lda WDVIA+VIA_PCR
+ and #%11110000 ;pa
+ ora #%00001110 ;ca2 hi (side), ca1 neg edge
+ sta WDVIA+VIA_PCR
+ lda #%00100011 ;ca1, ca2, t2 irq off
+ sta WDVIA+VIA_IER
+
+/* lda #0 ; der Controller braucht zulange, um das Register
+ sta WD1770+WD_TRCK ; upzudaten
+ cmp WD1770+WD_TRCK
+ bne xini
+*/
+ ldx #0
+i1 lda #00000011 ; 6ms Step-Zeit
+ sta drvst,x
+ lda #<-1
+ sta tracks,x
+ inx
+ cpx #ANZDRV
+ bcc i1
+ sta actdrv
+ clc
+ rts
+xini sec
+ rts
+ .)
+
+&DLOOP .(
+ .data
+dcnt .byt 0
+ .text
+
+ lda #0
+ sta dcnt
+ sta divers
+dl jsr setdrv ; a=drive
+
+ ldx divers
+ lda hd,x
+ and #%01000000
+ beq dl1
+ inc dcnt ; motor an
+ dec mcnt,x
+ bne dl1
+ lda hd,x
+ and #%10111111
+ sta hd,x
+ lda #%00000100
+ dex
+ bmi dl1a
+ asl
+dl1a ora WDVIA+VIA_DRA
+ sta WDVIA+VIA_DRA
+dl1
+ ldx divers
+ lda WDVIA+VIA_DRA ; test auf Disk Change
+ and #%00010000
+ bne dl2 ; not changed -> dl2
+
+ lda hd,x /* FIXME: move head to track 0? */
+ and #1
+ bne dl2
+ lda hd,x
+ ora #1
+ and #255-2 ; double-stepping aus
+ sta hd,x
+ lda #<-1
+ sta tracks,x
+ jsr INVDPB
+ jsr dchanged
+dl2
+ inc divers
+ lda divers
+ cmp #ANZDRV
+ bcc dl
+ jsr desel
+
+ lda WDVIA+VIA_DRA
+ and #%00001100 ; motor-bits
+ eor #%00001100 ; sind beide aus
+ bne dlx ; nein dann ende
+ jsr lowdens
+dlx lda dcnt ; mit z-flag �bergeben
+ rts
+ .)
+
+
+forcend .(
+ lda WD1770+WD_ST
+ and #1
+ beq fer
+ lda #%11010000 ; Force Interrupt
+ sta WD1770+WD_CMD
+ jsr wloop
+fer rts
+ .)
+
+selside .(
+ clc
+ and #1
+ sta side
+ bne side1
+ lda WDVIA+VIA_PCR
+ ora #%00000010
+ sta WDVIA+VIA_PCR
+ rts
+side1 lda #%11111101
+ and WDVIA+VIA_PCR
+ sta WDVIA+VIA_PCR
+ rts
+ .)
+
+wloop .(
+ txa
+ ldx #13
+wl1 dex
+ bne wl1
+ tax
+ rts
+ .)
+
+wcmd .(
+ pha
+#ifdef NMIDEV
+ lda #NMI_OFF
+ jsr CTRLNMI
+#endif
+ sei
+ jsr wloop
+ pla
+ sta WD1770+WD_CMD
+ lda #1
+wcl bit WD1770+WD_ST
+ beq wcl
+ rts
+ .)
+
+setstep .(
+ ldx actdrv
+ and #%11111100
+ ora #%00001000 ; ohne Motor-On-Time
+ sta divers
+ lda drvst,x
+ and #3
+ ora divers
+ php
+ ;sei
+ jsr wcmd
+ ldx #128
+wc2 jsr setti
+wc1 bit WDVIA+VIA_DRA
+ bmi wcok
+ jsr fragti
+ beq wc1
+ dex
+ bne wc2
+ plp
+ lda #E_CMD
+ sec
+ .byt $2c ; plp,clc �berspringen
+wcok plp
+ clc
+ ldx WD1770+WD_ST
+ rts
+ .)
+
+setti lda #255
+ sta WDVIA+VIA_T2CL
+ sta WDVIA+VIA_T2CH
+ rts
+
+fragti lda WDVIA+VIA_IFR
+ and #%00100000
+ rts
+
+seldrv .(
+ pha
+ ldx actdrv
+ bmi sd1
+ lda WD1770+WD_TRCK
+ sta tracks,x
+sd1 pla
+ sta actdrv
+
+ jsr setdrv ; a=drv
+ jsr setdens
+ jsr motoron
+
+ ldx actdrv
+ lda tracks,x
+ bpl sd2
+ jsr query
+ bcs sde
+sd2 sta WD1770+WD_TRCK
+ tay
+ ldx actdrv
+ lda hd,x
+ and #1
+ beq sd3
+ tya
+ eor #1 ; da track von 0-79 kann das nicht aus bereich raus
+ jsr go2track ; um disk-change zu l�schen
+ bcs sder
+ ldx actdrv
+ lda hd,x
+ and #%11111110
+ sta hd,x
+sd3 clc
+sder rts
+sde sta actdrv
+ rts
+ .)
+
+motoron .(
+ lda actdrv
+ and #1
+ beq drva
+ lda WDVIA+VIA_DRA
+ and #%11110111 ; Motor on
+ bne drvs
+drva lda WDVIA+VIA_DRA
+ and #%11111011
+drvs sta WDVIA+VIA_DRA
+ ldx actdrv
+ lda hd,x
+ and #%01000000
+ bne mok ; motor war schon an
+ sta mcnt,x ; motor-aus-z�hler auf null
+ lda hd,x
+ ora #%01000000
+ sta hd,x
+#ifdef SHOWD
+ lda #"m"
+ jsr SEROUT
+#endif
+
+&mdelay
+ lda WDVIA+VIA_DRA
+ and #%00001100 ; beide Motoren
+ eor #%00001100 ; aus ?
+ beq mok ; ja dann ende
+
+#ifdef SHOWD
+ lda #"M"
+ jsr SEROUT
+#endif
+ ldx #40
+ml jsr setti
+ml2 jsr YIELD
+ jsr fragti
+ beq ml2
+ dex
+ bne ml
+mok rts
+ .)
+
+setdrv .(
+ and #1
+ beq drva
+ lda WDVIA+VIA_DRA
+ and #%11111101 ; drive select
+ ora #%00000001
+ bne drvs
+drva lda WDVIA+VIA_DRA
+ and #%11111110
+ ora #%00000010
+drvs sta WDVIA+VIA_DRA
+&densok rts
+ .)
+
+setdens .(
+ ldx actdrv
+ lda hd,x ; high-Density-Bit
+ lsr ; auf Portbit schieben
+ lsr
+ eor WDVIA+VIA_DRA ; vergleichen
+ and #%00100000 ; maskieren
+ beq densok ; gleich dann fertig
+
+ lda hd,x
+ bpl lodens
+ lda WDVIA+VIA_DRA
+ ora #%00100000
+ bne denset
+lodens lda WDVIA+VIA_DRA
+ and #%11011111
+denset sta WDVIA+VIA_DRA
+ jmp mdelay
+ .)
+
+lowdens lda WDVIA+VIA_DRA
+ and #%11011111
+ sta WDVIA+VIA_DRA
+ rts
+highdens ldx actdrv
+ lda hd,x
+ bpl lowdens
+ lda WDVIA+VIA_DRA
+ ora #%00100000
+ sta WDVIA+VIA_DRA
+#ifdef SHOWD
+ lda #"H"
+ jsr SEROUT
+#endif
+ jmp mdelay
+
+query .(
+ jsr restore
+ bcs qx
+ lda #4 ; hd-count
+ sta divers
+
+ lda #0
+ jsr selside
+
+q ldx #40 ; bis 5.25" auf Drehzahl nach Density-Wechsel
+ lda #ERRCNT*2
+ sta errcnt
+ .byt $2c
+qloop ldx #16 ; 8*32ms=256ms <> 1 umdrehung bei 234 upm
+ lda #%11000000 ; Read Adress
+ ldy #5
+ ;sei
+ jsr wcmd
+q1 jsr setti
+ lda #%00100000
+q2 bit WDVIA+VIA_IFR
+ bne qn
+ bit WDVIA+VIA_DRA
+ bvc q2
+ ldx WD1770+WD_DATA
+ stx data,y
+ dey
+ bpl q2
+ lda WD1770+WD_ST
+ and #%00001100
+ bne q3
+ lda data+2 ; Sektor Length
+ and #3
+ beq q3 ; Sektoren mit 128 Byte gehen nicht
+ tax
+ lda POT2-1,x ; dann Anzahl 256-Byte-Blocks im Sektor
+ ldx actdrv
+ sta blen,x
+ cli
+#ifdef NMIDEV
+ lda #NMI_ON
+ jsr CTRLNMI
+#endif
+ lda data+5
+ clc
+ rts
+
+qn lda WD1770+WD_ST
+ dex
+ bne q1
+
+q3 dec errcnt
+ bne qloop
+ cli
+#ifdef NMIDEV
+ lda #NMI_ON
+ jsr CTRLNMI
+#endif
+ dec divers
+ beq qe
+
+ ldx actdrv
+ lda hd,x
+ eor #%10000000
+ sta hd,x
+ jsr setdens
+
+ lda divers
+ pha
+ cmp #2
+ bcs q4
+ jsr restore
+q4 pla
+ sta divers
+ jmp q
+
+qe lda #E_Q
+qx sec
+ rts
+
+&POT2 .byt 1,2,4
+ .)
+
+desel .(
+ ldx actdrv
+ bmi sd1
+ lda WD1770+WD_TRCK
+ sta tracks,x
+sd1 lda #<-1
+ sta actdrv
+ lda WDVIA+VIA_DRA
+ ora #%00000011
+ sta WDVIA+VIA_DRA
+ clc
+ rts
+ .)
+
+go2track .(
+ sta tr
+ cmp WD1770+WD_TRCK
+ beq gtr
+
+ jsr lowdens
+
+ jsr findtr
+ bcc gtc
+
+ lda #$04 ; restore mit verify
+ jsr setstep
+ bcs gts
+
+ jsr findtr
+ bcs gts
+gtc and #%00011000
+ bne gts
+
+ jsr highdens
+gtr clc
+ rts
+
+gts jsr highdens
+ lda #E_GT
+ sec
+ rts
+ .)
+
+findtr .(
+ lda tr
+ sta WD1770+WD_DATA
+
+ ldx actdrv
+ lda hd,x
+ and #2
+ beq gnd
+
+ lda WD1770+WD_TRCK
+ pha
+ lda #$10 ; stepping ohne verify
+ jsr setstep
+ pla
+ sta WD1770+WD_TRCK ; und das ganze nochmal mit verify
+ lda tr
+ sta WD1770+WD_DATA ; das sind dann doppelt so viele steps
+
+gnd lda #$14 ; seek track
+ jmp setstep
+ .)
+
+restore .(
+ jsr forcend
+ jsr lowdens
+ lda #$00 ; restore
+ jsr setstep
+ pha
+ jsr highdens
+ lda #0
+ sta tr
+ pla
+ rts
+ .)
+
+setadr sta zeid
+ sty zeid+1
+ clc
+ rts
+
+read .(
+ sta sect
+ stx data
+#ifdef BSHOW
+ lda #"R"
+ jsr SEROUT
+ txa
+ jsr HEXOUT
+#endif
+ jsr forcend
+ lda #ERRCNT
+ sta errcnt
+rdloop lda sect
+ sta WD1770+WD_SECT
+ ;sei
+ ldx data ; Anzahl 256-Byte-Bl�cke
+ ldy #0
+ lda #%10001000
+ jsr wcmd
+ lda WD1770+WD_ST
+rd1 bit WDVIA+VIA_DRA
+ bmi rde
+ bvc rd1
+ lda WD1770+WD_DATA
+ sta (zeid),y
+ iny
+ bne rd1
+ inc zeid+1
+ dex
+ bne rd1
+ clc
+ ldx WD1770+WD_ST
+ ldy errcnt
+ ;cli
+ ;rts
+ bcc rdee ; always
+rde dec errcnt
+ bne rdloop
+ lda #E_RD
+ sec
+ ldx WD1770+WD_ST
+rdee
+ cli
+#ifdef NMIDEV
+ php
+ pha
+ lda #NMI_ON
+ jsr CTRLNMI
+ pla
+ plp
+#endif
+ rts
+ .)
+
+write .(
+ sta sect ; ( x-reg die Anzahl 256-Byte-Bl�cke )
+ stx data
+#ifdef BSHOW
+ lda #"W"
+ jsr SEROUT
+ txa
+ jsr HEXOUT
+#endif
+ jsr forcend
+ lda #ERRCNT
+ sta errcnt
+wrloop lda sect
+ sta WD1770+WD_SECT
+ ;sei
+ ldx data ; Anzahl 256-Byte-Bl�cke
+ ldy #0
+ lda #%10101000
+ jsr wcmd
+ lda WD1770+WD_ST
+rd1 bit WDVIA+VIA_DRA
+ bmi rde
+ bvc rd1
+ lda (zeid),y
+ sta WD1770+WD_DATA
+ iny
+ bne rd1
+ inc zeid+1
+ dex
+ bne rd1
+ clc
+ lda WD1770+WD_ST
+ ;cli
+ ;rts
+ bcc rdee ; always
+rde dec errcnt
+ bne wrloop
+ lda #E_WR
+ sec
+ ldx WD1770+WD_ST
+rdee cli
+#ifdef NMIDEV
+ php
+ pha
+ lda #NMI_ON
+ jsr CTRLNMI
+ pla
+ plp
+#endif
+ rts
+ .)
+
+ftrack .(
+ sta divers ; virgin
+ stx data+4 ; Sektor-L�nge
+ lda POT2-1,x
+ sta data ; Anzahl 256-Byte-Bl�cke
+ lda #ERRCNT
+ sta errcnt
+errloop ldy #0
+ lda (zeid),y
+ sta data+2 ; endsector
+ iny
+ sty sect
+ jsr forcend
+ ;sei
+ lda #%11110100
+ jsr wcmd
+ lda WD1770+WD_ST ; intrq loeschen
+ ldy #80
+ ldx #$4e
+f1a bit WDVIA+VIA_DRA
+ bmi fey
+ bvc f1a
+ stx WD1770+WD_DATA
+ dey
+ bne f1a
+sloop lda data
+ sta data+1
+ ldx #0
+ ldy #12
+f2 bit WDVIA+VIA_DRA
+ bmi fey
+ bvc f2
+ stx WD1770+WD_DATA
+ dey
+ bne f2
+ ldx #$f5
+ ldy #3
+f3 bit WDVIA+VIA_DRA
+ bmi fey
+ bvc f3
+ stx WD1770+WD_DATA
+ dey
+ bne f3
+ ldx #$fe
+f4 bit WDVIA+VIA_DRA
+fey bmi fex
+ bvc f4
+ stx WD1770+WD_DATA
+ ldx tr
+f5 bit WDVIA+VIA_DRA
+ bmi fex
+ bvc f5
+ stx WD1770+WD_DATA
+ ldx side
+f6 bit WDVIA+VIA_DRA
+ bmi fex
+ bvc f6
+ stx WD1770+WD_DATA
+ ldy sect
+ lda (zeid),y
+ tax
+f7 bit WDVIA+VIA_DRA
+ bmi fex
+ bvc f7
+ stx WD1770+WD_DATA
+ ldx data+4 ; l�nge des Sektors
+f8 bit WDVIA+VIA_DRA
+ bmi fex
+ bvc f8
+ stx WD1770+WD_DATA
+ ldx #$f7
+f9 bit WDVIA+VIA_DRA
+ bmi fex
+ bvc f9
+ stx WD1770+WD_DATA
+ ldy #22
+ ldx #$4e
+f10 bit WDVIA+VIA_DRA
+ bmi fex
+ bvc f10
+ stx WD1770+WD_DATA
+ dey
+ bne f10
+ ldy #12
+ ldx #0
+f11 bit WDVIA+VIA_DRA
+ bmi fex
+ bvc f11
+ stx WD1770+WD_DATA
+ dey
+ bne f11
+ ldy #3
+ ldx #$f5
+f12 bit WDVIA+VIA_DRA
+fex bmi fe
+ bvc f12
+ stx WD1770+WD_DATA
+ dey
+ bne f12
+ ldx #$fb
+f13 bit WDVIA+VIA_DRA
+ bmi fe
+ bvc f13
+ stx WD1770+WD_DATA
+ ldx divers ; virgin
+f15 ldy #0
+f14 bit WDVIA+VIA_DRA ; 256 Byte
+ bmi fe
+ bvc f14
+ stx WD1770+WD_DATA
+ dey
+ bne f14
+ dec data+1
+ bne f15
+ ldx #$f7 ; end of sektor
+f16 bit WDVIA+VIA_DRA
+ bmi fe
+ bvc f16
+ stx WD1770+WD_DATA
+ ldy #24
+ ldx #$4e ; pause nach sektor
+f20 bit WDVIA+VIA_DRA
+ bmi fe
+ bvc f20
+ stx WD1770+WD_DATA
+ dey
+ bne f20
+ inc sect
+ dec data+2
+ beq f18a
+ jmp sloop
+f18a ldx #$4e
+f18 bit WDVIA+VIA_DRA
+ bmi fr
+ bvc f18
+ stx WD1770+WD_DATA
+ jmp f18 ; absolut
+fe dec errcnt
+ beq fee
+ jmp errloop
+fee sec
+ lda #E_FT
+ ldx WD1770+WD_ST
+ .byt $24
+fr sec
+ cli
+#ifdef NMIDEV
+ php
+ pha
+ lda #NMI_ON
+ jsr CTRLNMI
+ pla
+ plp
+#endif
+/*
+ cli
+ rts
+fr cli
+ clc
+ rts
+*/
+ .)
+ .)
+
+
diff --git a/dump/oa-2.0.9/arch/csa65/devices/oa1ds.a65 b/dump/oa-2.0.9/arch/csa65/devices/oa1ds.a65
new file mode 100644
index 0000000..719aabb
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/devices/oa1ds.a65
@@ -0,0 +1,401 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * Double ACIA serial line device driver
+ * for CS/A65 architecture.
+ * It uses other peripheral lines then the ones of the 6551 for rts/cts
+ */
+
+#define ACIA $efe8
+#define ACIA2 $e818
+#define PIA2 $e810
+#define Anzdev 2
+
+ .(
+ .word devend1
+ jmp prg1
+ .asc "ser",sernr, 0
+
+-sernr += 1
+
+devend1 .word devend2
+ jmp prg2
+ .asc "ser",sernr, 0
+
+-sernr += 1
+
+ .data
+dev .byt 0
+div .byt 0
+status .dsb Anzdev
+instr .dsb Anzdev
+outstr .dsb Anzdev
+brkkey .dsb Anzdev
+ .text
+
+prg1 ldx #0
+ .byt $2c
+prg2 ldx #1
+ stx dev
+ cmp #DC_RES
+ beq devini
+ pha
+ lda status,x
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini lda #0
+ sta status,x
+ sta instr,x
+ sta outstr,x
+
+ lda #3
+ sta brkkey,x
+
+ cpx #1
+ beq iniser2
+
+ STA ACIA+1
+ LDA #%00011000; 1200 BAUD
+ STA ACIA+3
+ cmp ACIA+3
+ bne devx
+ LDA #%00000101
+ STA ACIA+2
+ cmp ACIA+2
+ bne devx
+ LDA ACIA+1
+rts1hi lda SYSPORT /* RTS hi */
+ ora #SYS_RTS
+ sta SYSPORT
+ clc
+ rts
+
+iniser2 STA ACIA2+1
+ LDA #%00011000; 1200 BAUD
+ STA ACIA2+3
+ cmp ACIA2+3
+ bne devx
+ LDA #%00000101
+ STA ACIA2+2
+ cmp ACIA2+2
+ bne devx
+ LDA ACIA2+1
+rts2hi lda PIA2+PIA_CRA /* CA2 output hi =RTS Hi */
+ ora #%00111000
+ ;and #%11110111
+ sta PIA2+PIA_CRA
+ clc
+ rts
+
+devx lda status,x
+ ora #2
+ sta status,x
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq
+ cpx #1
+ bne irqser1
+ jmp irqser2
+irqser1
+ .(
+ lda ACIA+1
+ bpl irqend
+ sta div
+ bit status
+ bpl tx
+ and #%00001000
+ beq nobyt
+ ldx outstr
+ lda ACIA
+
+ cmp brkkey
+ bne nobrk
+ lda #SC_SSTAT
+ ldy #SCE_BRK
+ jsr STRCMD
+ lda brkkey
+nobrk
+ jsr PUTC
+ bcs test
+
+nobyt ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+
+irqend lda #E_NOIRQ
+ rts
+
+tstwater cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh jsr rts1hi
+ bcc tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+wl lda SYSPORT
+ and #255-SYS_RTS ; IO freigeben
+ sta SYSPORT
+
+tx bit status
+ bvc irqhs
+ lda div
+ and #%01010000
+ eor #%00010000
+ bne irqhs
+ ldx instr
+ jsr GETC
+ bcs test2
+ sta ACIA
+ bcc irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs lda ACIA+1
+ lda #E_OK
+ rts
+ .)
+
+irqser2 .(
+ lda ACIA2+1
+ bpl irqend
+ sta div
+ bit status+1
+ bpl tx
+ and #%00001000
+ beq nobyt
+ ldx outstr+1
+ lda ACIA2
+
+ cmp brkkey+1
+ bne nobrk
+ lda #SC_SSTAT
+ ldy #SCE_BRK
+ jsr STRCMD
+ lda brkkey+1
+nobrk
+ jsr PUTC
+ bcs test
+
+nobyt ldx outstr+1
+ lda #SC_STAT
+ jsr STRCMD
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+tstwater cmp #E_SEMPTY
+ beq wl
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh jsr rts2hi
+ bcc tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+wl lda PIA2+PIA_CRA
+ and #%11110111
+ sta PIA2+PIA_CRA
+
+tx bit status+1
+ bvc irqhs
+ lda div
+ and #%01010000
+ eor #%00010000
+ bne irqhs
+ ldx instr+1
+ jsr GETC
+ bcs test2
+ sta ACIA2
+ bcc irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs lda ACIA2+1
+ lda #E_OK
+ rts
+irqend lda #E_NOIRQ
+ rts
+ .)
+
+others cmp #DC_GS
+ bne o1
+ lda status,x
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr,x
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS
+ bne o2
+ lda status,x
+ and #DC_SW_RX
+ bne devonx
+ tya
+ sta outstr,x
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+ ; lda #3
+ ; sta brkkey,x
+ lda #DC_SW_TX
+o2a ora status,x
+ sta status,x
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+rxoff ldx dev
+ lda status,x
+ and #DC_SW_RX
+ beq devoffx
+ lda outstr,x
+ tax
+ lda #SC_EOF
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_RX
+ sta status,x
+ txa
+ beq rx1off
+ jsr rts2hi
+ bcc okx
+rx1off jsr rts1hi
+ bcc okx
+devoffx jmp devoff
+o5 cmp #DC_TX_OFF
+ bne o6
+txoff ldx dev
+ lda status,x
+ and #DC_SW_TX
+ beq devoffx
+ lda instr,x
+ tax
+ lda #SC_NUL
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_TX
+ sta status,x
+ jmp ok
+o6 cmp #DC_HS
+ bne o6a
+ lda status,x
+ and #255-1
+ sta status,x
+ tya
+ and #1
+ ora status,x
+ sta status,x
+ jmp ok
+o6a cmp #DC_SPD
+ bne o7
+ tya
+ and #%00001111
+ sta div
+ ldx dev
+ bne o6b
+ lda ACIA+3
+ and #%11110000
+ ora div
+ sta ACIA+3
+ jmp ok
+o6b lda ACIA2+3
+ and #%11110000
+ ora div
+ sta ACIA2+3
+ jmp ok
+
+o7 cmp #DC_ST
+ beq ok
+ cmp #DC_EXIT
+ bne o9 ; onotimp
+ jsr rxoff
+ jsr txoff
+ ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+ txa
+ bne o8a
+ sta ACIA+1
+ beq ok
+o8a sta ACIA2+1
+ beq ok
+o9
+ cmp #DC_BRKKEY
+ bne onotimp
+ lda brkkey,x
+ pha
+ tya
+ sta brkkey,x
+ pla
+ tay
+ ; jmp ok
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+devend2 .)
+
diff --git a/dump/oa-2.0.9/arch/csa65/devices/par.a65 b/dump/oa-2.0.9/arch/csa65/devices/par.a65
new file mode 100644
index 0000000..a4d86fc
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/devices/par.a65
@@ -0,0 +1,144 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#define WD_VIA $e8f0
+
+ .(
+ .word cntrend
+ jmp centrprg
+ .asc "par",0
+
+ .data
+instr .byt 0
+status .byt 0
+ .text
+
+centrprg cmp #DC_RES
+ bne sp1
+
+ ldx #0
+ stx status
+ dex
+ stx WD_VIA+VIA_DDRB
+ cpx WD_VIA+VIA_DDRB
+ beq ct1
+ inc status
+ sec
+ rts
+ct1 lda WD_VIA+VIA_PCR
+ and #%00001111 ;port b
+ ora #%11100000 ;cb2 hi out, cb1 neg. edge
+ sta WD_VIA+VIA_PCR
+ lda WD_VIA+VIA_ACR
+ and #%11100001 ;shift off, pb latch disabled
+ sta WD_VIA+VIA_ACR
+ lda #%00011100 ;cb2, shift, cb1 irq off
+ sta WD_VIA+VIA_IFR
+ sta WD_VIA+VIA_IER
+ clc
+ rts
+
+sp1 pha
+ lda status
+ lsr
+ pla
+ bcs nlnotimp
+; and #1
+; beq ct2
+; pla
+; lda #E_NOTIMP
+; sec
+; rts
+ct2 ;pla
+ cmp #DC_IRQ
+ bne sp2
+
+ lda status
+ and #DC_SW_TX
+ beq spe
+
+ lda WD_VIA+VIA_IFR
+ and #%00010000
+ beq spe
+
+ ldx instr
+ jsr GETC
+ bcc spil
+ cmp #E_EOF
+ bne spe
+ jsr txoff
+ bcc spe ; always
+
+spil sta WD_VIA+VIA_DRB
+ lda WD_VIA+VIA_PCR
+ and #%11011111 ;ora #%11100000
+ sta WD_VIA+VIA_PCR
+ ora #%11100000 ;and #%11011111
+ sta WD_VIA+VIA_PCR
+spe clc
+ lda #E_NOIRQ ; no irq source has been removed
+ rts
+
+sp2 cmp #DC_RX_OFF
+ beq nlnotimp
+ cmp #DC_TX_OFF
+ bne sp3
+txoff ldx instr
+ lda #SC_NUL
+ jsr STRCMD
+ lda status
+ and #255-DC_SW_TX
+ sta status
+ jmp ok
+
+sp3 cmp #DC_RX_ON
+ beq nlnotimp
+ cmp #DC_TX_ON
+ bne sp5
+ lda #DC_SW_TX
+ ora status
+ sta status
+
+ok lda #0
+ .byt $2c
+nlnotimp lda #E_NOTIMP
+ .byt $2c
+nldevon lda #E_DON
+ cmp #1
+ rts
+
+sp5 cmp #DC_GS
+ bne sp6 ;nlnotimp
+ lda status
+ and #DC_SW_TX
+ bne nldevon
+ sty instr
+ beq ok
+
+sp6 cmp #DC_EXIT
+ bne nlnotimp
+ inc status
+ bne ok
+cntrend .)
+
diff --git a/dump/oa-2.0.9/arch/csa65/devices/piec_csa.a65 b/dump/oa-2.0.9/arch/csa65/devices/piec_csa.a65
new file mode 100644
index 0000000..c995b12
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/devices/piec_csa.a65
@@ -0,0 +1,2290 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#define VIA1 $e840
+#define PIA1 $e820
+
+#include "chips/via6522.i65"
+#include "chips/pia6521.i65"
+
+#ifdef FSIEC_USE_STDLIB
+#define CHDIR Chdir
+#define ASSIGN Assign
+#endif
+
+ .data
+byte .byt 0
+bytfl .byt 0
+eoifl .byt 0
+ .text
+
+#ifndef NOLOOP
+ .data
+filetab .dsb FT_SLEN*ANZ_FT
+ .text
+#endif
+
+&getif clc
+ ldx #SEM_VIAE840_T1
+ jmp PSEM
+&freif ldx #SEM_VIAE840_T1
+ jmp VSEM
+
+&IECINIT .(
+#ifdef INVERT
+ lda #%00110000
+ sta PIA1+PIA_CRA
+ lda #0
+ sta PIA1+PIA_PA
+ cmp PIA1+PIA_PA
+ bne inix
+ lda #%00110100
+ sta PIA1+PIA_CRA
+
+ lda #%00110000
+ sta PIA1+PIA_CRB
+ lda #$ff
+ sta PIA1+PIA_PB
+ cmp PIA1+PIA_PB
+ bne inix
+ lda #%00110100
+ sta PIA1+PIA_CRB
+ lda #0
+ sta PIA1+PIA_PB
+
+ lda #%00111100
+ sta VIA1+VIA_DDRB
+ cmp VIA1+VIA_DDRB
+ bne inix
+
+ lda #0
+ sta VIA1+VIA_DRB
+
+ lda VIA1+VIA_ACR
+ and #%00111101
+ sta VIA1+VIA_ACR
+ lda VIA1+VIA_PCR
+ ora #%11100000 ; cb2 hi out
+ sta VIA1+VIA_PCR
+ lda #%01011000
+ sta VIA1+VIA_IER
+ lda #0
+ sta byte
+ sta bytfl
+ sta eoifl
+ clc
+ rts
+inix sec
+ rts
+#else
+ lda #%00111000
+ sta PIA1+PIA_CRA
+ lda #0
+ sta PIA1+PIA_PA ; DDRA
+ cmp PIA1+PIA_PA
+ bne inix
+ lda #%00111100 ; DAV hi
+ sta PIA1+PIA_CRA
+
+ lda #%00111000
+ sta PIA1+PIA_CRB
+ lda #$ff
+ sta PIA1+PIA_PB ; DDRB
+ cmp PIA1+PIA_PB
+ bne inix
+ lda #%00111100 ; NRFD hi
+ sta PIA1+PIA_CRB
+ lda #<-1 ; DRB
+ sta PIA1+PIA_PB
+
+ lda #%00111100
+ sta VIA1+VIA_DDRB
+ cmp VIA1+VIA_DDRB
+ bne inix
+ sta VIA1+VIA_DRB ; alle ausgaenge hi
+
+ lda VIA1+VIA_ACR
+ and #%00111101 ; PB2 Latch off, T1 timed IRQ
+ sta VIA1+VIA_ACR
+ lda VIA1+VIA_PCR
+ ora #%11100000 ; cb2 hi out (Piezo)
+ sta VIA1+VIA_PCR
+ lda #%01011000 ; T1, CB1, CB2 -IRQ off
+ sta VIA1+VIA_IER
+ lda #0
+ sta byte
+ sta bytfl
+ sta eoifl
+ clc
+ rts
+inix sec
+ rts
+#endif
+ .)
+
+#ifndef NOLOOP
+ .(
+
+&&&iniftab .(
+ ldx #0
+ lda #FT_MOD_FRE
+i1 sta filetab+ANZ_FT*FT_MOD,x
+ ;lda #0
+ sta filetab+ANZ_FT*FT_ST,x
+ inx
+ cpx #15
+ bcc i1
+ ldx #0
+ stx reterr
+ stx outpos
+ stx outlen
+ clc
+ rts
+ .)
+
+ .data
+cmdfl .byt 0
+listenfl .byt 0
+talkfl .byt 0
+reterr .byt 0
+bufpos .byt 0
+outpos .byt 0
+outlen .byt 0
+lstnadr .byt 0
+talkadr .byt 0
+&filenr .byt 0
+
+INBUF .dsb MAXLEN
+
+OUTBUF .dsb MAXLEN
+
+ .text
+
+RETLOOP cli
+ lda #0
+ sta cmdfl
+ jsr clrdata
+ jsr davhi
+ jsr eoihi
+ jsr ndachi
+ jmp nrfdhi
+
+&&INLOOP cli
+lx lda VIA1+VIA_DRA
+ cmp VIA1+VIA_DRA
+ bne lx
+ and #%00010000
+ bne RETLOOP ; wait atnlo
+atndet sei
+ lda #0
+ sta cmdfl
+ jsr clrdata
+ jsr davhi
+ jsr eoihi
+ jsr ndaclo
+ jsr nrfdlo
+ jsr atnalo
+inext jsr ndaclo
+ jsr nrfdhi
+ lda #$10
+ix1 bit VIA1+VIA_DRA
+ bne iende ; atn hi
+ bit VIA1+VIA_DRB
+ bvs ix1 ; dav hi
+ jsr nrfdlo
+ jsr bytin
+ pha
+ jsr ndachi
+ pla
+ cmp #$3f ; unlisten
+ bne il2
+ lda #0
+ sta listenfl
+ sta cmdfl
+ beq weiter
+il2 cmp #$5f ; untalk
+ bne il3
+ lda #0
+ sta talkfl
+ sta cmdfl
+ beq weiter
+il3 cmp lstnadr ; listen
+ bne il4
+ sta cmdfl
+ lda #1
+ sta listenfl
+ lda #0
+ sta talkfl
+ beq weiter
+il4 cmp talkadr ; talk
+ bne il5
+ sta cmdfl
+ lda #1
+ sta talkfl
+ lda #0
+ sta listenfl
+ beq weiter
+il5 ldx cmdfl
+ beq weiter
+ tax
+ and #$60
+ cmp #$60
+ bne weiter
+ txa
+ sta secadr
+ and #$f0
+ cmp #$e0
+ bne weiter
+ jsr iclose
+ lda #0
+ sta listenfl
+
+weiter bit VIA1+VIA_DRB
+ bvc weiter ; wait davhi
+ jmp inext
+
+iende lda listenfl
+ bne listenloop
+ jsr ndachi
+ jsr atnahi
+ lda talkfl
+ bne talkloopx
+ jmp RETLOOP
+
+talkloopx jmp talkloop
+atndet1 jmp atndet
+
+listenloop
+ jsr nrfdlo
+ jsr atnahi
+ lda #0
+ sta status
+
+ lda secadr
+ and #15
+ sta filenr
+ tax
+ cmp #15
+ beq incbuf ; secadr 15
+ lda secadr
+ and #$f0
+ cmp #$f0
+ beq inbuf ; open
+ cmp #$e0
+ beq inul
+ lda filetab+ANZ_FT*FT_MOD,x
+ and #127
+ cmp #FT_MOD_IN
+ bne inerr
+
+lstnlp jsr liecin
+ bit status
+ bvs ll
+ bcs atndet1
+ll
+#ifdef SHOW
+ jsr OUT
+#endif
+ ldy filenr
+ ldx filetab+ANZ_FT*FT_STR,y
+ jsr SOUT
+ bcs clnul
+ bit status
+ bvc lstnlp ; kein eoi
+retloop jmp RETLOOP ; gibt beim naechsten Schreibversuch time-out
+
+clnul jsr iclose
+ ldx #8
+ stx reterr
+ jmp inulx
+
+inerr ldx #2
+ cmp #FT_MOD_OUT
+ bne inerr1
+ .byt $2c
+inerr4 ldx #4
+ .byt $2c
+inerr5 ldx #5
+ .byt $2c
+inerr1 ldx #1
+ stx reterr
+inul jsr liecin
+atndet3 bcs atndet1
+inulx bit status
+ bvc inul
+ bvs retloop
+
+ ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_FRE
+ beq inerr1
+inbuf ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_FRE
+ bne inerr4
+incbuf ldy #0
+ sty bufpos
+inbufl jsr liecin
+ bit status
+ bvs il
+ bcs atndet3
+il ldy bufpos
+ jsr CBM2ASC
+ sta INBUF,y
+ inc bufpos
+ lda bufpos
+ cmp #MAXLEN-1
+ bcs inerr5
+ bit status
+ bvc inbufl
+ lda #0
+ ldy bufpos
+ sta INBUF,y
+ ; get SENDBUF and try to execute command.
+ ; locks if request from outside ends here and
+ ; request from inside has locked SENDBUF
+ ; and fsiec is supposed to serve...!
+#ifdef NOMMU
+ clc
+ ldx #SEM_SENDBUF
+ jsr PSEM
+#endif
+ lda secadr
+ and #15
+ cmp #15
+ beq cmd2
+ lda secadr
+ and #$f0
+ cmp #$f0
+ bne cmd2
+ jsr open
+#ifdef NOMMU
+ jmp RetLoop
+#else
+ jmp RETLOOP
+#endif
+cmd2 jsr sendcmd ; cmd ausf�hren
+RetLoop
+#ifdef NOMMU
+ ldx #SEM_SENDBUF
+ jsr VSEM
+#endif
+ jmp RETLOOP
+
+
+iclose lda secadr
+ and #15
+ sta filenr
+ cmp #15
+ beq clerr0
+ tay
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_FRE
+ beq clerr1
+
+ ldx filetab+ANZ_FT*FT_BUF,y
+ bmi clx
+ jsr setzei
+ ldy #F_FL
+ lda #F_FL_FRE
+ sta (fzei),y
+
+clx ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ ldx filetab+ANZ_FT*FT_STR,y
+ cmp #FT_MOD_DIR
+ beq clout
+ cmp #FT_MOD_OUT
+ beq clout
+ cmp #FT_MOD_EOF
+ beq clout
+ lda #SC_EOF
+ .byt $2c
+clout lda #SC_NUL
+ jsr STRCMD
+ lda #FT_MOD_FRE
+ sta filetab+ANZ_FT*FT_MOD,y
+clerr0 ldx #0
+ .byt $2c
+clerr1 ldx #1
+ .byt $2c
+operr4 ldx #4
+ stx reterr
+ rts
+
+open .(
+ .data
+owfl .byt 0
+ .text
+
+ ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_FRE
+ bne operr4
+ lda #<-1
+ sta filetab+ANZ_FT*FT_BUF,y
+ lda #0
+ sta filetab+ANZ_FT*FT_ST,y
+ cpy #1
+ beq os2
+ cpy #0
+ bne os1
+ lda #FT_MOD_OUT
+ .byt $2c
+os2 lda #FT_MOD_IN
+ sta filetab+ANZ_FT*FT_MOD,y
+os1 ldy #0
+ jsr fgetdrv ; a=drv, x=cmd
+ bcs operr3x
+ sta PCBUF+FS_OPEN_DRV
+ stx owfl
+ cpx #1
+ bne nodir
+ sty bufpos
+ ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_IN
+ beq operr9
+ jsr getbuf
+ bcs operr6
+operr3x bcs operr3
+ ldy filenr
+ txa
+ sta filetab+ANZ_FT*FT_BUF,y
+ lda #FT_MOD_DIR
+ sta filetab+ANZ_FT*FT_MOD,y
+ ldy #F_FL
+ lda #F_FL_DO
+ sta (fzei),y
+ ldy #F_LEN
+ lda #0
+ sta (fzei),y
+ ldy bufpos
+nodir ldx #FS_OPEN_NAME
+ jsr inspfad ; nach PCBUF,x
+o1 lda INBUF,y
+ sta PCBUF,x
+ beq onex
+ inx
+ iny
+ cmp #","
+ bne o1
+ lda #0
+ stx bufpos
+ dex
+ sta PCBUF,x
+o2 lda INBUF,y
+ beq one
+ iny
+ cmp #" "
+ beq o2
+ cmp #","
+ beq operr3
+ cmp #"R"
+ beq opout
+ cmp #"W"
+ beq opin
+o3 lda INBUF,y
+ beq one
+ iny
+ cmp #","
+ bne o3
+ beq o2
+
+operr7 ldy filenr
+ ldx filetab+ANZ_FT*FT_STR,y
+ jsr FRESTR
+ ldx #7
+ .byt $2c
+operr6 ldx #6
+ .byt $2c
+operr9 ldx #9
+ .byt $2c
+operr3 ldx #3
+ .byt $2c
+operr2 ldx #2
+ stx reterr
+ ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_DIR
+ bne ope
+ ldy #F_FL
+ lda #F_FL_FRE
+ sta (fzei),y
+ ldy filenr
+ope lda #FT_MOD_FRE
+ sta filetab+ANZ_FT*FT_MOD,y
+ rts
+
+onex inx
+ stx bufpos
+ bne one
+
+opout ldx #FT_MOD_OUT
+ lda owfl
+ cmp #2 ; ow = overwrite
+ beq operr9 ; notreadfile
+ .byt $2c
+opin ldx #FT_MOD_IN
+ ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_DIR
+ bne opx
+ cpx #FT_MOD_OUT
+ beq one
+ bne operr2
+opx txa
+ sta filetab+ANZ_FT*FT_MOD,y
+
+one ldy filenr
+
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_FRE
+ beq operr3
+ jsr GETSTR
+ bcs operr6
+ ldy filenr
+ txa
+ sta PCBUF+FS_OPEN_STR
+ sta filetab+ANZ_FT*FT_STR,y
+ lda #0
+ sta PCBUF+FS_OPEN_PFAD
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_OUT
+ beq oo
+ cmp #FT_MOD_DIR
+ beq od
+ lda owfl
+ cmp #2
+ bne owr
+ lda #FS_OPEN_OW
+ .byt $2c
+owr lda #FS_OPEN_WR
+ .byt $2c
+oo lda #FS_OPEN_RD
+ .byt $2c
+od lda #FS_OPEN_DR
+ ldx PCBUF+FS_OPEN_DRV
+ jsr assigndrv
+ stx PCBUF+FS_OPEN_DRV
+ pha
+ txa
+ ldy filenr
+ sta filetab+ANZ_FT*FT_DRV,y
+ pla
+ ldx #SEND_FM
+ ldy bufpos
+ jsr SEND
+ bcs operr7x
+ sec
+ jsr RECEIVE
+ cmp #1
+ bcs operr7xx
+ sta reterr
+ ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_IN
+ beq oe
+ jsr getobuf
+ ldy filenr
+ sta filetab+ANZ_FT*FT_BYT,y
+ lda #2
+ bcc ow
+ ora #128
+ow sta filetab+ANZ_FT*FT_ST,y
+oe rts
+operr7xx jsr fse2rete
+operr7x jmp operr7
+ .)
+
+fgetdrv .(
+ .data
+drv .byt 0
+gcmd .byt 0
+bufpos2 .byt 0
+xfl .byt 0
+ .text
+
+ ldx #0
+ .byt $2c
+&cgetdrv ldx #<-1
+ stx xfl
+
+ sty bufpos
+
+ lda #<-1 ; stddrv
+ sta drv
+ lda #0
+ sta gcmd
+
+g1 lda INBUF,y
+ beq nixxx
+ iny
+ cmp #":"
+ beq dp1x
+
+ cmp #"0"
+ bcc g1a
+ cmp #"9"+1
+ bcs g1a
+ and #%00001111
+ sta drv
+ lda INBUF,y
+ cmp #"0"
+ bcc g1x
+ cmp #"9"+1
+ bcs g1x
+ iny
+ pha
+ asl drv
+ lda drv
+ asl
+ asl
+ clc
+ adc drv
+ sta drv
+ pla
+ and #%00001111
+ clc
+ adc drv
+ sta drv
+g1x jmp gwend
+
+nixxx beq nixx
+dp1x beq dp1
+
+g1a cmp #" "
+ beq g1
+
+ lda gcmd
+ bne gerr
+
+ dey
+ sty bufpos2
+ ldx #1
+g2 stx gcmd
+ lda cmda-1,x
+ beq gerr
+ tax
+ ldy bufpos2
+g2a lda cmdt-1,x
+ beq found
+ cmp INBUF,y
+ bne g2b
+ inx
+ iny
+ bne g2a
+
+g2b cpy bufpos2
+ beq g2bq
+
+ lda INBUF,y
+ cmp #"a"
+ bcc found
+ cmp #"z"+1
+ bcs found
+
+g2bq ldx gcmd
+ inx
+ cpx #3
+ bcc g2
+ bit xfl
+ bmi g2
+ ldx #0
+ stx gcmd
+ ldy bufpos2
+g2c lda INBUF,y
+ beq nix
+dp1 beq dp
+ iny
+ cmp #":"
+ bne g2c
+
+gerr sec
+ rts
+
+found jmp g1
+
+gwend lda INBUF,y
+nixx beq nix
+ iny
+ cmp #":"
+ beq dp
+ cmp #" "
+ beq gwend
+ bne gerr
+
+nix lda gcmd
+ cmp #1 ; $
+ beq dp
+ bit xfl
+ bmi dp
+ lda #<-1 ; stddrv
+ ldx #0
+ ldy bufpos
+ clc
+ rts
+
+dp lda drv
+ ldx gcmd
+ clc
+ rts
+
+cmda .byt cmdt-c0,cow-c0,c2-c0,c3-c0,c4-c0,c5-c0,c6-c0,c7-c0 /*,c8-c0*/
+ .byt /*c9-c0,c10-c0,*/ c11-c0,c12-c0,c13-c0,c14-c0,c15-c0,0
+
+c0 =*-1
+cmdt .asc "$",0
+cow .asc "@",0
+c2 .asc "rename",0
+c3 .asc "scratch",0
+c4 .asc "copy",0
+c5 .asc "new",0
+c6 .asc "validate",0
+c7 .asc "initialize",0
+;c8 .asc "rmdir",0
+;c9 .asc "mkdir",0
+;c10 .asc "chdir",0
+c11 .asc "assign",0
+c12 .asc "cd",0
+c13 .asc "rd",0
+c14 .asc "md",0
+c15 .asc "drv",0 ; iec-bus-unit
+
+&fsctab .byt $ff,$ff,$ff,FS_RENAME,FS_DELETE,"c"
+ .byt FS_FORMAT,FS_CHKDSK,"i" /*,FS_RMDIR,FS_MKDIR,"d"*/
+ .byt "a","d",FS_RMDIR,FS_MKDIR,"u"
+ .)
+
+atndet2 jmp atndet
+
+talkloop .(
+ lda #0
+ sta status
+ sta eoifl
+ lda secadr
+ and #15
+ sta filenr
+ cmp #15
+ beq tl1
+ tay
+ lda filetab+ANZ_FT*FT_MOD,y
+ and #127
+ cmp #FT_MOD_OUT
+ beq tl1
+ cmp #FT_MOD_DIR
+ beq tl1
+ cmp #FT_MOD_EOF
+ bne outerr9
+ beq tlx
+tl1 jsr tiecout
+ bcs atndet2
+ bit eoifl
+ bvc tl1
+ ldy filenr
+ lda #FT_MOD_EOF
+ sta filetab+ANZ_FT*FT_MOD,y
+tlx jmp RETLOOP
+
+outerr9 lda #9
+ sta reterr
+ jmp RETLOOP
+ .)
+
+&getobuf .(
+ .data
+pos .byt 0
+pos2 .byt 0
+pcnt .byt 0
+ .text
+
+ ldy filenr
+ cpy #15
+ bne gofile
+ ldy outpos
+ cpy outlen
+ bcc tl3
+ jsr makeds
+tl3 ldy outpos
+ lda OUTBUF,y
+ iny
+ sty outpos
+ cpy outlen
+ rts
+
+gofile
+ ldy filenr
+ lda filetab+ANZ_FT*FT_MOD,y
+ cmp #FT_MOD_DIR
+ beq godir
+
+gfx ldy filenr
+ lda filetab+ANZ_FT*FT_BYT3,y
+ ldx filetab+ANZ_FT*FT_STR,y
+ tay
+ jsr GETC
+ bcc gf1
+ cmp #E_EOF
+ beq gf2
+ jsr YIELD
+ jmp gfx
+gf2 tya
+ sec
+ rts
+gf1 tax
+ tya
+ pha
+ ldy filenr
+ txa
+ sta filetab+ANZ_FT*FT_BYT3,y
+ pla
+ ldx filetab+ANZ_FT*FT_MOD,y
+ bmi gfok
+ txa
+ ora #128
+ sta filetab+ANZ_FT*FT_MOD,y
+ jmp gfx
+gfok clc
+ rts
+
+godir
+ ldx filetab+ANZ_FT*FT_BUF,y
+ jsr setzei
+ ldy #F_LEN
+ lda (fzei),y
+ bne g1 ; Laenge gleich 0, dann wars das erste mal
+ jsr gnew1 ; erste Zeile holen
+ jmp g2
+g1 ldy #F_BYT
+ cmp (fzei),y ; auslesen am ende
+ bne g2 ; nein dann weiter
+ jsr gnew ; sonst naechste Zeile holen
+ bcs ge
+g2 ldy #F_BYT
+ lda (fzei),y
+ tay
+ lda (bzei),y
+ pha
+ iny
+ tya
+ ldy #F_BYT
+ sta (fzei),y
+ pla
+ clc
+ge rts
+
+gnew1 ldy #64 ; Startadresse in den Puffer
+ lda #1
+ sta (bzei),y
+ iny
+ lda #4
+ sta (bzei),y
+ iny
+ jmp gnewend ; und ende
+
+gnew ldy #F_FL
+ lda (fzei),y
+ cmp #F_FL_DOX ; ende schon gewesen
+ bne gn1
+ lda #0 ; ja dann nullbyte
+ sec
+ rts
+gn1 ldy #F_BYT
+ lda #0
+ sta (fzei),y ; Anzahl Bytes erstmal auf null
+
+gg ldy filenr
+ lda filetab+ANZ_FT*FT_STR,y
+ tax
+ jsr GETC
+ bcc gok
+ cmp #E_EOF
+ beq geof
+ jsr YIELD
+ jmp gg
+
+geof ldy #F_FL ; ende des Dirs
+ lda #F_FL_DOX
+ sta (fzei),y
+ ldy #64
+ lda #0
+ sta (bzei),y
+ iny
+ jmp gnewend
+
+gok tax ; byte geholt
+ ldy #F_BYT
+ lda (fzei),y
+ tay
+ txa
+ sta (bzei),y
+ iny
+ tya
+ ldy #F_BYT
+ sta (fzei),y
+ cmp #FS_DIR_NAME+1
+ bcc gg
+ cpx #0
+ bne gg
+ ; ab hier wird in neue Struktur umgewandelt
+
+ ldy #FS_DIR_LEN
+ lda (bzei),y
+ beq gs1
+ iny
+ lda (bzei),y
+ clc
+ adc #1
+ sta (bzei),y
+gs1 ldy #64 ; link-adresse
+ lda #4
+ sta (bzei),y
+ iny
+ sta (bzei),y
+ ldy #FS_DIR_LEN+1 ; Datei-Laenge
+ lda (bzei),y
+ sta pos
+ ldy #66
+ sta (bzei),y
+ ldy #FS_DIR_LEN+2
+ lda (bzei),y
+ sta pos2
+ ldy #67
+ sta (bzei),y
+
+ ldy #FS_DIR_MODE
+ lda (bzei),y
+ ldy #68
+ cmp #FS_DIR_MOD_FIL
+ beq dirfil
+ cmp #FS_DIR_MOD_DIR
+ beq dirfil
+ jmp dirother
+dirfil lda #0
+ sta pcnt
+ ldx pos
+ lda pos2
+ cmp #>10000
+ bcc d1b
+ bne d1
+ cpx #<10000
+ bcs d1
+d1b inc pcnt
+ cmp #>1000
+ bcc d1c
+ bne d1
+ cpx #<1000
+ bcs d1
+d1c inc pcnt
+ cmp #>100
+ bne d1
+ cpx #100
+ bcs d1
+ inc pcnt
+ cpx #10
+ bcs d1
+ inc pcnt
+d1 ldx pcnt
+ ; y=schreibposition in Puffer
+ lda #" "
+gs2 dex
+ bmi gs2x
+ sta (bzei),y
+ iny
+ bne gs2
+gs2x lda #34
+ sta (bzei),y
+ iny
+ sty pos
+ ldy #FS_DIR_NAME
+ sty pos2
+ ldx #17
+gs4 ldy pos2
+ lda (bzei),y
+ beq gs3
+ dex
+ inc pos2
+ ldy pos
+ jsr ASC2CBM
+ sta (bzei),y
+ inc pos
+ cpy #66+24 ; sicherheitshalber range test
+ bcc gs4
+gs3 ldy pos
+ lda #34
+ sta (bzei),y
+ iny
+ lda #" "
+gs5 dex
+ bmi gs5x
+ sta (bzei),y
+ iny
+ bne gs5
+gs5x ldx #0
+ tya
+ pha
+ ldy #FS_DIR_MODE
+ lda (bzei),y
+ cmp #FS_DIR_MOD_DIR
+ beq gs6d
+ pla
+ tay
+gs6a lda prgtxt,x
+ sta (bzei),y
+ iny
+ inx
+ cpx #3
+ bcc gs6a
+ bcs gs6b
+gs6d pla
+ tay
+gs6c lda dirtxt,x
+ sta (bzei),y
+ iny
+ inx
+ cpx #3
+ bcc gs6c
+gs6b lda #0
+ sta (bzei),y
+ iny
+
+gnewend tya
+ ldy #F_LEN
+ sta (fzei),y
+ lda #64
+ ldy #F_BYT
+ sta (fzei),y
+ clc
+ rts
+
+prgtxt .asc "PRG"
+dirtxt .asc "DIR"
+
+dirother cmp #FS_DIR_MOD_NAM
+ bne dirfre
+ .(
+ ldy #66
+ ldx filenr
+ lda filetab+ANZ_FT*FT_DRV,x
+ sta (bzei),y
+ iny
+ lda #0
+ sta (bzei),y
+ iny
+ lda #18
+ sta (bzei),y
+ iny
+ lda #34
+ sta (bzei),y
+ iny
+ sty pos
+ lda #FS_DIR_NAME
+ sta pos2
+ ldx #15
+l1 ldy pos2
+ lda (bzei),y
+ beq l2
+ inc pos2
+ ldy pos
+ jsr ASC2CBM
+ sta (bzei),y
+ inc pos
+ dex
+ bpl l1
+ bmi l3
+l2 lda #32
+ ldy pos
+ sta (bzei),y
+ inc pos
+ dex
+ bpl l2
+l3 ldy pos
+ lda #34
+ sta (bzei),y
+ iny
+ ldx #6
+ lda #32
+l4 sta (bzei),y
+ iny
+ dex
+ bpl l4
+ lda #0
+ sta (bzei),y
+ iny
+ jmp gnewend
+ .)
+
+dirfre .(
+ ldx #0
+l1 lda fretxt,x
+ sta (bzei),y
+ iny
+ inx
+ cmp #0
+ bne l1
+ jmp gnewend
+
+fretxt .asc " BLOCKS FREE",0
+ .)
+
+ .)
+
+makeds .(
+ lda reterr
+ beq m0
+ clc
+ adc #19
+m0 ldx #"0"
+m1 cmp #10
+ bcc m2
+ sec
+ sbc #10
+ inx
+ bne m1
+m2 clc
+ adc #$30
+ sta OUTBUF+1
+ stx OUTBUF
+ lda #","
+ sta OUTBUF+2
+ lda #" "
+ sta OUTBUF+3
+ ldy reterr
+ ldx #4
+ lda tadr,y
+ tay
+m3 lda dstxt,y
+ sta OUTBUF,x
+ beq m4
+ iny
+ inx
+ bne m3
+m4 ldy #0
+m4b lda stdtxt,y
+ sta OUTBUF,x
+ beq m5
+ iny
+ inx
+ bne m4b
+m5 stx outlen
+ ldx #0
+ stx reterr
+ stx outpos
+ rts
+
+tadr .byt t0-t,t1-t,t2-t,t3-t,t4-t,t5-t,t6-t,t7-t,t8-t,t9-t,t10-t
+ .byt t11-t,t12-t,t13-t,t14-t,t7-t,t15-t,t16-t,t17-t,t18-t
+
+stdtxt .asc ",00,00",13,0
+
+dstxt t t0 .asc "OK",0
+t1 .asc "FILE NOT OPEN",0
+t2 .asc "NOT WRITE FILE",0
+t3 .asc "SYNTAX",0
+t4 .asc "FILE OPEN",0
+t5 .asc "CMD TO LONG",0
+t6 .asc "NO BUFFER",0
+t7 .asc "FILE NOT FOUND",0
+t8 .asc "WRITE ERROR",0
+t9 .asc "NOT READ FILE",0
+t10 .asc "NO DRIVE",0
+t11 .asc "WRITE PROTECT",0
+t12 .asc "DRIVE NOT READY",0
+t13 .asc "NO VALID PATH",0
+t14 .asc "NO VALID NAME",0
+t15 .asc "INVALID DATA",0
+t16 .asc "FILE EXIST",0
+t17 .asc "DISK FULL",0
+t18 .asc "DIR NOT EMPTY",0
+ .)
+
+sendcmd .(
+ .data
+drv .byt 0
+pos .byt 0
+ccmd .byt 0
+str .byt 0
+dy .byt 0
+ .text
+
+ ldy #0
+ jsr cgetdrv
+ bcs scerr3
+ sta drv
+ sta PCBUF+FS_CMD_DRV
+ sty pos
+ lda fsctab,x
+ sta ccmd
+#ifdef SHOW
+ pha
+ jsr HEXOUT
+ pla
+#endif
+ cmp #"a"
+ bcs xcmd
+ cmp #FS_FORMAT
+ bne nof
+ jmp fformat
+nof ldx INBUF,y
+ beq noname
+ cmp #FS_RENAME
+ bne nam
+ jmp doubnam
+nam ldy pos
+ ldx #FS_CMD_NAME
+ jsr inspfad
+nl lda INBUF,y
+ sta PCBUF,x
+#ifdef SHOW
+ jsr OUT
+ cmp #0
+#endif
+ beq ne
+ inx
+ iny
+ bne nl
+ne inx
+n1x txa
+ tay
+ jmp n1
+noname lda #0
+ sta PCBUF+FS_CMD_NAME
+ ldy #FS_CMD_NAME+1
+n1
+#ifdef SHOW
+ jsr CRLFOUT
+#endif
+ lda #0
+ sta PCBUF+FS_CMD_PFAD
+n4 ldx PCBUF+FS_CMD_DRV
+ jsr assigndrv
+ stx PCBUF+FS_CMD_DRV
+ ldx #SEND_FM
+ lda ccmd
+ jsr SEND
+ bcs scerr10
+ sec
+ jsr RECEIVE
+ cmp #1
+ bcc scerr0
+scerrfs jsr fse2rete
+ tax
+ .byt $2c
+scerr0 ldx #0
+ .byt $2c
+scerr6 ldx #6
+ .byt $2c
+scerr3 ldx #3
+ .byt $2c
+scerr10 ldx #10
+ stx reterr
+ rts
+
+xcmd .(
+ cmp #"i"
+ beq scerr0
+ cmp #"c"
+ bne o1
+ jmp copy
+o1 cmp #"a"
+ bne o2
+ jmp assign
+o2 cmp #"d"
+ bne o3
+ jmp cdir
+o3 cmp #"u"
+ bne o4
+ jmp unit
+o4 jmp scerr3 ; syntax
+
+ .(
+ .data
+assigntab .dsb 10
+ .text
+
+&assign ldy pos
+a1 lda INBUF,y
+ beq scerr3
+ iny
+ cmp #" "
+ beq a1
+ cmp #"0"
+ bcc scerr3
+ cmp #"9"+1
+ bcs scerr3
+ and #$0f
+
+ ldx PCBUF+FS_CMD_DRV
+ sec
+ jsr ASSIGN
+ bcs scerr10
+/*
+ ldy PCBUF+FS_CMD_DRV
+ cpy #10
+ bcs scerr10
+ sta assigntab,y
+*/
+ jmp scerr0
+
+&&&&&iniass
+ sec
+ ldx #<-1
+ jmp ASSIGN
+/*
+ ldx #0
+ai txa
+ sta assigntab,x
+ inx
+ cpx #10
+ bcc ai
+ clc
+ rts
+*/
+
+&&&assigndrv
+ clc
+ jmp ASSIGN
+/*
+ pha
+ cpx #10
+ bcs ae
+ lda assigntab,x
+ tax
+ae pla
+ rts
+*/
+ .)
+
+scerr6x bcs scerr6
+
+copy .(
+ ldy pos
+cn1 lda INBUF,y
+ beq scerr3
+ cmp #"="
+ beq infile
+ iny
+ bne cn1
+scerr3z jmp scerr3
+infile iny
+ jsr fgetdrv
+ bcs scerr3z
+ cpx #0
+ bne scerr3z
+ sta PCBUF+FS_OPEN_DRV
+ ldx #FS_OPEN_NAME
+ jsr inspfad
+i3 lda INBUF,y
+ sta PCBUF,x
+ inx
+ iny
+ cmp #0
+ bne i3
+ stx dy
+ lda #0
+ sta PCBUF+FS_OPEN_PFAD
+ jsr GETSTR
+ bcs scerr6x
+ ldy dy
+ stx str
+ stx PCBUF+FS_OPEN_STR
+ ldx PCBUF+FS_OPEN_DRV
+ jsr assigndrv
+ stx PCBUF+FS_OPEN_DRV
+ ldx #SEND_FM
+ lda #FS_OPEN_RD
+ jsr SEND
+ bcs i4a
+ sec
+ jsr RECEIVE
+ cmp #1
+ bcc i4
+i4a pha
+ ldx str
+ jsr FRESTR
+ pla
+ jmp scerrfs
+i4 lda drv
+ sta PCBUF+FS_OPEN_DRV
+ lda str
+ sta PCBUF+FS_OPEN_STR
+ lda #0
+ sta PCBUF+FS_OPEN_PFAD
+ ldy pos
+ ldx #FS_OPEN_NAME
+ jsr inspfad
+i5 lda INBUF,y
+ cmp #"="
+ beq ie
+ sta PCBUF,x
+ inx
+ iny
+ bne i5
+ie lda #0
+ sta PCBUF,x
+ inx
+ txa
+ tay
+ ldx PCBUF+FS_OPEN_DRV
+ jsr assigndrv
+ stx PCBUF+FS_OPEN_DRV
+ lda #FS_OPEN_WR
+ ldx #SEND_FM
+ jsr SEND
+ bcs i6
+ sec
+ jsr RECEIVE
+ cmp #1
+ bcc i7
+i6 pha
+ ldx str
+ lda #SC_NUL
+ jsr STRCMD
+ pla
+ jmp scerrfs
+i7 rts
+ .)
+
+
+&&&&&iniunit
+ .(
+ lda #10+$20
+ sta lstnadr
+ eor #$60
+ sta talkadr
+ clc
+ rts
+ .)
+
+unit .(
+ lda PCBUF+FS_OPEN_DRV
+ cmp #31
+ bcs scerr3u
+ ora #$20
+ sta lstnadr
+ eor #$60
+ sta talkadr
+ clc
+ rts
+ .)
+scerr3u jmp scerr3
+
+cdir .(
+ .data
+pdrv .byt 0
+pfad .dsb MAXLEN
+ .text
+
+ ldy pos
+ ldx #FS_CMD_NAME
+p1 lda INBUF,y
+ sta PCBUF,x
+ beq p2
+ inx
+ iny
+ bne p1
+p2 lda #pdrv
+ ldx #MAXLEN
+ jsr CHDIR
+ jmp scerr0
+/*
+ lda drv
+ bmi cderr10
+ sta pdrv
+ ldy pos
+ ldx #0
+p1 lda INBUF,y
+ sta pfad,x
+#ifdef SHOW
+ jsr OUT
+ cmp #0
+#endif
+ beq endp
+ inx
+ iny
+ cpx #MAXLEN-2
+ bcc p1
+ lda #0
+ sta pfad
+*/
+&&scerr3x jmp scerr3
+/*
+endp dex
+ bmi set
+ lda pfad,x
+ cmp #DIRSIGN
+ beq sc0
+set inx
+ lda #DIRSIGN
+ sta pfad,x
+ lda #0
+ sta pfad+1,x
+sc0 jmp scerr0
+cderr10 jmp scerr10
+*/
+
+&&&&&inipfad
+ lda #0
+ sta pdrv
+ sta pfad
+ rts
+
+&&&inspfad
+ sty dy
+ lda PCBUF+FS_OPEN_DRV
+ bpl nopfad
+ lda pdrv
+ sta PCBUF+FS_OPEN_DRV
+
+ lda INBUF,y
+ cmp #DIRSIGN
+ beq nopfad
+
+ ldy #0
+ip1 lda pfad,y
+ beq ipe
+ sta PCBUF,x
+ inx
+ iny
+ bne ip1
+ipe lda #DIRSIGN
+ sta PCBUF,x
+ inx
+nopfad ldy dy
+ rts
+ .)
+
+ .)
+
+/*scerr3x jmp scerr3*/
+
+doubnam .(
+ ldy pos
+dn lda INBUF,y
+ beq scerr3x
+ cmp #"="
+ beq nextnam
+ iny
+ bne dn
+nextnam iny
+ ldx #FS_CMD_NAME
+ jsr inspfad
+n2 lda INBUF,y
+ sta PCBUF,x
+ beq secnam
+ inx
+ iny
+ bne n2
+secnam inx
+ ldy pos
+n3 lda INBUF,y
+ cmp #"="
+ beq endnam
+ sta PCBUF,x
+ iny
+ inx
+ bne n3
+endnam lda #0
+ sta PCBUF,x
+ inx
+ jmp n1x
+ .)
+
+fformat .(
+ lda #0
+ sta PCBUF+FS_CMD_PFAD ; format
+ ldx #FS_CMD_NAME
+f1 lda INBUF,y
+ sta PCBUF,x
+ beq fe
+ inx
+ iny
+ cmp #","
+ bne f1
+ dex
+ lda #0
+ sta PCBUF,x
+f2 lda INBUF,y
+ beq scerr3y
+ iny
+ cmp #" "
+ beq f2
+ cmp #"0"
+ bcc scerr3y
+ cmp #"9"+1
+ bcs scerr3y
+ and #15
+ sta PCBUF+FS_CMD_PFAD
+#ifdef SHOW
+ pha
+ lda #"X"
+ jsr OUT
+ pla
+ jsr HEXOUT
+#endif
+fe inx
+ txa
+ tay
+ jmp n4
+scerr3y jmp scerr3
+ .)
+
+ .)
+
+fse2rete .(
+ ldy #11
+f1 cmp fsetab,y
+ beq rete
+ dey
+ bpl f1
+ lda #7
+ rts
+rete lda retetab,y
+ rts
+
+fsetab .byt E_OK,E_FNODRV,E_FNOPATH,E_FILLNAM,E_FNOFIL,E_FWPROT
+ .byt E_FLOGICAL /*NOCLUS*/,E_FLOGICAL, E_FILEXIST, E_FDISKFULL
+ .byt E_FDNEMPTY, E_FLOCKED
+retetab .byt 0,12,13,14,15,11
+ .byt 13,16,17,18,19,4
+ .)
+
+#ifndef FSIEC_USE_STDLIB
+ .(
+ .zero
+assigntab .dsb 10
+ .text
+
+&ASSIGN bcc xassigndrv
+ cpx #<-1
+ bne a
+iniassign
+ ldx #0
+ai txa
+ sta assigntab,x
+ inx
+ cpx #10
+ bcc ai
+ clc
+ rts
+xassigndrv
+ pha
+ cpx #10
+ bcs ae
+ lda assigntab,x
+ tax
+ae pla
+ rts
+
+a cpx #10
+ bcs ar
+ sta assigntab,x
+ar rts
+ .)
+
+ .(
+ .zero
+zp .word 0
+d .byt 0
+maxpath .byt 0
+ .text
+
+&CHDIR sta zp
+ sty zp+1
+ stx maxpath
+ lda PCBUF+FS_CMD_DRV
+ bmi nodrive
+ ldy #0
+ cmp (zp),y
+ beq nodrive
+ sta (zp),y
+ iny
+ lda #0
+ sta (zp),y
+nodrive inc zp
+ bne nd1
+ inc zp+1
+ ldy #0
+ ; Name untersuchen
+nd1 ldx #FS_CMD_NAME
+ lda PCBUF,x
+ bne ndrx ; kein Name dann Pfad loeschen
+ sta (zp),y
+ clc
+ rts
+ndrx
+ cmp #DIRSIGN ; Name beginnt mit DIRSIGN
+ bne nd2
+ lda #0 ; dann Pfad loeschen
+ sta (zp),y
+
+nd2a inx
+nd2 lda PCBUF,x ; weiter Name anschauen
+ beq ndr ; kein Name dann Ende
+ cmp #DIRSIGN
+ beq nd2a ; DIRSIGN ~Aberlesen
+ cmp #"."
+ bne nameok ; kein '.' dann ok
+ inx
+ lda PCBUF,x ; hier mindestens ein '.'
+ beq ndr ; Null dann Ende
+ cmp #DIRSIGN ; DIRSIGN,
+ beq nd2a ; dann '.' ignorieren
+ cmp #"." ; noch'n Punkt ?
+ bne nerrx ; nein, dann
+ jsr getpos
+ ldy d ; Position des letzten DIRSIGNs
+ lda #0
+ sta (zp),y ; loeschen = eine Verzeichnis-Ebene hoeher
+ beq nd2a ; (absolut)
+
+nerrx dex
+nameok jsr getpos ; y=Laenge des alten Pfads
+ sty d ; hier Verzeichnis-Name an Pfad anhaengen
+no iny
+ cpy maxpath
+ bcs nerr
+ lda PCBUF,x
+ beq nr
+ cmp #DIRSIGN
+ beq nr
+ sta (zp),y
+ inx
+ bne no
+nr lda #0
+ sta (zp),y
+ ldy d
+ lda #DIRSIGN ; alles ok, dann Nullbyte (Ende alter Pfad) mit
+ sta (zp),y ; DIRSIGN ~Aberschreiben
+ lda PCBUF,x ; Ende des neuen Verzeichnisses
+ bne nd2a ; nein, dann wieder nach oben
+ndr clc
+ rts
+nerr sec
+ rts
+getpos ldy #0 ; holt y=L~Dnge des alten Pfadnamens
+ sty d ; und d=Position des letzten DIRSIGNs
+no0 lda (zp),y
+ beq no1
+ cmp #DIRSIGN
+ bne no2
+ sty d
+no2 iny
+ bne no0
+no1 rts
+ .)
+
+#endif /* FSIEC_USE_STDLIB */
+ .)
+
+#endif /* NOLOOP */
+
+/* Blocktiefe 2 */
+
+#ifndef NOFS
+
+aout =atnout
+/*
+aout pha
+ lda #0
+ sta status
+ jsr nrfdhi
+ jsr ndachi
+
+ lda bytfl
+ beq oo1
+ sec
+ ror eoifl
+ jsr iecout
+ lda #0
+ sta bytfl
+
+oo1 pla
+ sta byte
+*/
+iec0out sei
+ jsr waitdavhi
+ jsr atnlo
+
+iecout .(
+ sei
+jsr nrfdhi
+jsr ndachi
+ jsr davhi
+ jsr tstdev ;nrfdhi & ndachi = z
+ beq devnotpr
+ lda byte
+ jsr out
+ox1 JSR setti
+ox1a JSR fragti
+ BNE XTO
+ lda VIA1+VIA_DRB
+ bpl ox1a ; wait nrfd hi
+ lda eoifl
+ bpl o0
+ jsr eoilo
+o0 jsr davlo
+ jsr setti
+o1 jsr fragti
+ bne timeout
+ jsr fragndac ; wait ndac hi
+ bcc o1
+ jsr davhi
+ jsr eoihi
+ lsr eoifl
+ jsr clrdata ; alle data hi
+ox2 lda VIA1+VIA_DRB
+ lsr
+ bcs ox2 ; wait ndaclo
+ clc
+; cli
+ rts
+
+XTO JSR YIELD
+ SEI
+ JMP ox1
+ .)
+
+&seclisten sta byte
+ jsr iecout
+ jsr atnhi
+ cli
+ rts
+#endif
+
+timeout lda #1
+ .byt $2c
+devnotpr lda #128
+ jsr seterr
+ jsr eoihi
+ jsr davhi
+ jsr ndachi
+ sec
+ cli
+ rts
+
+#ifndef NOLOOP
+tiecout .(
+ ldy filenr
+ lda filetab+ANZ_FT*FT_ST,y
+ tax
+ and #2
+ bne to1
+ cli
+ jsr getobuf
+ sei
+ ldy filenr
+ sta filetab+ANZ_FT*FT_BYT,y
+ lda #2
+ bcc to2
+ ora #128
+to2 ora filetab+ANZ_FT*FT_ST,y
+ sta filetab+ANZ_FT*FT_ST,y
+ tax
+to1 txa
+ and #128
+ sta eoifl
+ lda filetab+ANZ_FT*FT_BYT,y
+ sta byte
+ sei
+ jsr davhi
+ jsr tstdev ;nrfdhi & ndachi = z
+ beq devnotpr
+ lda byte
+ jsr out
+ox1 jsr fragatn
+ bcs atnin
+ lda VIA1+VIA_DRB
+ bpl ox1 ; wait nrfd hi
+ bit eoifl
+ bpl o0
+ jsr eoilo
+o0 jsr davlo
+
+/* naechstes Byte holen zur Ausgabe */
+/* Verhindert time out beim naechsten IECIN des */
+/* Listeners */
+
+ ldy filenr
+ lda filetab+ANZ_FT*FT_ST,y
+ and #1+128
+ bne o3
+ cli
+ jsr getobuf
+ sei
+ ldy filenr
+ sta filetab+ANZ_FT*FT_BYT2,y
+ lda #1
+ bcc o3x
+ ora #64
+o3x ora filetab+ANZ_FT*FT_ST,y
+ sta filetab+ANZ_FT*FT_ST,y
+
+o3 jsr setti
+o1 jsr fragti
+ bne timeouty
+ jsr fragatn
+ bcs atnin
+ jsr fragndac ; wait ndac hi
+ bcc o1
+
+ ldy filenr
+ lda filetab+ANZ_FT*FT_ST,y
+ asl
+ and #%10000010
+ sta filetab+ANZ_FT*FT_ST,y
+ lda filetab+ANZ_FT*FT_BYT2,y
+ sta filetab+ANZ_FT*FT_BYT,y
+ lsr eoifl
+
+ jsr davhi
+ jsr eoihi
+
+ jsr clrdata ; alle data hi
+ox2 jsr fragatn
+ bcs atnin
+ lda VIA1+VIA_DRB
+ lsr
+ bcs ox2 ; wait ndaclo
+ clc
+ ;cli
+ rts
+
+atnin sec
+ cli
+ rts
+
+timeouty jmp timeout
+
+&liecin .(
+ sei
+ jsr ndaclo
+ jsr nrfdhi
+i1 jsr fragatn ; wait nrfd hi
+ bcs atnin
+ lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne i1
+ asl
+ bcc i1
+ jsr setti
+o11 jsr fragatn ; atn testen
+ bcs atnin
+ jsr fragti
+ bne timeouty ; c= abgelaufen
+ jsr fragdav ; wait dav lo
+ bcs o11
+ jsr nrfdlo
+ jsr frageoi
+ bcs o12
+ lda #64
+ jsr seterr
+o12 jsr bytin
+ pha
+ jsr ndachi
+o12a jsr fragatn
+ bcs atnin
+ jsr fragdav
+ bcc o12a
+ jsr ndaclo
+ lda status
+ bne o12c
+ pla
+ clc
+ CLI
+ rts
+o12c pla
+ sec
+ cli
+ rts
+ .)
+
+fragatn .(
+ lda VIA1+VIA_DRA
+; cmp VIA1+VIA_DRA
+; bne fragatn
+ asl
+ eor VIA1+VIA_DRB
+ and #%00100000
+#ifdef INVERT
+ beq s ; bei inverted umdrehen
+#else
+ bne s
+#endif
+ clc
+ rts
+s sec
+ rts
+ .)
+ .)
+#endif
+
+#ifndef NOFS
+
+§alk sta byte
+ jsr iecout
+ jsr nrfdlo
+ jsr ndaclo
+ jsr atnhi
+ cli
+ rts
+
+&UNTALK jsr atnlo
+ lda #95
+ .byt $2c
+&UNLISTEN lda #63
+ jsr aout
+ jsr atnhi
+ cli
+ rts
+
+timeoutx jmp timeout
+
+&IECIN .(
+ sei
+ jsr ndaclo
+ jsr nrfdhi
+i1 lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne i1
+ asl
+ bcc i1
+ jsr setti
+o11 jsr fragti
+ bne timeoutx ; c= abgelaufen
+ jsr fragdav ; wait dav lo
+ bcs o11
+ jsr nrfdlo
+ jsr frageoi
+ bcs o12
+ lda #64
+ jsr seterr
+o12 jsr bytin
+ pha
+ jsr ndachi
+o12a jsr fragdav
+ bcc o12a
+ jsr ndaclo
+ lda status
+ bne o12c
+ pla
+ clc
+ cli
+ rts
+o12c pla
+ sec
+ cli
+ rts
+ .)
+
+#ifdef INVERT
+atnlo lda VIA1+VIA_DRB
+ ora #%00100100
+ sta VIA1+VIA_DRB
+ rts
+atnhi lda VIA1+VIA_DRB
+ and #%11011011
+ sta VIA1+VIA_DRB
+ rts
+#else
+atnhi lda VIA1+VIA_DRB
+ ora #%00100100
+ sta VIA1+VIA_DRB
+ rts
+atnlo lda VIA1+VIA_DRB
+ and #%11011011
+ sta VIA1+VIA_DRB
+ rts
+#endif
+#endif
+
+#ifdef INVERT
+#ifndef NOLOOP
+atnalo lda VIA1+VIA_DRB
+ ora #%00100000
+ sta VIA1+VIA_DRB
+ rts
+atnahi lda VIA1+VIA_DRB
+ and #%11011111
+ sta VIA1+VIA_DRB
+ rts
+#endif
+
+eoilo lda VIA1+VIA_DRB
+ ora #%00010000
+ sta VIA1+VIA_DRB
+ rts
+eoihi lda VIA1+VIA_DRB
+ and #%11101111
+ sta VIA1+VIA_DRB
+ rts
+
+ndaclo lda VIA1+VIA_DRB
+ ora #%00001000
+ sta VIA1+VIA_DRB
+ rts
+ndachi lda VIA1+VIA_DRB
+ and #%11110111
+ sta VIA1+VIA_DRB
+ rts
+
+nrfdlo lda #60
+ sta PIA1+PIA_CRB
+ rts
+nrfdhi lda #52
+ sta PIA1+PIA_CRB
+ rts
+
+davlo lda #60
+ sta PIA1+PIA_CRA
+ rts
+davhi lda #52
+ sta PIA1+PIA_CRA
+ rts
+#else
+#ifndef NOLOOP
+atnahi lda VIA1+VIA_DRB
+ ora #%00100000
+ sta VIA1+VIA_DRB
+ rts
+atnalo lda VIA1+VIA_DRB
+ and #%11011111
+ sta VIA1+VIA_DRB
+ rts
+#endif
+
+eoihi lda VIA1+VIA_DRB
+ ora #%00010000
+ sta VIA1+VIA_DRB
+ rts
+eoilo lda VIA1+VIA_DRB
+ and #%11101111
+ sta VIA1+VIA_DRB
+ rts
+
+ndachi lda VIA1+VIA_DRB
+ ora #%00001000
+ sta VIA1+VIA_DRB
+ rts
+ndaclo lda VIA1+VIA_DRB
+ and #%11110111
+ sta VIA1+VIA_DRB
+ rts
+
+nrfdhi lda #60
+ sta PIA1+PIA_CRB
+ rts
+nrfdlo lda #52
+ sta PIA1+PIA_CRB
+ rts
+
+davhi lda #60
+ sta PIA1+PIA_CRA
+ rts
+davlo lda #52
+ sta PIA1+PIA_CRA
+ rts
+#endif
+
+waitdavhi lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne waitdavhi
+ and #$40
+ beq waitdavhi
+ rts
+
+tstdev lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne tstdev
+ and #%10000001
+ cmp #%10000001
+ rts
+
+#ifdef INVERT
+clrdata lda #0
+ sta PIA1+PIA_PB
+ rts
+
+out sta PIA1+PIA_PB
+ rts
+#else
+clrdata lda #<-1
+ sta PIA1+PIA_PB
+ rts
+
+out eor #$ff
+ sta PIA1+PIA_PB
+ rts
+#endif
+
+waitnrfdhi
+ lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne waitnrfdhi
+ asl
+ bcc waitnrfdhi
+ rts
+
+fragndac lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne fragndac
+ lsr
+ rts
+
+fragdav lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne fragdav
+ asl
+ asl
+ rts
+
+seterr ora status
+ sta status
+ rts
+
+bytin lda PIA1+PIA_PA
+ eor #$ff
+ rts
+
+&setti lda #<65000
+ sta VIA1+VIA_T1CL
+ lda #>65000
+ sta VIA1+VIA_T1CH
+ rts
+&fragti lda VIA1+VIA_IFR
+ and #%01000000
+ rts
+
+frageoi lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne frageoi
+ lsr
+ lsr
+ rts
+
+
+#undef PIA1
+#undef VIA1
+
diff --git a/dump/oa-2.0.9/arch/csa65/devices/siec_csa.a65 b/dump/oa-2.0.9/arch/csa65/devices/siec_csa.a65
new file mode 100644
index 0000000..8be925d
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/devices/siec_csa.a65
@@ -0,0 +1,416 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#define VIA1 $e840
+
+#include "chips/via6522.i65"
+
+ .zero
+cnt2 .byt 0
+byte .byt 0
+bytfl .byt 0
+eoifl .byt 0
+ .text
+
+&getif clc
+ ldx #SEM_VIAE840_T1
+ jmp PSEM
+&freif ldx #SEM_VIAE840_T1
+ jmp VSEM
+
+&IECINIT .(
+ lda #%00101110
+ sta VIA1+VIA_DDRA
+ cmp VIA1+VIA_DDRA
+ bne inix
+#ifndef INVERT
+ lda #0
+#endif
+ sta VIA1+VIA_DRA
+ lda VIA1+VIA_PCR
+ and #%11110000
+ ora #%00000001
+ sta VIA1+VIA_PCR
+ lda VIA1+VIA_ACR
+ and #%00111110
+ sta VIA1+VIA_ACR
+ lda #%01000011
+ sta VIA1+VIA_IER
+
+ lda #0
+ sta status
+ sta cnt2
+ sta bytfl
+ sta eoifl
+ clc
+ rts
+inix sec
+ rts
+ .)
+
+&IECIN .(
+ sei
+ lda #0
+ sta eoifl
+ lda #8
+ sta cnt2
+ jsr clkhi
+ jsr datalo
+
+l14 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRA ; wait clkhi
+ cmp VIA1+VIA_DRA
+ bne l14
+ and #$40
+ beq l14
+
+l19 jsr setti
+ jsr datahi
+
+l16 jsr fragti
+ bne l15 ; abgelaufen
+ ; jsr testatn
+ ; bcs atnin
+ bit VIA1+VIA_DRA ; wait clklo
+ bvs l16
+ bvc l17
+
+l15 lda eoifl
+ beq l18
+ lda #2
+ jmp error
+l18 dec eoifl
+ jsr datalo
+ jsr waitus
+ lda #$40
+ jsr seterror
+ bne l19
+
+l17
+l20 lda VIA1+VIA_DRA
+ asl
+ bpl l20
+ lsr
+ lsr
+ ror byte
+
+l21 bit VIA1+VIA_DRA
+ bvs l21
+
+ dec cnt2
+ bne l20
+
+ jsr datalo
+
+ bit status
+ bvc l22
+ jsr endhndshk
+ lda byte
+ sec
+ cli
+ rts
+
+l22 lda byte
+ clc
+ cli
+ rts
+
+ .)
+
+/*
+atnin jsr datalo
+ jsr clkhi
+ sec
+ rts
+*/
+
+nodev lda #$80
+error jsr seterror
+ jsr atnhi
+endhndshk jsr waitus
+ jsr datahi
+ jsr clkhi
+ sec
+ rts
+
+/*
+atnout
+ pha
+ bit bytfl
+ bpl l1 ; noch ein byte zu senden
+
+ sec
+ ror cnt2 ; dann mit eoi senden
+ jsr iecout
+ lsr bytfl ; flags ruecksetzen
+
+l1 pla
+ sta byte
+*/
+iec0out .(
+ sei
+ jsr datahi
+ jsr atnlo
+&iec2out sei
+ jsr clklo
+ jsr datahi
+ jsr waitms
+&iecout sei
+ jsr datahi
+
+l0 lda VIA1+VIA_DRA
+ cmp VIA1+VIA_DRA
+ bne l0
+ lsr ; data in c
+ bcs nodev
+
+ jsr clkhi
+ bit eoifl
+ bpl l3
+ ; eoi senden
+l4 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRA ; wait data hi
+ cmp VIA1+VIA_DRA
+ bne l4
+ lsr
+ bcc l4
+
+l5 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRA ; wait data lo
+ cmp VIA1+VIA_DRA
+ bne l5
+ lsr
+ bcs l5
+
+l3 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRA ; wait data hi
+ cmp VIA1+VIA_DRA
+ bne l3
+ lsr
+ bcc l3
+
+ jsr clklo
+ lda #8
+ sta cnt2
+
+l6 lda VIA1+VIA_DRA
+ cmp VIA1+VIA_DRA
+ bne l6
+ lsr
+ bcc timexout
+
+ ror byte ; bit setzen
+ bcs l7
+ jsr datalo
+ bne l8
+l7 jsr datahi
+
+l8 jsr clkhi
+ jsr waitus
+
+ jsr dhiclo
+
+ dec cnt2
+ bne l6
+
+ jsr waitdlo
+ bcs timeout
+ rts
+timeout lda #3
+ .byt $2c
+timexout lda #4
+ jmp error
+
+ .)
+
+/*
+testatn .(
+ lda VIA1+VIA_DRA
+ bmi tstatn
+ and #%00100000
+ beq c
+s sec
+ rts
+tstatn and #%00100000
+ beq s
+c clc
+ rts
+ .)
+*/
+
+#ifndef INVERT
+clkhi lda VIA1+VIA_DRA
+ ora #%00000100
+ sta VIA1+VIA_DRA
+ rts
+clklo lda VIA1+VIA_DRA
+ and #%11111011
+ sta VIA1+VIA_DRA
+ rts
+datahi lda VIA1+VIA_DRA
+ ora #%00000010
+ sta VIA1+VIA_DRA
+ rts
+datalo lda VIA1+VIA_DRA
+ and #%11111101
+ sta VIA1+VIA_DRA
+ rts
+atnhi lda VIA1+VIA_DRA
+ ora #%00101000
+ sta VIA1+VIA_DRA
+ rts
+atnlo lda VIA1+VIA_DRA
+ and #%11010111
+ sta VIA1+VIA_DRA
+ rts
+atnahi lda VIA1+VIA_DRA
+ and #%11011111
+ sta VIA1+VIA_DRA
+ rts
+atnalo lda VIA1+VIA_DRA
+ ora #%00100000
+ sta VIA1+VIA_DRA
+ rts
+dhiclo lda VIA1+VIA_DRA
+ and #%11111011
+ ora #%00000010
+ sta VIA1+VIA_DRA
+ rts
+#else
+clklo lda VIA1+VIA_DRA
+ ora #%00000100
+ sta VIA1+VIA_DRA
+ rts
+clkhi lda VIA1+VIA_DRA
+ and #%11111011
+ sta VIA1+VIA_DRA
+ rts
+datalo lda VIA1+VIA_DRA
+ ora #%00000010
+ sta VIA1+VIA_DRA
+ rts
+datahi lda VIA1+VIA_DRA
+ and #%11111101
+ sta VIA1+VIA_DRA
+ rts
+atnlo lda VIA1+VIA_DRA
+ ora #%00101000
+ sta VIA1+VIA_DRA
+ rts
+atnhi lda VIA1+VIA_DRA
+ and #%11010111
+ sta VIA1+VIA_DRA
+ rts
+atnalo lda VIA1+VIA_DRA
+ and #%11011111
+ sta VIA1+VIA_DRA
+ rts
+atnahi lda VIA1+VIA_DRA
+ ora #%00100000
+ sta VIA1+VIA_DRA
+ rts
+dhiclo lda VIA1+VIA_DRA
+ and #%11111101
+ ora #%00000100
+ sta VIA1+VIA_DRA
+ rts
+#endif
+
+waitdlo
+ jsr setti
+w1 jsr fragti
+ bne w2
+ lda VIA1+VIA_DRA
+ cmp VIA1+VIA_DRA
+ bne w1
+ lsr
+ bcs w1
+ rts
+w2 sec
+ rts
+
+&setti lda #<1000
+ sta VIA1+VIA_T1CL
+ lda #>1000
+ sta VIA1+VIA_T1CH
+ rts
+&fragti lda VIA1+VIA_IFR
+ and #%01000000
+ rts
+
+waitms txa
+ ldx #$b6
+ bne w4
+waitus txa
+ ldx #8
+w4 dex
+ bne w4
+ tax
+ rts
+
+sectalk
+ sei
+ sta byte
+ jsr iec2out
+ bcs st1
+ jsr datalo
+ jsr atnhi
+ jsr clkhi
+st2 bit VIA1+VIA_DRA
+ bvs st2
+st1 cli
+ rts
+
+
+seclisten sei
+ sta byte
+ jsr iec2out
+ jsr atnhi
+ cli
+ rts
+
+&UNTALK sei
+ jsr clklo
+ lda #$5f
+ jsr atnout
+ jsr atnhi
+ jsr clkhi
+ jsr datahi
+ cli
+ rts
+
+&UNLISTEN lda #$3f
+ sei
+ jsr atnout
+ jsr atnhi
+ jsr clkhi
+ cli
+ rts
+
+
+#undef VIA1
+
diff --git a/dump/oa-2.0.9/arch/csa65/foo b/dump/oa-2.0.9/arch/csa65/foo
new file mode 100644
index 0000000..de9706e
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/foo
@@ -0,0 +1,20 @@
+
+If "ROMTEST" is defined:
+
+p 02
+e 2 18
+e 3 19
+e 4 1a
+e 5 1b
+e 6 1c
+e 7 1d
+e 8 1e
+e 9 1f
+yc
+l"csarom" 2000
+l"inirom" 3fe
+
+or otherwise:
+
+~/vice/src/vice-0.12.0.16-csa-22/bin/xcsa -kernal ./csarom -basic ./csarom2
+
diff --git a/dump/oa-2.0.9/arch/csa65/kernel/kenv.a65 b/dump/oa-2.0.9/arch/csa65/kernel/kenv.a65
new file mode 100644
index 0000000..ca2cd5f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/kernel/kenv.a65
@@ -0,0 +1,780 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/* Struct Task Environment Entry */
+
+/* we have three structs now:
+ * TE_* for task environment handling - not needed for system without
+ * memory management
+ * TT_* task table, contains STD streams, etc
+ * TH_* thread table, has stack info and state
+ */
+
+/************************************************************************
+ * These routines are needed in the env section!
+ * inienv
+ * savethread
+ * loadthread
+ * initsp
+ * push
+ * pull
+ * memtask
+ * memsys
+ *
+ * sbrk
+ * getenv
+ * freenv
+ */
+
+
+#define TE_NTASKS 0
+#define TE_MMU 1 /* must be at least 1 - see getenv */
+#define TE_MMU_LEN 15 /* allow up to 15 pages being mapped */
+#define TE_RAMLEN 16 /* the number of RAM blocks allocated */
+#define TE_SLEN 17
+
+ .data
+&actEnv .byt 0
+&envTab .dsb MAXENVS * TE_SLEN
+ .text
+
+
+/*
+ * Maps PCBUF to a place reachable by the kernel (called several times).
+ * The new address of PCBUF in kernel space is then called SYSBUF.
+ * MAPSYSBUF must preserve xr
+ */
+#define MAPSYSBUF jsr mapsysbuf
+
+&mapsysbuf
+ .( :\
+ ldy actEnv :\
+ cpy #<-1 :\
+ beq map1 :\
+ lda envTab+TE_MMU,y :\
+ .byt $2c :\
+map1 lda #SYSPAGE :\
+ sta MMU+1 :\
+ rts :\
+ .)
+
+#define SYSBUF $1200
+
+/*
+ * copies PCBUF from another (thread id in y) task to actual task
+ * length in TH_PAR+1(actThread)
+ */
+#define CPPCBUFRX() \
+ ldx actTask :\
+ lda taskTab + TT_ENV,x :\
+ tax :\
+ lda envTab + TE_MMU,x :\
+ sta MMU+2 :\
+ lda threadTab + TH_TASK,y :\
+ tax :\
+ lda taskTab + TT_ENV,x :\
+ tax :\
+ lda envTab + TE_MMU,x :\
+ sta MMU+1 :\
+ lda threadTab + TH_PAR+1,y :\
+ jsr cploop
+
+/*
+ * copies PCBUF from actual task to another (thread id in y)
+ * length in TH_PAR+1(actThread)
+ */
+#define CPPCBUFTX() \
+ jsr setmmu12 :\
+ ldx actThread :\
+ lda threadTab + TH_PAR+1,x :\
+ jsr cploop
+
+/*
+ * copies PCBUF from actual task to another (thread id in y)
+ * length in TH_PAR+1(actThread)
+ */
+#define CPFORKBUF() \
+ .( :\
+ ldy actThread :\
+ cpy #<-1 :\
+ beq nocopy :\
+ ldy div :\
+ jsr setmmu12 :\
+ lda #0 :\
+ jsr cploop :\
+nocopy .)
+
+cploop .(
+ tay
+l_0 dey
+ lda PCBUF+(BLKSIZ),y
+ sta PCBUF+(BLKSIZ*2),y
+ tya
+ bne l_0
+ rts
+ .)
+
+setmmu12 .(
+ ldx actEnv
+ lda envTab + TE_MMU,x
+ sta MMU+1
+ lda threadTab + TH_TASK,y
+ tax
+ lda taskTab + TT_ENV,x
+ tax
+ lda envTab + TE_MMU,x
+ sta MMU+2
+ rts
+ .)
+
+&inienv .(
+ jsr inimem
+ lda #<-1
+ sta actThread
+ sta actTask
+ sta actEnv
+ lda #1
+ sta Syscnt
+ ;clc
+ rts
+ .)
+
+setthread .(
+ .data
+newThread .byt 0
+ .text
+
+ cmp actThread
+ bne doit
+ rts
+doit
+ sta newThread
+
+ ldx actThread
+ cpx #<-1
+ beq nosave
+
+ ldy actEnv
+ lda envTab + TE_MMU,y
+ sta MMU+3
+
+ lda BLKSIZ*3 + THREADSAVE
+ sta threadTab + TH_LIBSAVE,x
+ lda BLKSIZ*3 + THREADSAVE+1
+ sta threadTab + TH_LIBSAVE+1,x
+
+;savetask
+ ldy threadTab + TH_TASK,x
+ lda BLKSIZ*3 + TASKSAVE
+ sta taskTab + TT_LIBSAVE,y
+ lda BLKSIZ*3 + TASKSAVE + 1
+ sta taskTab + TT_LIBSAVE + 1,y
+nosave
+;loadtask
+ ldx newThread
+ stx actThread
+ cpx #<-1
+ bne load
+ stx actTask
+ stx actEnv
+ beq noload
+load
+ ldy threadTab + TH_TASK,x
+ sty actTask
+ lda taskTab + TT_ENV,y
+ sta actEnv
+ tay
+ lda envTab + TE_MMU,y
+ sta MMU+3
+;loadtask
+ ldy actTask
+ lda taskTab + TT_LIBSAVE,y
+ sta BLKSIZ*3 + TASKSAVE
+ lda taskTab + TT_LIBSAVE + 1,y
+ sta BLKSIZ*3 + TASKSAVE + 1
+
+;loadthread
+ lda threadTab + TH_LIBSAVE,x
+ sta BLKSIZ*3 + THREADSAVE
+ lda threadTab + TH_LIBSAVE+1,x
+ sta BLKSIZ*3 + THREADSAVE+1
+noload
+endset rts
+ .)
+
+initsp .(
+ lda #<-1 ;STACKSIZE-1
+ ;ldx actThread
+ sta threadTab + TH_SP,x
+ rts
+ .)
+
+pull .(
+ MAPSYSBUF
+ ldx actThread
+ inc threadTab + TH_SP,x
+ lda threadTab + TH_SP,x
+ tay
+ lda SYSBUF - PCBUF + $0100,y
+ rts
+ .)
+
+push .(
+ pha
+ MAPSYSBUF
+ ldx actThread
+ lda threadTab + TH_SP,x
+ tay
+ pla
+ sta SYSBUF - PCBUF + $0100,y
+ dec threadTab + TH_SP,x
+ rts
+ .)
+
+/***************************************************************************/
+
+#define MAPENV() jsr mapenv
+#define MAPAENV() jsr mapaenv
+
+&mapaenv
+ ldx actEnv
+&mapenv .(
+ cpx #<-1
+ beq system
+ rts
+system pha
+ tya
+ lsr
+ lsr
+ lsr
+ lsr
+ tax
+#ifdef ROMTEST
+ ora #$10
+#endif
+ sta MMU,x
+ pla
+ rts
+ .)
+
+/***************************************************************************/
+
+/*
+ * we have changed the memtask call from jsr to jmp, but we need
+ * the jsr routine (or an equivalent) for the return from interrupt
+ */
+
+#define MEMTASK2() jsr memtask2
+
+&memtask jsr memtask2
+ rts
+
+ .(
+
+mempage = 3
+
+ .data
+AC .byt 0
+XR .byt 0
+YR .byt 0
+SR .byt 0
+ADR .word 0
+SSP .byt 0
+mmu .byt 0
+ .text
+
+&&memtask2
+ php
+ sei
+ dec Syscnt ; back to thread?
+ bne mtask ; no then end
+
+ bit adev
+ bpl mtask
+
+ sty YR ; otherwise set thread env
+ stx XR
+ sta AC
+ pla
+ sta SR
+ pla
+ sta ADR
+ pla
+ sta ADR+1
+ tsx
+ stx SSP ; save all regs
+
+ ldy actEnv
+
+ ldx #1
+tm1 lda envTab+TE_MMU+1,y
+ sta MMU,x
+ iny
+ inx
+ cpx #TE_MMU_LEN
+ bcc tm1
+
+ ldy actThread
+ ldx threadTab + TH_SP,y
+ txs
+
+ ldy actEnv
+ lda envTab+TE_MMU+mempage,y
+ sta mmu
+ lda envTab+TE_MMU,y
+ sta MMU
+
+mt2
+ lda #SYSPAGE
+ sta MMU+mempage
+
+ lda BLKSIZ*mempage+ADR+1
+ pha
+ lda BLKSIZ*mempage+ADR
+ pha
+ lda BLKSIZ*mempage+SR
+ pha
+ lda BLKSIZ*mempage+AC
+ pha
+ lda BLKSIZ*mempage+mmu
+ ldy BLKSIZ*mempage+YR
+ ldx BLKSIZ*mempage+XR
+ sta MMU+mempage
+ pla
+mtask plp
+ rts
+
+&&memsys php
+ sei
+ pha
+ lda #SYSPAGE
+ sta MMU+mempage
+ lda BLKSIZ*mempage+Syscnt
+ inc BLKSIZ*mempage+Syscnt
+ cmp #0
+ beq msys
+devr pla
+ plp
+ rts
+msys
+ bit BLKSIZ*mempage+adev
+ bpl devr
+
+ pla
+ sta BLKSIZ*mempage+AC
+ pla
+ sta BLKSIZ*mempage+SR
+ stx BLKSIZ*mempage+XR
+ sty BLKSIZ*mempage+YR
+#ifdef CMOSCPU
+ ply
+#else
+ pla
+ tay
+#endif
+ pla ; y/a hold the return address now
+
+ tsx
+ stx BLKSIZ*mempage + mmu
+ ldx #SYSPAGE
+ stx MMU
+ ldx SSP
+ txs
+
+ pha ; save return address
+#ifdef CMOSCPU
+ phy
+#else
+ tya
+ pha
+#endif
+ lda mmu
+ ldy actThread
+ sta threadTab + TH_SP,y
+
+ lda SR
+ pha
+ lda AC
+ ldx XR
+ ldy YR
+ plp
+ cld
+ rts
+
+ .)
+
+/***************************************************************************/
+
+ .(
+ .data
+gdiv .byt 0
+gdiv2 .byt 0
+gdiv3 .byt 0
+ .text
+
+&&kgetenv .(
+ sta gdiv ; number of 256-byte blocks as RAM from lo of mem
+ sty gdiv2 ; number of shared 256-byte blocks from top of mem
+ ldx #0
+l0 lda envTab + TE_NTASKS,x
+ beq found
+ txa
+ clc
+ adc #TE_SLEN
+ tax
+ cmp #TE_SLEN * MAXENVS
+ bcc l0
+ rts
+found stx gdiv3
+ ; first clean table
+ lda #$0f ; kernel ROM page, read-only
+ ldy #TE_MMU_LEN
+l0a sta envTab + TE_MMU,x
+ inx
+ dey
+ bne l0a
+ ; then copy shared
+ lda gdiv2
+ beq noshared
+ ; a memory page has 16 blocks - be sure to map all
+ ; also already shorten to length of MMU table
+#if 15-(16-TE_MMU_LEN)*16
+ clc
+ adc #< 15-(16-TE_MMU_LEN)*16
+#endif
+ lsr
+ lsr
+ lsr
+ lsr
+ sta gdiv2 ; number of 4k blocks
+
+ lda actEnv
+
+ cmp #<-1
+ bne valid
+ ldy #TE_MMU_LEN - 1
+l11 lda MMU,y
+ sta envTab + TE_MMU - 1, x
+ dex
+ dey
+ dec gdiv2
+ bne l11
+ beq l12
+
+valid clc
+ adc #TE_MMU_LEN
+ tay
+l1
+ lda envTab + TE_MMU - 1, y ; TE_MMU is at least 1, so no
+ sta envTab + TE_MMU - 1, x ; wraparound
+ dex
+ dey
+ dec gdiv2
+ bne l1
+noshared
+l12
+
+ ; now alloc the requested memory blocks
+ lda gdiv
+ beq end
+ clc
+ adc #15
+ lsr
+ lsr
+ lsr
+ lsr
+ sta gdiv ; number memory blocks to allocate
+
+ ldx gdiv3
+ stx gdiv2
+ sta envTab + TE_RAMLEN,x ; save length of RAM
+
+l2 jsr getmem
+ bcs release
+ txa
+ ldx gdiv2
+ sta envTab + TE_MMU,x
+ inc gdiv2
+ dec gdiv
+ bne l2
+
+ ldx gdiv3
+
+ lda envTab + TE_MMU,x ; needs to work with MAPSYSBUF of current
+ sta MMU+3 ; thread -> not page 1
+ lda #0
+ sta ENVSAVE+(3*BLKSIZ)
+ sta ENVSAVE+(3*BLKSIZ)+1
+
+ lda #1
+ sta envTab + TE_NTASKS,x
+ clc
+ rts
+release
+ ldy gdiv2
+ cpy gdiv3
+ beq end
+ dey
+ sty gdiv2
+ ldx envTab + TE_MMU,y
+ jsr fremem
+ jmp release
+end sec
+ rts
+ .)
+
+&&freenv .(
+ stx gdiv
+ lda envTab + TE_NTASKS,x
+ sec
+ sbc #1
+ sta envTab + TE_NTASKS,x
+ beq last
+ rts
+last
+ lda #TE_MMU_LEN
+ sta gdiv2
+
+l1 ldy gdiv
+ ldx envTab + TE_MMU,y
+ jsr fremem
+ bcs error
+ inc gdiv
+ dec gdiv2
+ bne l1
+error rts
+ .)
+
+&&sbrk .(
+ jsr memsys
+ bcc read
+ clc
+ adc #15
+ lsr
+ lsr
+ lsr
+ lsr
+ ldx actEnv
+ sec
+ sbc envTab + TE_RAMLEN,x
+ sta gdiv
+ beq read
+ bcs more
+less
+ dec envTab + TE_RAMLEN,x
+ lda envTab + TE_RAMLEN,x
+ clc
+ adc actEnv
+ tay
+ lda envTab + TE_MMU,y
+ tax
+ lda #$0f
+ sta envTab + TE_MMU,y
+ jsr fremem
+ inc gdiv
+ bne less
+ beq read
+more
+ jsr getmem
+ bcs read
+ txa
+ pha
+ ldx actEnv
+ lda envTab + TE_RAMLEN,x
+ inc envTab + TE_RAMLEN,x
+ clc
+ adc actEnv
+ tax
+ pla
+ sta envTab + TE_MMU,x
+ dec gdiv
+ bne more
+
+read ldx actEnv
+ lda envTab + TE_RAMLEN,x ; return available memory
+ asl
+ asl
+ asl
+ asl
+ clc
+ jmp memtask
+ .)
+
+ .)
+
+/***************************************************************************
+ *
+ * This code handles the setblk kernel call. It is used to change the
+ * MMU mapping by a task itself. It is for debugging puposes (monitor)
+ * only. It is reduced from the 1.3 kernel call, as it only allows writing,
+ * and also only for the own task.
+ * Handle with care!
+ */
+
+&&setblk .(
+ jsr memsys
+ cpy #TE_MMU_LEN
+ bcs indexerr
+ pha
+ tya
+ clc
+ adc actEnv
+ tay
+ pla
+ sta envTab + TE_MMU,y
+ clc
+indexerr
+ jmp memtask
+ .)
+
+/***************************************************************************
+ *
+ * The code below is the memory handling code previously located in
+ * oa1sm.a65. It is not needed for computer w/o MMU, so it moved here
+ */
+
+#define MBLOCKS 256
+
+ .(
+#ifndef MAP_ZERO
+ .data
+#else
+ .zero
+#endif
+MEMVAL .dsb MBLOCKS/8
+MEMFRE .dsb MBLOCKS/8
+mdiv .byt 0
+ .text
+
+&inimem .(
+ ldy #MBLOCKS/8
+ lda #0
+l1 sta MEMVAL,y
+ sta MEMFRE,y
+ dey
+ bpl l1
+ ;clc
+ rts
+ .)
+
+&getmem .(
+ ; jsr memsys
+ ldx #0
+l2 lda MEMVAL,x
+ and MEMFRE,x
+ beq gnext
+ ldy #7
+l3 asl
+ bcs found
+ dey
+ bpl l3
+found lda POT2,y
+ eor #$FF
+ and MEMFRE,x
+ sta MEMFRE,x
+ txa
+ asl
+ asl
+ asl
+ sta mdiv
+ tya
+ ora mdiv
+ tax
+ jmp gne
+gnext inx
+ cpx #MBLOCKS/8
+ bcc l2
+notfre lda #E_NOMEM
+ .byt $2c
+gne lda #E_OK
+ cmp #1
+ ;jsr memtask
+ rts
+ .)
+
+&fremem .(
+ ; jsr memsys
+#if MBLOCKS - 256
+ cpx #MBLOCKS
+ bcs notfre
+#endif
+ jsr gsetxy
+ ora MEMFRE,x
+ and MEMVAL,x
+ sta MEMFRE,x
+ lda #E_OK
+ clc
+ ;jsr memtask
+ rts
+ .)
+
+&&enmem jsr memsys
+#if MBLOCKS - 256
+ cpx #MBLOCKS
+ bcs notfre
+#endif
+ jsr gsetxy
+ ora MEMVAL,x
+ sta MEMVAL,x
+ lda POT2,y
+ ora MEMFRE,x
+ sta MEMFRE,x
+ lda #E_OK
+ clc
+ jmp memtask
+ ;jsr memtask
+ ;rts
+
+/*
+&getblk jsr memsys
+#if MBLOCKS - 256
+ cpx #MBLOCKS
+ bcs notfre
+#endif
+ jsr gsetxy
+ and MEMFRE,x
+ and MEMVAL,x
+ beq notfre
+ lda POT2,y
+ eor #$ff
+ and MEMFRE,x
+ sta MEMFRE,x
+ lda #E_OK
+ clc
+ jmp memtask
+ ;jsr memtask
+ ;rts
+*/
+ .)
+
+/*
+ * needed for GETINFO, gives mem available for task
+ */
+#define GETTASKMEM ldx taskTab + TT_ENV,y: lda envTab + TE_RAMLEN,x: asl: asl: asl: asl
+
+/*
+ * needed in device code to get active environment in AC
+ */
+#define GETACTENV() lda actEnv
+
diff --git a/dump/oa-2.0.9/arch/csa65/kernel/kinit.a65 b/dump/oa-2.0.9/arch/csa65/kernel/kinit.a65
new file mode 100644
index 0000000..1a40f37
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/kernel/kinit.a65
@@ -0,0 +1,211 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * This file is included in the RESET routine of the kernel,
+ * after the "sei:cld". The routine starting at the bginning
+ * of this file must initialize the hardware to the system RAM
+ * in the beginning and the system ROM in the end of the memory
+ * map. Also the system stack (pointer) is setup.
+ *
+ * In addition to that the system interrupt timer (needed for
+ * task preemtion) must be setup.
+ *
+ * After that the file must define the following macros:
+ *
+ * GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ * LEDPORT address of LED port to signal hardware failures
+ * LED_LED bit of LED bit in LEDPORT address
+ * H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ * the LED toggle routine if needed.
+ * CLRTIMER() clear the system interrupt timer interrupt
+ * KERNELIRQ() returns if an interrupt occured in the kernel
+ * or outside. Is checked by "BNE IRQ_in_Kernel"
+ * SAVEMEM() save system mem config for interrupt
+ * RESTOREMEM() restore system mem config after interrupt
+ * STARTMEM() This is used to alloc/enable memory pages found
+ * during kernel init. Takes mem size in AC as given
+ * by the kernel init. It is called _after_ inimem!
+ */
+
+/*
+ * init stack pointer for system stack
+ */
+ ldx #<-1
+ txs
+
+/*
+ * init memory configuration
+ */
+ .(
+#ifdef ROMTEST
+ ldx #7 ; only set RAM mapping, keep running ROM mapping
+#else
+ ldx #15
+#endif
+res1 txa ;lda mmu,x
+ sta MMU,x
+ dex
+#if SYSPAGE
+ bne res1
+ lda #SYSPAGE
+ sta MMU
+#else
+ bpl res1
+#endif /* SYSPAGE */
+ .)
+
+/*
+ * CSA65 specific irq timer init, 50 Hz irq (well, i.e. line freq. irq)
+ * We assume that the reset - or a loader program has disabled all irq
+ */
+ lda #SYS_IRQEN+SYS_EXTIO
+ sta SYSPORT
+
+/*
+ * check zeropage RAM, jump to he_zero if failure
+ */
+#include "kernel/zerotest.a65"
+
+/*
+ * check system RAM up to ROMSTART, jump to he_ram if failure
+ * returns available RAM in 256 byte blocks in AC
+ */
+ .(
+ .zero
+&cnt .byt 0
+ .text
+#include "kernel/ramtest.a65"
+ cmp #MIN_MEM ; memory size at least needed
+ bcc he_ram
+ sta cnt
+ .)
+
+ jmp endmem
+
+/*
+ * here we enable the memory pages found to be mapped by the MMU
+ * TODO: currently maximum 32k!!!!
+ */
+startmem .(
+ lsr
+ lsr
+ lsr
+ lsr
+ sta cnt
+xl dec cnt
+ ldx cnt
+#if SYSPAGE
+ cpx #SYSPAGE
+ beq x1
+#else
+ bmi x1
+#endif
+/*
+#ifdef ROMTEST
+ txa
+ ora #$10
+ tax
+#endif
+*/
+ jsr ENMEM
+ jmp xl
+x1
+ rts
+ .)
+
+#define STARTMEM() jsr startmem
+
+/*
+ * determine the speed the CPU is running with. We use the 50 Hz toggle
+ * line for it.
+ */
+getfreq .(
+ sei
+ lda #SYS_IRQEN
+ sta SYSPORT
+gf1 lda SYSPORT
+ bpl gf1
+ sta SYSPORT
+ bit SYSPORT
+ bmi gf1
+ lda #0
+ tay
+ tax
+gf2 bit SYSPORT
+ bmi gfe
+ clc
+ adc #1
+ bne gf2
+ inx
+ bne gf2
+ iny
+ bne gf2
+gfe cpx #8 ; more, then 2 MHZ
+ bcc gf3
+ lda #128 ; 2 MHz
+ rts
+gf3 lda #0 ; 1 MHz
+ rts
+ .)
+
+#define GETFREQ() jsr getfreq
+
+/*
+ * system LED to indicate hardware failures
+ */
+#ifndef LEDPORT
+#define LEDPORT SYSPORT
+#define LED_LED SYS_LED
+#endif
+
+/*
+ * clear the scheduler preemption timer
+ */
+#define CLRTIMER() lda SYSPORT:sta SYSPORT
+
+/*
+ * MMU systems may map task pages into kernel mem to make copying
+ * easier. This mapping has to be preserved during interrupt.
+ * SAVEMEM() saves the memory configuration, while RESTOREMEM()
+ * restores it, obviously.
+ * These routines are called _after_ "jsr memsys", so this routine
+ * has to preserve this mapping when called from kernel space,
+ * and so must memtask.
+ */
+/*
+#define SAVEMEM lda MMU+1:pha:lda MMU+2:pha
+#define RESTOREMEM() pla:sta MMU+2:pla:sta MMU+1
+*/
+#undef SAVEMEM
+#undef RESTOREMEM
+
+/*
+ * Check if we have an interrupt in the kernel
+ */
+
+#define KERNELIRQ() lda Syscnt:cmp #1
+
+endmem
+
diff --git a/dump/oa-2.0.9/arch/csa65/sysapps/Makefile b/dump/oa-2.0.9/arch/csa65/sysapps/Makefile
new file mode 100644
index 0000000..e5dad92
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/sysapps/Makefile
@@ -0,0 +1,46 @@
+
+apps = lsh
+sysapps = mon slipd
+files = mkdir rmdir rm format chkdsk ls cat mv
+inet = tlogin telnet httpd
+
+XA=xa
+
+all: osa.d64
+
+redo:
+ rm -f fsibm.o65
+ make
+ cat foo
+
+fsibm.o65: fsibm.a65
+ ${XA} -bz 32 -bt 1280 -bd 768 -bb 12288 -l fsibm.lab -r -I.. -I../../../include -I../../.. -R -DOSA2KERNEL=\$$f000 $< -o $@
+ file65 -V fsibm.o65
+ reloc65 -xt -o fsibm fsibm.o65
+
+osa.d64: ${files} ${sysapps} ${apps} fsibm.o65
+ ./mkdisk ${files} ${sysapps} ${apps} ${inet} fsibm.o65
+ dd if=osa.x64 of=osa.d64 bs=64 skip=1
+
+clean:
+ rm -f fsibm.o65 fsibm.lab fsibm
+ rm -f ${files} ${sysapps} ${apps} ${inet}
+ rm -f osa.d64 osa.x64
+
+${apps}:
+ (cd ../../../apps/lsh; make lsh;)
+ (if test ! -r lsh; then ln -s ../../../apps/lsh/lsh lsh; fi)
+
+${sysapps}:
+ (cd ../../../sysapps/$@; make $@;)
+ (if test ! -r $@; then ln -s ../../../sysapps/$@/$@ $@; fi)
+
+${files}:
+ (cd ../../../apps/file; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/file/$@ $@; fi)
+
+${inet}:
+ (cd ../../../apps/inet; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/inet/$@ $@; fi)
+
+
diff --git a/dump/oa-2.0.9/arch/csa65/sysapps/foo b/dump/oa-2.0.9/arch/csa65/sysapps/foo
new file mode 100644
index 0000000..3af0bf3
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/sysapps/foo
@@ -0,0 +1,4 @@
+monitor
+p 05
+e 1 18 19 1a
+l"fsibm" 500
diff --git a/dump/oa-2.0.9/arch/csa65/sysapps/fsibm.a65 b/dump/oa-2.0.9/arch/csa65/sysapps/fsibm.a65
new file mode 100644
index 0000000..1fc9fe8
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/sysapps/fsibm.a65
@@ -0,0 +1,9 @@
+
+/* #define FSIBM_DEVICE_DRV "devices/drv_wd1770.a65" */
+/* #define FSIBM_DEVICE_DRV "sysapps/fs/fsibm/drv_ramd1.a65" */
+#define FSIBM_DEVICE_DRV "devices/scsi.a65"
+
+#define DEBUGFS
+
+#include "sysapps/fs/fsibm.a65"
+
diff --git a/dump/oa-2.0.9/arch/csa65/sysapps/mkdisk b/dump/oa-2.0.9/arch/csa65/sysapps/mkdisk
new file mode 120000
index 0000000..243e029
--- /dev/null
+++ b/dump/oa-2.0.9/arch/csa65/sysapps/mkdisk
@@ -0,0 +1 @@
+../../c64/boot/mkdisk
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/embedded/Makefile b/dump/oa-2.0.9/arch/embedded/Makefile
new file mode 100644
index 0000000..ee5f4ce
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/Makefile
@@ -0,0 +1,19 @@
+
+TRG=boot/rom
+
+XAINPUT=../../include,..,../..
+XA=XAINPUT=${XAINPUT} xa
+FILE=file65
+RELOC=reloc65
+
+rom ${TRG}:
+ ${XA} -R -bt 61438 -bd 768 -bz 8 -bb 2560 rom.a65 -o rom.o65 -l rom.lab ;
+ ${FILE} rom.o65;
+ ${RELOC} -xt -o ${TRG} rom.o65;
+
+
+clean:
+ rm -f ${TRG} rom.lab rom.o65 boot.tgz
+ (cd boot; ${MAKE} clean;)
+ # (cd apps; ${MAKE} clean;)
+
diff --git a/dump/oa-2.0.9/arch/embedded/README b/dump/oa-2.0.9/arch/embedded/README
new file mode 100644
index 0000000..c6a96a1
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/README
@@ -0,0 +1,25 @@
+
+This is a sample implementation of an embedded version of the GeckOS.
+It is reduced to basic scheduling and interrupt handling and has
+thus removed the
+
+- streams
+
+- memory management
+
+- file manager
+
+- send/receive
+
+- semaphores
+
+This shortens the kernel to almost 2k in size.
+Also the used amount of RAM is $bc = 188 byte normal RAM,
+plus $e = 14 byte zeropage (not counting the environment, task and
+thread save 6 bytes from addresses 2-8), also not counting
+the possible use of PCBUF by fork and devcmd.
+1k RAM total should be sufficient for simple applications.
+
+Using the PCBUF without locking with a semaphore should be handled with
+care.
+
diff --git a/dump/oa-2.0.9/arch/embedded/boot/Makefile b/dump/oa-2.0.9/arch/embedded/boot/Makefile
new file mode 100644
index 0000000..bd8b636
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/boot/Makefile
@@ -0,0 +1,12 @@
+
+XA=xa
+
+all: rom
+
+rom:
+ (cd ..; ${MAKE};)
+
+clean:
+ rm -f rom
+
+
diff --git a/dump/oa-2.0.9/arch/embedded/config.i65 b/dump/oa-2.0.9/arch/embedded/config.i65
new file mode 100644
index 0000000..8e6656f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/config.i65
@@ -0,0 +1,71 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#echo ******** c64 config **********
+
+
+#ifndef ANZSTR
+
+/* StreamData */
+
+#define ANZSTRM 8
+
+/* SemaphoreData */
+
+#define ANZSEM 8 /* vielfaches von 8 */
+#define SYSSEM 8 /* vielfaches von 8, sem-nr von -SYSSEM bis -1 */
+
+/* DeviceData */
+
+#define MAXDEV 16
+
+/* EnvData */
+
+#define MAXENVS 1 /* one environment only */
+
+#ifndef STACKCOPY
+#define MAXNTHREADS 5 /* (Stackpage-56)/40 */
+#define MAXNTASKS 5
+#define STACKSIZE 40 /* (TH_SLEN * 5) */
+#else
+#define MAXNTHREADS 8 /* (up to 16 is possible, if enough memory) */
+#define MAXNTASKS 5
+#define STACKSIZE 64 /* (TH_SLEN * 8) */
+#endif
+#define ANZXENV 5 /* number of redirectable task IDs */
+
+/* TaskData */
+
+#define IRQCNT 3
+
+/* FileManager */
+
+#define MAXFS 4
+
+/* we don't map any of these memory areas */
+#undef MAP_ZERO
+#undef MAP_STACK
+#undef MAP_MEM
+
+#endif
+
diff --git a/dump/oa-2.0.9/arch/embedded/devices/oa1std.a65 b/dump/oa-2.0.9/arch/embedded/devices/oa1std.a65
new file mode 100644
index 0000000..729127e
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/devices/oa1std.a65
@@ -0,0 +1,297 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/**************************************************************************/
+/* */
+/* Standard-Device-Programm zur einfachen Erstellung einer anderen Device */
+/* */
+/**************************************************************************/
+
+ .(
+ .word devend
+ jmp prg1
+ .asc "name",0
+
+ .data
+status .byt 0
+instr .byt 0
+outstr .byt 0
+ .text
+
+prg1 cmp #DC_RES
+ beq devini
+
+ pha
+ lda status
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini lda #0
+ sta status
+ sta instr
+ sta outstr
+
+/************************ Reset ************************************/
+
+/******* go on here, or on error go to devx ************************/
+
+rts1hi
+
+/***************** here if stream over highwatermark ***************/
+
+/*******************************************************************/
+
+ clc
+ rts
+
+devx lda status
+ ora #2
+ sta status
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq .(
+
+/********************* is IRQ for device? no, then irqend **********/
+
+/************************ here if irq for device *******************/
+
+ lda status
+ bpl tx
+
+/**** receive byte to ac, no byte then nobyt ***********************/
+
+/*******************************************************************/
+
+ ldx outstr
+ jsr PUTC
+ bcs test
+
+nobyt ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+
+tstwater cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh jsr rts1hi
+ bcc tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+
+wl
+/******** here if stream below lowwatermark ************************/
+
+/*******************************************************************/
+
+tx lda status
+ rol
+ bpl irqhs
+
+/******* hardware ready to send? if not then irqhs *****************/
+
+/*******************************************************************/
+
+ ldx instr
+ jsr GETC
+ bcs test2
+
+/***************** send byte ***************************************/
+
+/*******************************************************************/
+
+ jmp irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs
+
+/**************** remove IRQ and clean up **************************/
+
+/*******************************************************************/
+
+ lda #E_OK ; interrupt source removed
+ rts
+irqend
+ lda #E_NOIRQ ; no interrupt source removed
+ rts
+
+ .)
+
+others cmp #DC_GS
+ bne o1
+ lda status
+ and #DC_SW_TX
+ bne devonx
+ sty instr
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS
+ bne o2
+ lda status
+ and #DC_SW_RX
+ bne devonx
+ sty outstr
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+
+/********************* check if receive possible ******************/
+
+/************************ if not then onotimp *********************/
+
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+
+/********************* check if send possible ********************/
+
+/************************ if not then onotimp ********************/
+
+ lda #DC_SW_TX
+o2a ora status
+ sta status
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+
+rxoff lda status
+ and #DC_SW_RX
+ beq devoffx
+ ldx outstr
+ lda #SC_EOF
+ jsr STRCMD
+ lda status
+ and #255-DC_SW_RX
+ sta status
+ jsr rts1hi
+ bcc okx
+devoffx jmp devoff
+o5 cmp #DC_TX_OFF
+ bne o6
+
+txoff lda status
+ and #DC_SW_TX
+ beq devoffx
+ ldx instr
+ lda #SC_NUL
+ jsr STRCMD
+ lda status
+ and #255-DC_SW_TX
+ sta status
+ jmp ok
+
+o6 cmp #DC_HS
+ bne o6a
+
+/******************** here Handshake ************************/
+
+ lda status
+ and #255-1
+ sta status
+ tya
+ and #1
+ ora status
+ sta status
+
+/***********************************************************/
+
+ jmp ok
+
+o6a cmp #DC_SPD
+ bne o7
+
+/****************** here speed *****************************/
+
+/***********************************************************/
+
+ jmp ok
+
+o7 cmp #DC_ST
+ bne o8
+
+ lda status
+ and #2
+ bne onotimp
+
+/****************** here state request *********************/
+
+/***********************************************************/
+
+ jmp ok
+
+o8 cmp #DC_EXIT
+ bne onotimp
+ jsr rxoff
+ jsr txoff
+ lda status
+ ora #2
+ sta status
+
+/****************** disable device ************************/
+
+/*********************************************************************/
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+/******************** subprograms, includes, etc *********************/
+
+/*********************************************************************/
+
+devend .)
+
diff --git a/dump/oa-2.0.9/arch/embedded/devices/oa1stds.a65 b/dump/oa-2.0.9/arch/embedded/devices/oa1stds.a65
new file mode 100644
index 0000000..2ead320
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/devices/oa1stds.a65
@@ -0,0 +1,330 @@
+/****************************************************************************
+
+ OS/A65 Version 1.3.3
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/**************************************************************************/
+/* */
+/* Standard-Device-Programm zur einfachen Erstellung von anderen Devices */
+/* */
+/**************************************************************************/
+
+#define Anzdev 1
+
+ .(
+ .word devend
+ jmp prg1
+ .asc "name1",0
+/*
+devend1 .word devend
+ jmp prg2
+ .asc "name2",0
+*/
+dev =sysmem
+status =sysmem+1
+instr =sysmem+Anzdev+1
+outstr =sysmem+Anzdev*2+1
+-sysmem +=Anzdev*3+1
+
+prg1 ldx #0
+/*
+ .byt $2c
+prg2 ldx #1
+*/
+ stx dev
+ cmp #DC_RES
+ beq devini
+
+ pha
+ lda status,x
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini lda #0
+ sta status,x
+ sta instr,x
+ sta outstr,x
+
+/************************ Reset ************************************/
+
+/******* hier weiter oder bei Fehler devx **************************/
+
+rts1hi
+
+/***************** hier falls Stream �ber highwatermark ************/
+
+/*******************************************************************/
+
+ clc
+ rts
+
+devx ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq .(
+ ldx dev
+
+/********************* ist irq f�r device? nein dann irqend **********/
+
+/************************ hier falls irq f�r device ******************/
+
+ ldx dev
+ lda status,x
+ bpl tx
+
+/**** Byte empfangen in ac, kein Byte dann nobyt *********************/
+
+/*********************************************************************/
+
+ pha
+ ldx dev
+ lda outstr,x
+ tax
+ pla
+ jsr PUTC
+ bcs test
+
+nobyt ldx dev
+ lda outstr,x
+ tax
+ lda #SC_STAT
+ jsr STRCMD
+
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+
+tstwater cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh jsr rts1hi
+ bcc tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+
+wl
+/******** hier Aktion falls Stream unter Lowwatermark ****************/
+
+/*********************************************************************/
+
+tx ldx dev
+ lda status,x
+ rol
+ bpl irqhs
+
+/******* Hardware sendebereit? falls nicht irqhs ********************/
+
+/*********************************************************************/
+
+ ldx dev
+ lda instr
+ tax
+ jsr GETC
+ bcs test2
+
+/***************** Byte senden **************************************/
+
+/********************************************************************/
+
+ jmp irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs
+
+/**************** Irq l�schen oder so am Ende des Device-Irqs ******/
+
+/*******************************************************************/
+
+ lda #E_OK ; interrupt source removed
+ rts
+
+irqend lda #E_NOIRQ ; no interrupt source removed
+ rts
+
+ .)
+
+others cmp #DC_GS
+ bne o1
+ lda status,x
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr,x
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS
+ bne o2
+ lda status,x
+ and #DC_SW_RX
+ bne devonx
+ tya
+ sta outstr,x
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+
+/********************* hier test, ob Receive erlaubt **************/
+
+/************************ falls nicht onotimp *********************/
+
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+
+/********************* hier test, ob send erlaubt *****************/
+
+/************************ falls nicht onotimp *********************/
+
+ lda #DC_SW_TX
+o2a ora status,x
+ sta status,x
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+
+rxoff ldx dev
+ lda status,x
+ and #DC_SW_RX
+ beq devoffx
+ lda outstr,x
+ tax
+ lda #SC_EOF
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_RX
+ sta status,x
+ jsr rts1hi
+ bcc okx
+devoffx jmp devoff
+o5 cmp #DC_TX_OFF
+ bne o6
+
+txoff ldx dev
+ lda status,x
+ and #DC_SW_TX
+ beq devoffx
+ lda instr,x
+ tax
+ lda #SC_NUL
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_TX
+ sta status,x
+ jmp ok
+
+o6 cmp #DC_HS
+ bne o6a
+
+/******************** hier Handshake ************************/
+
+ lda status,x
+ and #255-1
+ sta status,x
+ tya
+ and #1
+ ora status,x
+ sta status,x
+
+/***********************************************************/
+
+ jmp ok
+
+o6a cmp #DC_SPD
+ bne o7
+
+/****************** hier Geschwindigkeit *******************/
+
+/***********************************************************/
+
+ jmp ok
+
+o7 cmp #DC_ST
+ bne o8
+
+ lda status,x
+ and #2
+ bne onotimp
+
+/****************** hier Statusabfrage *********************/
+
+/***********************************************************/
+
+ jmp ok
+
+o8 cmp #DC_EXIT
+ bne onotimp
+ jsr rxoff
+ jsr txoff
+ ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+
+/****************** hier Irq abschalten (Exit) ***********************/
+
+/*********************************************************************/
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+/******************** hier Unterprogramme, includes etc **************/
+
+/*********************************************************************/
+
+devend .)
+
diff --git a/dump/oa-2.0.9/arch/embedded/devices/romdev.a65 b/dump/oa-2.0.9/arch/embedded/devices/romdev.a65
new file mode 100644
index 0000000..54b097f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/devices/romdev.a65
@@ -0,0 +1,87 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef ROM
+
+#include "kdefs.def"
+#include "kernel.i65"
+
+ ;.word $700
+ *=$700
+
+#endif
+
+
+/* Device-Block */
+
+ .(
+
+#ifdef ROM
+ .word endd
+ .byt PK_DEV+$80
+ .word devstart
+ .dsb P_NAME - P_RAM, $ff
+ .asc "devices",0
+#else
+/* Note: this is obsolete! */
+#ifndef NOPRG
+ .word 0
+ .byt PK_DEV
+ .byt 0
+ .word 0
+ .word devstart
+ .byt 0,0,<-1
+#endif
+#endif
+
+devstart
+
+-sernr = "1"
+
+/*
+
+#define CONSOLE_DEVICE "devices/con_c64.a65"
+#include "devices/console.a65" ; video device is merged with OS/A now...
+
+#include "devices/oa1dnl.a65" ; null device
+#include "devices/oa1dsp.a65" ; spooler device
+#include "devices/ser_9600.a65" ; fast serial interface by Daniel Dallmann
+
+#ifdef UARTBASE
+#include "devices/ser_uart.a65" ; standard UART 16550A driver
+#endif
+
+*/
+
+#include "devices/oa1std.a65"
+
+ .word $ffff
+
+#if 0
+#print sysmem
+#print syszp
+#endif
+
+endd .)
+
diff --git a/dump/oa-2.0.9/arch/embedded/kernel/kenv.a65 b/dump/oa-2.0.9/arch/embedded/kernel/kenv.a65
new file mode 120000
index 0000000..1239cfb
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/kernel/kenv.a65
@@ -0,0 +1 @@
+../../c64/kernel/kenv.a65
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/embedded/kernel/kinit.a65 b/dump/oa-2.0.9/arch/embedded/kernel/kinit.a65
new file mode 100644
index 0000000..9188cb1
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/kernel/kinit.a65
@@ -0,0 +1,147 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * This file is included in the RESET routine of the kernel,
+ * after the "sei:cld". The routine starting at the bginning
+ * of this file must initialize the hardware to the system RAM
+ * in the beginning and the system ROM in the end of the memory
+ * map. Also the system stack (pointer) is setup.
+ *
+ * In addition to that the system interrupt timer (needed for
+ * task preemtion) must be setup.
+ *
+ * After that the file must define the following macros:
+ *
+ * GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ * LEDPORT address of LED port to signal hardware failures
+ * LED_LED bit of LED bit in LEDPORT address
+ * H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ * the LED toggle routine if needed.
+ * CLRTIMER() clear the system interrupt timer interrupt
+ * KERNELIRQ() returns if an interrupt occured in the kernel
+ * or outside. Is checked by "BNE IRQ_in_Kernel"
+ * SAVEMEM() save system mem config for interrupt
+ * RESTOREMEM() restore system mem config after interrupt
+ * STARTMEM() This is used to alloc/enable memory pages found
+ * during kernel init. Takes mem size in AC as given
+ * by the kernel init. It is called _after_ inimem!
+ */
+
+/* Kernel routines for embedded hardware */
+
+/*
+ * init stack pointer for system stack
+ */
+ ldx #<-1
+ txs
+
+/*
+ * init memory configuration
+ */
+
+/*
+ lda #7
+ sta 0 /* CPU data direction register */
+ lda #5
+ sta 1 /* Memory configuration */
+*/
+
+/*
+ * C64 specific irq timer init, irq every 20ms
+ * We assume that the reset - or a loader program has disabled all irq
+ */
+
+/*
+ lda #<20000
+ sta C64CIA1+CIA_TBL ; load low byte
+ lda #>20000
+ sta C64CIA1+CIA_TBH ; load hi byte of counter value
+ lda #%00010001
+ sta C64CIA1+CIA_CRB ; start counter, counting system pulses
+ lda #%10000010
+ sta C64CIA1+CIA_ICR ; allow irq
+*/
+
+/*
+ * check zeropage RAM, jump to he_zero if failure
+ */
+#include "kernel/zerotest.a65"
+
+/*
+ * check system RAM up to RAMEND, jump to he_ram if failure
+ * returns available RAM in 256 byte blocks in AC
+ */
+ .(
+ .zero
+cnt .byt 0
+ .text
+#include "kernel/ramtest.a65"
+ .)
+
+/*
+ * originally SYSPORT specific, they have a value for the C64 also...
+ */
+#define GETFREQ() lda #0
+
+#define LEDPORT $d020
+#define LED_LED 1
+
+/*
+ * as we have set the CIA1 TB irq in the kernel, we have to clear the
+ * CIA interrupt flag. This is done with reading the ICRegister.
+ * With C64NEEDCIA1 one can disable reading the ICR here. But then you
+ * have to have a device that does it!
+ */
+#if 0 /* ndef C64NEEDCIA1 */
+#define CLRTIMER() lda C64CIA1+CIA_ICR
+#else
+#define CLRTIMER()
+#endif
+
+/*
+ * MMU systems may map task pages into kernel mem to make copying
+ * easier. This mapping has to be preserved during interrupt.
+ * SAVEMEM() saves the memory configuration, while RESTOREMEM()
+ * restores it, obviously.
+ * These routines are called _after_ "jsr memsys", so this routine
+ * has to preserve this mapping when called from kernel space,
+ * and so must memtask.
+ */
+
+#undef SAVEMEM
+#undef RESTOREMEM
+
+/*
+ * Check if we have an interrupt in the kernel
+ */
+
+#define KERNELIRQ() lda Syscnt:cmp #1
+
+/*
+ * no memory management...
+ */
+#define STARTMEM()
+
+
diff --git a/dump/oa-2.0.9/arch/embedded/rom.a65 b/dump/oa-2.0.9/arch/embedded/rom.a65
new file mode 100644
index 0000000..2ba0380
--- /dev/null
+++ b/dump/oa-2.0.9/arch/embedded/rom.a65
@@ -0,0 +1,112 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+
+/* These are necessary for embedded kernel *********************************/
+
+#define NOMMU
+#define NOSYSPORT
+#undef CLK2MHZ /* we only have approx. 1 MHz ... */
+#undef CMOSCPU /* ... and CMOS cpu ? not if we keep save */
+#define RAMTEST
+#define NOMIRRORMEM
+
+/* These are changeable ****************************************************/
+
+#define MIN_MEM $04 /* minimum memory we need in system env. to
+ work ok, in pages */
+
+#define RAMEND $20 /* where the ROM starts (in pages) */
+
+#define MEMINIVAL 0 /* Clear memory to 0 on boot */
+
+#undef STACKCOPY /* if defined, save stack area in memory
+ when context switching, otherwise divide
+ stack area and give each task a part.
+ It's faster without, but allows more
+ tasks with */
+
+#undef NMIDEV /* necessary for fast RS232 */
+
+#define NO_STREAMS /* no stream handling code included */
+
+#define NO_FSM /* no filesystem manager code included */
+
+#define NO_SEM /* no semaphore code */
+
+#define NO_SEND /* no SEND/RECEIVE/XRECEIVE calls */
+
+#define NO_DEVICE /* no DEVICE handling */
+
+#define EOK_SEPARATE /* include kernel/end.a65 separately */
+
+#undef EOK_NOFILL /* don't fill ROM till $ffff */
+
+/***************************************************************************/
+/* You should include your application files below */
+/* */
+
+#include "config.i65"
+#include "kdefs.i65"
+
+#include "kernel.i65"
+
+ .word $2000
+
+.(
+
+/*
+ * This inverses the order in which the kernel is assembled.
+ * This need not be but is working when EOK_SEPARATE is set.
+ */
+
+
+#include "kernel/kernel.a65"
+
+ .dsb 64,0 ; this is only to identify the kernel end in hexdump
+ ; and can be removed
+
+/*
+ * Here come the application files.
+ */
+
+ROMSTART =*
+
+#include "devices/romdev.a65"
+
+ .word -1
+
+/*
+ * This ends the kernel by filling till $fff* and putting the reset vectors
+ */
+
+#include "kernel/end.a65"
+
+.)
+
diff --git a/dump/oa-2.0.9/arch/gecko/Makefile b/dump/oa-2.0.9/arch/gecko/Makefile
new file mode 100644
index 0000000..fb32c25
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/Makefile
@@ -0,0 +1,24 @@
+
+TRG=boot/geckorom
+
+XAINPUT=../../include,../..
+XA=xa
+FILE=file65
+RELOC=reloc65
+
+gecko ${TRG}: geckorom.o65
+ ${RELOC} -xt -o ${TRG} geckorom.o65
+
+geckorom.o65: gecko.a65 config.i65 gecko.i65
+ ${XA} -I../.. -I../../include -R -bt 32768 -bd 768 -bz 8 -bb 2048 gecko.a65 -o geckorom.o65 -l gecko.lab ;
+ ${FILE} geckorom.o65;
+
+fsiectst: fsiectst.a65
+ (XAINPUT=${XAINPUT}; export XAINPUT;\
+ ${XA} -DKERNEL=61440 -bt 6144 -bz 128 -bd 4096 -bb 4352 fsiectst.a65 -o fsiectst ;\
+ if [ $$? -ne 0 ]; then rm -f fsiectst; fi; )
+
+clean:
+ rm -f ${TRG} geckorom gecko.lab geckorom.o65 fsiectst
+ (cd boot; ${MAKE} clean;)
+
diff --git a/dump/oa-2.0.9/arch/gecko/boot/Makefile b/dump/oa-2.0.9/arch/gecko/boot/Makefile
new file mode 100644
index 0000000..06e4567
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/boot/Makefile
@@ -0,0 +1,26 @@
+
+XAINPUT=../../../include
+XA=xa
+
+all: inigecko geckorom inig2 inig3
+
+gecko geckorom:
+ (cd ..; ${MAKE} ;)
+
+inigecko: inigecko.a65
+ (XAINPUT=${XAINPUT}; export XAINPUT;\
+ ${XA} -DKERNEL=61440 inigecko.a65 -o inigecko;\
+ if [ $$? -ne 0 ]; then rm -f inigecko; fi)
+
+inig2: inig2.a65
+ (XAINPUT=${XAINPUT}; export XAINPUT;\
+ ${XA} -DKERNEL=61440 inig2.a65 -o inig2;\
+ if [ $$? -ne 0 ]; then rm -f inig2; fi)
+
+inig3: inig3.a65
+ ${XA} -DXCSA -I../../../include -DKERNEL=61440 inig3.a65 -o inig3;
+
+clean:
+ rm -f geckorom inigecko inig2 inig3
+
+
diff --git a/dump/oa-2.0.9/arch/gecko/boot/inig2.a65 b/dump/oa-2.0.9/arch/gecko/boot/inig2.a65
new file mode 100644
index 0000000..2a41d37
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/boot/inig2.a65
@@ -0,0 +1,84 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * This little program starts the Gecko with the builtin ROM when
+ * it is connected to the emulator board
+ * It does not map anything else.
+ */
+
+#include "kdefs.i65"
+#include "kernel.i65"
+#include "../../csa65/csa65.i65"
+
+ .word $400
+ *=$400
+
+l1 =$0
+ ; exit all devices
+ lda #0
+ sta l1
+l2 ldx l1
+ lda #DC_EXIT
+ jsr DEVCMD
+ inc l1
+ lda l1
+ cmp #16
+ bcc l2
+ ; disable timer interrupt
+ lda SYSPORT
+ and #$ff-SYS_IRQEN
+ sta SYSPORT
+
+ sei ; remap MMU pages
+ ldy #$21
+ ldx #1
+l3 tya
+ sta $eff0,x
+ inx
+ iny
+ cpx #16
+ bcc l3
+
+ ldx #0 ; copy program to valid RAM
+l5 lda data,x
+ sta $1000,x
+ inx
+ bne l5
+
+ jmp $1000 ; and jump there
+
+data
+ lda #$20 ; remap page 0
+ sta $eff0
+; lda #$0b
+; sta $eff7 ; map $0e000 to $07000 for ext. I/O
+; lda #$2e
+; sta $effe
+ lda SYSPORT
+ ora #%00100000 ; ioinh
+ and #%11101111 ; extio
+ sta SYSPORT
+
+ jmp RESET
+
diff --git a/dump/oa-2.0.9/arch/gecko/boot/inig3.a65 b/dump/oa-2.0.9/arch/gecko/boot/inig3.a65
new file mode 100644
index 0000000..97e8fb4
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/boot/inig3.a65
@@ -0,0 +1,138 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * this little program starts the gecko when it is plugged in
+ * the CSA computer itself, setup for external CPU and I/O
+ * from the CPU
+ * The ROM is mapped from pages 4-c. The RAM is mapped from the
+ * Gecko card itself.
+ */
+
+#ifndef XCSA
+#define GSEGMENT $40 /* where the gecko lives in CS/A memory */
+ /* i.e. $40000-$4ffff */
+#else
+#define GSEGMENT 0
+#endif
+
+#include "kdefs.i65"
+#include "kernel.i65"
+#include "../../csa65/csa65.i65" ; we boot from a csa system
+
+; .word $400
+ *=$400
+
+l1 =$0
+ ; exit all devices
+ lda #0
+ sta l1
+l2 ldx l1
+ lda #DC_EXIT
+ jsr DEVCMD
+ inc l1
+ lda l1
+ cmp #16
+ bcc l2
+ ; disable timer interrupt
+ lda SYSPORT
+ and #$ff-SYS_IRQEN
+ sta SYSPORT
+
+ sei ; remap MMU pages 8-15 with values from
+.byt 2
+ ldx #8 ; 4 to c
+#ifdef XCSA
+l3 lda $eff1,x
+#else
+l3 lda $eff4,x
+#endif
+ sta $eff8,x
+ dex
+ bpl l3
+
+ ldx #1 ; set MMU pages 1-7 to 1-7
+l4 txa
+ ora #GSEGMENT
+ sta $eff0,x
+ inx
+ cpx #$8
+ bcc l4
+
+ ldx #8
+l3a lda $eff0,x ; copy to write-protect-MMU if available
+ sta $ef70,x
+ inx
+ cpx #16
+ bcc l3a
+
+ ldx #0 ; copy program to valid RAM
+l5 lda data,x
+ sta $1000,x
+ inx
+ bne l5
+
+ jmp $1000 ; and jump there
+
+data
+ lda #GSEGMENT ; remap page 0
+ sta $eff0
+
+; lda #$0b
+; sta $eff7 ; map $0e000 to $07000 for ext. I/O
+; lda #$2e
+; sta $effe
+; lda SYSPORT
+; ora #%00100000 ; ioinh
+; and #%11101111 ; extio
+; sta SYSPORT
+
+ lda SYSPORT ;$7fe0
+ eor #%00001000
+ sta SYSPORT ;$7fe0
+
+ ldx #0
+ ldy #0
+x0 dey
+ bne x0
+ dex
+ bne x0
+
+ lda SYSPORT ;$7fe0
+ eor #%00001000
+ sta SYSPORT ;$7fe0
+
+ ldx #0
+ ldy #0
+x1 dey
+ bne x1
+ dex
+ bne x1
+
+;lda #$0f
+;sta $7fff
+;lda #%00100000
+;sta $7fe0
+
+ jmp RESET
+
diff --git a/dump/oa-2.0.9/arch/gecko/boot/inigecko.a65 b/dump/oa-2.0.9/arch/gecko/boot/inigecko.a65
new file mode 100644
index 0000000..6ef2cef
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/boot/inigecko.a65
@@ -0,0 +1,130 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/*
+ * this little program starts the gecko when its CPU is replaced by
+ * the 40 pin connection to the CSA emulator board.
+ * The gecko must be setup for internal CPU.
+ *
+ * The ROM is mapped from pages 4-c. The RAM is mapped from the
+ * Gecko card itself.
+ *
+ * The I/O is mapped from the gecko obviously,
+ * i.e. we set ioinh on the BIOS board.
+ *
+ * As the I/O is mapped from the gecko, the whole page $exxx must
+ * not have any data/code in it, as it is remapped from the original
+ * gecko ROM, not from the pages 4-c like the rest of the ROM!
+ */
+
+#define GSEGMENT $20
+
+#include "kdefs.i65"
+#include "kernel.i65"
+#include "../../csa65/csa65.i65" ; we boot from a csa system
+
+ .word $400
+ *=$400
+
+l1 =$0
+ ; exit all devices
+ lda #0
+ sta l1
+l2 ldx l1
+ lda #DC_EXIT
+ jsr DEVCMD
+ inc l1
+ lda l1
+ cmp #16
+ bcc l2
+ ; disable timer interrupt
+ lda SYSPORT
+ and #$ff-SYS_IRQEN
+ sta SYSPORT
+
+ sei ; remap MMU pages 8-15 with values from
+ ldx #8 ; 4 to c
+l3 lda $eff4,x
+ sta $eff8,x
+ dex
+ bpl l3
+
+ ldx #1 ; map pages 1-7 from gecko
+l4 txa
+ ora #GSEGMENT
+ sta $eff0,x
+ inx
+ cpx #$8
+ bcc l4
+
+ ldx #0 ; copy program to valid RAM
+l5 lda data,x
+ sta $1000,x
+ inx
+ bne l5
+
+ jmp $1000 ; and jump there
+
+data
+ lda #GSEGMENT ; remap page 0
+ sta $eff0
+
+ lda #$0b ; extio is on page $0b000
+ sta $eff7 ; map I/O to $07000 for ext. I/O
+ lda #GSEGMENT + $e ; gecko I/O page
+ sta $effe
+ lda SYSPORT
+ ora #%00100000 ; ioinh
+ and #%11101111 ; extio
+ sta SYSPORT
+
+ lda $7fe0
+ eor #%00001000
+ sta $7fe0
+
+ ldx #0
+ ldy #0
+x0 dey
+ bne x0
+ dex
+ bne x0
+
+ lda $7fe0
+ eor #%00001000
+ sta $7fe0
+
+ ldx #0
+ ldy #0
+x1 dey
+ bne x1
+ dex
+ bne x1
+
+;lda #$0f
+;sta $7fff
+;lda #%00100000
+;sta $7fe0
+
+ jmp RESET
+
diff --git a/dump/oa-2.0.9/arch/gecko/config.i65 b/dump/oa-2.0.9/arch/gecko/config.i65
new file mode 100644
index 0000000..d3fe2ea
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/config.i65
@@ -0,0 +1,73 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef ANZSTR
+
+#include "gecko.i65"
+
+/************************ Daten f�r Computer ohne MMU *********************/
+
+/* StreamData */
+
+#define ANZSTRM 8
+
+/* SemaphoreData */
+
+#define ANZSEM 8 /* multiple of 8 */
+#define SYSSEM 8 /* multiple of 8, sem-no from -SYSSEM to -1 */
+
+/* DeviceData */
+
+#define MAXDEV 16
+
+/* EnvData */
+
+#ifndef STACKCOPY
+#define MAXNTHREADS 5 /* (Stackpage-56)/40 */
+#define MAXNTASKS 5
+#define STACKSIZE 40 /* (TH_SLEN * 5) */
+#else
+#define MAXNTHREADS 8 /* (up to 16 is possible, if enough memory) */
+#define MAXNTASKS 8
+#define STACKSIZE 64 /* (TH_SLEN * 8) */
+#endif
+#define ANZXENV 5 /* number of redirectable task IDs */
+
+/* TaskData */
+
+#define IRQCNT 3
+
+/* FileManager */
+
+#define MAXFS 4
+
+/* Memory handling */
+
+#undef MAP_ZERO
+#undef MAP_STACK
+#undef MAP_MEM
+#define NOMMU
+
+#endif
+
diff --git a/dump/oa-2.0.9/arch/gecko/devices/keydev.a65 b/dump/oa-2.0.9/arch/gecko/devices/keydev.a65
new file mode 100644
index 0000000..8f67515
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/devices/keydev.a65
@@ -0,0 +1,356 @@
+
+
+#define VIA $ec10
+#define IRQTIME 50000
+
+ .(
+ .word devend
+ jmp prg1
+ .asc "keys",0
+
+ .data
+status .byt 0
+outstr .byt 0
+ .text
+
+prg1
+ cmp #DC_RES
+ beq devini
+
+ pha
+ lda status
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini lda #0
+ sta status
+/* sta instr*/
+ sta outstr
+
+/************************ Reset ************************************/
+
+ jsr inikeys
+ lda VIA+VIA_ACR
+ and #%11011111
+ sta VIA+VIA_ACR
+ lda #%00100000
+ sta VIA+VIA_IFR
+ lda #%10100000
+ sta VIA+VIA_IER
+ lda #IRQTIME
+ sta VIA+VIA_T2CH
+
+/******* go on here or on error goto devx **************************/
+
+rts1hi
+
+/***************** here if stream over highwatermark ***************/
+
+/*******************************************************************/
+
+ clc
+ rts
+
+devx lda status
+ ora #2
+ sta status
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq .(
+
+/*************** Is interrupt for device? no, then irqend **********/
+
+ lda VIA+VIA_IFR
+ and #%00100000
+ beq irqend
+ lda #>IRQTIME
+ sta VIA+VIA_T2CH
+
+/************************ here if irq for device *******************/
+
+ lda status
+ bpl tx
+
+/**** get byte to ac - if non rx'd, goto nobyt **********************/
+
+ jsr getkey
+ bcs nobyt
+ txa
+
+/*********************************************************************/
+
+ ldx outstr
+ jsr PUTC
+ bcs test
+
+nobyt ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+
+tstwater /*
+ cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh jsr rts1hi
+ bcc tx ; always
+twl cmp #E_SLWM
+ bne tx
+
+wl
+/******** here action if stream below lowwatermark *******************/
+
+/*********************************************************************/
+*/
+tx/*
+ lda status
+ rol
+ bpl irqhs
+
+/******* hardware ready to send? if not goto irqhs *******************/
+
+ jmp irqhs
+
+/*********************************************************************/
+
+ ldx instr
+ jsr GETC
+ bcs test2
+
+/***************** send byte in ac **********************************/
+
+/********************************************************************/
+
+ jmp irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+*/
+irqhs
+
+/**************** clear interrupt at end of irq service ************/
+
+/*******************************************************************/
+
+irqend rts
+
+ .)
+
+devonx jmp devon
+others /*
+ cmp #DC_GS
+ bne o1
+ lda status
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr
+ jmp ok */
+
+o1 cmp #DC_PS
+ bne o2
+ lda status
+ and #DC_SW_RX
+ bne devonx
+ sty outstr
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+
+/********************* test if receive allowed ********************/
+
+/************************ if not, goto onotimp ********************/
+
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+
+/********************* test if send allowed ***********************/
+
+ jmp onotimp
+
+/************************ if not, goto onotimp ********************/
+
+ lda #DC_SW_TX
+o2a ora status
+ sta status
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+
+rxoff lda status
+ and #DC_SW_RX
+ beq devoffx
+ ldx outstr
+ lda #SC_EOF
+ jsr STRCMD
+ lda status
+ and #255-DC_SW_RX
+ sta status
+ jsr rts1hi
+ bcc okx
+devoffx jmp devoff
+
+o5 /*
+ cmp #DC_TX_OFF
+ bne o6
+
+txoff lda status
+ and #DC_SW_TX
+ beq devoffx
+ ldx instr
+ lda #SC_NUL
+ jsr STRCMD
+ lda status
+ and #255-DC_SW_TX
+ sta status
+ jmp ok
+
+o6
+ cmp #DC_HS
+ bne o6a
+
+/******************** here handshake ************************/
+
+ lda status
+ and #255-1
+ sta status
+ tya
+ and #1
+ ora status
+ sta status
+
+/***********************************************************/
+
+ jmp ok
+
+o6a cmp #DC_SPD
+ bne o7
+
+/****************** here speed *****************************/
+
+/***********************************************************/
+
+ jmp ok
+*/
+o7 cmp #DC_ST
+ bne o8
+
+ lda status,x
+ and #2
+ bne onotimp
+
+/****************** here status report *********************/
+
+/***********************************************************/
+
+ jmp ok
+
+o8 cmp #DC_EXIT
+ bne onotimp
+ jsr rxoff
+/* jsr txoff*/
+ lda status
+ ora #2
+ sta status
+
+/****************** disable irq (Exit) *********************/
+
+ lda #%00100000
+ sta VIA+VIA_IER
+
+/*********************************************************************/
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+/************** other device code **********************************/
+
+ .data
+lastkey .byt 0
+ .text
+
+inikeys .(
+ lda #<-1
+ sta lastkey
+ lda #%00001111
+ sta VIA+VIA_DDRA
+ cmp VIA+VIA_DDRA
+ bne novia
+ lda #0
+ sta VIA+VIA_DRA
+ clc
+ rts
+novia sec
+ rts
+ .)
+
+getkey .(
+ ldx #0
+
+g0 txa
+ lsr
+ lsr
+ sta VIA+VIA_DRA
+g1 lda VIA+VIA_DRA
+ cmp VIA+VIA_DRA
+ bne g1
+
+ ldy #4
+g2 rol
+ bcc pressed
+ inx
+ dey
+ bne g2
+
+ cpx #64
+ bcc g0
+ stx lastkey
+nokey sec
+ rts
+
+pressed cpx lastkey
+ stx lastkey
+ beq nokey
+ clc
+ rts
+ .)
+
+/*********************************************************************/
+
+devend .)
+
diff --git a/dump/oa-2.0.9/arch/gecko/devices/oadev.a65 b/dump/oa-2.0.9/arch/gecko/devices/oadev.a65
new file mode 100644
index 0000000..766a1ad
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/devices/oadev.a65
@@ -0,0 +1,94 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef ROM
+
+#include "kdefs.i65"
+#include "kernel.i65"
+
+ ;.word $700
+ *=$700
+
+/*#define NOPRG*/
+
+#endif
+
+
+/* Device-Block */
+
+ .(
+#if 0
+#ifndef NOMMU
+-sysmem =$300 /* werte um mit OS/A 1.33 nicht zu kollidieren */
+-syszp =$d0
+#endif
+
+#echo devices:
+#print sysmem
+#print syszp
+
+#endif
+
+#ifdef ROM
+ .word endd
+ .byt PK_DEV+$80
+ .word devstart
+ .dsb P_NAME - P_RAM, $ff
+ .asc "devices",0
+#else
+#ifndef NOPRG
+ .word 0
+ .byt PK_DEV
+ .byt 0
+ .word 0
+ .word devstart
+ .byt 0,0,<-1
+#endif
+#endif
+
+devstart
+
+/*#include "c:eigene\eigene.a65\osarom3\oadev\oa1dt.a65"*/
+
+
+-sernr = "1"
+
+#include "devices/keydev.a65"
+#include "devices/nulldev.a65"
+#include "devices/spooler.a65"
+
+#ifdef GECKO_CSAEMU
+#include "chips/pia6521.i65"
+#define SYSPORT $efe0
+#define SYS_RTS %00000100
+#include "../csa65/devices/oa1ds.a65"
+#endif
+
+#define UARTBASE $ec00
+#include "devices/ser_uart.a65"
+
+ .word $ffff
+
+endd .)
+
diff --git a/dump/oa-2.0.9/arch/gecko/devices/siec_gecko.a65 b/dump/oa-2.0.9/arch/gecko/devices/siec_gecko.a65
new file mode 100644
index 0000000..dae84dc
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/devices/siec_gecko.a65
@@ -0,0 +1,527 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#define VIA1 $ec10
+
+#include "chips/via6522.i65"
+
+#define DATAO %00000001
+#define DATAI %00000100
+#define CLKO %00001000
+#define CLKI %01000000 /* must be bit 6 -> bvc/bvs */
+#define ATNO %00000010
+#define ATNI %00010000
+#define ATNA %00100000
+
+ .zero
+cnt2 .byt 0
+byte .byt 0
+bytfl .byt 0
+eoifl .byt 0
+ .text
+
+
++IECINIT
+#ifdef SEM_T1
+ clc
+ ldx #SEM_T1
+ jsr PSEM
+#endif
+ sei
+
+ lda VIA1+VIA_DDRB
+ and #%10000000
+ ora #%00101011
+ sta VIA1+VIA_DDRB
+ cmp VIA1+VIA_DDRB
+ bne inix
+ lda VIA1+VIA_DRB
+ and #$80
+ sta VIA1+VIA_DRB
+ lda #%01010000 ; T1, CB1 disable IRQ
+ sta VIA1+VIA_IER
+ sta VIA1+VIA_IFR
+ lda VIA1+VIA_PCR
+ ora #%00010000 ; CB1 positive edge
+ sta VIA1+VIA_PCR
+ lda VIA1+VIA_ACR
+ and #%00111111 ; T1 timed IRQ
+ sta VIA1+VIA_ACR
+
+ lda #0
+ sta status
+ sta cnt2
+ sta bytfl
+ sta eoifl
+ clc
+ .byt $24
+inix sec
+ cli
+#ifdef SEM_T1
+ php
+ ldx #SEM_T1
+ jsr VSEM
+ plp
+#endif
+ rts
+
+&getif .( /* we need timer 1, as well as irtx */
+#ifdef SEM_T1
+ clc
+ ldx #SEM_T1
+ jsr PSEM
+#endif
+#ifdef NMIDEV
+ lda #NMI_OFF
+ jsr CTRLNMI
+#endif
+ php
+ sei
+ lda VIA1+VIA_ACR
+ and #%00111111
+ sta VIA1+VIA_ACR
+ lda VIA1+VIA_PCR
+ lda #%01010000 ; T1, CB1 disable IRQ
+ sta VIA1+VIA_IER
+ sta VIA1+VIA_IFR
+ plp
+
+ rts
+ .)
+
+&freif .(
+#ifdef NMIDEV
+ lda #NMI_ON
+ jsr CTRLNMI
+#endif
+#ifdef SEM_T1
+ ldx #SEM_T1
+ jmp VSEM
+#else
+ rts
+#endif
+ .)
+
+&IECIN .(
+ sei
+ lda #0
+ sta eoifl
+ lda #8
+ sta cnt2
+ jsr clkhi
+ jsr datalo
+
+l14 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRB ; wait clkhi
+ cmp VIA1+VIA_DRB
+ bne l14
+ and #CLKI
+ bne l14
+
+l19 jsr setti
+ jsr datahi
+
+l16 jsr fragti
+ bne l15 ; abgelaufen
+ ; jsr testatn
+ ; bcs atnin
+ bit VIA1+VIA_DRB ; wait clklo
+ bvc l16
+ bvs l17
+
+l15 lda eoifl
+ beq l18
+ lda #2
+ jmp error
+l18 dec eoifl
+ jsr datalo
+ jsr waitus
+ lda #$40
+ jsr seterror
+ bne l19
+
+l17 sec
+ lda #DATAI
+l20 bit VIA1+VIA_DRB
+ bvs l20
+ bne l20a
+ clc
+l20a
+ ror byte
+
+l21 bit VIA1+VIA_DRB
+ bvc l21
+
+ dec cnt2
+ bne l17
+
+ jsr datalo
+ bit status
+ bvc l22
+ jsr endhndshk
+#ifdef SHOW
+php
+cli
+lda #"x"
+jsr OUT
+lda status
+jsr HEXOUT
+plp
+#endif
+ lda byte
+ eor #$ff
+ sec
+ rts
+
+l22 lda byte
+ eor #$ff
+ clc
+ rts
+
+
+&nodev lda #$80
+&error jsr seterror
+ jsr atnhi
+endhndshk jsr waitus
+ jsr datahi
+ jsr clkhi
+#ifdef SHOW
+ lda #"y"
+ jsr OUT
+ lda status
+ jsr HEXOUT
+#endif
+ sec
+ rts
+ .)
+
+#ifdef CLK1MHZ
+/**************************** start of 1MHz section ************************/
+
+
+&setti lda #<1000
+ sta VIA1+VIA_T1CL
+ lda #>1000
+ sta VIA1+VIA_T1CH
+ rts
+&fragti lda VIA1+VIA_IFR
+ and #%01000000
+ rts
+
+waitms txa
+ ldx #$b6
+ bne w4
+waitus txa
+ ldx #8
+w4 dex
+ bne w4
+ tax
+ rts
+
+
+/****************************** end of 1MHz section ************************/
+#else
+/**************************** start of 2MHz section ************************/
+
+
+&setti lda #<2000
+ sta VIA1+VIA_T1CL
+ lda #>2000
+ sta VIA1+VIA_T1CH
+ rts
+&fragti lda VIA1+VIA_IFR
+ and #%01000000
+ rts
+
+waitms txa
+ ldx #$b6
+ jsr w4
+ ldx #$b6
+ bne w4
+waitus3 txa
+ ldx #8
+ bne w4
+waitus2 txa
+ ldx #16
+ bne w4
+waitus txa
+ ldx #16
+w4 dex
+ bne w4
+ tax
+ rts
+
+
+/****************************** end of 2MHz section ************************/
+#endif
+
+/*
+atnout .(
+ pha
+lda #0
+sta status
+ bit bytfl
+ bpl l1 ; noch ein byte zu senden
+
+ sec
+ ror eoifl ; dann mit eoi senden
+ jsr iecout
+ lda #0
+ sta bytfl
+ ;lsr bytfl ; flags ruecksetzen
+
+l1 pla
+ sta byte
+*/
+iec0out .(
+ sei
+ jsr datahi
+ jsr atnlo
+&iec2out sei
+ jsr clklo
+ jsr datahi
+ jsr waitms
+&iecout sei
+ jsr datahi
+
+l0 lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne l0
+ ;lsr ; data in c
+ ;bcs nodev
+ and #DATAI
+ beq nodev
+
+ jsr clkhi
+ bit eoifl
+ bpl l3
+ ; eoi senden
+l4 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRB ; wait data hi
+ cmp VIA1+VIA_DRB
+ bne l4
+ ;lsr
+ ;bcc l4
+ and #DATAI
+ bne l4
+
+l5 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRB ; wait data lo
+ cmp VIA1+VIA_DRB
+ bne l5
+ ;lsr
+ ;bcs l5
+ and #DATAI
+ beq l5
+
+l3 ; jsr testatn
+ ; bcs atnin
+ lda VIA1+VIA_DRB ; wait data hi
+ cmp VIA1+VIA_DRB
+ bne l3
+ ;lsr
+ ;bcc l3
+ and #DATAI
+ bne l3
+
+ jsr clklo
+ lda #8
+ sta cnt2
+
+#ifndef CLK1MHZ
+ jsr waitus2
+#endif
+
+l6 lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne l6
+ ;lsr
+ ;bcc timexout
+ and #DATAI
+ bne timexout
+
+ ror byte ; bit setzen
+ bcs l7
+ jsr datalo
+ bne l8
+l7 jsr datahi
+
+l8 jsr clkhi
+ jsr waitus
+
+ jsr dhiclo
+#ifndef CLK1MHZ
+ jsr waitus3
+#endif
+ dec cnt2
+ bne l6
+
+ jsr waitdlo
+ bcs timeout
+ rts
+timeout lda #3
+ .byt $2c
+timexout lda #4
+ jmp error
+ .)
+ /*
+atnin jsr datalo
+ jsr clkhi
+ sec
+ rts
+*/
+/*
+testatn .(
+ lda VIA1+VIA_DRB
+ bmi tstatn
+ and #%00100000
+ beq c
+s sec
+ rts
+tstatn and #%00100000
+ beq s
+c clc
+ rts
+ .)
+*/
+
+
+clklo lda VIA1+VIA_DRB
+ ora #CLKO
+ sta VIA1+VIA_DRB
+ rts
+clkhi lda VIA1+VIA_DRB
+ and #255-CLKO
+ sta VIA1+VIA_DRB
+ rts
+datalo lda VIA1+VIA_DRB
+ ora #DATAO
+ sta VIA1+VIA_DRB
+ rts
+datahi lda VIA1+VIA_DRB
+ and #255-DATAO
+ sta VIA1+VIA_DRB
+ rts
+atnlo lda VIA1+VIA_DRB
+ ora #ATNA+ATNO
+ sta VIA1+VIA_DRB
+ rts
+atnhi lda VIA1+VIA_DRB
+ and #255-ATNA-ATNO
+ sta VIA1+VIA_DRB
+ rts
+atnalo lda VIA1+VIA_DRB
+ ;and #%11011111
+ ora #ATNA
+ sta VIA1+VIA_DRB
+ rts
+atnahi lda VIA1+VIA_DRB
+ ;ora #%00100000
+ and #255-ATNA
+ sta VIA1+VIA_DRB
+ rts
+dhiclo lda VIA1+VIA_DRB
+ ;and #%11111101
+ ;ora #%00000100
+ ora #CLKO
+ and #255-DATAO
+ sta VIA1+VIA_DRB
+ rts
+
+waitdlo
+ jsr setti
+w1 jsr fragti
+ bne w2
+ lda VIA1+VIA_DRB
+ cmp VIA1+VIA_DRB
+ bne w1
+ ;lsr
+ ;bcs w1
+ and #DATAI
+ beq w1
+ clc
+ rts
+w2 sec
+ rts
+
+
+sectalk .(
+ sei
+ sta byte
+ jsr iec2out
+ bcs st1
+ jsr datalo
+ jsr atnhi
+ jsr clkhi
+st2 bit VIA1+VIA_DRB
+ ;bvs st2
+ bvc st2
+st1 cli
+ rts
+ .)
+
+seclisten .(
+ sei
+ sta byte
+ jsr iec2out
+ jsr atnhi
+ cli
+ rts
+ .)
+
+&UNTALK .(
+ sei
+ jsr clklo
+ lda #$5f
+ jsr atnout
+ jsr atnhi
+ jsr clkhi
+ jsr datahi
+ cli
+ rts
+ .)
+
+&UNLISTEN .(
+ lda #$3f
+ sei
+ jsr atnout
+ jsr atnhi
+ jsr clkhi
+ cli
+ rts
+ .)
+
+
+#undef VIA1
+#undef DATAO
+#undef DATAI
+#undef CLKO
+#undef CLKI
+#undef ATNO
+#undef ATNI
+#undef ATNA
+
+
diff --git a/dump/oa-2.0.9/arch/gecko/fsiectst.a65 b/dump/oa-2.0.9/arch/gecko/fsiectst.a65
new file mode 100644
index 0000000..22bdbbb
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/fsiectst.a65
@@ -0,0 +1,4 @@
+
+#define FSIEC_DEVICE "devices/siec_gecko.a65"
+#include "apps/fs/fsiec.a65"
+
diff --git a/dump/oa-2.0.9/arch/gecko/gecko.a65 b/dump/oa-2.0.9/arch/gecko/gecko.a65
new file mode 100644
index 0000000..db0ce71
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/gecko.a65
@@ -0,0 +1,166 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+
+/* These are necessary for Gecko kernel ************************************/
+
+#define NOSYSPORT
+/*#define SYSPORT $7fe0*/ /* if mapped */
+
+#define OSA_CPU "6502"
+#define OSA_ARCH "Gecko"
+
+/* These are changeable ****************************************************/
+
+#define GECKO_CSAEMU /* use CSA 6551 serial... */
+#define DEBUG
+
+#undef STACKCOPY
+
+#define RAMEND $80
+#define MIN_MEM $20
+
+#define CLK2MHZ
+
+#undef CMOSCPU
+
+#define NEED_CHECKCHLD /* this is necessary if using "init" or
+ lib6502 */
+#define NEED_GETINFO
+#define NEED_SLOCK
+#define NEED_RENICE
+
+#define BOOTDRV "c" /* where are the boot files */
+
+#define ROMSTART $8000
+
+/***************************************************************************/
+/* Better not change anything below */
+/* */
+
+#include "kdefs.i65"
+#include "fdefs.i65"
+#include "config.i65"
+#include "kernel.i65"
+
+#define STDIOADDR $e000
+
+/* Semaphore is needed to keep irtx and fsiec from interfering */
+#define SEM_T1 SEM_SERIEC
+
+ .(
+
+/************* ROM entries */
+
+/************* devices */
+
+#include "devices/oadev.a65"
+
+/************* fsdev - converts devices into files */
+
+#define FSDEV_AS_INIT
+#include "sysapps/fs/fsdev.a65"
+
+/************* fsiec - IEEE488/IEC bus filesystem */
+
+#define FSIEC_AS_INIT
+#define FSIEC_DEVICE "devices/siec_gecko.a65"
+#define NOLOOP
+/*
+#define NOFS
+#define INVERT
+#define NOCMD
+*/
+#include "sysapps/fs/fsiec.a65"
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+#define MON_MONDEV 3
+#define MON_MONEXE $83 /* init-like, autostart */
+#define MON_SHDEV 0
+#define MON_SHEXE 0
+#undef SHORTMON
+#undef NOSYSFKT
+#define NOSH
+
+#include "sysapps/mon/mon.a65"
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+#ifdef DEBUG
+
+#define MON_MONDEV 5
+#define MON_MONEXE $83 /* init-like, autostart */
+#define MON_SHDEV 0
+#define MON_SHEXE 0
+#undef SHORTMON
+#undef NOSYSFKT
+#define NOSH
+
+#include "sysapps/mon/mon.a65"
+
+#endif
+
+/************* payload - irtx stereo control menu.. :-) */
+
+#if 0
+
+#define VIA $ec10 /* VIA for irtx */
+#include "sysapps/irtx/irtx.a65"
+
+#endif
+
+/************* end of ROM executables */
+
+ .word -1
+
+/************* lib6502 code */
+
+/* lib6502 jmp table is below STDIOADDR */
+
+#include "lib6502/lib6502.a65"
+
+/*#include "oldlib/stdio.a65"*/
+
+/************* fill not used area (I/O, screens) */
+
+ .dsb $f000-*,<-1
+
+/************* Kernel */
+
+#include "kernel/kernel.a65"
+
+/************* Constants for lib6502 memory handling */
+
+Memstart = $1000
+Memend = ROMSTART
+Zerostart= $60
+
+ .)
+
diff --git a/dump/oa-2.0.9/arch/gecko/gecko.i65 b/dump/oa-2.0.9/arch/gecko/gecko.i65
new file mode 100644
index 0000000..e2011a4
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/gecko.i65
@@ -0,0 +1,3 @@
+
+#include "chips/via6522.i65"
+
diff --git a/dump/oa-2.0.9/arch/gecko/kernel/kenv.a65 b/dump/oa-2.0.9/arch/gecko/kernel/kenv.a65
new file mode 120000
index 0000000..1239cfb
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/kernel/kenv.a65
@@ -0,0 +1 @@
+../../c64/kernel/kenv.a65
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/gecko/kernel/kinit.a65 b/dump/oa-2.0.9/arch/gecko/kernel/kinit.a65
new file mode 100644
index 0000000..e502a49
--- /dev/null
+++ b/dump/oa-2.0.9/arch/gecko/kernel/kinit.a65
@@ -0,0 +1,135 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#define MEMCONFIG
+
+/***************************************************************************
+ *
+ * This file is included in the RESET routine of the kernel,
+ * after the "sei:cld". The routine starting at the bginning
+ * of this file must initialize the hardware to the system RAM
+ * in the beginning and the system ROM in the end of the memory
+ * map. Also the system stack (pointer) is setup.
+ *
+ * In addition to that the system interrupt timer (needed for
+ * task preemtion) must be setup.
+ *
+ * After that the file must define the following macros:
+ *
+ * GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ * LEDPORT address of LED port to signal hardware failures
+ * LED_LED bit of LED bit in LEDPORT address
+ * H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ * the LED toggle routine if needed.
+ * CLRTIMER() clear the system interrupt timer interrupt
+ * KERNELIRQ() returns if an interrupt occured in the kernel
+ * or outside. Is checked by "BNE IRQ_in_Kernel"
+ * SAVEMEM() save system mem config for interrupt
+ * RESTOREMEM() restore system mem config after interrupt
+ * STARTMEM() This is used to alloc/enable memory pages found
+ * during kernel init. Takes mem size in AC as given
+ * by the kernel init. It is called _after_ inimem!
+ */
+
+/* Kernel routines for C64 hardware */
+
+/*
+ * init stack pointer for system stack
+ */
+ ldx #<-1
+ txs
+
+/*
+ * init memory configuration
+ */
+
+/* ... none needed for Gecko */
+
+/*
+ * C64 specific irq timer init, irq every 20ms
+ * We assume that the reset - or a loader program has disabled all irq
+ */
+
+/* ... none for the Gecko - keydev provides us with a preemption irq */
+
+/*
+ * check zeropage RAM, jump to he_zero if failure
+ */
+#include "kernel/zerotest.a65"
+
+/*
+ * check system RAM up to ROMSTART, jump to he_ram if failure
+ * returns available RAM in 256 byte blocks in AC
+ */
+ .zero
+cnt .byt 0
+ .text
+#include "kernel/ramtest.a65"
+
+/*
+ * originally SYSPORT specific, they have a value for the Gecko also...
+ */
+#ifdef CLK2MHZ
+#define GETFREQ() lda #$80
+#else
+#define GETFREQ() lda #$00
+#endif
+
+#define LEDPORT $ec04
+#define LED_LED %00001000
+
+/*
+ * as we have set the CIA1 TB irq in the kernel, we have to clear the
+ * CIA interrupt flag. This is done with reading the ICRegister.
+ * With C64NEEDCIA1 one can disable reading the ICR here. But then you
+ * have to have a device that does it!
+ */
+/* ... none for the gecko - keydev provides the preemption irq */
+
+#define CLRTIMER()
+
+/*
+ * MMU systems may map task pages into kernel mem to make copying
+ * easier. This mapping has to be preserved during interrupt.
+ * SAVEMEM() saves the memory configuration, while RESTOREMEM()
+ * restores it, obviously.
+ * These routines are called _after_ "jsr memsys", so this routine
+ * has to preserve this mapping when called from kernel space,
+ * and so must memtask.
+ */
+
+#undef SAVEMEM
+#define RESTOREMEM()
+
+/*
+ * Check if we have an interrupt in the kernel
+ */
+
+#define KERNELIRQ() lda Syscnt:cmp #1
+
+/*
+ * no memory management...
+ */
+#define STARTMEM()
+
+
diff --git a/dump/oa-2.0.9/arch/pet32k/Makefile b/dump/oa-2.0.9/arch/pet32k/Makefile
new file mode 100644
index 0000000..19522d8
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/Makefile
@@ -0,0 +1,23 @@
+
+TRG=boot/rom
+
+XAINPUT=../../include,..,../..
+XA=xa
+FILE=file65
+RELOC=reloc65
+
+pet ${TRG}:
+ ${XA} -I../../include -I../.. -R -bt 4862 -bd 768 -bz 8 -bb 2432 rom.a65 -o rom.o65 -l rom.lab;
+ ${FILE} rom.o65;
+ ${RELOC} -xt -o ${TRG} rom.o65;
+
+rom2 ${TRG}2:
+ ${XA} -DHAVE_MON -I../../include -I../.. -R -bt 5030 -bd 768 -bz 8 -bb 2656 rom.a65 -o rom.o65 -l rom.lab;
+ ${FILE} rom.o65;
+ ${RELOC} -xt -o ${TRG}2 rom.o65;
+
+clean:
+ rm -f ${TRG} rom.lab rom.o65 boot.tgz
+ (cd boot; ${MAKE} clean;)
+ # (cd apps; ${MAKE} clean;)
+
diff --git a/dump/oa-2.0.9/arch/pet32k/boot/Makefile b/dump/oa-2.0.9/arch/pet32k/boot/Makefile
new file mode 100644
index 0000000..fe04266
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/boot/Makefile
@@ -0,0 +1,56 @@
+
+apps = lsh
+sysapps = mon # slipd
+files = mkdir rmdir rm format chkdsk ls cat mv
+inet = # tlogin telnet httpd
+
+XA=xa
+
+all: rom ${files} ${apps} ${sysapps} ${inet}
+
+rom rom2:
+ (cd ..; ${MAKE} boot/$@;)
+
+clean:
+ rm -f rom rom2 osa.d64 osam.d64 osa.x64
+ rm -f ${files} ${sysapps} ${apps} ${inet}
+ rm -f vice.trace reltest
+
+tar ../boot.tgz: rom loader howto.boot
+ tar czvf ../boot.tgz rom loader howto.boot
+
+##############################################################################
+#
+# d64 emulator disk image + run
+#
+
+osa.d64: ${files} ${sysapps} ${apps} ${inet} rom loader rom2 loaderm
+ ./mkdisk ${files} ${sysapps} ${apps} ${inet} rom loader rom2 loaderm
+ dd if=osa.x64 of=osa.d64 bs=64 skip=1
+ rm osa.x64
+
+emurun: osa.d64
+ xpet -8 osa.d64
+
+##############################################################################
+#
+# lib6502 programs
+#
+
+${apps}:
+ (cd ../../../apps/lsh; make lsh;)
+ (if test ! -r lsh; then ln -s ../../../apps/lsh/lsh lsh; fi)
+
+${sysapps}:
+ (cd ../../../sysapps/$@; make $@;)
+ (if test ! -r $@; then ln -s ../../../sysapps/$@/$@ $@; fi)
+
+${files}:
+ (cd ../../../apps/file; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/file/$@ $@; fi)
+
+${inet}:
+ (cd ../../../apps/inet; make $@;)
+ (if test ! -r $@; then ln -s ../../../apps/inet/$@ $@; fi)
+
+
diff --git a/dump/oa-2.0.9/arch/pet32k/boot/howto.boot b/dump/oa-2.0.9/arch/pet32k/boot/howto.boot
new file mode 100644
index 0000000..e40a827
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/boot/howto.boot
@@ -0,0 +1,13 @@
+
+Howto Boot the GeckOS/A65 on 8x96
+-------------------------------------
+
+1) transfer all files in this directory to a (1541) disk. (osa.d64)
+
+2) put this disk to a CBM2031/CBM4040 or other IEEE488 disk drive
+ connected with to the 8x96.
+
+3) load the file "loader" on the 8x96 and run it
+ After a while the new OS should come up and running
+ (Repeat switches between virtual terminals)
+
diff --git a/dump/oa-2.0.9/arch/pet32k/boot/loader b/dump/oa-2.0.9/arch/pet32k/boot/loader
new file mode 100644
index 0000000..ded4580
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/boot/loader
Binary files differ
diff --git a/dump/oa-2.0.9/arch/pet32k/boot/loader11 b/dump/oa-2.0.9/arch/pet32k/boot/loader11
new file mode 100644
index 0000000..dd018ba
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/boot/loader11
Binary files differ
diff --git a/dump/oa-2.0.9/arch/pet32k/boot/loaderm b/dump/oa-2.0.9/arch/pet32k/boot/loaderm
new file mode 100644
index 0000000..c545c4f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/boot/loaderm
Binary files differ
diff --git a/dump/oa-2.0.9/arch/pet32k/boot/loaderm11 b/dump/oa-2.0.9/arch/pet32k/boot/loaderm11
new file mode 100644
index 0000000..6e5f27f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/boot/loaderm11
Binary files differ
diff --git a/dump/oa-2.0.9/arch/pet32k/boot/mkdisk b/dump/oa-2.0.9/arch/pet32k/boot/mkdisk
new file mode 100755
index 0000000..ddfd9b8
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/boot/mkdisk
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+echo "set tmpfile"
+tmpfile=/tmp/mkdisk.$user.$$
+
+#echo "get files"
+#files=`ls *`
+
+files="$*"
+
+echo "files=$files"
+
+echo "format osa,65 x64 osa.x64" > $tmpfile
+
+for i in $files; do
+ if test "$i" != "mkdisk" -a "$i" != "osa.d64" ; then
+ echo "write $i" >> $tmpfile
+ fi
+done
+
+cat $tmpfile | c1541 > /dev/null
+
+rm -f $tmpfile
+
diff --git a/dump/oa-2.0.9/arch/pet32k/config.i65 b/dump/oa-2.0.9/arch/pet32k/config.i65
new file mode 100644
index 0000000..597aac0
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/config.i65
@@ -0,0 +1,76 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#ifndef _PETCONFIG_
+#define _PETCONFIG_
+
+#echo ******** PET config **********
+
+
+/* StreamData */
+
+#define ANZSTRM 16 /* number of streams */
+
+/* SemaphoreData */
+
+#define ANZSEM 8 /* number of semaphores - multiple of 8 */
+#define SYSSEM 8 /* multiple of 8, no of system semaphores
+ i.e. sems from -SYSSEM to -1 */
+
+/* DeviceData */
+
+#define MAXDEV 16 /* maximum number of devices */
+
+/* EnvData */
+
+#define MAXENVS 1 /* one environment only */
+
+#ifndef STACKCOPY
+#define MAXNTHREADS 5 /* (Stackpage-56)/40 */
+#define MAXNTASKS 5
+#define STACKSIZE 40 /* (TH_SLEN * 5) */
+#else
+#define MAXNTHREADS 12 /* (up to 16 is possible, if enough memory) */
+#define MAXNTASKS 12
+#define STACKSIZE 64 /* (TH_SLEN * 8) */
+#endif
+#define ANZXENV 5 /* number of redirectable task IDs */
+
+/* TaskData */
+
+#define IRQCNT 3 /* default priority for ROM-started tasks */
+
+/* FileManager */
+
+#define MAXFS 4 /* maximum number of fileserver tasks */
+
+/* we don't map any of these memory areas */
+#undef MAP_ZERO
+#undef MAP_STACK
+#undef MAP_MEM
+
+/* graphics keyboard */
+#define PET_KEYB_GRAPHICS
+
+#endif /* _PETCONFIG_ */
+
diff --git a/dump/oa-2.0.9/arch/pet32k/devices/con_pet.a65 b/dump/oa-2.0.9/arch/pet32k/devices/con_pet.a65
new file mode 100644
index 0000000..1486bd4
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/devices/con_pet.a65
@@ -0,0 +1,235 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#define PIO $e810
+#define VIA1 $e840
+#define vdcctrl $e888
+#define vdc $e880
+#define VIDPAGE 4
+
+#define MAX_SCREEN 2 /* hard limit for tables */
+
+#define MAX_ASCREEN #2 /* soft limit */
+
+;#define SWITCHKEY 23
+#define SWITCHKEY 79
+
+#define SET_MMU
+
+#define BELLIRQ jsr bellirq
+
+#define TRIGBELL jsr trigbell
+
+#define MAXSPAL numcols
+
+#define MAXZEIL #25
+;#define MAXZEIL #23 /* debug */
+
+#define KEY_START 16 /* when does key repetition start */
+
+ /* screen# -> hi byte of base address in AC */
+/* #define HI_VID asl:asl:bit freq:bpl l1:asl:l1 clc:adc #VIDPAGE<<4 */
+/* #define HI_VID asl:asl:asl:clc:adc #$90 */
+#define HI_VID
+
+#define ACT_HI_VID .( :\
+ lda screen :\
+ cmp actscr :\
+ beq orig :\
+ lda #$78 :\
+ .byt $2c :\
+orig lda #$80 :\
+ .)
+
+#define SCR_SPACE " " /* screencode space */
+
+ /* ASCII to PET screen code */
+#define ASC2SCR .( :\
+ and #$7f :\
+ cmp #64 :\
+ bcc ok :\
+ beq zero :\
+ cmp #91 :\
+ bcc ok :\
+ cmp #97 :\
+ bcc tab1 :\
+ cmp #123 :\
+ bcs tab2 :\
+ sbc #95 :\
+ bne ok :\
+tab2 tay :\
+ lda ctab2-123,y :\
+ bne ok :\
+tab1 tay :\
+ lda ctab1-91,y :\
+ .byt $2c :\
+zero lda #0 :\
+ok .)
+
+#define SCR2ASC .( :\
+ and #$7f :\
+ beq at :\
+ cmp #27 :\
+ bcs x1 :\
+ adc #96 :\
+ bne ok :\
+x1 cmp #32 :\
+ bcc tab1 :\
+ cmp #91 :\
+ bcc ok :\
+ tay :\
+ lda atab2-91,y :\
+ bcs ok :\
+tab1 tay :\
+ lda atab1-27,y :\
+ .byt $2c :\
+at lda #64 :\
+ok .) :\
+
+&ctab1 .byt 27, 28, 29, 30, 100, 124
+&ctab2 .byt 115, 93, 107, 112, 122
+&atab1 .byt 91, 0, 93, 94, 0
+&atab2 .byt 0,0,124,0,0,0,0,0,0,95,0,0,0,0,0,0,125,0,0,0,0,126,0,0,123
+ .byt 0,0,0,0,0,0,127,0,96,0,0,0
+
+#define DO_IRQ .( :\
+ bit actchange :\
+ bpl ok :\
+ cpy actscr :\
+ bne ok :\
+ ldx zeile :\
+ jsr setzei :\
+ ldy screen :\
+ok .)
+
+ .data
+&actchange .byt 0
+&numcols .byt 0
+ .text
+
+&console_init .(
+ jsr inimem
+ jsr inivid
+ jsr inikbd
+ jsr inicrsr
+ jsr inibell
+ rts
+ .)
+
+inimem .(
+ clc
+ rts
+ .)
+
+&inivid .(
+ lda screen
+ bne ix
+
+ lda #0
+ sta $8000
+ sta $8400
+ inc $8000
+ lda $8400
+ bne col40
+ lda #80
+ .byt $2c
+col40 lda #40
+ sta numcols
+
+ lda PETVIA+VIA_PCR
+ and #%11111111
+ ora #%00001110
+ sta PETVIA+VIA_PCR
+
+/* we assume the CRTC to be initialized...
+ ldx #0
+i1 bit freq
+ lda vdc4tab,x
+ stx vdc
+ sta vdc+1
+ inx
+ cpx #16
+ bcc i1
+*/
+ix
+ rts
+
+/* vdc8tab .byt $7e,$50,$64,6,$29,0,$19,$21,0,7,$60,7,0,0,0,0 */
+
+/* vdc4tab .byt $3f,$28,$32,3,$29,0,$19,$21,0,7,$60,7,0,0,0,0 */
+
+ .)
+
+&setact .(
+
+scrbuf =$7800
+
+ .zero
+p1 .word 0
+p2 .word 0
+ .text
+
+ cpx actscr
+ bne doit
+ rts
+doit
+ sec
+ ror actchange
+
+ lda #0
+ sta p1
+ sta p2
+ lda #$78
+ sta p1+1
+ lda #$80
+ sta p2+1
+
+ lda numcols
+ cmp #40
+ beq dohalf
+ ldx #8
+ .byt $2c
+dohalf ldx #4
+
+ ldy #0
+cp1 lda (p2),y
+ pha
+ lda (p1),y
+ sta (p2),y
+ pla
+ sta (p1),y
+ iny
+ bne cp1
+ inc p2+1
+ inc p1+1
+ dex
+ bne cp1
+
+ ldx zeile
+ jmp setzei
+
+ .)
+
+#include "devices/kbd_pet.a65"
+
+
diff --git a/dump/oa-2.0.9/arch/pet32k/devices/devices.a65 b/dump/oa-2.0.9/arch/pet32k/devices/devices.a65
new file mode 100644
index 0000000..d45a6d5
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/devices/devices.a65
@@ -0,0 +1,71 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef ROM
+
+#include "kdefs.def"
+#include "kernel.i65"
+
+ ;.word $700
+ *=$700
+
+/*#define NOPRG*/
+
+#endif
+
+
+/* Device-Block */
+
+ .(
+
+#ifdef ROM
+ .word endd
+ .byt PK_DEV+$80
+ .word devstart
+ .dsb P_NAME - P_RAM, $ff
+ .asc "devices",0
+#else
+#ifndef NOPRG
+ .word 0
+ .byt PK_DEV
+ .byt 0
+ .word 0
+ .word devstart
+ .byt 0,0,<-1
+#endif
+#endif
+
+devstart
+
+
+#define CONSOLE_DEVICE "devices/con_pet.a65"
+#include "devices/console.a65" ; video device is merged with OS/A now...
+
+#include "devices/nulldev.a65" ; null device
+#include "devices/spooler.a65" ; spooler device
+
+ .word $ffff
+
+endd .)
+
diff --git a/dump/oa-2.0.9/arch/pet32k/devices/kbd_pet.a65 b/dump/oa-2.0.9/arch/pet32k/devices/kbd_pet.a65
new file mode 120000
index 0000000..afae968
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/devices/kbd_pet.a65
@@ -0,0 +1 @@
+../../cbm8x96/devices/kbd_pet.a65
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/pet32k/devices/piec_pet.a65 b/dump/oa-2.0.9/arch/pet32k/devices/piec_pet.a65
new file mode 120000
index 0000000..cd8b6d7
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/devices/piec_pet.a65
@@ -0,0 +1 @@
+../../cbm8x96/devices/piec_pet.a65
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/pet32k/kernel/kenv.a65 b/dump/oa-2.0.9/arch/pet32k/kernel/kenv.a65
new file mode 100644
index 0000000..418405d
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/kernel/kenv.a65
@@ -0,0 +1,424 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/* TODO: make stack addr computation a table lookup, which is faster */
+
+/* Struct Task Environment Entry */
+
+/* we have three structs now:
+ * TE_* for task environment handling - not needed for system without
+ * memory management
+ * TT_* task table, contains STD streams, etc
+ * TH_* thread table, has stack info and state
+ */
+
+#define TE_SLEN 0 /* we don't have envs */
+
+/************************************************************************
+ * These routines are needed in the env section!
+ * inienv
+ * setthread
+ * initsp
+ * push
+ * pull
+ * memtask
+ * memsys
+ *
+ * sbrk
+ * getenv
+ * freenv
+ */
+
+&&enmem = notimp ; to enable memory blocks to the kernel
+&&setblk = notimp ; to set memory blocks in MMU mapping
+
+#ifdef STACKCOPY
+ .zero
+zp .word 0
+
+ .data
+
+Stacks .dsb MAXNTHREADS * STACKSIZE
+
+ .text
+#endif
+
+
+&inienv .(
+ lda #<-1
+ sta actThread
+ sta actTask
+ lda #1
+ sta Syscnt
+ clc
+ rts
+ .)
+
+setthread .(
+ .data
+newThread .byt 0
+ .text
+
+ cmp actThread
+ bne doit
+ rts
+doit
+ sta newThread
+
+ ldx actThread
+ cpx #<-1
+ beq nosave
+
+ lda THREADSAVE
+ sta threadTab + TH_LIBSAVE,x
+ lda THREADSAVE+1
+ sta threadTab + TH_LIBSAVE+1,x
+
+#ifdef STACKCOPY
+ txa ; stack is 8 * TH_SLEN = 64
+ ldy #0
+ sty zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ clc
+ adc #Stacks
+ adc zp+1
+ sta zp+1
+ ;bcc l1
+ ;inc zp+1
+;l1
+ lda threadTab + TH_SP,x
+ tay
+ iny
+l2 cpy #STACKSIZE
+ bcs savetask
+ lda $100,y
+ sta (zp),y
+ iny
+ bne l2
+#endif
+savetask
+ ldy threadTab + TH_TASK,x
+ lda TASKSAVE
+ sta taskTab + TT_LIBSAVE,y
+ lda TASKSAVE + 1
+ sta taskTab + TT_LIBSAVE + 1,y
+nosave
+loadtask
+ ldx newThread
+ stx actThread
+ cpx #<-1
+ bne load
+ stx actTask
+ beq noload
+load
+ ldy threadTab + TH_TASK,x
+ sty actTask
+
+ lda taskTab + TT_LIBSAVE,y
+ sta TASKSAVE
+ lda taskTab + TT_LIBSAVE + 1,y
+ sta TASKSAVE + 1
+
+loadthread
+ lda threadTab + TH_LIBSAVE,x
+ sta THREADSAVE
+ lda threadTab + TH_LIBSAVE+1,x
+ sta THREADSAVE+1
+
+#ifdef STACKCOPY
+ txa
+ ldy #0
+ sty zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ asl
+ rol zp+1
+ clc
+ adc #Stacks
+ adc zp+1
+ sta zp+1
+ ;bcc l3
+ ;inc zp+1
+;l3
+ lda threadTab + TH_SP,x
+ tay
+ iny
+l4 cpy #STACKSIZE
+ bcs endset
+ lda (zp),y
+ sta $100,y
+ iny
+ bne l4
+#endif
+noload
+endset rts
+ .)
+
+initsp .(
+#ifdef STACKCOPY
+ lda #STACKSIZE-1
+ ;ldx actThread
+ sta threadTab + TH_SP,x
+ rts
+#else
+ .data
+divsp .byt 0
+ .text
+
+ ;ldx actThread
+ txa
+ clc
+ adc #TH_SLEN
+ sta divsp
+ asl
+ asl ; split stack
+ clc
+ adc divsp
+ sta threadTab + TH_SP,x
+ dec threadTab + TH_SP,x
+ rts
+#endif
+ .)
+
+pull .(
+ ldx actThread
+ inc threadTab + TH_SP,x
+ lda threadTab + TH_SP,x
+ tay
+ lda $0100,y
+ rts
+ .)
+
+&push .(
+ pha
+ ldx actThread
+ lda threadTab + TH_SP,x
+ tay
+ pla
+ sta $0100,y
+ dec threadTab + TH_SP,x
+ rts
+ .)
+
+ .(
+ .zero
+AC .byt 0
+XR .byt 0
+YR .byt 0
+SR .byt 0
+ADR .word 0
+&SSP .byt 0
+ .text
+
+/*
+ * this one is used to return from an interrupt. We do not need to save
+ * any registers. so for brevity, we do it as macro
+ * This doesn't check for interrupted devices, as we do not have them
+ * without MMU (so far).
+ */
+
+#define MEMTASK2() \
+ .( :\
+ sei :\
+ dec Syscnt :\
+ bne mtask :\
+ tsx :\
+ stx SSP :\
+; ldy actTask :\
+; ldx taskTab+TT_ENV,y :\
+; beq system :\
+; ldx #%10001100 :\
+; stx $fff0 :\
+;system :\
+ ldy actThread :\
+ ldx threadTab+TH_SP,y :\
+ txs :\
+mtask .)
+
+/*
+ * This is the standard return to user space. the kernel jumps here,
+ * so we need not save any return address, but use the one on the
+ * user stack.
+ */
+&&memtask .(
+ php
+ sei
+ dec Syscnt ; wieder in Task
+ bne mtask ; nein dann Ende
+
+ bit adev ; Ruecksprung in Device
+ bpl mtask ; ja dann Ende
+
+ sty YR ; sonst Task-Env setzen
+ stx XR
+ sta AC
+ pla ; SR
+
+ tsx
+ stx SSP
+
+ ldy actThread
+ ldx threadTab+TH_SP,y
+ txs
+
+; ldy actTask
+; ldx taskTab+TT_ENV,y
+; beq system
+; ldx #%10001100 ; map alternate 8x96 memory bank
+; stx $fff0
+;system
+
+ pha ; SR
+ lda AC
+ ldy YR
+ ldx XR
+mtask
+ plp
+ rts
+ .)
+
+/*
+ * This is the kernel entry routine. It leaves all registers as they
+ * are, except for the stack pointer, which is set to the system stack.
+ * also the return address is moved from user stack to system stack,
+ * to allow "JSR"-ing to memsys.
+ */
+&&memsys php
+ sei
+ pha
+
+; lda #%11100000 ; map system memory
+; sta $fff0
+
+ lda Syscnt
+ inc Syscnt
+ cmp #0
+ bne mse
+ bit adev ; called by device
+ bmi msys ; no then save stack
+mse pla
+ plp
+ rts
+
+msys pla
+ sta AC
+ pla
+ sta SR
+ stx XR
+ ; sty YR
+ pla
+ sta ADR
+ pla
+ sta ADR+1
+ tsx
+
+ txa
+ ldx actThread
+ sta threadTab+TH_SP,x
+ ldx SSP
+ txs
+ lda ADR+1
+ pha
+ lda ADR
+ pha
+ lda SR
+ pha
+ lda AC
+ ldx XR
+ ; ldy YR
+ plp
+ cld
+ rts
+ .)
+
+
+&&sbrk .(
+ bcc ok
+ sec
+ lda #E_NOMEM
+ rts
+ok lda #>ROMSTART ; return available memory
+ clc
+ rts
+ .)
+
+kgetenv .(
+ ldx #0
+; tya
+; bne system
+; inx
+system
+ clc
+ rts
+ .)
+
+freenv .(
+ clc
+ rts
+ .)
+
+/*
+ * MAPSYSBUF() maps the PCBUF of the active task into the system memory
+ * at address SYSBUF. It's not needed in a C64...
+ */
+#undef MAPSYSBUF
+#define SYSBUF $200
+
+/*
+ * MAPENV() maps the address given in a/y in env x to somewhere in the
+ * kernel map. returns mapped address in a/y
+ * MAPAENV() does the same but for the actual task (env)
+ */
+#define MAPENV()
+#define MAPAENV()
+
+
+/*
+ * needed for GETINFO, gives RAM available for task
+ */
+#define GETTASKMEM lda #>ROMSTART
+
+/*
+ * copy routines for SEND/RECEIVE and FORK
+ */
+#undef CPPCBUFRX
+#undef CPPCBUFTX
+#define CPFORKBUF()
+
+/*
+ * needed in device code to get active environment in AC
+ */
+#define GETACTENV() lda #<-1
+
+
diff --git a/dump/oa-2.0.9/arch/pet32k/kernel/kinit.a65 b/dump/oa-2.0.9/arch/pet32k/kernel/kinit.a65
new file mode 100644
index 0000000..0bb9bcc
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/kernel/kinit.a65
@@ -0,0 +1,142 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * This file is included in the RESET routine of the kernel,
+ * after the "sei:cld". The routine starting at the bginning
+ * of this file must initialize the hardware to the system RAM
+ * in the beginning and the system ROM in the end of the memory
+ * map. Also the system stack (pointer) is setup.
+ *
+ * In addition to that the system interrupt timer (needed for
+ * task preemtion) must be setup.
+ *
+ * After that the file must define the following macros:
+ *
+ * GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ * LEDPORT address of LED port to signal hardware failures
+ * LED_LED bit of LED bit in LEDPORT address
+ * H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ * the LED toggle routine if needed.
+ * CLRTIMER() clear the system interrupt timer interrupt
+ * KERNELIRQ() returns if an interrupt occured in the kernel
+ * or outside. Is checked by "BNE IRQ_in_Kernel"
+ * SAVEMEM() save system mem config for interrupt
+ * RESTOREMEM() restore system mem config after interrupt
+ * STARTMEM() This is used to alloc/enable memory pages found
+ * during kernel init. Takes mem size in AC as given
+ * by the kernel init. It is called _after_ inimem!
+ */
+
+/* Kernel routines for C64 hardware */
+
+/*
+ * init stack pointer for system stack
+ */
+ ldx #<-1
+ txs
+
+/*
+ * check zeropage RAM, jump to he_zero if failure
+ * clears zeropage - at least 2-7 is a _must_!
+ */
+#include "kernel/zerotest.a65"
+
+/*
+ * init memory configuration - set IRQ vector on 32k PETs
+ * (must be after zerotest... )
+ */
+ lda #petirqjmp
+ sta $91
+ lda #petbrkjmp
+ sta $93
+
+/*
+ * C64 specific irq timer init, irq every 20ms
+ * We assume that the reset - or a loader program has disabled all irq
+ */
+
+ lda #%00000001 ; enable PIA1 CB1 screen retrace timer
+ sta PETPIA1+PIA_CRA
+
+
+/*
+ * check system RAM from RAMSTAT up to RAMEND, jump to he_ram if failure
+ * returns available RAM in 256 byte blocks in AC
+ */
+#if 0 /* we don't need it - assume normal boot did it already */
+ .zero
+cnt .byt 0
+ .text
+#include "kernel/ramtest.a65"
+ cmp #MIN_MEM
+ bcs ok
+ lda #0
+ sta $fff0
+ jmp ($fffc)
+ok
+#endif
+
+/*
+ * originally SYSPORT specific, they have a value for the C64 also...
+ */
+#define GETFREQ() lda #0
+
+#undef LEDPORT
+#undef LED_LED
+
+/*
+ * We have to clear the interrupt timer
+ */
+
+#define CLRTIMER() lda PETPIA1+PIA_PA
+
+/*
+ * MMU systems may map task pages into kernel mem to make copying
+ * easier. This mapping has to be preserved during interrupt.
+ * SAVEMEM() saves the memory configuration, while RESTOREMEM()
+ * restores it, obviously.
+ * These routines are called _after_ "jsr memsys", so this routine
+ * has to preserve this mapping when called from kernel space,
+ * and so must memtask.
+ */
+
+#undef SAVEMEM
+#undef RESTOREMEM
+
+/*
+ * Check if we have an interrupt in the kernel
+ */
+
+#define KERNELIRQ() lda Syscnt:cmp #1
+
+/*
+ * no memory management...
+ */
+#define STARTMEM()
+
diff --git a/dump/oa-2.0.9/arch/pet32k/petdef.i65 b/dump/oa-2.0.9/arch/pet32k/petdef.i65
new file mode 100644
index 0000000..2fe226b
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/petdef.i65
@@ -0,0 +1,34 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * These are the C64 specific defines
+ */
+
+#define PETPIA1 $e810
+#define PETPIA2 $e820
+#define PETVIA $e840
+
+#include "chips/pia6521.i65"
+#include "chips/via6522.i65"
+
diff --git a/dump/oa-2.0.9/arch/pet32k/rom.a65 b/dump/oa-2.0.9/arch/pet32k/rom.a65
new file mode 100644
index 0000000..fe63f37
--- /dev/null
+++ b/dump/oa-2.0.9/arch/pet32k/rom.a65
@@ -0,0 +1,190 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+#undef EMUTEST
+
+/* These are necessary for PET kernel **************************************/
+
+#define NOMMU
+#define NOSYSPORT
+#undef CLK2MHZ /* we only have approx. 1 MHz ... */
+#undef CMOSCPU /* ... and no CMOS cpu */
+#define VIDPAGE 8
+#undef SHORTLINE /* prepare for 80 col screen */
+
+#undef NMIDEV /* there is no NMI in the PET machine */
+#define EOK_NOFILL /* do not fill kernel to end of mem */
+
+#undef PET_KEYB_GRAPHICS /* en business keyboard is default */
+
+#define OSA_CPU "6502"
+#define OSA_ARCH "PET32K"
+
+/* These are changeable ****************************************************/
+
+#ifdef HAVE_MON
+#define ROMSTART $13ab /* where the ROM starts */
+#else
+#define ROMSTART $1303 /* where the ROM starts */
+#endif
+
+#define STACKCOPY /* if defined, save stack area in memory
+ when context switching, otherwise divide
+ stack area and give each task a part.
+ It's faster without, but allows more
+ tasks with */
+
+#define NEED_CHECKCHLD /* this is necessary if using "init" or
+ lib6502 */
+#define NEED_GETINFO
+#define NEED_SLOCK
+#define NEED_RENICE
+
+#define BOOTDRV "b" /* where are the boot files */
+
+#define ROOTPATH "b:" /* where lsh chdirs into on boot */
+
+
+/***************************************************************************
+ *
+ * Here comes the ROM content
+ */
+
+#include "config.i65"
+#include "kdefs.i65"
+#include "fdefs.i65"
+#include "petdef.i65"
+
+#include "kernel.i65"
+
+#define SEM_VIAE840_T1 SEM_SERIEC
+#undef SEM_SERIEC
+#undef SEM_PARIEC
+
+ .word *+2 /* load address */
+ jmp RESET
+ ; ROMSTART is here!
+.(
+
+/************* ROM entries */
+
+/************* devices */
+
+#include "devices/devices.a65"
+
+/************* init process */
+
+
+#define INIT_VERBOSE
+#define INIT_RESTART
+#define INIT_MERGE
+#define INIT_LIB6502
+/* #define INIT_USE_STDLIB */
+/* #define INIT_OUTDEV 2*/
+#include "sysapps/init/init.a65"
+
+
+/************* fsdev - converts devices into files */
+
+#define FSDEV_NOROM
+#include "sysapps/fs/fsdev.a65"
+
+
+/************* fsiec - IEEE488/IEC bus filesystem */
+
+/* both, the parallel and serial iec bus use the same timer */
+#define SEM_CIA2TB SEM_SERIEC
+#undef SEM_PARIEC
+#undef SEM_SERIEC
+
+#define NOLOOP
+#define FSIEC_DEVICE "devices/piec_pet.a65"
+#include "sysapps/fs/fsiec.a65"
+#undef FSIEC_DEVICE
+#print *
+
+
+/************* mon - OS/A 1 old style monitor/shell */
+
+#ifdef HAVE_MON
+
+#define MON_SHEXE $c0 /* executable flag -> autostart+restart*/
+/*#define MON_SHEXE $83*/ /* executable flag -> init process+autostart*/
+#define MON_MONEXE 0 /* ROM executable flag */
+#define MON_SHDEV 1 /* start on device 0 = video1 */
+#define SHORTMON /* no assembler/disassembler */
+#define NOSH
+#include "sysapps/mon/mon.a65"
+
+#endif
+
+/************* boot lsh from BOOTDRV */
+
+#if 1
+ /* add autostart of lib6502 program 'lsh' */
+
+ .(
+ .word end_auto
+ .byt PK_LIB+PK_AUTOEXEC+PK_RESTART ; is lib6502 program
+ .word 0 ; P_ADDR ignored
+ .byt 16 ; P_RAM
+ .byt 128 ; P_SHARED
+ .byt 0 ; P_PRIORITY
+ .byt 0,0 ; P_DEV
+ .byt BOOTDRV,":lsh",0,"-v", 0, "-d", 0,ROOTPATH,0,0
+end_auto
+ .)
+
+#endif
+
+/************* end of ROM executables */
+
+ .word -1
+
+/************* lib6502 code */
+
+#define LIB6502_NONET
+#include "lib6502/lib6502.a65"
+
+/************* Kernel */
+
+#include "kernel\kernel.a65"
+
+/************* Constants for lib6502 memory handling */
+
+#ifdef HAVE_MON
+Memstart =$6400
+#else
+Memstart =$5440
+#endif
+Memend =$7800
+Zerostart =$94 /* PET ROM irq vectors at $90-$93 */
+
+.)
+
diff --git a/dump/oa-2.0.9/arch/proto/Makefile b/dump/oa-2.0.9/arch/proto/Makefile
new file mode 100644
index 0000000..3360ef9
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/Makefile
@@ -0,0 +1,19 @@
+
+TRG=boot/rom
+
+XAINPUT=../../include,..,../..
+XA=XAINPUT=${XAINPUT} xa
+FILE=file65
+RELOC=reloc65
+
+rom ${TRG}:
+ ${XA} -R -bt 32766 -bd 768 -bz 8 -bb 2560 rom.a65 -o rom.o65 -l rom.lab ;
+ ${FILE} rom.o65;
+ ${RELOC} -xt -o ${TRG} rom.o65;
+
+
+clean:
+ rm -f ${TRG} rom.lab rom.o65 boot.tgz
+ (cd boot; ${MAKE} clean;)
+ # (cd apps; ${MAKE} clean;)
+
diff --git a/dump/oa-2.0.9/arch/proto/boot/Makefile b/dump/oa-2.0.9/arch/proto/boot/Makefile
new file mode 100644
index 0000000..bd8b636
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/boot/Makefile
@@ -0,0 +1,12 @@
+
+XA=xa
+
+all: rom
+
+rom:
+ (cd ..; ${MAKE};)
+
+clean:
+ rm -f rom
+
+
diff --git a/dump/oa-2.0.9/arch/proto/config.i65 b/dump/oa-2.0.9/arch/proto/config.i65
new file mode 100644
index 0000000..8e6656f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/config.i65
@@ -0,0 +1,71 @@
+/****************************************************************************
+
+ OS/A65 Version 1.4.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1997 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+#echo ******** c64 config **********
+
+
+#ifndef ANZSTR
+
+/* StreamData */
+
+#define ANZSTRM 8
+
+/* SemaphoreData */
+
+#define ANZSEM 8 /* vielfaches von 8 */
+#define SYSSEM 8 /* vielfaches von 8, sem-nr von -SYSSEM bis -1 */
+
+/* DeviceData */
+
+#define MAXDEV 16
+
+/* EnvData */
+
+#define MAXENVS 1 /* one environment only */
+
+#ifndef STACKCOPY
+#define MAXNTHREADS 5 /* (Stackpage-56)/40 */
+#define MAXNTASKS 5
+#define STACKSIZE 40 /* (TH_SLEN * 5) */
+#else
+#define MAXNTHREADS 8 /* (up to 16 is possible, if enough memory) */
+#define MAXNTASKS 5
+#define STACKSIZE 64 /* (TH_SLEN * 8) */
+#endif
+#define ANZXENV 5 /* number of redirectable task IDs */
+
+/* TaskData */
+
+#define IRQCNT 3
+
+/* FileManager */
+
+#define MAXFS 4
+
+/* we don't map any of these memory areas */
+#undef MAP_ZERO
+#undef MAP_STACK
+#undef MAP_MEM
+
+#endif
+
diff --git a/dump/oa-2.0.9/arch/proto/devices/oa1std.a65 b/dump/oa-2.0.9/arch/proto/devices/oa1std.a65
new file mode 100644
index 0000000..729127e
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/devices/oa1std.a65
@@ -0,0 +1,297 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/**************************************************************************/
+/* */
+/* Standard-Device-Programm zur einfachen Erstellung einer anderen Device */
+/* */
+/**************************************************************************/
+
+ .(
+ .word devend
+ jmp prg1
+ .asc "name",0
+
+ .data
+status .byt 0
+instr .byt 0
+outstr .byt 0
+ .text
+
+prg1 cmp #DC_RES
+ beq devini
+
+ pha
+ lda status
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini lda #0
+ sta status
+ sta instr
+ sta outstr
+
+/************************ Reset ************************************/
+
+/******* go on here, or on error go to devx ************************/
+
+rts1hi
+
+/***************** here if stream over highwatermark ***************/
+
+/*******************************************************************/
+
+ clc
+ rts
+
+devx lda status
+ ora #2
+ sta status
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq .(
+
+/********************* is IRQ for device? no, then irqend **********/
+
+/************************ here if irq for device *******************/
+
+ lda status
+ bpl tx
+
+/**** receive byte to ac, no byte then nobyt ***********************/
+
+/*******************************************************************/
+
+ ldx outstr
+ jsr PUTC
+ bcs test
+
+nobyt ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+
+tstwater cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh jsr rts1hi
+ bcc tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+
+wl
+/******** here if stream below lowwatermark ************************/
+
+/*******************************************************************/
+
+tx lda status
+ rol
+ bpl irqhs
+
+/******* hardware ready to send? if not then irqhs *****************/
+
+/*******************************************************************/
+
+ ldx instr
+ jsr GETC
+ bcs test2
+
+/***************** send byte ***************************************/
+
+/*******************************************************************/
+
+ jmp irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs
+
+/**************** remove IRQ and clean up **************************/
+
+/*******************************************************************/
+
+ lda #E_OK ; interrupt source removed
+ rts
+irqend
+ lda #E_NOIRQ ; no interrupt source removed
+ rts
+
+ .)
+
+others cmp #DC_GS
+ bne o1
+ lda status
+ and #DC_SW_TX
+ bne devonx
+ sty instr
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS
+ bne o2
+ lda status
+ and #DC_SW_RX
+ bne devonx
+ sty outstr
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+
+/********************* check if receive possible ******************/
+
+/************************ if not then onotimp *********************/
+
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+
+/********************* check if send possible ********************/
+
+/************************ if not then onotimp ********************/
+
+ lda #DC_SW_TX
+o2a ora status
+ sta status
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+
+rxoff lda status
+ and #DC_SW_RX
+ beq devoffx
+ ldx outstr
+ lda #SC_EOF
+ jsr STRCMD
+ lda status
+ and #255-DC_SW_RX
+ sta status
+ jsr rts1hi
+ bcc okx
+devoffx jmp devoff
+o5 cmp #DC_TX_OFF
+ bne o6
+
+txoff lda status
+ and #DC_SW_TX
+ beq devoffx
+ ldx instr
+ lda #SC_NUL
+ jsr STRCMD
+ lda status
+ and #255-DC_SW_TX
+ sta status
+ jmp ok
+
+o6 cmp #DC_HS
+ bne o6a
+
+/******************** here Handshake ************************/
+
+ lda status
+ and #255-1
+ sta status
+ tya
+ and #1
+ ora status
+ sta status
+
+/***********************************************************/
+
+ jmp ok
+
+o6a cmp #DC_SPD
+ bne o7
+
+/****************** here speed *****************************/
+
+/***********************************************************/
+
+ jmp ok
+
+o7 cmp #DC_ST
+ bne o8
+
+ lda status
+ and #2
+ bne onotimp
+
+/****************** here state request *********************/
+
+/***********************************************************/
+
+ jmp ok
+
+o8 cmp #DC_EXIT
+ bne onotimp
+ jsr rxoff
+ jsr txoff
+ lda status
+ ora #2
+ sta status
+
+/****************** disable device ************************/
+
+/*********************************************************************/
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+/******************** subprograms, includes, etc *********************/
+
+/*********************************************************************/
+
+devend .)
+
diff --git a/dump/oa-2.0.9/arch/proto/devices/oa1stds.a65 b/dump/oa-2.0.9/arch/proto/devices/oa1stds.a65
new file mode 100644
index 0000000..2ead320
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/devices/oa1stds.a65
@@ -0,0 +1,330 @@
+/****************************************************************************
+
+ OS/A65 Version 1.3.3
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/**************************************************************************/
+/* */
+/* Standard-Device-Programm zur einfachen Erstellung von anderen Devices */
+/* */
+/**************************************************************************/
+
+#define Anzdev 1
+
+ .(
+ .word devend
+ jmp prg1
+ .asc "name1",0
+/*
+devend1 .word devend
+ jmp prg2
+ .asc "name2",0
+*/
+dev =sysmem
+status =sysmem+1
+instr =sysmem+Anzdev+1
+outstr =sysmem+Anzdev*2+1
+-sysmem +=Anzdev*3+1
+
+prg1 ldx #0
+/*
+ .byt $2c
+prg2 ldx #1
+*/
+ stx dev
+ cmp #DC_RES
+ beq devini
+
+ pha
+ lda status,x
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini lda #0
+ sta status,x
+ sta instr,x
+ sta outstr,x
+
+/************************ Reset ************************************/
+
+/******* hier weiter oder bei Fehler devx **************************/
+
+rts1hi
+
+/***************** hier falls Stream �ber highwatermark ************/
+
+/*******************************************************************/
+
+ clc
+ rts
+
+devx ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq .(
+ ldx dev
+
+/********************* ist irq f�r device? nein dann irqend **********/
+
+/************************ hier falls irq f�r device ******************/
+
+ ldx dev
+ lda status,x
+ bpl tx
+
+/**** Byte empfangen in ac, kein Byte dann nobyt *********************/
+
+/*********************************************************************/
+
+ pha
+ ldx dev
+ lda outstr,x
+ tax
+ pla
+ jsr PUTC
+ bcs test
+
+nobyt ldx dev
+ lda outstr,x
+ tax
+ lda #SC_STAT
+ jsr STRCMD
+
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+
+tstwater cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh jsr rts1hi
+ bcc tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+
+wl
+/******** hier Aktion falls Stream unter Lowwatermark ****************/
+
+/*********************************************************************/
+
+tx ldx dev
+ lda status,x
+ rol
+ bpl irqhs
+
+/******* Hardware sendebereit? falls nicht irqhs ********************/
+
+/*********************************************************************/
+
+ ldx dev
+ lda instr
+ tax
+ jsr GETC
+ bcs test2
+
+/***************** Byte senden **************************************/
+
+/********************************************************************/
+
+ jmp irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs
+
+/**************** Irq l�schen oder so am Ende des Device-Irqs ******/
+
+/*******************************************************************/
+
+ lda #E_OK ; interrupt source removed
+ rts
+
+irqend lda #E_NOIRQ ; no interrupt source removed
+ rts
+
+ .)
+
+others cmp #DC_GS
+ bne o1
+ lda status,x
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr,x
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS
+ bne o2
+ lda status,x
+ and #DC_SW_RX
+ bne devonx
+ tya
+ sta outstr,x
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+
+/********************* hier test, ob Receive erlaubt **************/
+
+/************************ falls nicht onotimp *********************/
+
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+
+/********************* hier test, ob send erlaubt *****************/
+
+/************************ falls nicht onotimp *********************/
+
+ lda #DC_SW_TX
+o2a ora status,x
+ sta status,x
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+
+rxoff ldx dev
+ lda status,x
+ and #DC_SW_RX
+ beq devoffx
+ lda outstr,x
+ tax
+ lda #SC_EOF
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_RX
+ sta status,x
+ jsr rts1hi
+ bcc okx
+devoffx jmp devoff
+o5 cmp #DC_TX_OFF
+ bne o6
+
+txoff ldx dev
+ lda status,x
+ and #DC_SW_TX
+ beq devoffx
+ lda instr,x
+ tax
+ lda #SC_NUL
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_TX
+ sta status,x
+ jmp ok
+
+o6 cmp #DC_HS
+ bne o6a
+
+/******************** hier Handshake ************************/
+
+ lda status,x
+ and #255-1
+ sta status,x
+ tya
+ and #1
+ ora status,x
+ sta status,x
+
+/***********************************************************/
+
+ jmp ok
+
+o6a cmp #DC_SPD
+ bne o7
+
+/****************** hier Geschwindigkeit *******************/
+
+/***********************************************************/
+
+ jmp ok
+
+o7 cmp #DC_ST
+ bne o8
+
+ lda status,x
+ and #2
+ bne onotimp
+
+/****************** hier Statusabfrage *********************/
+
+/***********************************************************/
+
+ jmp ok
+
+o8 cmp #DC_EXIT
+ bne onotimp
+ jsr rxoff
+ jsr txoff
+ ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+
+/****************** hier Irq abschalten (Exit) ***********************/
+
+/*********************************************************************/
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+/******************** hier Unterprogramme, includes etc **************/
+
+/*********************************************************************/
+
+devend .)
+
diff --git a/dump/oa-2.0.9/arch/proto/devices/romdev.a65 b/dump/oa-2.0.9/arch/proto/devices/romdev.a65
new file mode 100644
index 0000000..54b097f
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/devices/romdev.a65
@@ -0,0 +1,87 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#ifndef ROM
+
+#include "kdefs.def"
+#include "kernel.i65"
+
+ ;.word $700
+ *=$700
+
+#endif
+
+
+/* Device-Block */
+
+ .(
+
+#ifdef ROM
+ .word endd
+ .byt PK_DEV+$80
+ .word devstart
+ .dsb P_NAME - P_RAM, $ff
+ .asc "devices",0
+#else
+/* Note: this is obsolete! */
+#ifndef NOPRG
+ .word 0
+ .byt PK_DEV
+ .byt 0
+ .word 0
+ .word devstart
+ .byt 0,0,<-1
+#endif
+#endif
+
+devstart
+
+-sernr = "1"
+
+/*
+
+#define CONSOLE_DEVICE "devices/con_c64.a65"
+#include "devices/console.a65" ; video device is merged with OS/A now...
+
+#include "devices/oa1dnl.a65" ; null device
+#include "devices/oa1dsp.a65" ; spooler device
+#include "devices/ser_9600.a65" ; fast serial interface by Daniel Dallmann
+
+#ifdef UARTBASE
+#include "devices/ser_uart.a65" ; standard UART 16550A driver
+#endif
+
+*/
+
+#include "devices/oa1std.a65"
+
+ .word $ffff
+
+#if 0
+#print sysmem
+#print syszp
+#endif
+
+endd .)
+
diff --git a/dump/oa-2.0.9/arch/proto/kernel/kenv.a65 b/dump/oa-2.0.9/arch/proto/kernel/kenv.a65
new file mode 120000
index 0000000..1239cfb
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/kernel/kenv.a65
@@ -0,0 +1 @@
+../../c64/kernel/kenv.a65
\ No newline at end of file
diff --git a/dump/oa-2.0.9/arch/proto/kernel/kinit.a65 b/dump/oa-2.0.9/arch/proto/kernel/kinit.a65
new file mode 100644
index 0000000..8eda2b0
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/kernel/kinit.a65
@@ -0,0 +1,138 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/***************************************************************************
+ *
+ * This file is included in the RESET routine of the kernel,
+ * after the "sei:cld". The routine starting at the bginning
+ * of this file must initialize the hardware to the system RAM
+ * in the beginning and the system ROM in the end of the memory
+ * map. Also the system stack (pointer) is setup.
+ *
+ * In addition to that the system interrupt timer (needed for
+ * task preemtion) must be setup.
+ *
+ * After that the file must define the following macros:
+ *
+ * GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ * LEDPORT address of LED port to signal hardware failures
+ * LED_LED bit of LED bit in LEDPORT address
+ * H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ * the LED toggle routine if needed.
+ * CLRTIMER() clear the system interrupt timer interrupt
+ * KERNELIRQ() returns if an interrupt occured in the kernel
+ * or outside. Is checked by "BNE IRQ_in_Kernel"
+ * SAVEMEM() save system mem config for interrupt
+ * RESTOREMEM() restore system mem config after interrupt
+ * STARTMEM() This is used to alloc/enable memory pages found
+ * during kernel init. Takes mem size in AC as given
+ * by the kernel init. It is called _after_ inimem!
+ */
+
+/* Kernel routines for ??? hardware */
+
+/*
+ * init stack pointer for system stack
+ */
+ ldx #<-1
+ txs
+
+/*
+ * init memory configuration
+ */
+/*
+ lda #7
+ sta 0 /* CPU data direction register */
+ lda #5
+ sta 1 /* Memory configuration */
+*/
+/*
+ * C64 specific irq timer init, irq every 20ms
+ * We assume that the reset - or a loader program has disabled all irq
+ */
+/*
+ lda #<20000
+ sta C64CIA1+CIA_TBL ; load low byte
+ lda #>20000
+ sta C64CIA1+CIA_TBH ; load hi byte of counter value
+ lda #%00010001
+ sta C64CIA1+CIA_CRB ; start counter, counting system pulses
+ lda #%10000010
+ sta C64CIA1+CIA_ICR ; allow irq
+*/
+/*
+ * check zeropage RAM, jump to he_zero if failure
+ */
+#include "kernel/zerotest.a65"
+
+/*
+ * check system RAM up to ROMSTART, jump to he_ram if failure
+ * returns available RAM in 256 byte blocks in AC
+ */
+#include "kernel/ramtest.a65"
+
+/*
+ * originally SYSPORT specific, they have a value for the C64 also...
+ */
+#define GETFREQ() lda #0
+
+#define LEDPORT $d020
+#define LED_LED 1
+
+/*
+ * as we have set the CIA1 TB irq in the kernel, we have to clear the
+ * CIA interrupt flag. This is done with reading the ICRegister.
+ * With C64NEEDCIA1 one can disable reading the ICR here. But then you
+ * have to have a device that does it!
+ */
+#if 0 /* ndef C64NEEDCIA1 */
+#define CLRTIMER() lda C64CIA1+CIA_ICR
+#else
+#define CLRTIMER()
+#endif
+
+/*
+ * MMU systems may map task pages into kernel mem to make copying
+ * easier. This mapping has to be preserved during interrupt.
+ * SAVEMEM() saves the memory configuration, while RESTOREMEM()
+ * restores it, obviously.
+ * These routines are called _after_ "jsr memsys", so this routine
+ * has to preserve this mapping when called from kernel space,
+ * and so must memtask.
+ */
+
+#undef SAVEMEM
+#undef RESTOREMEM
+
+/*
+ * Check if we have an interrupt in the kernel
+ */
+
+#define KERNELIRQ() lda Syscnt:cmp #1
+
+/*
+ * no memory management...
+ */
+#define STARTMEM()
+
+
diff --git a/dump/oa-2.0.9/arch/proto/rom.a65 b/dump/oa-2.0.9/arch/proto/rom.a65
new file mode 100644
index 0000000..5ff1252
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/rom.a65
@@ -0,0 +1,140 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+/***************************************************************************/
+/* These defines control the ROM build */
+/* */
+
+#define ROM
+
+/* These are necessary for ??? kernel **************************************/
+
+#define NOMMU
+#define NOSYSPORT
+#undef CLK2MHZ /* we only have approx. 1 MHz ... */
+#undef CMOSCPU /* ... and no CMOS cpu */
+#define VIDPAGE 14
+#define SHORTLINE /* prepare for 40 col screen */
+#define RAMTEST
+#define NOMIRRORMEM
+
+/* These are changeable ****************************************************/
+
+#define RAMSIZE $80 /* The size of the RAM we allow to be used.
+ Size in pages (256 bytes). Must be below
+ ROMSTART */
+
+#define MIN_MEM $80 /* minimum memory we need in system env. to
+ work ok, in pages */
+
+#define ROMSTART $8000 /* where the ROM starts */
+
+#define MEMINIVAL 0 /* Clear memory to 0 on boot */
+
+#define STACKCOPY /* if defined, save stack area in memory
+ when context switching, otherwise divide
+ stack area and give each task a part.
+ It's faster without, but allows more
+ tasks with */
+
+#define NMIDEV /* necessary for fast RS232 */
+
+/***************************************************************************/
+/* Better not change anything below */
+/* */
+
+#include "config.i65"
+#include "kdefs.i65"
+#include "fdefs.i65"
+
+#include "kernel.i65"
+
+ .word $2000
+
+.(
+
+
+#include "devices/romdev.a65"
+
+
+#define INIT_VERBOSE
+#define INIT_MERGE
+/* #define INIT_USE_STDLIB */
+/* #define INIT_OUTDEV 2*/
+#include "sysapps/init/init.a65"
+
+#include "sysapps/fs/fsdev.a65"
+
+#if 0
+
+/* both, the parallel and serial iec bus use the same timer */
+#define SEM_CIA2TB SEM_SERIEC
+#undef SEM_PARIEC
+#undef SEM_SERIEC
+
+#define NOLOOP
+#ifdef PARALLEL
+#define FSIEC_DEVICE "devices/piec_c64.a65"
+#else
+#define FSIEC_DEVICE "devices/siec_c64.a65"
+#endif
+#include "sysapps/fs/fsiec.a65"
+#undef FSIEC_DEVICE
+#print *
+
+#define MON_SHEXE $80 /* ROM executable flag */
+#define MON_MONEXE 0 /* ROM executable flag */
+#define MON_SHDEV 0 /* start on device 0 = video1 */
+/* #define MON_USE_STDLIB */
+#include "sysapps/mon/sh.a65"
+
+#if 0
+#define NOSH
+#undef MON_MONEXE
+#define MON_MONEXE $80 /* ROM executable flag */
+#undef MON_MONDEV
+#define MON_MONDEV 1 /* start on device 1 = video2 */
+#include "apps/sh/sh.a65"
+#undef MON_NOSH
+#endif
+ .text
+ .word -1
+
+/* relocated STDIO to get more space (because I/O is at $d000 */
+/*
+#define STDIOADDR $d000
+#include "stdlib/stdio.a65"
+*/
+
+#endif
+
+.dsb $d000-*,<-1
+.dsb $2000, <-1 /* from d000 to f000 */
+
+ .dsb $f000-*,<-1
+
+#include "kernel\kernel.a65"
+
+.)
+
diff --git a/dump/oa-2.0.9/arch/proto/sysapps/fstst.a65 b/dump/oa-2.0.9/arch/proto/sysapps/fstst.a65
new file mode 100644
index 0000000..922ffe3
--- /dev/null
+++ b/dump/oa-2.0.9/arch/proto/sysapps/fstst.a65
@@ -0,0 +1,234 @@
+/****************************************************************************
+
+ OS/A65 Version 1.3.3
+ Multitasking Operating System for 6502 Computers
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#define NOPRG
+
+ .(
+#ifdef ROM
+ .word ende
+ .byt PK_PRG+$80
+ .byt 4
+ .word 0
+ .word PRG
+ .byt 8,$c,9,$d,$a,$e,<-1
+ .asc "fsdev",0
+#else
+
+#include "oa1\oa1con.def"
+#include "oa1\oa1str.def"
+#include "oa1\oa1sj.a65"
+#include "oafs\oa1fs.def"
+
+#ifdef NOPRG
+ .word $800
+ *=$800
+ jmp PRG
+#else
+ .word $800
+ *=$800
+ .word 0
+ .byt PK_PRG
+ .byt 4
+ .word 0
+ .word PRG
+ .byt <-1
+#endif
+#endif
+
+-syszp =$10
+-sysmem =$300
+-sysblk =$800
+
+owntask =sysmem
+ac =sysmem+1
+xr =sysmem+2
+yr =sysmem+3
+-sysmem +=4
+
+PRG .(
+ stx owntask
+
+ clc
+ ldx #SEM_SENDBUF
+ jsr PSEM
+
+ lda #1 ; 1 Drive
+ sta PCBUF+FM_REG_DRVS
+ lda owntask
+ sta PCBUF+FM_REG_ENV
+ lda #FM_REG
+ ldx #SEND_FM
+ ldy #2
+ jsr SEND
+
+ php
+ ldx #SEM_SENDBUF
+ jsr VSEM
+ plp
+
+ bcc loop
+ jmp TERM
+
+loop sec
+ jsr RECEIVE
+ bcs loop
+
+ sta ac
+ stx xr
+ sty yr
+
+ ldy #ta-t
+ jsr tout
+ lda ac
+ jsr HEXOUT
+ ldy #ty-t
+ jsr tout
+ lda yr
+ jsr HEXOUT
+ ldy #tx-t
+ jsr tout
+ lda xr
+ jsr HEXOUT
+ ldy #td-t
+ jsr tout
+ lda PCBUF+FS_OPEN_DRV
+ jsr HEXOUT
+ ldy #ts-t
+ jsr tout
+ lda PCBUF+FS_OPEN_STR
+ jsr HEXOUT
+ ldy #tp-t
+ jsr tout
+ lda PCBUF+FS_OPEN_PFAD
+ jsr HEXOUT
+ ldy #tt-t
+ jsr tout
+ ldy #FS_OPEN_NAME
+l1 lda PCBUF,y
+ bne l2
+ lda #"@"
+l2 jsr SEROUT
+ iny
+ cpy yr
+ bcc l1
+ ldy #te-t
+ jsr tout
+
+ lda #<-1
+ sta PCBUF+FS_X_ERR
+ ldx xr
+ ldy #FS_X_SLEN
+ jsr SEND
+
+ jmp loop
+
+HEXOUT .(
+ pha
+ lsr
+ lsr
+ lsr
+ lsr
+ jsr NIBOUT
+ pla
+ and #$0f
+NIBOUT clc
+ adc #"0"
+ cmp #"9"+1
+ bcc nout
+ adc #6
+nout jmp SEROUT
+ .)
+
+ .(
+dxr =sysmem
+dyr =sysmem+1
+str =sysmem+2
+-sysmem +=3
+
+&SERIN stx dxr
+ ldx #STDIN
+ bne s0
+&IN stx dxr
+s0 sty dyr
+ stx str
+s1 ldx str
+ jsr GETC
+ bcc s1a
+ cmp #E_EOF
+ beq s1b
+ jsr YIELD
+ jmp s1
+s1b sec
+s1a ldx dxr
+ ldy dyr
+ rts
+
+&SEROUT stx dxr
+ ldx #STDOUT
+ bne o0
+&OUT stx dxr
+o0 sty dyr
+s2 pha
+ jsr PUTC
+ pla
+ bcc s2a
+ jsr YIELD
+ jmp s2
+s2a ldx dxr
+ ldy dyr
+ cmp #0
+ rts
+
+&SERBRK stx dxr
+ sty dyr
+ lda #SC_STAT
+ ldx #STDIN
+ jsr STRCMD
+ ldx dxr
+ ldy dyr
+ cmp #E_SEMPTY
+ bne s3
+ clc
+ rts
+s3 sec
+ rts
+ .)
+
+tout lda t,y
+ beq tend
+ jsr SEROUT
+ iny
+ bne tout
+tend rts
+
+t ta .asc "AC=",0
+tx .asc " XR=",0
+ty .asc " YR=",0
+td .asc 13,10,"DRV=",0
+ts .asc " STR=",0
+tp .asc " PATH=",0
+tt te .asc 13,10,0
+
+ende .)
+
diff --git a/dump/oa-2.0.9/devices/README b/dump/oa-2.0.9/devices/README
new file mode 100644
index 0000000..3f1911b
--- /dev/null
+++ b/dump/oa-2.0.9/devices/README
@@ -0,0 +1,10 @@
+
+Here are the more or less hardware independent devices.
+
+They are either completely architecture independent or they
+include files from the arch/`arch` directory.
+
+If they only need a single base address for a chip which could
+be defined elsewhere (like the UART serial device), then
+they should also go here.
+
diff --git a/dump/oa-2.0.9/devices/console.a65 b/dump/oa-2.0.9/devices/console.a65
new file mode 100644
index 0000000..7bb38bb
--- /dev/null
+++ b/dump/oa-2.0.9/devices/console.a65
@@ -0,0 +1,929 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+ Generic console device
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+ .(
+
+ .(
+#define DC_SW_MOD $20
+#define DC_SW_EXIT $10
+
+ .word devend1
+ jmp prg1
+ .asc "video1",0
+
+devend1 .word devend2
+ jmp prg2
+ .asc "video2",0
+
+devend2 .word devend3
+ jmp prg3
+ .asc "video3",0
+
+devend3 .word devend
+ jmp prg4
+ .asc "video4",0
+
+#include CONSOLE_DEVICE
+
+prg4 ldx #3
+ .byt $2c
+prg3 ldx #2
+ .byt $2c
+prg2 ldx #1
+ .byt $2c
+prg1 ldx #0
+ .)
+
+ .data
+screen .byt 0 ; screen the device is working on
+actscr .byt 0 ; visible screen
+freq .byt 0 ; hardware status byte from kernel (1/2 MHz bit)
+#ifndef NOSYSPORT
+syscnt .byt 0 ; reentrance semaphore when IRQ can be checked
+#endif
+shfl .byt 0 ; shift flag for typed char
+rspd .byt 0 ; key repeat speed
+status .dsb MAX_SCREEN
+outstr .dsb MAX_SCREEN
+getstr .dsb MAX_SCREEN
+brkkey .dsb MAX_SCREEN
+ctrlst .dsb MAX_SCREEN
+
+ .zero
+zei2 .word 0
+
+ .text
+
+ .(
+ pha
+ tya
+ pha
+ txa
+ jsr setscr
+ ldx screen
+ pla
+ tay
+ pla
+ cmp #DC_RES
+ bne p1
+ sty freq
+
+ txa
+ beq foo ; screen 0 is always reset, to set MAX_SCREEN
+ cmp #MAX_SCREEN
+ bcs max_err
+foo
+ lda #3 ; ^C
+ sta brkkey,x
+
+ lda #0 ; linein off ; DC_SW_MOD ; linein ein
+ sta status,x
+ sta ctrlst,x
+
+ sta outstr,x
+ sta getstr,x
+
+#ifndef NOSYSPORT
+ sta syscnt
+#endif
+ sta actscr
+
+ txa
+ bne re ; only the first is hw-initialized
+ jsr console_init ; init hardware (called with y=hardware byte)
+&re
+ jsr inivscr
+ clc
+ rts
+
+max_err sec
+ rts
+ .)
+
+ .(
+p2x jmp p2
+
+#if 0 /*ndef NOSYSPORT */
+noirq lda #E_NOIRQ
+ .byt $2c
+#endif
+&max_err lda #E_NODEV
+ sec
+ rts
+#if 0 /*ndef NOSYSPORT */
+wasirq lda #E_OK
+ rts
+#endif
+
+&p1 cpx #MAX_SCREEN
+ bcs max_err
+
+ pha
+ lda status,x
+ and #DC_SW_EXIT
+ beq p1ok
+ pla
+ sec
+ rts
+p1ok pla
+ cmp #DC_IRQ
+ bne p2x
+
+#if 1 /*def NOSYSPORT*/ /* allows interruptable devices! */
+ jsr do_irq
+ sec
+ rts
+#else
+ bit SYSPORT
+ bpl noirq /* not my (50 Hz) irq */
+ lda SYSPORT
+ sta SYSPORT /* clear 50 Hz interrupt */
+
+ lda syscnt /* this devices has already been interrupted */
+ bmi wasirq /* then return */
+ lda SYSPORT
+ and #1
+ beq do_irq /* CPU irq line active -> no cli */
+
+ dec syscnt /* signal that devices is interrupted */
+ cli
+
+ lda #0
+x3 jsr setscr
+ jsr do_irq
+ lda screen
+ clc
+ adc #1
+ cmp MAX_ASCREEN
+ bcc x3
+
+xe sei
+ inc syscnt
+ lda #E_NOIRQ
+ rts
+#endif /* NOSYSPORT */
+ .)
+
+do_irq .(
+ ldy screen
+ DO_IRQ
+ lda status,y
+ and #DC_SW_RX
+ beq nocheck
+
+ ldx outstr,y
+ lda #SC_STAT
+ jsr STRCMD
+ cmp #E_NUL
+ bne nocheck
+ jsr rxoff
+nocheck
+ lda screen ; get keyboard only for visible screen
+ cmp actscr
+ bne notact
+ jsr getkey ; returns x=shiftfl, y=index in keytable, a=ascii code
+ bcs notact
+ cpy #SWITCHKEY
+ bne gotchar
+ jsr crsroff ; must preserve xr
+ jsr do_switch
+ jmp notact
+gotchar
+ sta zei2
+ ldy screen ; first check if we are receiving (from keyboard)
+ lda status,y
+ and #DC_SW_RX
+ beq notact
+ lda zei2
+ cmp brkkey,y
+ bne nobrk
+ ldx outstr,y
+ lda #SC_SSTAT
+ ldy #SCE_BRK
+ jsr STRCMD
+nobrk
+ ldx zei2
+ ldy screen
+ lda status,y
+ and #DC_SW_RX+DC_SW_TX+DC_SW_MOD
+ cmp #DC_SW_RX+DC_SW_TX+DC_SW_MOD
+ bne direct ; indirect mode -> print char and send line on cr
+ cpx #TC_CR
+ bne print ; no cr, then just print it
+ jsr crsroff
+ jsr sendline ; otherwise send the whole line
+ ldx #TC_CR
+print
+ jsr crsroff
+ txa
+ jsr printchar
+ jmp notact
+
+direct and #DC_SW_RX ; direct mode -> send the char directly
+ beq notact
+ txa
+ ldx outstr,y
+ jsr PUTC
+notact ; output stuff
+ ldx screen
+ lda status,x
+ and #DC_SW_TX ; do we send?
+ beq endirq
+
+ lda getstr,x
+ tax
+ lda #SC_STAT
+ jsr STRCMD ; check stream state
+ cmp #E_EOF
+ bne txok
+ jsr txoff
+ jmp endirq
+txok
+ cmp #E_SEMPTY
+ beq endirq
+
+ lda screen
+ cmp actscr
+ bne txloop
+ jsr crsroff
+
+txloop ldy screen
+ ldx getstr,y
+ jsr GETC
+ bcs endirq
+ jsr printchar
+ jmp txloop
+endirq
+ lda screen
+ cmp actscr
+ bne end1
+ jsr crsron
+end1
+ BELLIRQ
+ lda #E_NOIRQ
+ rts
+ .)
+
+do_switch .(
+ dex
+ bpl p1c2 ; without shift or ctrl
+
+p1c1b ldx actscr ; needed to tell setact the old screen number
+ inc actscr ; then switch screen
+ lda actscr
+ cmp MAX_ASCREEN
+ bcc p1c1a
+ lda #0
+ sta actscr
+p1c1a
+ tay
+ lda status,y
+ and #DC_SW_EXIT
+ bne p1c1b
+ tya
+ jsr setact
+ jmp p1b
+
+p1c2 dex
+ bmi p1b ; shift only, then ignore
+ dex
+ bpl p1c3 ; Ctrl only, then mode switch
+ ldy screen
+ lda status,y
+ eor #DC_SW_MOD
+ sta status,y
+ jmp p1b
+
+p1c3 dex
+ bpl p1b ; Ctrl and Shift then close stream
+ jsr rxoff
+ ;jmp p1b
+p1b rts
+ .)
+
+/*************************************************************************/
+
+p2 .(
+ cmp #DC_TX_ON
+ bne ox1q
+ ldy screen
+ lda #0
+ sta ctrlst,y
+ jsr towcl
+ lda #DC_SW_TX
+ bne ox1q1
+ox1q cmp #DC_RX_ON
+ bne ox1
+ ; ldy screen
+ ; lda #3
+ ; sta brkkey,y
+ lda #DC_SW_RX
+ox1q1 ldy screen
+ ora status,y
+ sta status,y
+ jmp ok
+ox1 cmp #DC_TX_OFF
+ bne ox2x
+&txoff ldy screen
+ lda status,y
+ and #DC_SW_TX
+ beq devoff
+ ldx getstr,y
+ lda #SC_NUL
+ jsr STRCMD
+ lda status,y
+ and #255-DC_SW_TX
+ sta status,y
+ jmp ok
+ox2x cmp #DC_RX_OFF
+ bne ox2
+&rxoff ldy screen
+ lda status,y
+ and #DC_SW_RX
+ beq devoff
+ ldx outstr,y
+ lda #SC_EOF
+ jsr STRCMD
+ lda status,y
+ and #255-DC_SW_RX
+ sta status,y
+ jmp ok
+ox2 cmp #DC_EXIT
+ bne ox2a
+ jsr rxoff
+ jsr txoff
+ ldy screen
+ lda #DC_SW_EXIT
+ ora status,y
+ sta status,y
+ bne ok
+ox2a cmp #DC_ST
+ bne o3
+ok lda #E_OK
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+notimp lda #E_NOTIMP
+ cmp #1
+ rts
+o3 cmp #DC_PS
+ bne o4
+ ldx screen
+ lda status,x
+ and #DC_SW_RX
+ bne devon
+ tya
+ sta outstr,x
+ jmp ok
+o4 cmp #DC_SPD
+ bne o5
+ sty rspd
+ beq ok
+o5 cmp #DC_GS
+ bne o6 ; notimp
+ ldx screen
+ lda status,x
+ and #DC_SW_TX
+ bne devon
+ tya
+ sta getstr,x
+ jmp ok
+o6 cmp #DC_BRKKEY
+ bne notimp
+ ldx screen
+ lda brkkey,x
+ pha
+ tya
+ sta brkkey,x
+ pla
+ tay
+ jmp ok
+ .)
+
+/**************************************************************************/
+
+ .(
+
+ .data
+&spalte .byt 0
+&zeile .byt 0
+wx .byt 0
+wy .byt 0
+wr .byt 0
+wh .byt 0
+hivid .byt 0
+iz .byt 0
+is .byt 0
+#if is-spalte+2 > 12
+#echo Warning: illegal struct length for vtab
+#else
+vtab .dsb MAX_SCREEN*12
+#endif
+ .zero
+&vzei .word 0
+
+ .text
+
+&inivscr .(
+
+ lda screen
+ jsr iniscr
+
+ lda #TC_FF ; form feed
+ jsr printchar
+ jsr setlin
+
+ clc
+ rts
+ .)
+
+setlin .(
+ lda zeile
+ sta iz
+ lda spalte
+ sta is
+ rts
+ .)
+
+&sendline .(
+ SET_MMU
+ ldy zeile
+ cpy iz
+ bne liex
+ ldy is
+ cpy spalte
+ bcc liex2
+ beq liex2
+liex ldy wx
+liex2 sty spalte
+ sty zei2
+ ldy wr
+lie2 cpy spalte
+ beq lie1
+ dey
+ lda (vzei),y
+ cmp #SCR_SPACE
+ beq lie2
+ iny
+lie1 sty zei2+1
+lie3 ldy zei2
+ cpy zei2+1
+ bcs lie4
+ lda (vzei),y
+ SCR2ASC
+ ldy screen
+ ldx outstr,y
+ jsr PUTC
+ SET_MMU
+ inc zei2
+ bne lie3
+lie4 lda #TC_CR
+ ldy screen
+ ldx outstr,y
+ jsr PUTC
+ lda #SC_SSTAT
+ ldy #SCE_PUSH
+ jmp STRCMD
+ .)
+
+ /* handle multi-byte sequences - pretty simple now. */
+extra .(
+ dey
+ beq crsrrow
+
+crsrcol clc
+ adc wx
+ cmp wr
+ bcc colok
+ lda wr
+ sbc #1
+colok sta spalte
+
+clrctrl lda #0
+ sta ctrlst,x
+ rts
+
+crsrrow cmp wh
+ bcc rowok
+ lda wh
+ sbc #1
+rowok sta zeile
+inccst inc ctrlst,x
+ rts
+
+ .)
+
+ /* print all characters on screen */
+&printchar .(
+ SET_MMU
+
+ ldx screen
+ ldy ctrlst,x
+ bne extra
+
+ tay
+ bmi x1
+ cmp #32
+ bcs outc
+ jmp xout
+x1 cmp #128+32
+ bcs outc
+ jmp xcode
+
+outc ASC2SCR
+ ldy spalte
+ sta (vzei),y
+
+&nextc ldy spalte
+ iny
+ cpy wr
+ bcc o1
+ jsr nextz
+ ldy wx
+o1 sty spalte
+ rts
+
+&nextz ldx zeile
+ inx
+ cpx wh
+ bcc o2
+ jsr scrollup
+ ldx wh
+ dex
+o2 ;stx zeile
+
+&&setzei stx zeile
+ txa
+ clc
+ adc wy
+ tax
+ lda #0
+ sta vzei
+ sta vzei+1
+ sta zei2+1
+ lda MAXSPAL
+ sta zei2
+szmul txa
+ beq sz1
+ lsr
+ tax
+ bcc szm1
+ lda zei2:clc:adc vzei:sta vzei
+ lda zei2+1:adc vzei+1:sta vzei+1
+szm1 asl zei2:rol zei2+1
+ jmp szmul
+sz1 ACT_HI_VID
+ clc
+ adc vzei+1
+ sta vzei+1
+ ldx zeile
+ rts
+
+scrollup ldx #0
+ jsr setzei
+
+su2 inx
+ cpx wh
+ bcs su3
+ lda vzei
+ clc
+ adc MAXSPAL
+ sta zei2
+ lda vzei+1
+ adc #0
+ sta zei2+1
+ ldy wx
+su1 lda (zei2),y
+ sta (vzei),y
+ iny
+ cpy wr
+ bcc su1
+
+ lda zei2
+ sta vzei
+ lda zei2+1
+ sta vzei+1
+ jmp su2
+
+su3 ldy wx
+ lda #SCR_SPACE
+su4 sta (vzei),y
+ iny
+ cpy wr
+ bcc su4
+
+&clrli ldx #<-1
+ stx iz
+ rts
+ .)
+
+iniscr .( ; screen number in AC
+ HI_VID
+ sta hivid
+
+ lda #0
+ sta wx
+ sta wy
+ sta spalte
+ lda MAXSPAL
+ sta wr
+ lda MAXZEIL
+ sta wh
+
+ ldx #0
+ jmp setzei
+ .)
+
+&setscr .(
+ ldx screen
+ cpx #MAX_SCREEN
+ bcs nosave
+ cmp screen
+ beq setmmu ; same screen as current
+ pha
+ ; save screen
+ lda screen
+ asl
+ asl
+ sta zei2+1 ; screen# times 4
+ asl
+ clc
+ adc zei2+1
+ tax ; screen# times 12
+ ldy #0
+s1 lda spalte,y ; copy screen control struct
+ sta vtab,x ; to buffer
+ inx
+ iny
+ cpy #is-spalte+1
+ bcc s1
+ lda vzei
+ sta vtab,x
+ lda vzei+1
+ sta vtab+1,x
+ pla
+nosave sta screen
+ ; restore screen
+ asl
+ asl
+ sta zei2+1
+ asl
+ clc
+ adc zei2+1
+ tax
+ ldy #0
+s2 lda vtab,x ; copy screen control struct from buffer
+ sta spalte,y ; to struct
+ inx
+ iny
+ cpy #is-spalte+1
+ bcc s2
+ lda vtab,x
+ sta vzei
+ lda vtab+1,x
+ sta vzei+1
+setmmu
+ SET_MMU
+ rts
+ .)
+
+xout .(
+ cmp #TC_CR
+ bne x1
+ lda wx
+ sta spalte
+ rts
+x1 cmp #TC_LF
+ bne x2
+ jmp nextz
+x2 cmp #TC_BEL
+ bne x3a
+ TRIGBELL
+ rts
+x3a .(
+ cmp #TC_FF
+ bne x3
+&&toclr ldx #0
+c2b jsr setzei
+ ldy wx
+ lda #SCR_SPACE
+c2a sta (vzei),y
+ iny
+ cpy wr
+ bcc c2a
+ inx
+ cpx wh
+ bcc c2b
+ jsr clrli
+&&tohome lda wx
+ sta spalte
+ ldx #0
+ jmp setzei
+ .)
+x3 .(
+ cmp #TC_BS
+ bne x4
+ ldy spalte
+ cpy wx
+ beq c7
+ dec spalte
+bslp lda (vzei),y
+ dey
+ sta (vzei),y
+ iny
+ iny
+ cpy wr
+ bcc bslp
+ dey
+ lda #SCR_SPACE
+ sta (vzei),y
+&x4 c7 rts
+ .)
+ .)
+
+xcode .(
+ and #$7f
+ cmp #maxcode
+ bcs xe
+ asl
+ tax
+ lda xadr+1,x
+ pha
+ lda xadr,x
+ pha
+xe rts
+
+maxcode =16
+xadr .word tocl-1,nextc-1,tocu-1,nextz-1
+ .word tohome-1,toclr-1,todel-1,toins-1
+ .word towlo-1,towru-1,towcl-1
+ .word toeol-1,toclrl-1
+ .word toecho-1, tonoecho-1, tocpos-1
+
+tocpos .(
+ ldx screen
+ lda #1
+ sta ctrlst,x
+ rts
+ .)
+
+toecho .(
+ ldx screen
+ lda status,x
+ ora #DC_SW_MOD
+ sta status,x
+ rts
+ .)
+
+tonoecho .(
+ ldx screen
+ lda status,x
+ and #$ff-DC_SW_MOD
+ sta status,x
+ rts
+ .)
+
+todel .(
+ ldy spalte
+td0 iny
+ cpy wr
+ bcs td1
+ lda (vzei),y
+ dey
+ sta (vzei),y
+ iny
+ bne td0
+td1 dey
+ lda #SCR_SPACE
+ sta (vzei),y
+ rts
+ .)
+
+toins .(
+ ldy wr
+ dey
+ lda (vzei),y
+ cmp #SCR_SPACE
+ bne tie
+ cpy spalte
+ beq tie
+ti1 dey
+ lda (vzei),y
+ iny
+ sta (vzei),y
+ dey
+ cpy spalte
+ bne ti1
+ lda #SCR_SPACE
+ sta (vzei),y
+tie rts
+ .)
+
+toeol .(
+ ldy wr
+l dey
+ bmi e
+ lda (vzei),y
+ cmp #SCR_SPACE
+ beq l
+e iny
+ cpy wr
+ bcs x
+ sty spalte
+x rts
+ .)
+
+toclrl .(
+ lda #SCR_SPACE
+ ldy spalte
+c sta (vzei),y
+ iny
+ cpy wr
+ bcc c
+ rts
+ .)
+
+tocl .(
+ ldy spalte
+ cpy wx
+ beq c4
+ dec spalte
+ rts
+c4 ldy wr
+ dey
+ sty spalte
+&tocu ldx zeile
+ beq c5
+ dex
+c5 jsr setzei
+ rts
+ .)
+
+towlo .(
+ lda spalte
+ sta wx
+ lda wh
+ sec
+ sbc zeile
+ sta wh
+ lda zeile
+ clc
+ adc wy
+ sta wy
+ lda #0
+ sta zeile
+ jmp clrli
+ .)
+
+towru .(
+ ldy spalte
+ iny
+ sty wr
+ ldx zeile
+ inx
+ stx wh
+ jmp clrli
+ .)
+
+&&towcl .(
+ lda zeile
+ clc
+ adc wy
+ sta zeile
+ lda #0
+ sta wx
+ sta wy
+ lda MAXSPAL
+ sta wr
+ lda MAXZEIL
+ sta wh
+ jmp clrli
+ .)
+ .)
+
+ .)
+devend .)
+
diff --git a/dump/oa-2.0.9/devices/nulldev.a65 b/dump/oa-2.0.9/devices/nulldev.a65
new file mode 100644
index 0000000..2b50d21
--- /dev/null
+++ b/dump/oa-2.0.9/devices/nulldev.a65
@@ -0,0 +1,120 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+ Generic nulldevice
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#define ANZINSTR 16
+
+ .(
+ .word nulend
+ jmp nulprg
+ .asc "nuldev",0
+
+ .data
+anzinstr .byt 0
+instr .dsb ANZINSTR
+ .text
+
+nulprg cmp #DC_RES
+ bne sp1
+
+ ldy #0
+ sty anzinstr
+ lda #<-1
+ni1 sta instr,y
+ iny
+ cpy #ANZINSTR
+ bcc ni1
+ clc
+ rts
+
+sp1 cmp #DC_IRQ
+ bne sp2
+
+ ldy #0
+spil ldx instr,y
+ bmi spiln
+ jsr GETC
+ bcc spil
+ cmp #E_EOF
+ bne spiln
+
+ ldx instr,y
+ lda #SC_NUL
+ jsr STRCMD
+ lda #<-1
+ sta instr,y
+
+spiln iny
+ cpy #ANZINSTR
+ bcc spil
+ clc
+ lda #E_NOIRQ
+ rts
+
+sp2 cmp #DC_RX_OFF
+ beq nlnotimp
+ cmp #DC_TX_OFF
+ bne sp3
+ ldy #0 ; rxoff
+rxo1 ldx instr,y
+ lda #SC_NUL
+ jsr STRCMD
+ lda #<-1
+ sta instr,y
+ iny
+ cpy #ANZINSTR
+ bcc rxo1
+ bcs ok
+
+sp3 cmp #DC_RX_ON
+ beq nlnotimp
+ cmp #DC_TX_ON
+ bne sp5
+
+ok lda #0
+ .byt $2c
+nlnotimp lda #E_NOTIMP
+ .byt $2c
+nldevon lda #E_DON
+ cmp #1
+ rts
+
+sp5 cmp #DC_GS
+ bne nlnotimp
+ ldx #0
+sp5a lda instr,x
+ bpl sp5n
+ tya
+ sta instr,x
+ clc
+ rts
+sp5n inx
+ cpx #ANZINSTR
+ bcc sp5a
+ bcs nldevon
+
+#undef ANZINSTR
+
+nulend .)
+
diff --git a/dump/oa-2.0.9/devices/scsi.a65 b/dump/oa-2.0.9/devices/scsi.a65
new file mode 100644
index 0000000..0e2ddb8
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi.a65
@@ -0,0 +1,304 @@
+
+
+#ifdef DEBUGFS
+#define PRINT
+#define PRINT2
+#echo "SCSI PRINT MODE"
+#endif
+#undef DEBUG
+
+/*
+ * Sample SCSI + PC-style partition manager program
+ */
+
+;--------------------------------------------------------------
+; CS/A65 specific code
+
+#ifndef SCSIBASE
+#define SCSIBASE $e870
+#endif
+
+
+;--------------------------------------------------------------
+
+#include "devices/scsi/part.i65"
+
+ .(
+ .data
+prwpar .dsb PRW_SLEN
+ .text
+
+INVDPB .( ; x ist Drive
+ txa
+ jsr setdzei
+ ldy #D_ST
+ lda #DS_INV
+ sta (dzei),y
+ clc
+ rts
+ .)
+
+&DINIT .(
+;.byt 2
+ clc ; oh, what shall we do....
+ ldx #0
+il stx prwpar
+ jsr INVDPB
+ ldx prwpar
+ inx
+ cpx #ANZDRV
+ bcc il
+ clc
+
+ lda #buffer
+ ldx #>BUFLEN
+ jsr scanpart
+ rts
+ .)
+
+&GETDPB .(
+ jsr boot2dpb
+ ldy #D_ST
+ lda #DS_OK
+ sta (dzei),y
+ ldy #D_BFLAG
+ lda #1 ; 0 -> 12 bit FAT, 1 -> 16 bit FAT
+ sta (dzei),y
+ clc
+ rts
+illpar lda #E_ILLPAR
+ sec
+ rts
+ .)
+
+&RWSEC .(
+ php
+ sta dp
+ sty dp+1
+
+#ifdef DEBUGFS
+.(
+lda #":"
+jsr SEROUT
+lda dp+1
+jsr HEXOUT
+lda dp
+jsr HEXOUT
+lda #"."
+jsr SEROUT
+ldy #0
+ll lda (dp),y
+jsr HEXOUT
+iny
+cpy #RW_SLEN
+bcc ll
+jsr CRLFOUT
+.)
+#endif
+ ldy #RW_DRV
+ lda (dp),y
+ sta prwpar+PRW_PART
+ lda #1
+ sta prwpar+PRW_NSEC
+
+ ldy #RW_SECTOR
+ lda (dp),y
+ sta prwpar+PRW_SECTOR
+ iny
+ lda (dp),y
+ sta prwpar+PRW_SECTOR+1
+ iny
+ lda (dp),y
+ sta prwpar+PRW_SECTOR+2
+ iny
+ lda (dp),y
+ sta prwpar+PRW_SECTOR+3
+
+ ldy #RW_ADR
+ lda (dp),y
+ sta prwpar+PRW_BUF
+ iny
+ lda (dp),y
+ sta prwpar+PRW_BUF+1
+
+ lda #prwpar
+
+ plp
+ bcs pwr
+
+ jmp pread
+pwr
+ jmp pwrite
+ .)
+
+&DLOOP rts
+
+&DFORMAT .(
+; .data
+; dfa .byt 0,0,0,0
+; .text
+;dfa =ar1
+
+ ldy drive
+ jsr CLBUF
+
+ ldy drive
+ lda #0
+ sta ar2
+ sta ar2+1
+ sta ar2+2
+ sta ar2+3
+ jsr RDBUF
+
+ ldx drive
+ jsr setpadr
+ sta dp
+ stx dp+1
+
+ ldy #D_ST
+ lda #DS_INV
+ sta (dzei),y
+
+ ldy #BS_SLEN
+df1 lda bootsector,y
+ sta (dp),y
+ dey
+ bpl df1
+
+ /* modify boot sector to fit partition size */
+ lda drive
+ asl
+ asl
+ asl
+ asl
+ tax
+
+ ; BS_BPS ; bytes per sector
+ ldy #BS_BPS
+ lda parts+PT_BSIZE,x
+ sta (dp),y
+ iny
+ lda parts+PT_BSIZE+1,x
+ sta (dp),y
+
+ /* TODO: this is buggy - old bootsector only allows 2-byte # of sec
+ * but we misuse the MEDIA byte as third byte of the sector # */
+ ; BS_SEC ; total number of sectors
+ ldy #BS_SEC
+ lda parts+PT_LEN,x
+ sta (dp),y
+ sta ar1-BS_SEC,y
+ iny
+ lda parts+PT_LEN+1,x
+ sta (dp),y
+ sta ar1-BS_SEC,y
+ iny
+ lda parts+PT_LEN+2,x
+ sta (dp),y
+ sta ar1-BS_SEC,y
+ iny
+ lda parts+PT_LEN+3,x
+ ; sta (dp),y
+ sta ar1-BS_SEC,y
+
+ ; BS_SPC ; 1 byte sectors per cluster
+ ldy #BS_SPC
+ lda #1
+ sta (dp),y
+spc1
+ lda ar1+2
+ ora ar1+3
+ beq spf
+
+ lsr ar1+3
+ ror ar1+2
+ ror ar1+1
+ ror ar1
+
+ lda (dp),y
+ asl
+ sta (dp),y
+ jmp spc1
+spf
+#ifdef DEBUGFS
+lda #"+":jsr SEROUT
+ldy #0:sss1 lda ar1,y:jsr HEXOUT:iny:cpy #4:bcc sss1
+#endif
+ ; BS_SPF ; sectors per FAT = (BS_SEC/BS_SPC * BS_BPS/2)
+ ldy #BS_BPS+1
+ lda (dp),y
+ lsr
+ tax
+ dey
+ lda (dp),y
+ ror
+ jsr div32
+ ldy #BS_SPF
+ clc
+ adc #1
+ sta (dp),y
+ iny
+ txa
+ adc #0
+ sta (dp),y
+#ifdef DEBUGFS
+dey:lda (dp),y:jsr HEXOUT:iny:lda (dp),y:jsr HEXOUT
+jsr CRLFOUT
+#endif
+ ; BS_SPT ; sectors per track ??? -> not needed
+
+ ; BS_SIDE ; sides ??? -> not needed
+#ifdef DEBUGFS
+lda "*":jsr SEROUT
+ldy #0:ffoo1 lda (dp),y:jsr HEXOUT:lda #" ":jsr SEROUT:iny
+cpy #BS_SLEN:bcc ffoo1:jsr CRLFOUT
+#endif
+/*
+ txa
+ clc
+ adc #3
+ tay
+lda #"x":jsr SEROUT
+ ldx #3
+df2 lda parts+PT_LEN,y
+ sta ar1,x
+jsr HEXOUT
+ dey
+ dex
+ bpl df2
+*/
+ ldy drive
+ jsr WABUF
+
+ ldy drive
+ jsr FRBUF
+
+ clc
+ rts
+
+bootsector ; is modified after having been copied to the buffer.
+ .byt $eb,$34,$90,"OS/A 2.1"
+ .word $200 ; BPS
+ .byt 2 ; SPC
+ .word 1 ; RES
+ .byt 2 ; FATs
+ .word 112 ; DIR
+ .word 720 ; SECs
+ .byt 248 ; Media
+ .word 3 ; SPF
+ .word 9 ; SPT
+ .word 1 ; Side
+ .word 0 ; Hidden
+ .word 0 ; (Dummy)
+ .)
+
+#include "devices/scsi/pcpart.a65"
+#include "devices/scsi/paccess.a65"
+/*#include "devices/scsi/csascsi1.a65"*/ /* needs SCSIBASE */
+#include "devices/scsi/ramdscsi.a65"
+#include "devices/scsi/printcsa.a65"
+
+ .)
+
diff --git a/dump/oa-2.0.9/devices/scsi/COPYING b/dump/oa-2.0.9/devices/scsi/COPYING
new file mode 100644
index 0000000..6d2b1ca
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/COPYING
@@ -0,0 +1,353 @@
+
+All files in this directory are copyrighted by me. However, only
+the driver (i.e. all files _except_ csascsi1.gif and csascsi1.ps)
+are distributed under the GPL (see below). The schematics, i.e.
+csascsi1.gif and csascsi1.ps are under a more restrictive copyright.
+You may only use them for non-commercial purposes and may not
+be changed without notice. GPL sections 11 and 12 (No Warranty!)
+cover _all_ files.
+
+ Andre fachat
+-----------------------------------------------------------
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C) 19yy
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ , 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/dump/oa-2.0.9/devices/scsi/Makefile b/dump/oa-2.0.9/devices/scsi/Makefile
new file mode 100644
index 0000000..c30fa2d
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/Makefile
@@ -0,0 +1,24 @@
+
+c64: main.a65 csascsi1.a65 pcpart.a65 printc64.a65 paccess.a65 part.i65
+ xa -DC64 -l main.lab -I../oa-2.0.0a/include \
+ -bz 250 -bb 4096 \
+ main.a65 -o mainc64
+
+csa: main.a65 csascsi1.a65 pcpart.a65 printcsa.a65 paccess.a65 part.i65
+ xa -DCSA -R -l main.lab -I../oa-2.0.0a/include -DOSA2KERNEL=\$$f000 -bz 128 -bt 1024 -bb 3072 main.a65 -o main.o65
+ file65 main.o65
+ reloc65 -xt -o maincsa main.o65
+
+clean:
+ rm -f *.o65 *.lab main maincsa
+
+dist: c64 clean
+ (cd ..; tar czv --exclude=scsi/csascsi1.fig -f scsidist.tar.gz scsi ; )
+
+mrproper: clean
+ rm -f mainc64
+
+arc: mrproper
+ (cd ..; tar czvf scsi.tar.gz scsi ; )
+
+
diff --git a/dump/oa-2.0.9/devices/scsi/README b/dump/oa-2.0.9/devices/scsi/README
new file mode 100644
index 0000000..b5419e4
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/README
@@ -0,0 +1,136 @@
+
+Generic driver for the CS/A65 SCSI interface
+--------------------------------------------
+
+This is the generic driver for the CS/A SCSI interface, written for
+the 6502 CPU.
+
+The hardware is derived from a very old SASI interface described
+in the german elektor magazin.
+The schematics can be found in csascsi1.{gif|ps}
+A description and parts list are in csascsi1{desc|parts}.txt.
+
+The software runs on the C64 with the C64-CS/A65 bus adaptor
+(See http://www.tu-chemnitz.de/~fachat/8bit/c64/csa/index.html)
+as well as on a CS/A65 computer.
+(See http://www.tu-chemnitz.de/~fachat/8bit/hardware/csa/index.html)
+
+To build the driver you need the xa65 6502 cross assembler.
+(See http://www.tu-chemnitz.de/~fachat/8bit/cross/xa/index.html)
+It should be easy to patch the source for another assembler.
+
+New with 1.1:
+-------------
+
+- the pc partition scanner handles extended partions better
+- a C64 binary is included (as "mainc64"). Simply LOAD and RUN it
+ if you have the SCSI-interface at $de00.
+ (It doesn't check if it's there!)
+
+Driver Description
+------------------
+
+The driver is divided into several parts:
+
+csascsi1.a65 contains the low-level routines to scan the SCSI bus
+ and to read/write sectors for the CS/A65 SCSI card.
+ To use another hardware this module can be replaced.
+
+part.i65 defines a general interface to read and write blocks in a
+ partition. Also the partition table format is defined here.
+
+pcpart.a65 uses the low-level routines to scan the devices for
+ PC-style partition tables. They are registered in the partition
+ table. To use a different type of partition tables
+ (Amiga for example), replace this file.
+
+paccess.a65 implements the pread and pwrite functions to read and
+ write blocks in a partition with the use of the partition table.
+
+print*.a65 are some help routines to print debugging output when
+ the routines are used in an OS/A65 1.3 or C64 environment.
+ It is not needed without output or has to be replaced for
+ another operating environment.
+
+main.a65 is a simple test program. It also includes the driver for
+ assembling with the xa65 crosscompiler and the OS-specific
+ startup code.
+
+
+Comments
+--------
+
+This is the very first version. There are sure some bugs.
+Error handling is miserable.
+The hardware only works as single controller and only as ID 7.
+There is no fdisk program - it would be partition-style dependent
+and would use the low-level driver.
+If in doubt, read the source :-)
+
+Here is the sample output of the main program:
+
+-------------------------------------------------------------------------
+>l"maincsa" 400:0B14
+>g 400
+CS/A65 SCSI driver
+
+Resetting SCSI bus
+Device select timeout 00
+Device select timeout 01
+Device found 02
+SEAGATE ST1096N [Type 00, SCSI Rev. 01]
+ [Blocks: 00028091, Byte/Block: 00000200]
+Device select timeout 03
+Device found 04
+IBM DCAS-34330W [Type 00, SCSI Rev. 02]
+ [Blocks: 008132FF, Byte/Block: 00000200]
+Device select timeout 05
+Device select timeout 06
+
+Scanning for PC-type partitions
+
+Found Direct Access Device 02
+Partition Type 04, Device 02, First 00000020, Len 0000F7E0
+Partition Type 05, Device 02 (extended)
+Partition Type 06, Device 02, First 0000F820, Len 000187E0
+
+Found Direct Access Device 04
+Partition Type 06, Device 04, First 00000020, Len 001DB7E0
+Partition Type 05, Device 04 (extended)
+Partition Type 83, Device 04, First 001DB820, Len 0000A7E0
+Partition Type 05, Device 04 (extended)
+Partition Type 83, Device 04, First 001E6020, Len 001F47E0
+Partition Type 05, Device 04 (extended)
+Partition Type 82, Device 04, First 003DA820, Len 0003C7E0
+Partition Type 05, Device 04 (extended)
+Partition Type 83, Device 04, First 00417020, Len 003FBFE0
+
+>m e1e e5e
+>,0E1E 04 00 02 00 00 02 00 00 20 00 00 00 E0 F7 00 00:........ ...a/..
+>,0E2E 06 00 02 00 00 02 00 00 20 F8 00 00 E0 87 01 00:........ 0..a...
+>,0E3E 06 00 04 00 00 02 00 00 20 00 00 00 E0 B7 1D 00:........ ...ao..
+>,0E4E 00 00 04 00 00 02 00 00 00 70 43 30 08 04 71 00:.........pC0..q.
+>
+-------------------------------------------------------------------------
+
+As you can see the driver is pretty small (the whole text segment is
+about 1k without print + about 180 byte for partition tables etc.
+(Of course it needs buffers to read & store the sectors read from disk)
+
+It can also handle multiple devices as well. The IBM 4G Ultra-Wide SCSI-II
+(with Wide-SCSI -> SCSI adapter) is handled as well as the old Seagate
+ST1096N SCSI-I at the same time.
+
+The partition table shows three usable partitions, of types 4
+(FAT 16 bit < 32M) and 6 (FAT 16 bit >= 32M) and
+on (SCSI-) devices 2 and 4. the 4th to 7th byte are the bytes/block,
+then the first block and the length of the partition on the device.
+The other partitions found but written to the partition table are
+Linux partitions :-)
+
+There will be a binding to the fsibm 12/16 Bit filesystem for OS/A65.
+
+Have fun
+Andre Fachat 13 June 1998
+
+
diff --git a/dump/oa-2.0.9/devices/scsi/csascsi1.a65 b/dump/oa-2.0.9/devices/scsi/csascsi1.a65
new file mode 100644
index 0000000..207aa32
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/csascsi1.a65
@@ -0,0 +1,778 @@
+
+/*
+ * Generic SCSI driver for CS/A SCSI card
+ *
+ * Modified SASI interface from german "Elektor Computing" magazin,
+ * special issue "Hardware", year unknown, probably around 1988-1989.
+ *
+ * Modified hardware and rewritten driver by A. Fachat in may 1998.
+ *
+ * Hardware:
+ *
+ * 2 addresses, $e870-$e871
+ *
+ * $e870 : read SCSI data bus; write data for SCSI data bus
+ *
+ * $e871 : read status
+ * bit 0: I/O (SCSI in)
+ * 1: -ACK (SCSI out, from latch)
+ * 2: -RST (SCSI out, from latch)
+ * 3: BSY (SCSI in)
+ * 4: MSG (SCSI in)
+ * 5:
+ * 6: REQ (SCSI in)
+ * 7: C/D (SCSI in)
+ * write control
+ * bit 0: 1 = -SEL active
+ * 1: 1 = activate ID bit for arbitration
+ * 2: 1 = -BSY active
+ * 3: 1 = -ATN active
+ * 4:
+ * 5:
+ * 6:
+ * 7: 1 = /RST active
+ *
+ * $e872 : write any value -> pulse on /SEL (SCSI out)
+ *
+ * Software:
+ *
+ * This is a stateless SCSI driver with the following routines:
+ *
+ * initscsi <- a/y address of buffer (>=256 byte)
+ * -> a/y address of (static) table with device type
+ * of each device in it (0=disk, ff=none)
+ * also available as "devtype"
+ * x = number of table entries
+ *
+ * inquiry <- a/y address of buffer (>=256 byte)
+ * x = device SCSI ID
+ * -> buffer contains SCSI return
+ *
+ * getsize <- a/y address of buffer (>=8 byte)
+ * x = device SCSI ID
+ * -> buffer contains 4 byte # of blocks (hi-low format)
+ * and 4 byte byte/blocks (hi-lo)
+ *
+ * readblock <- a/y address of buffer (>= N * byte/block)
+ * x = SCSI device address
+ * lba (4 byte) LBA of first block to read (hi-lo)
+ * nsec (2 byte) # of blocks to read (consecutively)
+ * -> buffer contains data
+ * writeblock <- see readblock, buffer contains data
+ *
+ *
+ * $Log$
+ *
+ */
+
+#undef DEBUG
+/* #undef PRINT */
+/* #undef STANDALONE */
+
+#ifndef SCSIBASE
+#define SCSIBASE $e870
+#endif
+
+#ifdef DEBUG
+#define PRINT
+#endif
+
+#ifdef PRINT2
+#define PRINT
+#endif
+
+/**********************************************************************
+ * system defines
+ */
+/*
+#define DATA $e870
+#define CTRL $e871
+#define STATUS $e871
+
+#define DATA $de70
+#define CTRL $de71
+#define STATUS $de71
+*/
+
+#define DATA 0+SCSIBASE
+#define CTRL 1+SCSIBASE
+#define STATUS 1+SCSIBASE
+
+#define S_IO %00000001
+#define S_ACK %00000010
+#define S_RST %00000100
+#define S_BSY %00001000
+#define S_MSG %00010000
+#define S_REQ %01000000 /* check BVC/BVS */
+#define S_CD %10000000 /* check BMI/BPL */
+
+#define S_PHASEMASK S_IO+S_CD+S_MSG
+#define S_DATAIN S_IO
+#define S_MSGIN S_IO+S_CD+S_MSG
+#define S_STATUS S_IO+S_CD
+#define S_COMMAND S_CD
+
+#define C_RST %10000000
+#define C_SEL %00001000
+#define C_BSY %00000100
+#define C_IDENT %00000010
+#define C_ATN %00000001
+
+#define MYID 7 /* hardcoded in controller */
+
+#ifdef PRINT
+#define log(a) ldx #a:jsr logout
+#define hout(a) lda a:jsr hexout
+#define crlf() jsr crlfout
+#else
+#define log(a)
+#define hout(a)
+#define crlf(a)
+#endif
+
+#ifdef DEBUG
+#define lc(a) php:pha:lda #a:jsr cout:pla:plp
+#else
+#define lc(a)
+#endif
+
+/*************************************************************************
+ * load addr and Jump table
+ */
+
+#ifdef STANDALONE
+
+ lda #buffer
+ jsr initscsi
+
+ lda #0
+ sta task+2
+ sta task+3
+ sta task+4
+ sta task+5
+
+ sta task+7
+ lda #1
+ sta task+8
+
+ lda #buffer
+ ldx #0
+ jsr readblock
+ rts
+
+#endif
+
+ .(
+
+/*************************************************************************
+ * globals
+ */
+
+ ; powers of 2
+
+pow2 .byt 1, 2, 4, 8, 16, 32, 64, 128
+
+
+ .zero
+&dp .word 0
+ .text
+
+/*************************************************************************
+ * SCSI Subroutines
+ */
+
+; reqwait waits for request from device
+
+reqwait lda #S_BSY
+reqw bit STATUS
+ beq reqend
+ bvc reqw
+reqend rts
+
+; waitbsy waits until the device is busy
+
+waitbsy lda STATUS
+ and #S_BSY
+ beq waitbsy
+ rts
+
+; waitrdy waits until the device is ready
+
+waitrdy lda STATUS
+ and #S_BSY
+ bne waitrdy
+ rts
+
+; clrtask clears the command buffer
+
+clrtask ldy #0
+ tya
+gs1 sta task,y
+ iny
+ cpy #10
+ bcc gs1
+ rts
+
+; selcntr selects the default controller
+
+selcntr
+ lc("A")
+ sei
+ lda #0
+ sta CTRL
+ jsr waitrdy
+
+ ldy #MYID
+ lda pow2,y
+ sta DATA ; own ID
+ ldy #C_BSY | C_IDENT ; sets ID bit and disables normal bus driver
+ sty CTRL ; arbitrate
+ nop
+#if 0 /* if MYID != 7 */
+ cmp DATA ; TODO - must check against e.g. %00111111 for ID=5
+ beq gotit
+lost
+ lc("L")
+ lda #0
+ sta CTRL
+ sta DATA
+ jmp selcntr
+#endif
+gotit
+ lc("S")
+ ldy #C_SEL | C_BSY | C_IDENT
+ sty CTRL
+ ldy actdev ; controller select code
+ ora pow2,y
+ sta DATA ; write to data latch
+ lda #C_SEL | C_BSY | C_ATN
+ sta CTRL
+ and #$ff-C_BSY
+ sta CTRL
+
+ ; now wait for busy, but only a defined time
+ ldy #5
+sel1 lda STATUS
+ and #S_BSY
+ bne busyok
+ tya
+ jsr wait30us
+ tay
+ lc(".")
+ dey
+ bne sel1
+ lda #0
+ sta DATA
+ sta CTRL
+ sec
+ rts
+busyok lc(":")
+ clc
+ lda #0
+ sta DATA
+ sta CTRL
+ rts
+
+error2 jmp error
+
+; taskout sends the command held in AC to the controller
+
+taskAout
+ ldy #10
+ .byt $2c
+taskout ldy #6 ; byte count
+ cmp #2 ; check for illegal code
+ beq error
+ sta task ; store command in table
+ ldx #0
+t1 jsr reqwait ; wait for request from device
+ lda task,x
+ sta DATA
+ inx
+ dey
+ bne t1
+ rts
+
+; getstat retrieves the status byte and the null byte from the device
+; at the end of a command. AC is returned with a non-zero value if
+; an error has occured.
+
+getstat jsr reqwait
+ lda STATUS
+ and #S_PHASEMASK
+ beq gsend
+#ifdef DEBUG
+ cmp #S_DATAIN
+ beq gsdatin
+ cmp #S_STATUS
+ beq gsst
+ cmp #S_MSGIN
+ beq gsmsgin
+ pha
+ lda #"*"
+ jsr cout
+ pla
+ jsr hexout
+ jmp gsget
+gsdatin lda #"D"
+ .byt $2c
+gsst lda #"S"
+ .byt $2c
+gsmsgin lda #"M"
+ jsr cout
+gsget
+#endif
+; jsr reqwait
+ lda DATA
+ tay
+#ifdef DEBUG
+ jsr hexout
+#endif
+ jmp getstat
+gsend
+ cli
+#ifdef DEBUG
+ lda #"-"
+ jsr cout
+ jsr crlfout
+#endif
+ tya
+ and #2
+ cmp #2
+ rts
+
+error cli
+ log(2)
+ pla
+ pla
+ sec
+ rts
+
+wait30us
+ ldy #$5d
+ .byt $2c
+wait75us
+ ldy #$ea
+ ldx #0
+w75a dex
+ bne w75a
+ dey
+ bne w75a
+ rts
+
+/*************************************************************************
+ * Read a block from the device
+ * task+2/3/4/5 has block number (hi-lo), task+7/8 has number of blocks to rd
+ * a/y has memory address of buffer where to write block to
+ */
+
+&readblock
+ sta dp
+ sty dp+1
+ stx actdev
+
+#ifdef PRINT2
+ .(
+ log(10)
+ hout(actdev)
+ log(11)
+ ldy #0
+rdll lda lba,y
+ jsr hexout
+ iny
+ cpy #4
+ bcc rdll
+ log(12)
+ hout(nsec)
+ hout(nsec+1)
+ log(13)
+ hout(dp+1)
+ hout(dp)
+ log(14)
+nopr2
+ .)
+#endif
+ lda #0
+ sta task+1
+ sta task+9
+
+ jsr selcntr
+ bcs selerr3
+
+ lda #$28 ; read extended (32 bit LBA)
+ jsr taskAout
+
+ ldy #0
+rdloop jsr reqwait
+ bmi rddone
+ lda DATA
+ sta (dp),y
+ iny
+ bne rdloop
+ inc dp+1
+ jmp rdloop
+rddone
+ jmp getstat
+
+selerr3 jmp selerr
+
+/*************************************************************************
+ * Read a block from the device
+ * task+2/3/4/5 has block number (hi-lo), task+7/8 has number of blocks to rd
+ * a/y has memory address of buffer where to write block to
+ */
+
+&writeblock
+ sta dp
+ sty dp+1
+ stx actdev
+
+#ifdef PRINT2
+ .(
+ log(15)
+ hout(actdev)
+ log(11)
+ ldy #0
+rdll lda lba,y
+ jsr hexout
+ iny
+ cpy #4
+ bcc rdll
+ log(12)
+ hout(nsec)
+ hout(nsec+1)
+ log(13)
+ hout(dp+1)
+ hout(dp)
+ log(14)
+nopr2
+ .)
+#endif
+ lda #0
+ sta task+1
+ sta task+9
+
+ jsr selcntr
+ bcs selerr3
+
+ lda #$2A ; write extended (32 bit LBA)
+ jsr taskAout
+
+ ldy #0
+wrloop jsr reqwait
+ bmi wrdone
+ lda (dp),y
+ sta DATA
+ iny
+ bne wrloop
+ inc dp+1
+ jmp wrloop
+wrdone jmp getstat
+
+/*************************************************************************
+ * Initialization (a/y = buffer)
+ */
+
+&initscsi
+ sta dp
+ sty dp+1
+
+ log(0)
+
+ sei
+
+ lda #C_RST ; send reset pulse
+ sta CTRL
+ jsr wait30us ; approx. 30us
+ lda #0
+ sta CTRL ; clear RST
+
+ lda #12 ; wait approx. ? ms
+rd jsr wait75us
+ sec
+ sbc #1
+ bne rd
+
+; scan SCSI bus for devices
+
+ jsr clrtask
+ lda #0
+ sta actdev ; start with first device
+iniloop
+ lda actdev
+ cmp #MYID
+ beq nodev
+
+ jsr selcntr
+ bcs iselerr
+ lda #0 ; drive ready command
+ jsr taskout
+ jsr getstat
+ bcc iniok
+
+ log(1)
+ hout(actdev)
+ crlf()
+ jmp next
+
+iselerr cli
+ log(4)
+ hout(actdev)
+ crlf()
+ jmp nodev
+
+iniok log(3)
+ hout(actdev)
+ crlf()
+
+ lda dp
+ ldy dp+1
+ ldx actdev
+ jsr inquire
+#ifdef PRINT
+ pha
+ jsr loginquire
+ pla
+#endif
+ .byt $2c
+nodev lda #$ff
+ cli
+ ldx actdev
+ sta devtype,x
+
+#ifdef PRINT
+ cmp #5
+ beq print
+ cmp #0
+ bne next
+print
+ lda dp
+ ldy dp+1
+ ldx actdev
+ jsr getsize
+ jsr printsize
+#endif
+next
+ inc actdev
+ lda actdev
+ cmp #8
+ bcc iniloop
+
+ lda #devtype
+ ldx #8
+ clc
+ rts
+
+selerr cli
+ log(4)
+ hout(actdev)
+ crlf()
+ sec
+ rts
+
+/*************************************************************************
+ * Inquire device status/info into buffer (addr=a/y)
+ */
+
+&inquire
+ sta dp
+ sty dp+1
+ stx actdev
+ lc("i")
+ jsr clrtask
+ jsr selcntr
+selerr2 bcs selerr
+ lda #<-1
+ sta task+4
+ lda #$12
+ jsr taskout
+
+ ldy #0
+inl jsr reqwait
+ bmi indone
+ lda DATA
+ sta (dp),y
+ iny
+ bne inl
+indone
+#ifdef DEBUG
+ lc("d")
+ tya
+ jsr hexout
+#endif
+ jsr getstat
+ bcc inrts
+ jmp error
+inrts ldy #0
+ lda (dp),y ; 0 = disk, 1 = Tape, 5 = CDROM
+ rts
+
+
+/*************************************************************************
+ * Get Medium capacity, a/y = buffer
+ * returns 4 byte # of blocks (hi-low format) + 4 byte byte/block in
+ * buffer
+ */
+
+&getsize
+ sta dp
+ sty dp+1
+ stx actdev
+ jsr clrtask
+ jsr selcntr
+ bcs selerr2
+ lda #$25
+ jsr taskAout
+ ldy #0
+gsl jsr reqwait
+ bmi gsdone
+ lda DATA
+ sta (dp),y
+ iny
+ bne gsl
+gsdone jsr getstat
+ bcc gsrts
+ jmp error
+gsrts rts
+
+/*************************************************************************
+ * Print data subroutines
+ *************************************************************************/
+
+#ifdef PRINT
+
+/*************************************************************************
+ * Print inquiry data
+ */
+
+loginquire
+ ldy #8
+li1 lda (dp),y
+ jsr cout
+ iny
+ cpy #32
+ bcc li1
+ log(5)
+ ldy #0
+ lda (dp),y
+ and #%00011111
+ jsr hexout
+ log(6)
+ ldy #2
+ lda (dp),y
+ and #%00000111
+ jsr hexout
+liret log(7)
+ rts
+
+/*************************************************************************
+ * Print media size
+ */
+
+printsize
+ log(8)
+
+ ldy #0
+pl1 lda (dp),y
+ jsr hexout
+ iny
+ cpy #4
+ bcc pl1
+
+ log(9)
+
+ ldy #4
+pl2 lda (dp),y
+ jsr hexout
+ iny
+ cpy #8
+ bcc pl2
+
+ jmp liret
+
+
+/*************************************************************************
+ * Generic Subroutines
+ */
+
+logout txa
+ asl
+ tax
+ lda laddr+1,x
+ tay
+ lda laddr,x
+ jmp txtout
+
+laddr .word logt0, logt1, logt2, logt3, logt4, int0, int1, int2, ps1, ps2
+#ifdef PRINT2
+ .word rd1, rd2, rd3, rd4, rd5, rd6
+#endif
+
+logt0 .asc 13,10,"CS/A65 SCSI driver",13,10
+ .asc 13,10,"Resetting SCSI bus",13,10,0
+logt1 .asc "Device not ready ",0
+logt2 .asc "Device error bit set",13,10,0
+logt3 .asc "Device found ",0
+logt4 .asc "Device select timeout ",0
+
+int0 .asc "[Type ",0
+int1 .asc ", SCSI Rev. ",0
+int2 .asc "]",13,10,0
+
+ps1 .asc " [Blocks: ",0
+ps2 .asc ", Byte/Block: ",0
+
+#ifdef PRINT2
+
+rd1 .asc "Read Block Dev: ",0
+rd2 .asc ", Sect: ",0
+rd3 .asc ", nsec: ",0
+rd4 .asc " To: ",0
+rd5 .asc 13,10,0
+rd6 .asc "Write Block Dev: ",0
+
+#endif
+
+#endif /* PRINT */
+
+/*************************************************************************
+ * Data structures (no extended read/writes)
+ */
+
+ .bss
+
+; active device number (0-7)
+
+actdev .byt 0
+
+; contains the device type for each SCSI ID
+
+&devtype .dsb 8
+
+; this structure is sent as it is for one command
+
+task .byt 0 ; command code
+ .byt 0 ; LUN
+&lba .byt 0 ;
+ .byt 0 ;
+ .byt 0 ;
+ .byt 0 ;
+ .byt 0
+&nsec .byt 0
+ .byt 0
+ .byt 0
+
+ .)
+
+#ifdef STANDALONE
+
+buffer =*
+
+#endif
+ .text
+
+
+
diff --git a/dump/oa-2.0.9/devices/scsi/csascsi1.fig b/dump/oa-2.0.9/devices/scsi/csascsi1.fig
new file mode 100644
index 0000000..d67b4ec
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/csascsi1.fig
@@ -0,0 +1,1405 @@
+#FIG 3.2
+Portrait
+Center
+Metric
+A4
+70.00
+Single
+2
+1200 2
+5 1 1 1 0 7 0 0 -1 4.000 0 1 0 0 14422.500 5512.500 14400 5400 14310 5490 14400 5625
+6 1575 8325 3825 9000
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 3600 8550 45 45 3600 8550 3645 8550
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 2250 8550 1800 8550 1800 8775
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 8550 3600 8550
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1710 8775 1890 8775
+4 0 0 0 0 16 12 0.0000 4 135 405 2250 8550 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 8550 20\001
+4 0 0 0 0 16 12 0.0000 4 135 210 2025 8550 10\001
+4 0 0 0 0 16 12 0.0000 4 135 345 2790 8550 Vcc\001
+-6
+6 5625 4950 7875 5625
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 7650 5175 45 45 7650 5175 7695 5175
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 6300 5175 5850 5175 5850 5400
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 5175 7650 5175
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 5760 5400 5940 5400
+4 0 0 0 0 16 12 0.0000 4 135 405 6300 5175 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 5175 20\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 5175 10\001
+4 0 0 0 0 16 12 0.0000 4 135 345 6840 5175 Vcc\001
+-6
+6 7515 1800 8010 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 7762.500 2475.000 7560 2295 7740 2205 7965 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 7762.500 2385.000 7560 2205 7740 2115 7965 2205
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 7801.875 2171.250 7560 2205 7650 1980 7740 1935
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 7738.269 2165.192 7965 2205 7875 1980 7740 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 7740 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7740 1935 7740 1800
+-6
+6 7965 1800 8460 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8212.500 2475.000 8010 2295 8190 2205 8415 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8212.500 2385.000 8010 2205 8190 2115 8415 2205
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8251.875 2171.250 8010 2205 8100 1980 8190 1935
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 8188.269 2165.192 8415 2205 8325 1980 8190 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 8190 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8190 1935 8190 1800
+-6
+6 8415 1800 8910 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8662.500 2475.000 8460 2295 8640 2205 8865 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8662.500 2385.000 8460 2205 8640 2115 8865 2205
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8701.875 2171.250 8460 2205 8550 1980 8640 1935
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 8638.270 2165.192 8865 2205 8775 1980 8640 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 8640 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8640 1935 8640 1800
+-6
+6 8865 1800 9360 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 9112.500 2475.000 8910 2295 9090 2205 9315 2295
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 9112.500 2385.000 8910 2205 9090 2115 9315 2205
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 9151.875 2171.250 8910 2205 9000 1980 9090 1935
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 9088.270 2165.192 9315 2205 9225 1980 9090 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 9090 1935
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9090 1935 9090 1800
+-6
+6 7740 1260 8235 1755
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 7987.500 1935.000 7785 1755 7965 1665 8190 1755
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 7987.500 1845.000 7785 1665 7965 1575 8190 1665
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8026.875 1631.250 7785 1665 7875 1440 7965 1395
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 7963.269 1625.192 8190 1665 8100 1440 7965 1395
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 7965 1395
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7965 1395 7965 1260
+-6
+6 8640 1260 9135 1755
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8887.500 1935.000 8685 1755 8865 1665 9090 1755
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8887.500 1845.000 8685 1665 8865 1575 9090 1665
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8926.875 1631.250 8685 1665 8775 1440 8865 1395
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 8863.270 1625.192 9090 1665 9000 1440 8865 1395
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 8865 1395
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8865 1395 8865 1260
+-6
+6 8190 675 8685 1170
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8437.500 1350.000 8235 1170 8415 1080 8640 1170
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8437.500 1260.000 8235 1080 8415 990 8640 1080
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 8476.875 1046.250 8235 1080 8325 855 8415 810
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 8413.270 1040.192 8640 1080 8550 855 8415 810
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 8415 810
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8415 810 8415 675
+-6
+6 9450 450 9675 900
+1 4 0 1 0 7 0 0 -1 0.000 1 0.0000 9562 787 33 33 9540 765 9585 810
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 9450 540 9450 810 9675 675 9450 540
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9585 810 9585 900
+-6
+6 11925 1350 14175 2025
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 12015 1350 14085 1350 14085 2025 12015 2025 12015 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12240 1350 12240 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12465 1350 12465 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12690 1350 12690 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12915 1350 12915 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13140 1350 13140 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13365 1350 13365 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13590 1350 13590 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13815 1350 13815 2025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 12150 1350
+-6
+6 11925 9000 14175 9675
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 12015 9000 14085 9000 14085 9675 12015 9675 12015 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12240 9000 12240 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12465 9000 12465 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12690 9000 12690 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12915 9000 12915 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13140 9000 13140 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13365 9000 13365 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13590 9000 13590 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13815 9000 13815 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 1
+ 12150 9000
+-6
+6 12150 900 14175 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 12150 1350 12150 900 14175 900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12375 900 12375 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12600 900 12600 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12825 900 12825 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13050 900 13050 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13275 900 13275 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13500 900 13500 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13725 900 13725 1350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13950 900 13950 1350
+-6
+6 12375 14985 12600 15165
+1 4 0 1 0 7 0 0 -1 0.000 1 0.0000 12555 15075 45 45 12510 15075 12600 15075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 12375 14985 12375 15165 12510 15075 12375 14985
+-6
+6 12375 15210 12600 15390
+1 4 0 1 0 7 0 0 -1 0.000 1 0.0000 12555 15300 45 45 12510 15300 12600 15300
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 12375 15210 12375 15390 12510 15300 12375 15210
+-6
+6 8775 13950 9225 14175
+1 4 0 1 0 7 0 0 -1 0.000 0 4.7124 8888 14063 33 33 8910 14085 8865 14040
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 9135 14175 8865 14175 9000 13950 9135 14175
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8865 14040 8775 14040
+-6
+6 10350 9225 11925 13950
+6 10440 9900 11610 10575
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 10440 9900 11610 9900 11610 10575 10440 10575 10440 9900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10665 9900 10665 10575
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10890 9900 10890 10575
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11115 9900 11115 10575
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11340 9900 11340 10575
+-6
+6 10440 12375 11610 13050
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 10440 12375 11610 12375 11610 13050 10440 13050 10440 12375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10665 12375 10665 13050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10890 12375 10890 13050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11115 12375 11115 13050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11340 12375 11340 13050
+-6
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 11700 9450 45 45 11700 9450 11745 9450
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11475 9450 45 45 11475 9450 11520 9450
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11250 9450 45 45 11250 9450 11295 9450
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11025 9450 45 45 11025 9450 11070 9450
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 10800 9450 45 45 10800 9450 10845 9450
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 10575 13500 45 45 10575 13500 10620 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 10800 13500 45 45 10800 13500 10845 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11025 13500 45 45 11025 13500 11070 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11250 13500 45 45 11250 13500 11295 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 10575 11025 45 45 10575 11025 10620 11025
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 10800 11250 45 45 10800 11250 10845 11250
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11025 11475 45 45 11025 11475 11070 11475
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11250 11700 45 45 11250 11700 11295 11700
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11475 11925 45 45 11475 11925 11520 11925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10575 10575 10575 12375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10800 10575 10800 12375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 10575 11025 12375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11250 10575 11250 12375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11475 10575 11475 12375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 10575 9900 10575 9450 11700 9450
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10800 9900 10800 9450
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 9450 11025 9900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11250 9450 11250 9900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11475 9450 11475 9900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10575 13050 10575 13725
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10800 13050 10800 13500
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 13050 11025 13500
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11250 13050 11250 13500
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 11475 13050 11475 13500 10575 13500
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 10485 13725 10665 13725
+-6
+6 9315 9900 10035 10350
+5 1 0 1 0 7 0 0 -1 0.000 0 0 0 0 9675.000 10398.214 9315 10350 9675 10035 10035 10350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9315 10350 10035 10350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9675 10035 9675 9900
+-6
+6 9540 9135 9810 9450
+1 4 0 1 0 7 0 0 -1 0.000 1 0.0000 9675 9180 45 45 9675 9225 9675 9135
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 9540 9450 9810 9450 9675 9225 9540 9450
+-6
+6 6300 17550 7200 18450
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 6300 17550 7200 17550 7200 18450 6300 18450 6300 17550
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 6300 17910 6525 18000 6300 18090
+4 0 0 0 0 16 12 0.0000 4 135 135 6345 17865 D\001
+4 0 0 0 0 16 12 0.0000 4 135 180 6345 18315 /S\001
+4 0 0 0 0 16 12 0.0000 4 135 180 6930 18315 /R\001
+4 0 0 0 0 16 12 0.0000 4 135 150 6975 17865 Q\001
+-6
+6 6300 19125 7200 20025
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 6300 19125 7200 19125 7200 20025 6300 20025 6300 19125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 6300 19485 6525 19575 6300 19665
+4 0 0 0 0 16 12 0.0000 4 135 135 6345 19440 D\001
+4 0 0 0 0 16 12 0.0000 4 135 180 6345 19890 /S\001
+4 0 0 0 0 16 12 0.0000 4 135 180 6930 19890 /R\001
+4 0 0 0 0 16 12 0.0000 4 135 150 6975 19440 Q\001
+-6
+6 12375 15660 12600 15840
+1 4 0 1 0 7 0 0 -1 0.000 1 0.0000 12555 15750 45 45 12510 15750 12600 15750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 12375 15660 12375 15840 12510 15750 12375 15660
+-6
+6 12375 16110 12600 16290
+1 4 0 1 0 7 0 0 -1 0.000 1 0.0000 12555 16200 45 45 12510 16200 12600 16200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 12375 16110 12375 16290 12510 16200 12375 16110
+-6
+6 10125 15975 10575 16425
+1 4 0 1 0 7 0 0 -1 0.000 1 4.7124 10350 16155 45 45 10350 16110 10350 16200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 10440 15975 10260 15975 10350 16110 10440 15975
+-6
+6 13140 13950 14085 14625
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 13140 13950 14085 13950 14085 14625 13140 14625 13140 13950
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13365 13950 13365 14625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13590 13950 13590 14625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13815 13950 13815 14625
+-6
+6 13140 16650 14085 17325
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 13140 16650 14085 16650 14085 17325 13140 17325 13140 16650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13365 16650 13365 17325
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13590 16650 13590 17325
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13815 16650 13815 17325
+-6
+6 4050 8775 4500 9225
+1 4 0 1 0 7 0 0 -1 0.000 0 1.5708 4275 9045 45 45 4275 9090 4275 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 4365 9225 4185 9225 4275 9090 4365 9225
+-6
+6 4500 15750 4950 16200
+1 4 0 1 0 7 0 0 -1 0.000 1 0.0000 4680 15975 45 45 4635 15975 4725 15975
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 4500 15885 4500 16065 4635 15975 4500 15885
+-6
+6 3015 14625 3735 15075
+5 1 0 1 0 7 0 0 -1 0.000 0 1 0 0 3375.000 14576.786 3015 14625 3375 14940 3735 14625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3015 14625 3735 14625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3375 14940 3375 15075
+-6
+6 9675 13950 10125 14175
+1 4 0 1 0 7 0 0 -1 0.000 0 4.7124 9788 14063 33 33 9810 14085 9765 14040
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 10035 14175 9765 14175 9900 13950 10035 14175
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9765 14040 9675 14040
+-6
+6 13185 18585 15660 19935
+4 0 -1 0 0 18 20 0.0000 4 270 1740 13185 19155 (c) A. Fachat\001
+4 0 -1 0 0 18 20 0.0000 4 270 2475 13185 19500 All rights reserved\001
+4 0 -1 0 0 18 20 0.0000 4 270 1755 13185 19845 No Warranty!\001
+4 0 -1 0 0 18 20 0.0000 4 210 1440 13185 18810 CS/A SCSI\001
+-6
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 3600 6075 45 45 3600 6075 3645 6075
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 3600 7200 45 45 3600 7200 3645 7200
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 3600 7425 45 45 3600 7425 3645 7425
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 3825 6975 45 45 3825 6975 3870 6975
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 3825 6750 45 45 3825 6750 3870 6750
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 3825 6525 45 45 3825 6525 3870 6525
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 4050 6075 45 45 4050 6075 4095 6075
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 3600 11700 45 45 3600 11700 3645 11700
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 1800 12600 45 45 1800 12600 1845 12600
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 9225 4275 45 45 9225 4275 9270 4275
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 9000 4050 45 45 9000 4050 9045 4050
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 8775 3825 45 45 8775 3825 8820 3825
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 8550 3600 45 45 8550 3600 8595 3600
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 8325 3375 45 45 8325 3375 8370 3375
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 8100 3150 45 45 8100 3150 8145 3150
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 7875 2925 45 45 7875 2925 7920 2925
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 7650 2700 45 45 7650 2700 7695 2700
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 9450 4725 45 45 9450 4725 9495 4725
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12150 2475 45 45 12150 2475 12195 2475
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12375 2700 45 45 12375 2700 12420 2700
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12600 2925 45 45 12600 2925 12645 2925
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12825 3150 45 45 12825 3150 12870 3150
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13050 3375 45 45 13050 3375 13095 3375
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13275 3600 45 45 13275 3600 13320 3600
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13500 3825 45 45 13500 3825 13545 3825
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 4050 45 45 13725 4050 13770 4050
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13950 4275 45 45 13950 4275 13995 4275
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 14175 900 45 45 14175 900 14220 900
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12375 6750 45 45 12375 6750 12420 6750
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12600 6975 45 45 12600 6975 12645 6975
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12825 7200 45 45 12825 7200 12870 7200
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13050 7425 45 45 13050 7425 13095 7425
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13275 7650 45 45 13275 7650 13320 7650
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13500 7875 45 45 13500 7875 13545 7875
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 8100 45 45 13725 8100 13770 8100
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13950 8325 45 45 13950 8325 13995 8325
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12375 10125 45 45 12375 10125 12420 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12150 10125 45 45 12150 10125 12195 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12600 10125 45 45 12600 10125 12645 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12825 10125 45 45 12825 10125 12870 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13050 10125 45 45 13050 10125 13095 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13275 10125 45 45 13275 10125 13320 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13500 10125 45 45 13500 10125 13545 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 10125 45 45 13725 10125 13770 10125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12375 900 45 45 12375 900 12420 900
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12600 900 45 45 12600 900 12645 900
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 12825 900 45 45 12825 900 12870 900
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13050 900 45 45 13050 900 13095 900
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13275 900 45 45 13275 900 13320 900
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13500 900 45 45 13500 900 13545 900
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 900 45 45 13725 900 13770 900
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 11475 5175 45 45 11475 5175 11520 5175
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 7650 13500 45 45 7650 13500 7695 13500
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 7650 9225 45 45 7650 9225 7695 9225
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 7650 16650 45 45 7650 16650 7695 16650
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 9000 8325 45 45 9000 8325 9045 8325
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 8775 15750 45 45 8775 15750 8820 15750
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 9900 11025 45 45 9900 11025 9945 11025
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 7650 18225 45 45 7650 18225 7695 18225
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 5850 18225 45 45 5850 18225 5895 18225
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 5850 19800 45 45 5850 19800 5895 19800
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 5850 19350 45 45 5850 19350 5895 19350
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 8325 17775 45 45 8325 17775 8370 17775
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 8100 19350 45 45 8100 19350 8145 19350
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 11925 11250 45 45 11925 11250 11970 11250
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13275 17775 45 45 13275 17775 13320 17775
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13500 17775 45 45 13500 17775 13545 17775
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 17775 45 45 13725 17775 13770 17775
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13275 15075 45 45 13275 15075 13320 15075
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13500 15300 45 45 13500 15300 13545 15300
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 15750 45 45 13725 15750 13770 15750
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13950 16200 45 45 13950 16200 13995 16200
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13500 13500 45 45 13500 13500 13545 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 13500 45 45 13725 13500 13770 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13725 13500 45 45 13725 13500 13770 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 13950 13500 45 45 13950 13500 13995 13500
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 5850 15975 45 45 5850 15975 5895 15975
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 4050 15975 45 45 4050 15975 4095 15975
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 4500 10575 45 45 4500 10575 4545 10575
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 4275 10350 45 45 4275 10350 4320 10350
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 14175 13500 45 45 14175 13500 14220 13500
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 14400 5625 45 45 14400 5625 14445 5625
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 14400 5400 45 45 14400 5400 14445 5400
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 14400 4725 45 45 14400 4725 14445 4725
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 2025 19125 45 45 2025 19125 2070 19125
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 2025 18675 45 45 2025 18675 2070 18675
+1 3 0 1 0 0 0 0 20 0.000 1 0.0000 9900 11925 45 45 9900 11925 9945 11925
+1 3 0 1 0 7 0 0 -1 0.000 1 0.0000 2025 16650 45 45 2025 16650 2070 16650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 675 1125 1350 1125 1350 13500 675 13500
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 2925 1800 2925 2025 2700
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 3150 1800 3150 2025 2925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 3375 1800 3375 2025 3150
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 3600 1800 3600 2025 3375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 3825 1800 3825 2025 3600
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 4050 1800 4050 2025 3825
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 4275 1800 4275 2025 4050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 4500 1800 4500 2025 4275
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 2250 5625 3150 5625 3150 8775 2250 8775 2250 5625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 6075 2250 6075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 6300 2250 6300
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 6525 2250 6525
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 6750 2250 6750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 6975 2250 6975
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 7200 2250 7200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 7425 2250 7425
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 7650 2250 7650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 8100 2250 8100
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 6075 4050 6075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 3150 7650 3600 7650 3600 6075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 7425 3600 7425
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 7200 3600 7200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 3150 6300 3825 6300 3825 7200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 6525 3825 6525
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 6750 3825 6750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 6975 3825 6975
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3735 7200 3915 7200
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 2250 9675 3150 9675 3150 11925 2250 11925 2250 9675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 10575 2250 10575
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 10800 2250 10800
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 11025 2250 11025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 6
+ 3150 8100 3825 8100 3825 9225 1800 9225 1800 9900 2250 9900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 11250 2250 11250
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 2250 10125 1800 10125 1800 10350
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1710 10350 1890 10350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 2250 11700 1800 11700 1800 11925
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1710 11925 1890 11925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 3150 11700 3600 11700
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1350 12600 1800 12600
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1350 12825 1800 12825 1800 13050
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1710 13050 1890 13050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 6
+ 2025 4275 2025 2250 2250 2025 5175 2025 5400 2250 5400 17550
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 2475 5625 2700 6300 2700
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 2700 5625 2925 6300 2925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 2925 5625 3150 6300 3150
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 3150 5625 3375 6300 3375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 3375 5625 3600 6300 3600
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 3600 5625 3825 6300 3825
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 3825 5625 4050 6300 4050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 4050 5625 4275 6300 4275
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 6300 2250 7200 2250 7200 5400 6300 5400 6300 2250
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 2925 10125 2925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 3150 10125 3150
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 3375 10125 3375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 3600 10125 3600
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 3825 10125 3825
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 4050 10125 4050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 4275 10125 4275
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7650 2250 7650 2700
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7875 2250 7875 2925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8100 2250 8100 3150
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8325 2250 8325 3375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8550 2250 8550 3600
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8775 2250 8775 3825
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9000 2250 9000 4050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9225 2250 9225 4275
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7740 1800 7875 1800 7875 1710
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 8190 1800 8100 1800 8100 1710
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 8640 1800 8775 1800 8775 1710
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 9090 1800 9000 1800 9000 1710
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7965 1260 8325 1260 8325 1125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 8550 1125 8550 1260 8865 1260
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8415 675 8550 675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8550 675 9450 675
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 9585 900 9585 1125 9450 1125 9450 6075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9450 4725 10125 4725
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7200 4725 7650 4725 7650 4950
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7560 4950 7740 4950
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 2700 15075 2700
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 2925 15075 2925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 3150 15075 3150
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 3375 15075 3375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 3600 15075 3600
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 3825 15075 3825
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 4050 15075 4050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 4275 15075 4275
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 9675 675 11475 675 11475 2475 15075 2475
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12150 2025 12150 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12375 2025 12375 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12600 2025 12600 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12825 2025 12825 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13050 2025 13050 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13275 2025 13275 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13500 2025 13500 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13725 2025 13725 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13950 2025 13950 9000
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9585 5400 9765 5400
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 6750 12375 6750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 6975 12600 6975
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 7200 12825 7200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 7425 13050 7425
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 7650 13275 7650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 7875 13500 7875
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 8100 13725 8100
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 8325 13950 8325
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 6525 5625 6750 6300 6750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 6975 5625 7200 6300 7200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 7200 5625 7425 6300 7425
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 7425 5625 7650 6300 7650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 7650 5625 7875 6300 7875
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 7875 5625 8100 6300 8100
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 8100 5625 8325 6300 8325
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12375 9675 12375 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12600 9675 12600 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12825 9675 12825 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13050 9675 13050 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13275 9675 13275 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13500 9675 13500 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13725 9675 13725 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13950 9675 13950 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12150 9675 12150 10350
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12060 10350 12240 10350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12150 10125 13950 10125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 2700 10125 2700
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 10125 2250 11025 2250 11025 5400 10125 5400 10125 2250
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 11025 4725 11475 4725 11475 4950
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11385 4950 11565 4950
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 10125 5175 9675 5175 9675 5400
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 11025 5175 11475 5175
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 6750 5625 6975 6300 6975
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 6300 10575 7200 10575 7200 13725 6300 13725 6300 10575
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7200 13050 7650 13050 7650 13275
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7560 13275 7740 13275
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 6300 13500 5850 13500 5850 13725
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 13500 7650 13500
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 5760 13725 5940 13725
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 6300 6300 7200 6300 7200 9450 6300 9450 6300 6300
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7200 8775 7650 8775 7650 9000
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7560 9000 7740 9000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 6300 9225 5850 9225 5850 9450
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 9225 7650 9225
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 5760 9450 5940 9450
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 10800 5625 11025 6300 11025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 11025 5625 11250 6300 11250
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 11250 5625 11475 6300 11475
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 11475 5625 11700 6300 11700
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 11700 5625 11925 6300 11925
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 11925 5625 12150 6300 12150
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 12150 5625 12375 6300 12375
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 11025 15075 11025
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 11250 15075 11250
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 11475 15075 11475
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 11925 15075 11925
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 6300 14625 7200 14625 7200 16875 6300 16875 6300 14625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 14850 5625 15075 6300 15075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 15075 5625 15300 6300 15300
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 15300 5625 15525 6300 15525
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 15525 5625 15750 6300 15750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 6300 16650 5850 16650 5850 16875
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 16650 7650 16650
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 5760 16875 5940 16875
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 15075 12375 15075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12600 15075 15075 15075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12600 15300 15075 15300
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9000 14175 9000 14400
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 8910 14400 9090 14400
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7200 15750 8775 15750 8775 14040
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9000 13950 9000 8325
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9900 11025 9900 10350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 9675 9000 9675 6075 9450 6075
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9675 9450 9675 9900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9675 9000 9675 9135
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5400 17550 5625 17775 6300 17775
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 6300 18225 5850 18225
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 18225 7650 18225
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 6300 19800 5850 19800
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 6300 19350 5850 19350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 11700 15075 11700
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 9675 14040 9675 15525 7200 15525
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7200 12150 8325 12150 8325 17775
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 7200 12375 8100 12375 8100 19350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 7200 15300 12375 15300
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 7200 17775 10800 17775 10800 15750 12375 15750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12600 15750 15075 15750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 12600 16200 15075 16200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 11925 11250 11925 14625 10350 14625 10350 15975
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 7200 19350 11250 19350 11250 16200 12375 16200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 10350 16200 10350 19800 7200 19800
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 15750 1800 15075 1800 15075 17550 15750 17550
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 14625 7650 14625 7425 15075 7425
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 14535 7650 14715 7650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 14535 8325 15075 8325
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13275 14625 13275 16650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13500 14625 13500 16650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13725 14625 13725 16650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13950 14625 13950 16650
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 13275 13950 13275 13500 14175 13500
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13500 13500 13500 13950
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13725 13500 13725 13950
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13950 13500 13950 13950
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13275 17325 13275 18000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13500 17325 13500 17775
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13725 17325 13725 17775
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 13950 17325 13950 17775 13275 17775
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 13185 18000 13365 18000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 3150 10350 4275 10350 4275 9225
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 4275 9000 4275 4725 6300 4725
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 3150 10575 4500 10575 4500 8775 6300 8775
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 3150 10800 4050 10800 4050 15975 4500 15975
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 4725 15975 6300 15975
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 5850 15975 5850 16200 6300 16200
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 4050 15975 4050 18000 6300 18000
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 3150 11025 3825 11025 3825 13050 6300 13050
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 4275 10350 4275 13950 3150 13950 3150 14625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 4
+ 4500 10575 4500 14175 3600 14175 3600 14625
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 8775 15750 9450 15750 9450 10350
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 3375 15075 3375 19575 6300 19575
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1935 19800 2115 19800
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1575 19575 2025 19575 2025 19800
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 675 18225 1575 18225 1575 20025 675 20025 675 18225
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 225 225 16650 225 16650 21375 225 21375 225 225
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 15075 5850 14400 5850 14400 5625
+2 1 0 1 0 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 14265 5175 14535 5175
+2 1 0 1 0 7 0 0 -1 4.000 0 0 -1 0 0 4
+ 14400 5175 14265 4950 14535 4950 14400 5175
+2 1 0 1 0 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 14400 5175 14400 5400
+2 1 0 1 0 7 0 0 -1 4.000 0 0 -1 0 0 2
+ 14400 4950 14400 4725
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 14625 6750 14625 6525 15075 6525
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 14535 6750 14715 6750
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1575 19125 2025 19125
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1575 18450 2025 18450 2025 18900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1575 18675 2025 18675
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1935 18900 2115 18900
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9900 14175 9900 14400
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9810 14400 9990 14400
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 9900 13950 9900 11925
+2 1 0 2 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1935 17550 2115 17550
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 3
+ 1575 17325 2025 17325 2025 17550
+2 1 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 2
+ 1575 16650 2025 16650
+2 2 0 1 0 7 0 0 -1 0.000 0 0 -1 0 0 5
+ 675 15975 1575 15975 1575 17775 675 17775 675 15975
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 6075 c12\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 6300 c13\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 6525 c14\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 6750 c15\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 6975 c16\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 7200 c17\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 7425 c18\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 7650 c19\001
+4 0 0 0 0 16 12 0.0000 4 135 210 1350 8100 a7\001
+4 0 0 0 0 16 12 0.0000 4 135 345 900 6075 A11\001
+4 0 0 0 0 16 12 0.0000 4 135 345 900 6300 A10\001
+4 0 0 0 0 16 12 0.0000 4 135 600 675 8100 /IOSEL\001
+4 0 0 0 0 16 12 0.0000 4 135 195 2250 8100 /G\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 8100 19\001
+4 0 0 0 0 16 12 0.0000 4 135 420 2700 8100 /A=B\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 8100 1\001
+4 0 0 0 0 16 12 0.0000 4 135 360 2475 5850 '688\001
+4 0 0 0 0 16 12 0.0000 4 135 210 2025 6075 12\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 6300 9\001
+4 0 0 0 0 16 12 0.0000 4 135 210 2025 6525 14\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 6750 7\001
+4 0 0 0 0 16 12 0.0000 4 135 210 2025 6975 16\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 7200 5\001
+4 0 0 0 0 16 12 0.0000 4 135 210 2025 7425 18\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 7650 3\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 6075 11\001
+4 0 0 0 0 16 12 0.0000 4 135 105 3150 6300 8\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 6525 13\001
+4 0 0 0 0 16 12 0.0000 4 135 105 3150 6750 6\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 6975 15\001
+4 0 0 0 0 16 12 0.0000 4 135 105 3150 7200 4\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 7425 17\001
+4 0 0 0 0 16 12 0.0000 4 135 105 3150 7650 2\001
+4 0 0 0 0 16 12 0.0000 4 135 285 2475 5625 IC1\001
+4 0 0 0 0 16 12 0.0000 4 135 285 2475 9675 IC2\001
+4 0 0 0 0 16 12 0.0000 4 135 360 2700 9900 '138\001
+4 0 0 0 0 16 12 0.0000 4 135 285 2250 9900 /E1\001
+4 0 0 0 0 16 12 0.0000 4 135 285 2250 10125 /E2\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2250 10575 E3\001
+4 0 0 0 0 16 12 0.0000 4 135 135 2250 10800 C\001
+4 0 0 0 0 16 12 0.0000 4 135 120 2250 11025 B\001
+4 0 0 0 0 16 12 0.0000 4 135 135 2250 11250 A\001
+4 0 0 0 0 16 12 0.0000 4 135 405 2250 11700 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 345 2790 11700 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 9900 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 10125 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 10575 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 10800 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 11025 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 11250 1\001
+4 0 0 0 0 16 12 0.0000 4 135 105 2025 11700 8\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 11700 16\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 10575 c26\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 10800 c22\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 11025 c23\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 11250 c25\001
+4 0 0 0 0 16 12 0.0000 4 135 375 900 10575 Phi2\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 10800 A1\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 11025 A0\001
+4 0 0 0 0 16 12 0.0000 4 135 465 900 11250 R/-W\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 10350 15\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 10575 14\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 10800 13\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 11025 12\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 2925 a22\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 3150 a21\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 3375 a20\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 3600 a19\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 3825 a18\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 4050 a17\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 4500 a15\001
+4 0 0 0 0 16 12 0.0000 4 135 315 1350 4275 a16\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 2925 D0\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 3150 D1\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 3375 D2\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 3600 D3\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 3825 D4\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 4050 D5\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 4275 D6\001
+4 0 0 0 0 16 12 0.0000 4 135 240 900 4500 D7\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 2700 D0\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 4275 D7\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 2700 19\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 2925 18\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 3150 17\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 3375 16\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 3600 15\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 3825 14\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 4275 12\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 4050 13\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 4725 1\001
+4 0 0 0 0 16 12 0.0000 4 135 330 6840 4725 /OE\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 4275 Q7\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 4050 Q6\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 3825 Q5\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 3600 Q4\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 3375 Q3\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 3150 Q2\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 2925 Q1\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 2700 Q0\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 2700 D0\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 2925 D1\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 3150 D2\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 3375 D3\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 3600 D4\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 3825 D5\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 4050 D6\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 4275 D7\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6300 4725 LE\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 2700 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 2925 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 3150 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 3375 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 3600 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 3825 7\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 4050 8\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 4275 9\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 4725 11\001
+4 0 0 0 0 16 12 0.0000 4 135 285 6525 2250 IC6\001
+4 0 0 0 0 16 12 0.0000 4 135 360 6525 2475 '573\001
+4 0 0 0 0 16 12 0.0000 4 135 390 10350 2250 IC10\001
+4 0 0 0 0 16 12 0.0000 4 135 360 10350 2475 '540\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 2700 18\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 2925 17\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 3150 16\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 3375 15\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 3600 14\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 3825 13\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 4050 12\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 4275 11\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 4725 19\001
+4 0 0 0 0 16 12 0.0000 4 135 435 10575 4725 /OE2\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 2700 E0\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 2925 E1\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 3150 E2\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 3375 E3\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 3600 E4\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 3825 E5\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 4050 E6\001
+4 0 0 0 0 16 12 0.0000 4 135 225 10125 4275 E7\001
+4 0 0 0 0 16 12 0.0000 4 135 435 10125 4725 /OE1\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 2700 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 2925 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 3150 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 3375 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 3600 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 3825 7\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 4050 8\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 4275 9\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9900 4725 1\001
+4 0 0 0 0 16 12 0.0000 4 135 405 10125 5175 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 210 11025 5175 20\001
+4 0 0 0 0 16 12 0.0000 4 135 210 9900 5175 10\001
+4 0 0 0 0 16 12 0.0000 4 135 345 10665 5175 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 360 6525 10800 '540\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 13050 19\001
+4 0 0 0 0 16 12 0.0000 4 135 435 6750 13050 /OE2\001
+4 0 0 0 0 16 12 0.0000 4 135 435 6300 13050 /OE1\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 13050 1\001
+4 0 0 0 0 16 12 0.0000 4 135 405 6300 13500 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 13500 20\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 13500 10\001
+4 0 0 0 0 16 12 0.0000 4 135 345 6840 13500 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 11025 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 11250 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 11475 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 11700 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 11925 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 12150 7\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 12375 8\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 12600 9\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 11025 /Q0\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 11250 /Q1\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 11475 /Q2\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 11700 /Q3\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 11925 /Q4\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 12150 /Q5\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 12375 /Q6\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 12600 /Q7\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 11025 18\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 11250 17\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 11475 16\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 11700 15\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 11925 14\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 12150 13\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 12375 12\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 12600 11\001
+4 0 0 0 0 16 12 0.0000 4 135 285 6525 6300 IC7\001
+4 0 0 0 0 16 12 0.0000 4 135 360 6525 6525 '540\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 8775 19\001
+4 0 0 0 0 16 12 0.0000 4 135 435 6750 8775 /OE2\001
+4 0 0 0 0 16 12 0.0000 4 135 435 6300 8775 /OE1\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 8775 1\001
+4 0 0 0 0 16 12 0.0000 4 135 405 6300 9225 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 9225 20\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 9225 10\001
+4 0 0 0 0 16 12 0.0000 4 135 345 6840 9225 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 6750 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 6975 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 7200 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 7425 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 7650 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 7875 7\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 8100 8\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 8325 9\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 6750 /Q0\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 6975 /Q1\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 7200 /Q2\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 7425 /Q3\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 7650 /Q4\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 7875 /Q5\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 8100 /Q6\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6300 8325 /Q7\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 6750 18\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 6975 17\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 7200 16\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 7425 15\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 7650 14\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 7875 13\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 8100 12\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 8325 11\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 11025 D0\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 11250 D6\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 11475 D7\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 11700 D4\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 11925 D3\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 12150 D2\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 12375 D1\001
+4 0 0 0 0 16 12 0.0000 4 135 405 6300 16650 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 345 6840 16650 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 16650 12\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 16650 5\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 15075 D0\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 15300 D3\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 15525 D2\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 15750 D1\001
+4 0 0 0 0 16 12 0.0000 4 135 105 12150 15075 4\001
+4 0 0 0 0 16 12 0.0000 4 135 210 12600 15075 16\001
+4 0 0 0 0 16 12 0.0000 4 135 105 12150 15300 3\001
+4 0 0 0 0 16 12 0.0000 4 135 210 12600 15300 17\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6525 14850 '75\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 15075 16\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 15300 15\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 15525 11\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 15750 8\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 15075 1D\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 15300 2D\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 15525 3D\001
+4 0 0 0 0 16 12 0.0000 4 135 240 6300 15750 4D\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 15075 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 15300 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 15525 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 15750 7\001
+4 0 0 0 0 16 12 0.0000 4 135 390 9675 450 IC13\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9675 675 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9225 675 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9675 900 1\001
+4 0 0 0 0 16 12 0.0000 4 135 495 14175 1575 9*220\001
+4 0 0 0 0 16 12 0.0000 4 135 495 14175 9225 9*330\001
+4 0 0 0 0 16 12 0.0000 4 135 345 14175 9450 RP2\001
+4 0 0 0 0 16 12 0.0000 4 135 345 14175 1800 RP1\001
+4 0 0 0 0 16 12 0.0000 4 135 210 9450 9225 12\001
+4 0 0 0 0 16 12 0.0000 4 135 285 9225 9450 IC4\001
+4 0 0 0 0 16 12 0.0000 4 135 285 9900 10125 IC3\001
+4 0 0 0 0 16 12 0.0000 4 135 240 4950 17775 D7\001
+4 0 0 0 0 16 12 0.0000 4 135 390 10125 14175 IC13\001
+4 0 0 0 0 16 12 0.0000 4 135 390 8550 13725 IC13\001
+4 0 0 0 0 16 12 0.0000 4 135 105 12150 15750 6\001
+4 0 0 0 0 16 12 0.0000 4 135 210 12600 15750 14\001
+4 0 0 0 0 16 12 0.0000 4 135 105 12150 16200 5\001
+4 0 0 0 0 16 12 0.0000 4 135 210 12600 16200 15\001
+4 0 0 0 0 16 12 0.0000 4 135 105 10125 15975 7\001
+4 0 0 0 0 16 12 0.0000 4 135 210 10125 16425 13\001
+4 0 0 0 0 16 12 0.0000 4 135 285 9900 16200 IC4\001
+4 0 0 0 0 16 12 0.0000 4 135 465 12150 16650 4*IC4\001
+4 0 0 0 0 16 12 0.0000 4 135 315 15075 2475 /DP\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 2700 /D0\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 2925 /D1\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 3150 /D2\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 3375 /D3\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 3600 /D4\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 3825 /D5\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 4050 /D6\001
+4 0 0 0 0 16 12 0.0000 4 135 300 15075 4275 /D7\001
+4 0 0 0 0 16 12 0.0000 4 135 255 15075 11025 I/O\001
+4 0 0 0 0 16 12 0.0000 4 135 450 15075 11250 /REQ\001
+4 0 0 0 0 16 12 0.0000 4 135 330 15075 11475 C/D\001
+4 0 0 0 0 16 12 0.0000 4 135 480 15075 11700 /MSG\001
+4 0 0 0 0 16 12 0.0000 4 135 435 15075 11925 /BSY\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 2475 18\001
+4 0 0 0 0 16 12 0.0000 4 135 105 14850 2700 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 14850 2925 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 14850 3150 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 14850 3375 8\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 3600 10\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 3825 12\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 4050 14\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 4275 16\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 11025 50\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 11250 48\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 11475 46\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 11700 42\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 11925 36\001
+4 0 0 0 0 16 12 0.0000 4 135 405 15075 15075 /SEL\001
+4 0 0 0 0 16 12 0.0000 4 135 435 15075 15300 /ATN\001
+4 0 0 0 0 16 12 0.0000 4 135 405 15075 15750 /RST\001
+4 0 0 0 0 16 12 0.0000 4 135 450 15075 16200 /ACK\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 15075 44\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 15300 32\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 15750 40\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 16200 38\001
+4 0 0 0 0 16 12 0.0000 4 135 420 15525 9450 SCSI\001
+4 0 0 0 0 16 12 0.0000 4 135 405 15075 7425 GND\001
+4 0 0 0 0 16 12 0.0000 4 165 735 14310 7425 1,3,...,49\001
+4 0 0 0 0 16 12 0.0000 4 135 345 11700 10350 RP3\001
+4 0 0 0 0 16 12 0.0000 4 135 495 11700 10575 5*220\001
+4 0 0 0 0 16 12 0.0000 4 135 345 10125 12600 RP4\001
+4 0 0 0 0 16 12 0.0000 4 135 495 9945 12825 5*330\001
+4 0 0 0 0 16 12 0.0000 4 135 345 14175 14175 RP3\001
+4 0 0 0 0 16 12 0.0000 4 135 495 14175 14400 4*220\001
+4 0 0 0 0 16 12 0.0000 4 135 345 14175 16875 RP4\001
+4 0 0 0 0 16 12 0.0000 4 135 495 14175 17100 4*330\001
+4 0 0 0 0 16 12 0.0000 4 135 615 6525 17550 1/2 IC9\001
+4 0 0 0 0 16 12 0.0000 4 135 615 6525 19125 1/2 IC9\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 17775 2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 18000 3\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 18225 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 17775 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 18225 1\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 19350 12\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 19575 11\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 19800 10\001
+4 0 0 0 0 16 12 0.0000 4 135 105 7200 19350 9\001
+4 0 0 0 0 16 12 0.0000 4 135 210 7200 19800 13\001
+4 0 0 0 0 16 12 0.0000 4 135 285 6300 15975 /E1\001
+4 0 0 0 0 16 12 0.0000 4 135 285 6300 16200 /E2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 6075 15975 4\001
+4 0 0 0 0 16 12 0.0000 4 135 210 6075 16200 13\001
+4 0 0 0 0 16 12 0.0000 4 135 210 4725 16200 11\001
+4 0 0 0 0 16 12 0.0000 4 135 105 4275 16200 9\001
+4 0 0 0 0 16 12 0.0000 4 135 225 15300 1800 P2\001
+4 0 0 0 0 16 12 0.0000 4 135 225 900 1125 P1\001
+4 0 0 0 0 16 12 0.0000 4 135 345 900 12600 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 405 900 12825 GND\001
+4 0 0 0 0 16 12 0.0000 4 165 375 1350 12600 c2,3\001
+4 0 0 0 0 16 12 0.0000 4 165 1350 1350 12825 a1,28-32,c1,32\001
+4 0 0 0 0 16 12 0.0000 4 135 285 2700 14850 IC3\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3375 14625 13\001
+4 0 0 0 0 16 12 0.0000 4 135 285 6525 14625 IC5\001
+4 0 0 0 0 16 12 0.0000 4 135 240 990 6525 A9\001
+4 0 0 0 0 16 12 0.0000 4 135 240 990 6750 A8\001
+4 0 0 0 0 16 12 0.0000 4 135 240 990 6975 A7\001
+4 0 0 0 0 16 12 0.0000 4 135 240 990 7200 A6\001
+4 0 0 0 0 16 12 0.0000 4 135 240 990 7425 A5\001
+4 0 0 0 0 16 12 0.0000 4 135 240 990 7650 A4\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2295 6075 B4\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2295 6300 B3\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2295 6525 B5\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2295 6750 B2\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2340 6975 B6\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2340 7200 B1\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2295 7425 B7\001
+4 0 0 0 0 16 12 0.0000 4 135 225 2295 7650 B0\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 6075 A4\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 6300 A3\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 6525 A5\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 6750 A2\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 6975 A6\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 7200 A1\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 7425 A7\001
+4 0 0 0 0 16 12 0.0000 4 135 240 2880 7650 A0\001
+4 0 0 0 0 16 12 0.0000 4 135 315 2790 10350 /Q0\001
+4 0 0 0 0 16 12 0.0000 4 135 315 2790 10575 /Q1\001
+4 0 0 0 0 16 12 0.0000 4 135 315 2790 10800 /Q2\001
+4 0 0 0 0 16 12 0.0000 4 135 315 2790 11025 /Q3\001
+4 0 0 0 0 16 12 0.0000 4 135 210 1575 19575 10\001
+4 0 0 0 0 16 12 0.0000 4 135 405 1125 19575 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 285 990 18225 IC4\001
+4 0 0 0 0 16 12 0.0000 4 135 450 450 9450 CS/A\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9765 10575 4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9315 10575 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9495 9990 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9540 9675 8\001
+4 0 0 0 0 16 12 0.0000 4 135 285 6525 10575 IC8\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 6750 E0\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 6975 E1\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 7200 E2\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 7425 E3\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 7650 E4\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 7875 E5\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 8100 E6\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 8325 E7\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 11025 E0\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 11250 E1\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 11475 E2\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 11700 E3\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 11925 E4\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 12150 E5\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 12375 E6\001
+4 0 0 0 0 16 12 0.0000 4 135 225 6930 12600 E7\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 15075 Q1\001
+4 0 0 0 0 16 12 0.0000 4 135 255 6930 15300 Q2\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6885 15525 /Q3\001
+4 0 0 0 0 16 12 0.0000 4 135 315 6885 15750 /Q4\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 2700 /Q0\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 2925 /Q1\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 3375 /Q3\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 3150 /Q2\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 3600 /Q4\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 3825 /Q5\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 4050 /Q6\001
+4 0 0 0 0 16 12 0.0000 4 135 315 10710 4275 /Q7\001
+4 0 0 0 0 16 12 0.0000 4 135 285 4275 15795 IC4\001
+4 0 0 0 0 18 14 0.0000 4 210 7350 5580 20655 - One Controller on SCSI-bus only (SCSI Data/Ctrl bus always driven)\001
+4 0 0 0 0 18 14 0.0000 4 210 2295 5580 20910 - Controller ID 7 only \001
+4 0 0 0 0 18 14 0.0000 4 210 1380 4050 20655 Known Bugs:\001
+4 0 0 0 0 18 14 0.0000 4 210 4230 5580 21165 - Controller only (not useable as device)\001
+4 0 0 0 0 16 12 0.0000 4 135 915 15075 5850 TERMPWR\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14175 5850 J1\001
+4 0 0 0 0 16 12 0.0000 4 135 240 14625 5175 D1\001
+4 0 0 0 0 18 14 0.0000 4 165 1185 4050 20385 Comments:\001
+4 0 0 0 0 18 14 0.0000 4 210 4410 5580 20385 - RP1-4 only if SCSI termination on board\001
+4 0 0 0 0 16 9 0.0000 4 90 75 7650 1935 3\001
+4 0 0 0 0 16 9 0.0000 4 90 75 7560 2430 1\001
+4 0 0 0 0 16 9 0.0000 4 90 75 7785 2430 2\001
+4 0 0 0 0 16 9 0.0000 4 90 150 8235 1935 11\001
+4 0 0 0 0 16 9 0.0000 4 90 150 7920 2430 13\001
+4 0 0 0 0 16 9 0.0000 4 90 150 8145 2430 12\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8460 2430 1\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8685 2430 2\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8550 1935 3\001
+4 0 0 0 0 16 9 0.0000 4 90 150 9135 1935 11\001
+4 0 0 0 0 16 9 0.0000 4 90 150 8820 2430 13\001
+4 0 0 0 0 16 9 0.0000 4 90 150 9045 2430 12\001
+4 0 0 0 0 16 9 0.0000 4 90 75 7695 1800 4\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8235 1800 5\001
+4 0 0 0 0 16 9 0.0000 4 90 75 7875 1395 6\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8595 1800 4\001
+4 0 0 0 0 16 9 0.0000 4 90 75 9135 1800 5\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8910 1395 6\001
+4 0 0 0 0 16 12 0.0000 4 135 570 6885 1755 3*IC12\001
+4 0 0 0 0 16 12 0.0000 4 135 570 8865 1125 4*IC11\001
+4 0 0 0 0 16 9 0.0000 4 90 150 8100 1260 10\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8685 1260 9\001
+4 0 0 0 0 16 9 0.0000 4 90 75 8325 810 8\001
+4 0 0 0 0 16 12 0.0000 4 135 210 2925 14625 12\001
+4 0 0 0 0 16 12 0.0000 4 135 210 3150 15120 11\001
+4 0 0 0 0 16 12 0.0000 4 135 210 14850 5850 26\001
+4 0 0 0 0 16 12 0.0000 4 135 405 15075 6525 GND\001
+4 0 0 0 0 16 12 0.0000 4 135 795 15075 8325 Reserved\001
+4 0 0 0 0 16 12 0.0000 4 135 360 14175 8415 N.C.\001
+4 0 0 0 0 16 12 0.0000 4 135 210 4050 9000 18\001
+4 0 0 0 0 16 12 0.0000 4 135 285 3870 9225 IC4\001
+4 0 0 0 0 16 12 0.0000 4 135 105 4140 9450 2\001
+4 0 0 0 0 16 12 0.0000 4 135 345 1125 19125 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 210 1575 19125 20\001
+4 0 0 0 0 16 12 0.0000 4 135 105 1575 18450 1\001
+4 0 0 0 0 16 12 0.0000 4 135 210 1575 18675 19\001
+4 0 0 0 0 16 12 0.0000 4 135 435 1125 18450 /OE1\001
+4 0 0 0 0 16 12 0.0000 4 135 435 1125 18675 /OE2\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9045 14355 9\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9945 14355 5\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9945 13950 6\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9045 13950 8\001
+4 0 0 0 0 16 12 0.0000 4 135 210 8550 14085 10\001
+4 0 0 0 0 16 12 0.0000 4 135 105 9540 14085 4\001
+4 0 0 0 0 16 12 0.0000 4 165 480 14580 8325 24,28\001
+4 0 0 0 0 16 12 0.0000 4 165 1020 14085 6525 20,22,30,34\001
+4 0 0 0 0 16 12 0.0000 4 135 210 1575 16650 14\001
+4 0 0 0 0 16 12 0.0000 4 135 105 1575 17325 7\001
+4 0 0 0 0 16 12 0.0000 4 135 345 1125 16650 Vcc\001
+4 0 0 0 0 16 12 0.0000 4 135 405 1125 17325 GND\001
+4 0 0 0 0 16 12 0.0000 4 165 1260 585 15975 IC3,9,11,12,13\001
+4 0 -1 0 0 18 16 0.0000 4 240 3045 12960 20475 CS/A-SCSI-1.0A-05jun98\001
diff --git a/dump/oa-2.0.9/devices/scsi/csascsi1.gif b/dump/oa-2.0.9/devices/scsi/csascsi1.gif
new file mode 100644
index 0000000..f852c03
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/csascsi1.gif
Binary files differ
diff --git a/dump/oa-2.0.9/devices/scsi/csascsi1.ps b/dump/oa-2.0.9/devices/scsi/csascsi1.ps
new file mode 100644
index 0000000..c3a5451
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/csascsi1.ps
@@ -0,0 +1,2849 @@
+%!PS-Adobe-2.0
+%%Title: csascsi1.ps
+%%Creator: fig2dev Version 3.2 Patchlevel 0-beta2
+%%CreationDate: Sat Jun 6 17:53:48 1998
+%%For: fachat@newton (Andre Fachat)
+%%Orientation: Portrait
+%%BoundingBox: 26 71 569 770
+%%Pages: 1
+%%BeginSetup
+%%IncludeFeature: *PageSize A4
+%%EndSetup
+%%Magnification: 0.55
+%%EndComments
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+save
+19.0 777.5 translate
+1 -1 scale
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+ /endangle exch def
+ /startangle exch def
+ /yrad exch def
+ /xrad exch def
+ /y exch def
+ /x exch def
+ /savematrix mtrx currentmatrix def
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
+ savematrix setmatrix
+ } def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+%%EndProlog
+
+$F2psBegin
+10 setmiterlimit
+n 0 21427 m 0 0 l 16702 0 l 16702 21427 l cp clip
+ 0.03300 0.03300 sc
+%%Page: 1 1
+7.500 slw
+% Ellipse
+n 3600 8550 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 2250 8550 m 1800 8550 l 1800 8775 l gs col0 s gr
+% Polyline
+n 3150 8550 m 3600 8550 l gs col0 s gr
+% Polyline
+15.000 slw
+n 1710 8775 m 1890 8775 l gs col0 s gr
+/Helvetica ff 180.00 scf sf
+2250 8550 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 8550 m
+gs 1 -1 sc (20) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 8550 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2790 8550 m
+gs 1 -1 sc (Vcc) col0 sh gr
+7.500 slw
+% Ellipse
+n 7650 5175 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 6300 5175 m 5850 5175 l 5850 5400 l gs col0 s gr
+% Polyline
+n 7200 5175 m 7650 5175 l gs col0 s gr
+% Polyline
+15.000 slw
+n 5760 5400 m 5940 5400 l gs col0 s gr
+/Helvetica ff 180.00 scf sf
+6300 5175 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 5175 m
+gs 1 -1 sc (20) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 5175 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6840 5175 m
+gs 1 -1 sc (Vcc) col0 sh gr
+% Arc
+7.500 slw
+gs n 7762.5 2475.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 7762.5 2385.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 7801.9 2171.2 244.2 172.1 -104.7 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 7738.3 2165.2 230.2 10.0 -89.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 7736 1935 m 7744 1935 l gs col0 s gr
+% Polyline
+n 7740 1935 m 7740 1800 l gs col0 s gr
+% Arc
+gs n 8212.5 2475.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8212.5 2385.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8251.9 2171.2 244.2 172.1 -104.7 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8188.3 2165.2 230.2 10.0 -89.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 8186 1935 m 8194 1935 l gs col0 s gr
+% Polyline
+n 8190 1935 m 8190 1800 l gs col0 s gr
+% Arc
+gs n 8662.5 2475.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8662.5 2385.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8701.9 2171.2 244.2 172.1 -104.7 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8638.3 2165.2 230.2 10.0 -89.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 8636 1935 m 8644 1935 l gs col0 s gr
+% Polyline
+n 8640 1935 m 8640 1800 l gs col0 s gr
+% Arc
+gs n 9112.5 2475.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 9112.5 2385.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 9151.9 2171.2 244.2 172.1 -104.7 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 9088.3 2165.2 230.2 10.0 -89.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 9086 1935 m 9094 1935 l gs col0 s gr
+% Polyline
+n 9090 1935 m 9090 1800 l gs col0 s gr
+% Arc
+gs n 7987.5 1935.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 7987.5 1845.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8026.9 1631.2 244.2 172.1 -104.7 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 7963.3 1625.2 230.2 10.0 -89.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 7961 1395 m 7969 1395 l gs col0 s gr
+% Polyline
+n 7965 1395 m 7965 1260 l gs col0 s gr
+% Arc
+gs n 8887.5 1935.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8887.5 1845.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8926.9 1631.2 244.2 172.1 -104.7 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8863.3 1625.2 230.2 10.0 -89.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 8861 1395 m 8869 1395 l gs col0 s gr
+% Polyline
+n 8865 1395 m 8865 1260 l gs col0 s gr
+% Arc
+gs n 8437.5 1350.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8437.5 1260.0 270.9 -138.4 -41.6 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8476.9 1046.2 244.2 172.1 -104.7 arc
+gs col0 s gr
+ gr
+
+% Arc
+gs n 8413.3 1040.2 230.2 10.0 -89.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 8411 810 m 8419 810 l gs col0 s gr
+% Polyline
+n 8415 810 m 8415 675 l gs col0 s gr
+% Ellipse
+n 9562 787 33 33 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 9450 540 m 9450 810 l 9675 675 l 9450 540 l cp gs col0 s gr
+% Polyline
+n 9585 810 m 9585 900 l gs col0 s gr
+% Polyline
+n 12015 1350 m 14085 1350 l 14085 2025 l 12015 2025 l cp gs col0 s gr
+% Polyline
+n 12240 1350 m 12240 2025 l gs col0 s gr
+% Polyline
+n 12465 1350 m 12465 2025 l gs col0 s gr
+% Polyline
+n 12690 1350 m 12690 2025 l gs col0 s gr
+% Polyline
+n 12915 1350 m 12915 2025 l gs col0 s gr
+% Polyline
+n 13140 1350 m 13140 2025 l gs col0 s gr
+% Polyline
+n 13365 1350 m 13365 2025 l gs col0 s gr
+% Polyline
+n 13590 1350 m 13590 2025 l gs col0 s gr
+% Polyline
+n 13815 1350 m 13815 2025 l gs col0 s gr
+% Polyline
+n 12146 1350 m 12154 1350 l gs col0 s gr
+% Polyline
+n 12015 9000 m 14085 9000 l 14085 9675 l 12015 9675 l cp gs col0 s gr
+% Polyline
+n 12240 9000 m 12240 9675 l gs col0 s gr
+% Polyline
+n 12465 9000 m 12465 9675 l gs col0 s gr
+% Polyline
+n 12690 9000 m 12690 9675 l gs col0 s gr
+% Polyline
+n 12915 9000 m 12915 9675 l gs col0 s gr
+% Polyline
+n 13140 9000 m 13140 9675 l gs col0 s gr
+% Polyline
+n 13365 9000 m 13365 9675 l gs col0 s gr
+% Polyline
+n 13590 9000 m 13590 9675 l gs col0 s gr
+% Polyline
+n 13815 9000 m 13815 9675 l gs col0 s gr
+% Polyline
+n 12146 9000 m 12154 9000 l gs col0 s gr
+% Polyline
+n 12150 1350 m 12150 900 l 14175 900 l gs col0 s gr
+% Polyline
+n 12375 900 m 12375 1350 l gs col0 s gr
+% Polyline
+n 12600 900 m 12600 1350 l gs col0 s gr
+% Polyline
+n 12825 900 m 12825 1350 l gs col0 s gr
+% Polyline
+n 13050 900 m 13050 1350 l gs col0 s gr
+% Polyline
+n 13275 900 m 13275 1350 l gs col0 s gr
+% Polyline
+n 13500 900 m 13500 1350 l gs col0 s gr
+% Polyline
+n 13725 900 m 13725 1350 l gs col0 s gr
+% Polyline
+n 13950 900 m 13950 1350 l gs col0 s gr
+% Ellipse
+n 12555 15075 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 12375 14985 m 12375 15165 l 12510 15075 l 12375 14985 l cp gs col0 s gr
+% Ellipse
+n 12555 15300 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 12375 15210 m 12375 15390 l 12510 15300 l 12375 15210 l cp gs col0 s gr
+% Rotated Ellipse
+gs
+8888 14063 tr
+-270.001 rot
+n 0 0 33 33 0 360 DrawEllipse gs col0 s gr
+gr
+
+% Polyline
+n 9135 14175 m 8865 14175 l 9000 13950 l 9135 14175 l cp gs col0 s gr
+% Polyline
+n 8865 14040 m 8775 14040 l gs col0 s gr
+% Polyline
+n 10440 9900 m 11610 9900 l 11610 10575 l 10440 10575 l cp gs col0 s gr
+% Polyline
+n 10665 9900 m 10665 10575 l gs col0 s gr
+% Polyline
+n 10890 9900 m 10890 10575 l gs col0 s gr
+% Polyline
+n 11115 9900 m 11115 10575 l gs col0 s gr
+% Polyline
+n 11340 9900 m 11340 10575 l gs col0 s gr
+% Polyline
+n 10440 12375 m 11610 12375 l 11610 13050 l 10440 13050 l cp gs col0 s gr
+% Polyline
+n 10665 12375 m 10665 13050 l gs col0 s gr
+% Polyline
+n 10890 12375 m 10890 13050 l gs col0 s gr
+% Polyline
+n 11115 12375 m 11115 13050 l gs col0 s gr
+% Polyline
+n 11340 12375 m 11340 13050 l gs col0 s gr
+% Ellipse
+n 11700 9450 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 11475 9450 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11250 9450 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11025 9450 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 10800 9450 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 10575 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 10800 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11025 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11250 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 10575 11025 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 10800 11250 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11025 11475 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11250 11700 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11475 11925 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Polyline
+n 10575 10575 m 10575 12375 l gs col0 s gr
+% Polyline
+n 10800 10575 m 10800 12375 l gs col0 s gr
+% Polyline
+n 11025 10575 m 11025 12375 l gs col0 s gr
+% Polyline
+n 11250 10575 m 11250 12375 l gs col0 s gr
+% Polyline
+n 11475 10575 m 11475 12375 l gs col0 s gr
+% Polyline
+n 10575 9900 m 10575 9450 l 11700 9450 l gs col0 s gr
+% Polyline
+n 10800 9900 m 10800 9450 l gs col0 s gr
+% Polyline
+n 11025 9450 m 11025 9900 l gs col0 s gr
+% Polyline
+n 11250 9450 m 11250 9900 l gs col0 s gr
+% Polyline
+n 11475 9450 m 11475 9900 l gs col0 s gr
+% Polyline
+n 10575 13050 m 10575 13725 l gs col0 s gr
+% Polyline
+n 10800 13050 m 10800 13500 l gs col0 s gr
+% Polyline
+n 11025 13050 m 11025 13500 l gs col0 s gr
+% Polyline
+n 11250 13050 m 11250 13500 l gs col0 s gr
+% Polyline
+n 11475 13050 m 11475 13500 l 10575 13500 l gs col0 s gr
+% Polyline
+15.000 slw
+n 10485 13725 m 10665 13725 l gs col0 s gr
+% Arc
+7.500 slw
+gs n 9675.0 10398.2 363.2 -172.4 -7.6 arc
+gs col0 s gr
+ gr
+
+% Polyline
+n 9315 10350 m 10035 10350 l gs col0 s gr
+% Polyline
+n 9675 10035 m 9675 9900 l gs col0 s gr
+% Ellipse
+n 9675 9180 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 9540 9450 m 9810 9450 l 9675 9225 l 9540 9450 l cp gs col0 s gr
+% Polyline
+n 6300 17550 m 7200 17550 l 7200 18450 l 6300 18450 l cp gs col0 s gr
+% Polyline
+n 6300 17910 m 6525 18000 l 6300 18090 l gs col0 s gr
+/Helvetica ff 180.00 scf sf
+6345 17865 m
+gs 1 -1 sc (D) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6345 18315 m
+gs 1 -1 sc (/S) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 18315 m
+gs 1 -1 sc (/R) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6975 17865 m
+gs 1 -1 sc (Q) col0 sh gr
+% Polyline
+n 6300 19125 m 7200 19125 l 7200 20025 l 6300 20025 l cp gs col0 s gr
+% Polyline
+n 6300 19485 m 6525 19575 l 6300 19665 l gs col0 s gr
+/Helvetica ff 180.00 scf sf
+6345 19440 m
+gs 1 -1 sc (D) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6345 19890 m
+gs 1 -1 sc (/S) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 19890 m
+gs 1 -1 sc (/R) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6975 19440 m
+gs 1 -1 sc (Q) col0 sh gr
+% Ellipse
+n 12555 15750 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 12375 15660 m 12375 15840 l 12510 15750 l 12375 15660 l cp gs col0 s gr
+% Ellipse
+n 12555 16200 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 12375 16110 m 12375 16290 l 12510 16200 l 12375 16110 l cp gs col0 s gr
+% Rotated Ellipse
+gs
+10350 16155 tr
+-270.001 rot
+n 0 0 45 45 0 360 DrawEllipse gs col0 s gr
+gr
+
+% Polyline
+n 10440 15975 m 10260 15975 l 10350 16110 l 10440 15975 l cp gs col0 s gr
+% Polyline
+n 13140 13950 m 14085 13950 l 14085 14625 l 13140 14625 l cp gs col0 s gr
+% Polyline
+n 13365 13950 m 13365 14625 l gs col0 s gr
+% Polyline
+n 13590 13950 m 13590 14625 l gs col0 s gr
+% Polyline
+n 13815 13950 m 13815 14625 l gs col0 s gr
+% Polyline
+n 13140 16650 m 14085 16650 l 14085 17325 l 13140 17325 l cp gs col0 s gr
+% Polyline
+n 13365 16650 m 13365 17325 l gs col0 s gr
+% Polyline
+n 13590 16650 m 13590 17325 l gs col0 s gr
+% Polyline
+n 13815 16650 m 13815 17325 l gs col0 s gr
+% Rotated Ellipse
+gs
+4275 9045 tr
+-90.000 rot
+n 0 0 45 45 0 360 DrawEllipse gs col0 s gr
+gr
+
+% Polyline
+n 4365 9225 m 4185 9225 l 4275 9090 l 4365 9225 l cp gs col0 s gr
+% Ellipse
+n 4680 15975 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 4500 15885 m 4500 16065 l 4635 15975 l 4500 15885 l cp gs col0 s gr
+% Arc
+gs n 3375.0 14576.8 363.2 172.4 7.6 arcn
+gs col0 s gr
+ gr
+
+% Polyline
+n 3015 14625 m 3735 14625 l gs col0 s gr
+% Polyline
+n 3375 14940 m 3375 15075 l gs col0 s gr
+% Rotated Ellipse
+gs
+9788 14063 tr
+-270.001 rot
+n 0 0 33 33 0 360 DrawEllipse gs col0 s gr
+gr
+
+% Polyline
+n 10035 14175 m 9765 14175 l 9900 13950 l 10035 14175 l cp gs col0 s gr
+% Polyline
+n 9765 14040 m 9675 14040 l gs col0 s gr
+/Helvetica-Bold ff 300.00 scf sf
+13185 19155 m
+gs 1 -1 sc (\(c\) A. Fachat) col-1 sh gr
+/Helvetica-Bold ff 300.00 scf sf
+13185 19500 m
+gs 1 -1 sc (All rights reserved) col-1 sh gr
+/Helvetica-Bold ff 300.00 scf sf
+13185 19845 m
+gs 1 -1 sc (No Warranty!) col-1 sh gr
+/Helvetica-Bold ff 300.00 scf sf
+13185 18810 m
+gs 1 -1 sc (CS/A SCSI) col-1 sh gr
+% Arc
+gs [60] 0 sd
+n 14422.5 5512.5 114.7 -101.3 101.3 arcn
+gs col0 s gr
+ gr
+ [] 0 sd
+% Ellipse
+n 3600 6075 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 3600 7200 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 3600 7425 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 3825 6975 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 3825 6750 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 3825 6525 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 4050 6075 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 3600 11700 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 1800 12600 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 9225 4275 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 9000 4050 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 8775 3825 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 8550 3600 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 8325 3375 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 8100 3150 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 7875 2925 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 7650 2700 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 9450 4725 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12150 2475 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12375 2700 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12600 2925 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12825 3150 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13050 3375 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13275 3600 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13500 3825 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 4050 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13950 4275 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 14175 900 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 12375 6750 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12600 6975 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12825 7200 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13050 7425 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13275 7650 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13500 7875 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 8100 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13950 8325 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12375 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12150 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12600 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12825 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13050 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13275 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13500 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 10125 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12375 900 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12600 900 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 12825 900 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13050 900 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13275 900 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13500 900 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 900 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11475 5175 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 7650 13500 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 7650 9225 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 7650 16650 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 9000 8325 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 8775 15750 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 9900 11025 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 7650 18225 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 5850 18225 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 5850 19800 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 5850 19350 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 8325 17775 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 8100 19350 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 11925 11250 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13275 17775 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13500 17775 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 17775 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13275 15075 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13500 15300 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 15750 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13950 16200 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13500 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13725 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 13950 13500 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 5850 15975 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 4050 15975 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 4500 10575 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 4275 10350 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 14175 13500 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 14400 5625 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 14400 5400 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 14400 4725 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 2025 19125 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Ellipse
+n 2025 18675 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 9900 11925 45 45 0 360 DrawEllipse gs 0.00 setgray ef gr gs col0 s gr
+
+% Ellipse
+n 2025 16650 45 45 0 360 DrawEllipse gs col0 s gr
+
+% Polyline
+n 675 1125 m 1350 1125 l 1350 13500 l 675 13500 l gs col0 s gr
+% Polyline
+n 1350 2925 m 1800 2925 l 2025 2700 l gs col0 s gr
+% Polyline
+n 1350 3150 m 1800 3150 l 2025 2925 l gs col0 s gr
+% Polyline
+n 1350 3375 m 1800 3375 l 2025 3150 l gs col0 s gr
+% Polyline
+n 1350 3600 m 1800 3600 l 2025 3375 l gs col0 s gr
+% Polyline
+n 1350 3825 m 1800 3825 l 2025 3600 l gs col0 s gr
+% Polyline
+n 1350 4050 m 1800 4050 l 2025 3825 l gs col0 s gr
+% Polyline
+n 1350 4275 m 1800 4275 l 2025 4050 l gs col0 s gr
+% Polyline
+n 1350 4500 m 1800 4500 l 2025 4275 l gs col0 s gr
+% Polyline
+n 2250 5625 m 3150 5625 l 3150 8775 l 2250 8775 l cp gs col0 s gr
+% Polyline
+n 1350 6075 m 2250 6075 l gs col0 s gr
+% Polyline
+n 1350 6300 m 2250 6300 l gs col0 s gr
+% Polyline
+n 1350 6525 m 2250 6525 l gs col0 s gr
+% Polyline
+n 1350 6750 m 2250 6750 l gs col0 s gr
+% Polyline
+n 1350 6975 m 2250 6975 l gs col0 s gr
+% Polyline
+n 1350 7200 m 2250 7200 l gs col0 s gr
+% Polyline
+n 1350 7425 m 2250 7425 l gs col0 s gr
+% Polyline
+n 1350 7650 m 2250 7650 l gs col0 s gr
+% Polyline
+n 1350 8100 m 2250 8100 l gs col0 s gr
+% Polyline
+n 3150 6075 m 4050 6075 l gs col0 s gr
+% Polyline
+n 3150 7650 m 3600 7650 l 3600 6075 l gs col0 s gr
+% Polyline
+n 3150 7425 m 3600 7425 l gs col0 s gr
+% Polyline
+n 3150 7200 m 3600 7200 l gs col0 s gr
+% Polyline
+n 3150 6300 m 3825 6300 l 3825 7200 l gs col0 s gr
+% Polyline
+n 3150 6525 m 3825 6525 l gs col0 s gr
+% Polyline
+n 3150 6750 m 3825 6750 l gs col0 s gr
+% Polyline
+n 3150 6975 m 3825 6975 l gs col0 s gr
+% Polyline
+15.000 slw
+n 3735 7200 m 3915 7200 l gs col0 s gr
+% Polyline
+7.500 slw
+n 2250 9675 m 3150 9675 l 3150 11925 l 2250 11925 l cp gs col0 s gr
+% Polyline
+n 1350 10575 m 2250 10575 l gs col0 s gr
+% Polyline
+n 1350 10800 m 2250 10800 l gs col0 s gr
+% Polyline
+n 1350 11025 m 2250 11025 l gs col0 s gr
+% Polyline
+n 3150 8100 m 3825 8100 l 3825 9225 l 1800 9225 l 1800 9900 l 2250 9900 l gs col0 s gr
+% Polyline
+n 1350 11250 m 2250 11250 l gs col0 s gr
+% Polyline
+n 2250 10125 m 1800 10125 l 1800 10350 l gs col0 s gr
+% Polyline
+15.000 slw
+n 1710 10350 m 1890 10350 l gs col0 s gr
+% Polyline
+7.500 slw
+n 2250 11700 m 1800 11700 l 1800 11925 l gs col0 s gr
+% Polyline
+15.000 slw
+n 1710 11925 m 1890 11925 l gs col0 s gr
+% Polyline
+7.500 slw
+n 3150 11700 m 3600 11700 l gs col0 s gr
+% Polyline
+n 1350 12600 m 1800 12600 l gs col0 s gr
+% Polyline
+n 1350 12825 m 1800 12825 l 1800 13050 l gs col0 s gr
+% Polyline
+15.000 slw
+n 1710 13050 m 1890 13050 l gs col0 s gr
+% Polyline
+7.500 slw
+n 2025 4275 m 2025 2250 l 2250 2025 l 5175 2025 l 5400 2250 l 5400 17550 l gs col0 s gr
+% Polyline
+n 5400 2475 m 5625 2700 l 6300 2700 l gs col0 s gr
+% Polyline
+n 5400 2700 m 5625 2925 l 6300 2925 l gs col0 s gr
+% Polyline
+n 5400 2925 m 5625 3150 l 6300 3150 l gs col0 s gr
+% Polyline
+n 5400 3150 m 5625 3375 l 6300 3375 l gs col0 s gr
+% Polyline
+n 5400 3375 m 5625 3600 l 6300 3600 l gs col0 s gr
+% Polyline
+n 5400 3600 m 5625 3825 l 6300 3825 l gs col0 s gr
+% Polyline
+n 5400 3825 m 5625 4050 l 6300 4050 l gs col0 s gr
+% Polyline
+n 5400 4050 m 5625 4275 l 6300 4275 l gs col0 s gr
+% Polyline
+n 6300 2250 m 7200 2250 l 7200 5400 l 6300 5400 l cp gs col0 s gr
+% Polyline
+n 7200 2925 m 10125 2925 l gs col0 s gr
+% Polyline
+n 7200 3150 m 10125 3150 l gs col0 s gr
+% Polyline
+n 7200 3375 m 10125 3375 l gs col0 s gr
+% Polyline
+n 7200 3600 m 10125 3600 l gs col0 s gr
+% Polyline
+n 7200 3825 m 10125 3825 l gs col0 s gr
+% Polyline
+n 7200 4050 m 10125 4050 l gs col0 s gr
+% Polyline
+n 7200 4275 m 10125 4275 l gs col0 s gr
+% Polyline
+n 7650 2250 m 7650 2700 l gs col0 s gr
+% Polyline
+n 7875 2250 m 7875 2925 l gs col0 s gr
+% Polyline
+n 8100 2250 m 8100 3150 l gs col0 s gr
+% Polyline
+n 8325 2250 m 8325 3375 l gs col0 s gr
+% Polyline
+n 8550 2250 m 8550 3600 l gs col0 s gr
+% Polyline
+n 8775 2250 m 8775 3825 l gs col0 s gr
+% Polyline
+n 9000 2250 m 9000 4050 l gs col0 s gr
+% Polyline
+n 9225 2250 m 9225 4275 l gs col0 s gr
+% Polyline
+n 7740 1800 m 7875 1800 l 7875 1710 l gs col0 s gr
+% Polyline
+n 8190 1800 m 8100 1800 l 8100 1710 l gs col0 s gr
+% Polyline
+n 8640 1800 m 8775 1800 l 8775 1710 l gs col0 s gr
+% Polyline
+n 9090 1800 m 9000 1800 l 9000 1710 l gs col0 s gr
+% Polyline
+n 7965 1260 m 8325 1260 l 8325 1125 l gs col0 s gr
+% Polyline
+n 8550 1125 m 8550 1260 l 8865 1260 l gs col0 s gr
+% Polyline
+n 8415 675 m 8550 675 l gs col0 s gr
+% Polyline
+n 8550 675 m 9450 675 l gs col0 s gr
+% Polyline
+n 9585 900 m 9585 1125 l 9450 1125 l 9450 6075 l gs col0 s gr
+% Polyline
+n 9450 4725 m 10125 4725 l gs col0 s gr
+% Polyline
+n 7200 4725 m 7650 4725 l 7650 4950 l gs col0 s gr
+% Polyline
+15.000 slw
+n 7560 4950 m 7740 4950 l gs col0 s gr
+% Polyline
+7.500 slw
+n 11025 2700 m 15075 2700 l gs col0 s gr
+% Polyline
+n 11025 2925 m 15075 2925 l gs col0 s gr
+% Polyline
+n 11025 3150 m 15075 3150 l gs col0 s gr
+% Polyline
+n 11025 3375 m 15075 3375 l gs col0 s gr
+% Polyline
+n 11025 3600 m 15075 3600 l gs col0 s gr
+% Polyline
+n 11025 3825 m 15075 3825 l gs col0 s gr
+% Polyline
+n 11025 4050 m 15075 4050 l gs col0 s gr
+% Polyline
+n 11025 4275 m 15075 4275 l gs col0 s gr
+% Polyline
+n 9675 675 m 11475 675 l 11475 2475 l 15075 2475 l gs col0 s gr
+% Polyline
+n 12150 2025 m 12150 9000 l gs col0 s gr
+% Polyline
+n 12375 2025 m 12375 9000 l gs col0 s gr
+% Polyline
+n 12600 2025 m 12600 9000 l gs col0 s gr
+% Polyline
+n 12825 2025 m 12825 9000 l gs col0 s gr
+% Polyline
+n 13050 2025 m 13050 9000 l gs col0 s gr
+% Polyline
+n 13275 2025 m 13275 9000 l gs col0 s gr
+% Polyline
+n 13500 2025 m 13500 9000 l gs col0 s gr
+% Polyline
+n 13725 2025 m 13725 9000 l gs col0 s gr
+% Polyline
+n 13950 2025 m 13950 9000 l gs col0 s gr
+% Polyline
+15.000 slw
+n 9585 5400 m 9765 5400 l gs col0 s gr
+% Polyline
+7.500 slw
+n 7200 6750 m 12375 6750 l gs col0 s gr
+% Polyline
+n 7200 6975 m 12600 6975 l gs col0 s gr
+% Polyline
+n 7200 7200 m 12825 7200 l gs col0 s gr
+% Polyline
+n 7200 7425 m 13050 7425 l gs col0 s gr
+% Polyline
+n 7200 7650 m 13275 7650 l gs col0 s gr
+% Polyline
+n 7200 7875 m 13500 7875 l gs col0 s gr
+% Polyline
+n 7200 8100 m 13725 8100 l gs col0 s gr
+% Polyline
+n 7200 8325 m 13950 8325 l gs col0 s gr
+% Polyline
+n 5400 6525 m 5625 6750 l 6300 6750 l gs col0 s gr
+% Polyline
+n 5400 6975 m 5625 7200 l 6300 7200 l gs col0 s gr
+% Polyline
+n 5400 7200 m 5625 7425 l 6300 7425 l gs col0 s gr
+% Polyline
+n 5400 7425 m 5625 7650 l 6300 7650 l gs col0 s gr
+% Polyline
+n 5400 7650 m 5625 7875 l 6300 7875 l gs col0 s gr
+% Polyline
+n 5400 7875 m 5625 8100 l 6300 8100 l gs col0 s gr
+% Polyline
+n 5400 8100 m 5625 8325 l 6300 8325 l gs col0 s gr
+% Polyline
+n 12375 9675 m 12375 10125 l gs col0 s gr
+% Polyline
+n 12600 9675 m 12600 10125 l gs col0 s gr
+% Polyline
+n 12825 9675 m 12825 10125 l gs col0 s gr
+% Polyline
+n 13050 9675 m 13050 10125 l gs col0 s gr
+% Polyline
+n 13275 9675 m 13275 10125 l gs col0 s gr
+% Polyline
+n 13500 9675 m 13500 10125 l gs col0 s gr
+% Polyline
+n 13725 9675 m 13725 10125 l gs col0 s gr
+% Polyline
+n 13950 9675 m 13950 10125 l gs col0 s gr
+% Polyline
+n 12150 9675 m 12150 10350 l gs col0 s gr
+% Polyline
+15.000 slw
+n 12060 10350 m 12240 10350 l gs col0 s gr
+% Polyline
+7.500 slw
+n 12150 10125 m 13950 10125 l gs col0 s gr
+% Polyline
+n 7200 2700 m 10125 2700 l gs col0 s gr
+% Polyline
+n 10125 2250 m 11025 2250 l 11025 5400 l 10125 5400 l cp gs col0 s gr
+% Polyline
+n 11025 4725 m 11475 4725 l 11475 4950 l gs col0 s gr
+% Polyline
+15.000 slw
+n 11385 4950 m 11565 4950 l gs col0 s gr
+% Polyline
+7.500 slw
+n 10125 5175 m 9675 5175 l 9675 5400 l gs col0 s gr
+% Polyline
+n 11025 5175 m 11475 5175 l gs col0 s gr
+% Polyline
+n 5400 6750 m 5625 6975 l 6300 6975 l gs col0 s gr
+% Polyline
+n 6300 10575 m 7200 10575 l 7200 13725 l 6300 13725 l cp gs col0 s gr
+% Polyline
+n 7200 13050 m 7650 13050 l 7650 13275 l gs col0 s gr
+% Polyline
+15.000 slw
+n 7560 13275 m 7740 13275 l gs col0 s gr
+% Polyline
+7.500 slw
+n 6300 13500 m 5850 13500 l 5850 13725 l gs col0 s gr
+% Polyline
+n 7200 13500 m 7650 13500 l gs col0 s gr
+% Polyline
+15.000 slw
+n 5760 13725 m 5940 13725 l gs col0 s gr
+% Polyline
+7.500 slw
+n 6300 6300 m 7200 6300 l 7200 9450 l 6300 9450 l cp gs col0 s gr
+% Polyline
+n 7200 8775 m 7650 8775 l 7650 9000 l gs col0 s gr
+% Polyline
+15.000 slw
+n 7560 9000 m 7740 9000 l gs col0 s gr
+% Polyline
+7.500 slw
+n 6300 9225 m 5850 9225 l 5850 9450 l gs col0 s gr
+% Polyline
+n 7200 9225 m 7650 9225 l gs col0 s gr
+% Polyline
+15.000 slw
+n 5760 9450 m 5940 9450 l gs col0 s gr
+% Polyline
+7.500 slw
+n 5400 10800 m 5625 11025 l 6300 11025 l gs col0 s gr
+% Polyline
+n 5400 11025 m 5625 11250 l 6300 11250 l gs col0 s gr
+% Polyline
+n 5400 11250 m 5625 11475 l 6300 11475 l gs col0 s gr
+% Polyline
+n 5400 11475 m 5625 11700 l 6300 11700 l gs col0 s gr
+% Polyline
+n 5400 11700 m 5625 11925 l 6300 11925 l gs col0 s gr
+% Polyline
+n 5400 11925 m 5625 12150 l 6300 12150 l gs col0 s gr
+% Polyline
+n 5400 12150 m 5625 12375 l 6300 12375 l gs col0 s gr
+% Polyline
+n 7200 11025 m 15075 11025 l gs col0 s gr
+% Polyline
+n 7200 11250 m 15075 11250 l gs col0 s gr
+% Polyline
+n 7200 11475 m 15075 11475 l gs col0 s gr
+% Polyline
+n 7200 11925 m 15075 11925 l gs col0 s gr
+% Polyline
+n 6300 14625 m 7200 14625 l 7200 16875 l 6300 16875 l cp gs col0 s gr
+% Polyline
+n 5400 14850 m 5625 15075 l 6300 15075 l gs col0 s gr
+% Polyline
+n 5400 15075 m 5625 15300 l 6300 15300 l gs col0 s gr
+% Polyline
+n 5400 15300 m 5625 15525 l 6300 15525 l gs col0 s gr
+% Polyline
+n 5400 15525 m 5625 15750 l 6300 15750 l gs col0 s gr
+% Polyline
+n 6300 16650 m 5850 16650 l 5850 16875 l gs col0 s gr
+% Polyline
+n 7200 16650 m 7650 16650 l gs col0 s gr
+% Polyline
+15.000 slw
+n 5760 16875 m 5940 16875 l gs col0 s gr
+% Polyline
+7.500 slw
+n 7200 15075 m 12375 15075 l gs col0 s gr
+% Polyline
+n 12600 15075 m 15075 15075 l gs col0 s gr
+% Polyline
+n 12600 15300 m 15075 15300 l gs col0 s gr
+% Polyline
+n 9000 14175 m 9000 14400 l gs col0 s gr
+% Polyline
+15.000 slw
+n 8910 14400 m 9090 14400 l gs col0 s gr
+% Polyline
+7.500 slw
+n 7200 15750 m 8775 15750 l 8775 14040 l gs col0 s gr
+% Polyline
+n 9000 13950 m 9000 8325 l gs col0 s gr
+% Polyline
+n 9900 11025 m 9900 10350 l gs col0 s gr
+% Polyline
+n 9675 9000 m 9675 6075 l 9450 6075 l gs col0 s gr
+% Polyline
+n 9675 9450 m 9675 9900 l gs col0 s gr
+% Polyline
+n 9675 9000 m 9675 9135 l gs col0 s gr
+% Polyline
+n 5400 17550 m 5625 17775 l 6300 17775 l gs col0 s gr
+% Polyline
+n 6300 18225 m 5850 18225 l gs col0 s gr
+% Polyline
+n 7200 18225 m 7650 18225 l gs col0 s gr
+% Polyline
+n 6300 19800 m 5850 19800 l gs col0 s gr
+% Polyline
+n 6300 19350 m 5850 19350 l gs col0 s gr
+% Polyline
+n 7200 11700 m 15075 11700 l gs col0 s gr
+% Polyline
+n 9675 14040 m 9675 15525 l 7200 15525 l gs col0 s gr
+% Polyline
+n 7200 12150 m 8325 12150 l 8325 17775 l gs col0 s gr
+% Polyline
+n 7200 12375 m 8100 12375 l 8100 19350 l gs col0 s gr
+% Polyline
+n 7200 15300 m 12375 15300 l gs col0 s gr
+% Polyline
+n 7200 17775 m 10800 17775 l 10800 15750 l 12375 15750 l gs col0 s gr
+% Polyline
+n 12600 15750 m 15075 15750 l gs col0 s gr
+% Polyline
+n 12600 16200 m 15075 16200 l gs col0 s gr
+% Polyline
+n 11925 11250 m 11925 14625 l 10350 14625 l 10350 15975 l gs col0 s gr
+% Polyline
+n 7200 19350 m 11250 19350 l 11250 16200 l 12375 16200 l gs col0 s gr
+% Polyline
+n 10350 16200 m 10350 19800 l 7200 19800 l gs col0 s gr
+% Polyline
+n 15750 1800 m 15075 1800 l 15075 17550 l 15750 17550 l gs col0 s gr
+% Polyline
+n 14625 7650 m 14625 7425 l 15075 7425 l gs col0 s gr
+% Polyline
+15.000 slw
+n 14535 7650 m 14715 7650 l gs col0 s gr
+% Polyline
+7.500 slw
+n 14535 8325 m 15075 8325 l gs col0 s gr
+% Polyline
+n 13275 14625 m 13275 16650 l gs col0 s gr
+% Polyline
+n 13500 14625 m 13500 16650 l gs col0 s gr
+% Polyline
+n 13725 14625 m 13725 16650 l gs col0 s gr
+% Polyline
+n 13950 14625 m 13950 16650 l gs col0 s gr
+% Polyline
+n 13275 13950 m 13275 13500 l 14175 13500 l gs col0 s gr
+% Polyline
+n 13500 13500 m 13500 13950 l gs col0 s gr
+% Polyline
+n 13725 13500 m 13725 13950 l gs col0 s gr
+% Polyline
+n 13950 13500 m 13950 13950 l gs col0 s gr
+% Polyline
+n 13275 17325 m 13275 18000 l gs col0 s gr
+% Polyline
+n 13500 17325 m 13500 17775 l gs col0 s gr
+% Polyline
+n 13725 17325 m 13725 17775 l gs col0 s gr
+% Polyline
+n 13950 17325 m 13950 17775 l 13275 17775 l gs col0 s gr
+% Polyline
+15.000 slw
+n 13185 18000 m 13365 18000 l gs col0 s gr
+% Polyline
+7.500 slw
+n 3150 10350 m 4275 10350 l 4275 9225 l gs col0 s gr
+% Polyline
+n 4275 9000 m 4275 4725 l 6300 4725 l gs col0 s gr
+% Polyline
+n 3150 10575 m 4500 10575 l 4500 8775 l 6300 8775 l gs col0 s gr
+% Polyline
+n 3150 10800 m 4050 10800 l 4050 15975 l 4500 15975 l gs col0 s gr
+% Polyline
+n 4725 15975 m 6300 15975 l gs col0 s gr
+% Polyline
+n 5850 15975 m 5850 16200 l 6300 16200 l gs col0 s gr
+% Polyline
+n 4050 15975 m 4050 18000 l 6300 18000 l gs col0 s gr
+% Polyline
+n 3150 11025 m 3825 11025 l 3825 13050 l 6300 13050 l gs col0 s gr
+% Polyline
+n 4275 10350 m 4275 13950 l 3150 13950 l 3150 14625 l gs col0 s gr
+% Polyline
+n 4500 10575 m 4500 14175 l 3600 14175 l 3600 14625 l gs col0 s gr
+% Polyline
+n 8775 15750 m 9450 15750 l 9450 10350 l gs col0 s gr
+% Polyline
+n 3375 15075 m 3375 19575 l 6300 19575 l gs col0 s gr
+% Polyline
+15.000 slw
+n 1935 19800 m 2115 19800 l gs col0 s gr
+% Polyline
+7.500 slw
+n 1575 19575 m 2025 19575 l 2025 19800 l gs col0 s gr
+% Polyline
+n 675 18225 m 1575 18225 l 1575 20025 l 675 20025 l cp gs col0 s gr
+% Polyline
+n 225 225 m 16650 225 l 16650 21375 l 225 21375 l cp gs col0 s gr
+% Polyline
+n 15075 5850 m 14400 5850 l 14400 5625 l gs col0 s gr
+% Polyline
+n 14265 5175 m 14535 5175 l gs col0 s gr
+% Polyline
+n 14400 5175 m 14265 4950 l 14535 4950 l 14400 5175 l cp gs col0 s gr
+% Polyline
+n 14400 5175 m 14400 5400 l gs col0 s gr
+% Polyline
+n 14400 4950 m 14400 4725 l gs col0 s gr
+% Polyline
+n 14625 6750 m 14625 6525 l 15075 6525 l gs col0 s gr
+% Polyline
+15.000 slw
+n 14535 6750 m 14715 6750 l gs col0 s gr
+% Polyline
+7.500 slw
+n 1575 19125 m 2025 19125 l gs col0 s gr
+% Polyline
+n 1575 18450 m 2025 18450 l 2025 18900 l gs col0 s gr
+% Polyline
+n 1575 18675 m 2025 18675 l gs col0 s gr
+% Polyline
+15.000 slw
+n 1935 18900 m 2115 18900 l gs col0 s gr
+% Polyline
+7.500 slw
+n 9900 14175 m 9900 14400 l gs col0 s gr
+% Polyline
+15.000 slw
+n 9810 14400 m 9990 14400 l gs col0 s gr
+% Polyline
+7.500 slw
+n 9900 13950 m 9900 11925 l gs col0 s gr
+% Polyline
+15.000 slw
+n 1935 17550 m 2115 17550 l gs col0 s gr
+% Polyline
+7.500 slw
+n 1575 17325 m 2025 17325 l 2025 17550 l gs col0 s gr
+% Polyline
+n 1575 16650 m 2025 16650 l gs col0 s gr
+% Polyline
+n 675 15975 m 1575 15975 l 1575 17775 l 675 17775 l cp gs col0 s gr
+/Helvetica ff 180.00 scf sf
+1350 6075 m
+gs 1 -1 sc (c12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 6300 m
+gs 1 -1 sc (c13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 6525 m
+gs 1 -1 sc (c14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 6750 m
+gs 1 -1 sc (c15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 6975 m
+gs 1 -1 sc (c16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 7200 m
+gs 1 -1 sc (c17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 7425 m
+gs 1 -1 sc (c18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 7650 m
+gs 1 -1 sc (c19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 8100 m
+gs 1 -1 sc (a7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 6075 m
+gs 1 -1 sc (A11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 6300 m
+gs 1 -1 sc (A10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+675 8100 m
+gs 1 -1 sc (/IOSEL) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 8100 m
+gs 1 -1 sc (/G) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 8100 m
+gs 1 -1 sc (19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2700 8100 m
+gs 1 -1 sc (/A=B) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 8100 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2475 5850 m
+gs 1 -1 sc ('688) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 6075 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 6300 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 6525 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 6750 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 6975 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 7200 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 7425 m
+gs 1 -1 sc (18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 7650 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 6075 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 6300 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 6525 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 6750 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 6975 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 7200 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 7425 m
+gs 1 -1 sc (17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 7650 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2475 5625 m
+gs 1 -1 sc (IC1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2475 9675 m
+gs 1 -1 sc (IC2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2700 9900 m
+gs 1 -1 sc ('138) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 9900 m
+gs 1 -1 sc (/E1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 10125 m
+gs 1 -1 sc (/E2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 10575 m
+gs 1 -1 sc (E3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 10800 m
+gs 1 -1 sc (C) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 11025 m
+gs 1 -1 sc (B) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 11250 m
+gs 1 -1 sc (A) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2250 11700 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2790 11700 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 9900 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 10125 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 10575 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 10800 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 11025 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 11250 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2025 11700 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 11700 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 10575 m
+gs 1 -1 sc (c26) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 10800 m
+gs 1 -1 sc (c22) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 11025 m
+gs 1 -1 sc (c23) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 11250 m
+gs 1 -1 sc (c25) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 10575 m
+gs 1 -1 sc (Phi2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 10800 m
+gs 1 -1 sc (A1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 11025 m
+gs 1 -1 sc (A0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 11250 m
+gs 1 -1 sc (R/-W) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 10350 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 10575 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 10800 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 11025 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 2925 m
+gs 1 -1 sc (a22) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 3150 m
+gs 1 -1 sc (a21) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 3375 m
+gs 1 -1 sc (a20) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 3600 m
+gs 1 -1 sc (a19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 3825 m
+gs 1 -1 sc (a18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 4050 m
+gs 1 -1 sc (a17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 4500 m
+gs 1 -1 sc (a15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 4275 m
+gs 1 -1 sc (a16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 2925 m
+gs 1 -1 sc (D0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 3150 m
+gs 1 -1 sc (D1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 3375 m
+gs 1 -1 sc (D2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 3600 m
+gs 1 -1 sc (D3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 3825 m
+gs 1 -1 sc (D4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 4050 m
+gs 1 -1 sc (D5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 4275 m
+gs 1 -1 sc (D6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 4500 m
+gs 1 -1 sc (D7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 2700 m
+gs 1 -1 sc (D0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 4275 m
+gs 1 -1 sc (D7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 2700 m
+gs 1 -1 sc (19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 2925 m
+gs 1 -1 sc (18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 3150 m
+gs 1 -1 sc (17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 3375 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 3600 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 3825 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 4275 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 4050 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 4725 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6840 4725 m
+gs 1 -1 sc (/OE) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 4275 m
+gs 1 -1 sc (Q7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 4050 m
+gs 1 -1 sc (Q6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 3825 m
+gs 1 -1 sc (Q5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 3600 m
+gs 1 -1 sc (Q4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 3375 m
+gs 1 -1 sc (Q3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 3150 m
+gs 1 -1 sc (Q2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 2925 m
+gs 1 -1 sc (Q1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 2700 m
+gs 1 -1 sc (Q0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 2700 m
+gs 1 -1 sc (D0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 2925 m
+gs 1 -1 sc (D1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 3150 m
+gs 1 -1 sc (D2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 3375 m
+gs 1 -1 sc (D3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 3600 m
+gs 1 -1 sc (D4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 3825 m
+gs 1 -1 sc (D5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 4050 m
+gs 1 -1 sc (D6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 4275 m
+gs 1 -1 sc (D7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 4725 m
+gs 1 -1 sc (LE) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 2700 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 2925 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 3150 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 3375 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 3600 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 3825 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 4050 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 4275 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 4725 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 2250 m
+gs 1 -1 sc (IC6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 2475 m
+gs 1 -1 sc ('573) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10350 2250 m
+gs 1 -1 sc (IC10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10350 2475 m
+gs 1 -1 sc ('540) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 2700 m
+gs 1 -1 sc (18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 2925 m
+gs 1 -1 sc (17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 3150 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 3375 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 3600 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 3825 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 4050 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 4275 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 4725 m
+gs 1 -1 sc (19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10575 4725 m
+gs 1 -1 sc (/OE2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 2700 m
+gs 1 -1 sc (E0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 2925 m
+gs 1 -1 sc (E1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 3150 m
+gs 1 -1 sc (E2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 3375 m
+gs 1 -1 sc (E3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 3600 m
+gs 1 -1 sc (E4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 3825 m
+gs 1 -1 sc (E5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 4050 m
+gs 1 -1 sc (E6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 4275 m
+gs 1 -1 sc (E7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 4725 m
+gs 1 -1 sc (/OE1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 2700 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 2925 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 3150 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 3375 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 3600 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 3825 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 4050 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 4275 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 4725 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 5175 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11025 5175 m
+gs 1 -1 sc (20) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 5175 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10665 5175 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 10800 m
+gs 1 -1 sc ('540) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 13050 m
+gs 1 -1 sc (19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6750 13050 m
+gs 1 -1 sc (/OE2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 13050 m
+gs 1 -1 sc (/OE1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 13050 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 13500 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 13500 m
+gs 1 -1 sc (20) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 13500 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6840 13500 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 11025 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 11250 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 11475 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 11700 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 11925 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 12150 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 12375 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 12600 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 11025 m
+gs 1 -1 sc (/Q0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 11250 m
+gs 1 -1 sc (/Q1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 11475 m
+gs 1 -1 sc (/Q2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 11700 m
+gs 1 -1 sc (/Q3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 11925 m
+gs 1 -1 sc (/Q4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 12150 m
+gs 1 -1 sc (/Q5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 12375 m
+gs 1 -1 sc (/Q6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 12600 m
+gs 1 -1 sc (/Q7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 11025 m
+gs 1 -1 sc (18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 11250 m
+gs 1 -1 sc (17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 11475 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 11700 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 11925 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 12150 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 12375 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 12600 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 6300 m
+gs 1 -1 sc (IC7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 6525 m
+gs 1 -1 sc ('540) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 8775 m
+gs 1 -1 sc (19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6750 8775 m
+gs 1 -1 sc (/OE2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 8775 m
+gs 1 -1 sc (/OE1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 8775 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 9225 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 9225 m
+gs 1 -1 sc (20) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 9225 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6840 9225 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 6750 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 6975 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 7200 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 7425 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 7650 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 7875 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 8100 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 8325 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 6750 m
+gs 1 -1 sc (/Q0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 6975 m
+gs 1 -1 sc (/Q1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 7200 m
+gs 1 -1 sc (/Q2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 7425 m
+gs 1 -1 sc (/Q3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 7650 m
+gs 1 -1 sc (/Q4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 7875 m
+gs 1 -1 sc (/Q5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 8100 m
+gs 1 -1 sc (/Q6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 8325 m
+gs 1 -1 sc (/Q7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 6750 m
+gs 1 -1 sc (18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 6975 m
+gs 1 -1 sc (17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 7200 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 7425 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 7650 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 7875 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 8100 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 8325 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 11025 m
+gs 1 -1 sc (D0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 11250 m
+gs 1 -1 sc (D6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 11475 m
+gs 1 -1 sc (D7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 11700 m
+gs 1 -1 sc (D4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 11925 m
+gs 1 -1 sc (D3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 12150 m
+gs 1 -1 sc (D2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 12375 m
+gs 1 -1 sc (D1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 16650 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6840 16650 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 16650 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 16650 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 15075 m
+gs 1 -1 sc (D0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 15300 m
+gs 1 -1 sc (D3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 15525 m
+gs 1 -1 sc (D2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 15750 m
+gs 1 -1 sc (D1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12150 15075 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12600 15075 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12150 15300 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12600 15300 m
+gs 1 -1 sc (17) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 14850 m
+gs 1 -1 sc ('75) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 15075 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 15300 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 15525 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 15750 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 15075 m
+gs 1 -1 sc (1D) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 15300 m
+gs 1 -1 sc (2D) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 15525 m
+gs 1 -1 sc (3D) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 15750 m
+gs 1 -1 sc (4D) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 15075 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 15300 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 15525 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 15750 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9675 450 m
+gs 1 -1 sc (IC13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9675 675 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9225 675 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9675 900 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 1575 m
+gs 1 -1 sc (9*220) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 9225 m
+gs 1 -1 sc (9*330) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 9450 m
+gs 1 -1 sc (RP2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 1800 m
+gs 1 -1 sc (RP1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9450 9225 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9225 9450 m
+gs 1 -1 sc (IC4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 10125 m
+gs 1 -1 sc (IC3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4950 17775 m
+gs 1 -1 sc (D7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 14175 m
+gs 1 -1 sc (IC13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+8550 13725 m
+gs 1 -1 sc (IC13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12150 15750 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12600 15750 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12150 16200 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12600 16200 m
+gs 1 -1 sc (15) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 15975 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 16425 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9900 16200 m
+gs 1 -1 sc (IC4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+12150 16650 m
+gs 1 -1 sc (4*IC4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 2475 m
+gs 1 -1 sc (/DP) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 2700 m
+gs 1 -1 sc (/D0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 2925 m
+gs 1 -1 sc (/D1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 3150 m
+gs 1 -1 sc (/D2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 3375 m
+gs 1 -1 sc (/D3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 3600 m
+gs 1 -1 sc (/D4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 3825 m
+gs 1 -1 sc (/D5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 4050 m
+gs 1 -1 sc (/D6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 4275 m
+gs 1 -1 sc (/D7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 11025 m
+gs 1 -1 sc (I/O) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 11250 m
+gs 1 -1 sc (/REQ) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 11475 m
+gs 1 -1 sc (C/D) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 11700 m
+gs 1 -1 sc (/MSG) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 11925 m
+gs 1 -1 sc (/BSY) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 2475 m
+gs 1 -1 sc (18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 2700 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 2925 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 3150 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 3375 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 3600 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 3825 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 4050 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 4275 m
+gs 1 -1 sc (16) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 11025 m
+gs 1 -1 sc (50) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 11250 m
+gs 1 -1 sc (48) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 11475 m
+gs 1 -1 sc (46) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 11700 m
+gs 1 -1 sc (42) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 11925 m
+gs 1 -1 sc (36) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 15075 m
+gs 1 -1 sc (/SEL) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 15300 m
+gs 1 -1 sc (/ATN) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 15750 m
+gs 1 -1 sc (/RST) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 16200 m
+gs 1 -1 sc (/ACK) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 15075 m
+gs 1 -1 sc (44) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 15300 m
+gs 1 -1 sc (32) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 15750 m
+gs 1 -1 sc (40) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 16200 m
+gs 1 -1 sc (38) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15525 9450 m
+gs 1 -1 sc (SCSI) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 7425 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14310 7425 m
+gs 1 -1 sc (1,3,...,49) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11700 10350 m
+gs 1 -1 sc (RP3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+11700 10575 m
+gs 1 -1 sc (5*220) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10125 12600 m
+gs 1 -1 sc (RP4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9945 12825 m
+gs 1 -1 sc (5*330) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 14175 m
+gs 1 -1 sc (RP3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 14400 m
+gs 1 -1 sc (4*220) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 16875 m
+gs 1 -1 sc (RP4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 17100 m
+gs 1 -1 sc (4*330) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 17550 m
+gs 1 -1 sc (1/2 IC9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 19125 m
+gs 1 -1 sc (1/2 IC9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 17775 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 18000 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 18225 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 17775 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 18225 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 19350 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 19575 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 19800 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 19350 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+7200 19800 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 15975 m
+gs 1 -1 sc (/E1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6300 16200 m
+gs 1 -1 sc (/E2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 15975 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6075 16200 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4725 16200 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4275 16200 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15300 1800 m
+gs 1 -1 sc (P2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 1125 m
+gs 1 -1 sc (P1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 12600 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+900 12825 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 12600 m
+gs 1 -1 sc (c2,3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1350 12825 m
+gs 1 -1 sc (a1,28-32,c1,32) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2700 14850 m
+gs 1 -1 sc (IC3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3375 14625 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 14625 m
+gs 1 -1 sc (IC5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+990 6525 m
+gs 1 -1 sc (A9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+990 6750 m
+gs 1 -1 sc (A8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+990 6975 m
+gs 1 -1 sc (A7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+990 7200 m
+gs 1 -1 sc (A6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+990 7425 m
+gs 1 -1 sc (A5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+990 7650 m
+gs 1 -1 sc (A4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2295 6075 m
+gs 1 -1 sc (B4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2295 6300 m
+gs 1 -1 sc (B3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2295 6525 m
+gs 1 -1 sc (B5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2295 6750 m
+gs 1 -1 sc (B2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2340 6975 m
+gs 1 -1 sc (B6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2340 7200 m
+gs 1 -1 sc (B1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2295 7425 m
+gs 1 -1 sc (B7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2295 7650 m
+gs 1 -1 sc (B0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 6075 m
+gs 1 -1 sc (A4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 6300 m
+gs 1 -1 sc (A3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 6525 m
+gs 1 -1 sc (A5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 6750 m
+gs 1 -1 sc (A2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 6975 m
+gs 1 -1 sc (A6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 7200 m
+gs 1 -1 sc (A1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 7425 m
+gs 1 -1 sc (A7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2880 7650 m
+gs 1 -1 sc (A0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2790 10350 m
+gs 1 -1 sc (/Q0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2790 10575 m
+gs 1 -1 sc (/Q1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2790 10800 m
+gs 1 -1 sc (/Q2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2790 11025 m
+gs 1 -1 sc (/Q3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1575 19575 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1125 19575 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+990 18225 m
+gs 1 -1 sc (IC4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+450 9450 m
+gs 1 -1 sc (CS/A) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9765 10575 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9315 10575 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9495 9990 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9540 9675 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6525 10575 m
+gs 1 -1 sc (IC8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 6750 m
+gs 1 -1 sc (E0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 6975 m
+gs 1 -1 sc (E1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 7200 m
+gs 1 -1 sc (E2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 7425 m
+gs 1 -1 sc (E3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 7650 m
+gs 1 -1 sc (E4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 7875 m
+gs 1 -1 sc (E5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 8100 m
+gs 1 -1 sc (E6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 8325 m
+gs 1 -1 sc (E7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 11025 m
+gs 1 -1 sc (E0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 11250 m
+gs 1 -1 sc (E1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 11475 m
+gs 1 -1 sc (E2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 11700 m
+gs 1 -1 sc (E3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 11925 m
+gs 1 -1 sc (E4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 12150 m
+gs 1 -1 sc (E5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 12375 m
+gs 1 -1 sc (E6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 12600 m
+gs 1 -1 sc (E7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 15075 m
+gs 1 -1 sc (Q1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6930 15300 m
+gs 1 -1 sc (Q2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6885 15525 m
+gs 1 -1 sc (/Q3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6885 15750 m
+gs 1 -1 sc (/Q4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 2700 m
+gs 1 -1 sc (/Q0) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 2925 m
+gs 1 -1 sc (/Q1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 3375 m
+gs 1 -1 sc (/Q3) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 3150 m
+gs 1 -1 sc (/Q2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 3600 m
+gs 1 -1 sc (/Q4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 3825 m
+gs 1 -1 sc (/Q5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 4050 m
+gs 1 -1 sc (/Q6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+10710 4275 m
+gs 1 -1 sc (/Q7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4275 15795 m
+gs 1 -1 sc (IC4) col0 sh gr
+/Helvetica-Bold ff 210.00 scf sf
+5580 20655 m
+gs 1 -1 sc (- One Controller on SCSI-bus only \(SCSI Data/Ctrl bus always driven\)) col0 sh gr
+/Helvetica-Bold ff 210.00 scf sf
+5580 20910 m
+gs 1 -1 sc (- Controller ID 7 only ) col0 sh gr
+/Helvetica-Bold ff 210.00 scf sf
+4050 20655 m
+gs 1 -1 sc (Known Bugs:) col0 sh gr
+/Helvetica-Bold ff 210.00 scf sf
+5580 21165 m
+gs 1 -1 sc (- Controller only \(not useable as device\)) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 5850 m
+gs 1 -1 sc (TERMPWR) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 5850 m
+gs 1 -1 sc (J1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14625 5175 m
+gs 1 -1 sc (D1) col0 sh gr
+/Helvetica-Bold ff 210.00 scf sf
+4050 20385 m
+gs 1 -1 sc (Comments:) col0 sh gr
+/Helvetica-Bold ff 210.00 scf sf
+5580 20385 m
+gs 1 -1 sc (- RP1-4 only if SCSI termination on board) col0 sh gr
+/Helvetica ff 135.00 scf sf
+7650 1935 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 135.00 scf sf
+7560 2430 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 135.00 scf sf
+7785 2430 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8235 1935 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 135.00 scf sf
+7920 2430 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8145 2430 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8460 2430 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8685 2430 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8550 1935 m
+gs 1 -1 sc (3) col0 sh gr
+/Helvetica ff 135.00 scf sf
+9135 1935 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8820 2430 m
+gs 1 -1 sc (13) col0 sh gr
+/Helvetica ff 135.00 scf sf
+9045 2430 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 135.00 scf sf
+7695 1800 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8235 1800 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 135.00 scf sf
+7875 1395 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8595 1800 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 135.00 scf sf
+9135 1800 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8910 1395 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+6885 1755 m
+gs 1 -1 sc (3*IC12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+8865 1125 m
+gs 1 -1 sc (4*IC11) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8100 1260 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8685 1260 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 135.00 scf sf
+8325 810 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+2925 14625 m
+gs 1 -1 sc (12) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3150 15120 m
+gs 1 -1 sc (11) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14850 5850 m
+gs 1 -1 sc (26) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 6525 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+15075 8325 m
+gs 1 -1 sc (Reserved) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14175 8415 m
+gs 1 -1 sc (N.C.) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4050 9000 m
+gs 1 -1 sc (18) col0 sh gr
+/Helvetica ff 180.00 scf sf
+3870 9225 m
+gs 1 -1 sc (IC4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+4140 9450 m
+gs 1 -1 sc (2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1125 19125 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1575 19125 m
+gs 1 -1 sc (20) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1575 18450 m
+gs 1 -1 sc (1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1575 18675 m
+gs 1 -1 sc (19) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1125 18450 m
+gs 1 -1 sc (/OE1) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1125 18675 m
+gs 1 -1 sc (/OE2) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9045 14355 m
+gs 1 -1 sc (9) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9945 14355 m
+gs 1 -1 sc (5) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9945 13950 m
+gs 1 -1 sc (6) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9045 13950 m
+gs 1 -1 sc (8) col0 sh gr
+/Helvetica ff 180.00 scf sf
+8550 14085 m
+gs 1 -1 sc (10) col0 sh gr
+/Helvetica ff 180.00 scf sf
+9540 14085 m
+gs 1 -1 sc (4) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14580 8325 m
+gs 1 -1 sc (24,28) col0 sh gr
+/Helvetica ff 180.00 scf sf
+14085 6525 m
+gs 1 -1 sc (20,22,30,34) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1575 16650 m
+gs 1 -1 sc (14) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1575 17325 m
+gs 1 -1 sc (7) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1125 16650 m
+gs 1 -1 sc (Vcc) col0 sh gr
+/Helvetica ff 180.00 scf sf
+1125 17325 m
+gs 1 -1 sc (GND) col0 sh gr
+/Helvetica ff 180.00 scf sf
+585 15975 m
+gs 1 -1 sc (IC3,9,11,12,13) col0 sh gr
+/Helvetica-Bold ff 240.00 scf sf
+12960 20475 m
+gs 1 -1 sc (CS/A-SCSI-1.0A-05jun98) col-1 sh gr
+$F2psEnd
+rs
+showpage
diff --git a/dump/oa-2.0.9/devices/scsi/csascsi1desc.txt b/dump/oa-2.0.9/devices/scsi/csascsi1desc.txt
new file mode 100644
index 0000000..603bcd0
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/csascsi1desc.txt
@@ -0,0 +1,35 @@
+
+Description for CS/A SCSI, version 1.0
+--------------------------------------
+
+whatsit : SCSI interface for CS/A bus
+I/O : ports at $870-$e87f
+Mem : --
+
+IC1 selects the I/O range $87*, and IC2 selects the right registers.
+IC6, 7 and 10 make up the SCSI data port at $870. IC11 and 12 compute the
+parity. IC8 reads the status lines of the SCSI bus.
+IC5 outputs SCSI control lines. The two parts of IC13 controlled
+by IC5 are used as pseudo Open Collector for arbitration purposes.
+The lower half of IC9 implements a hardware handshake to simplify
+data transfer: a simple read or write acknowledges a /REQ request
+from the bus.
+
+During arbitration the data bus outputs are decoupled from the
+data bus (D1 through IC5) and also lowers data bus 7 to indicate
+SCSI ID 7 (highest priority - the ID is hardcoded).
+
+For operation with another controller this controller must not drive
+the SCSI data bus. But this is not implemented. So only one controller
+is possible.
+
+Also I/O can not be driven by the controller so deselect/reselect
+can not be supported.
+
+The SCSI protocol can be seen from the SCSI(-II) standard.
+
+The usual rules for SCSI cable termination etc. apply.
+
+See also several SCSI FAQs on the internet.
+
+
diff --git a/dump/oa-2.0.9/devices/scsi/csascsi1parts.txt b/dump/oa-2.0.9/devices/scsi/csascsi1parts.txt
new file mode 100644
index 0000000..78042d5
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/csascsi1parts.txt
@@ -0,0 +1,23 @@
+
+Parts list for CS/A SCSI board, version 1.0
+-------------------------------------------
+
+IC 1 74HCT688
+ 2 74LS138
+ 3 74LS08
+ 4,7,8,10 74LS540
+ 5 74LS75
+ 6 74LS573
+ 9 74LS74
+ 11,12 74LS86
+ 13 74LS125
+
+P 1 CS/A bus connector
+ 2 50 pin flat cable boxed male connector, standard pitch
+
+RP 1,3 9*220 Ohm 1)
+ 2,4 9*330 Ohm 1)
+
+
+1) only if SCSI termination on board
+
diff --git a/dump/oa-2.0.9/devices/scsi/main.a65 b/dump/oa-2.0.9/devices/scsi/main.a65
new file mode 100644
index 0000000..987bef7
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/main.a65
@@ -0,0 +1,109 @@
+
+
+#define PRINT
+#undef PRINT2
+#undef DEBUG
+
+/*
+ * Sample SCSI + PC-style partition manager program
+ */
+
+;--------------------------------------------------------------
+; C64 specific code
+
+#ifdef C64
+
+#define CSADAPTER $de00
+
+#define SCSIBASE (CSADAPTER+$70)
+
+ .word $801
+ *=$801
+ .word link
+ .word 10
+ .byt $9e, "2061",0
+link .word 0
+
+ ; set up C64 - CS/A adapter
+ lda #$00
+ sta CSADAPTER+$80
+ lda #$10
+ sta CSADAPTER+$81
+ lda #$ff
+ sta CSADAPTER+$82
+ sta CSADAPTER+$83
+
+ jmp main
+
+#include "printc64.a65"
+
+#endif /* C64 */
+
+;--------------------------------------------------------------
+; CS/A65 specific code
+
+#ifdef CSA
+
+#define SCSIBASE $e870
+
+ jmp main
+
+#include "printcsa.a65"
+
+#endif /* CSA */
+
+;--------------------------------------------------------------
+
+#include "part.i65"
+
+main .(
+ lda #buffer
+ ldx #2
+ jsr scanpart
+
+ rts
+
+ lda #0
+ sta rwpar+PRW_PART
+ lda #1
+ sta rwpar+PRW_NSEC
+
+ ldy #PRW_SECTOR
+ lda #0
+ml1 sta rwpar,y
+ iny
+ cpy #PRW_SECTOR+4
+ bcc ml1
+
+ lda #buffer
+ sta rwpar+PRW_BUF+1
+
+ lda #rwpar
+ jsr pread
+
+ inc rwpar+PRW_PART
+ lda #rwpar
+ jsr pread
+
+ rts
+
+ .)
+
+ .bss
+
+buffer .dsb 512
+
+rwpar .dsb PRW_SLEN
+
+ .text
+
+#include "pcpart.a65"
+#include "paccess.a65"
+#include "csascsi1.a65" /* needs SCSIBASE */
+
+
diff --git a/dump/oa-2.0.9/devices/scsi/paccess.a65 b/dump/oa-2.0.9/devices/scsi/paccess.a65
new file mode 100644
index 0000000..6aa7be4
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/paccess.a65
@@ -0,0 +1,80 @@
+
+/*
+ * read/write block on partitions partition
+ *
+ * pread <- a/y address of PRW struct
+ * pwrite <- a/y address of PRW struct
+ *
+ * $Log$
+ *
+ */
+
+#include "devices/scsi/part.i65"
+
+ .(
+
+/***************************************************************************
+ * read/write sector on partitions
+ */
+
+&pwrite jsr ptrans
+ jmp writeblock
+
+&pread jsr ptrans
+ jmp readblock
+
+ptrans sta pp
+ sty pp+1
+ ldy #PRW_PART
+ lda (pp),y
+ asl
+ asl
+ asl
+ asl
+ sta apart
+
+ tax
+ lda parts+PT_ID,x
+ bne ptrok
+ sec
+ rts
+ptrok
+ ldx #3
+ ldy #PRW_SECTOR
+ clc
+ptr1 lda (pp),y
+ sta lba,x
+ iny
+ dex
+ bpl ptr1
+
+ ldy apart
+ ldx #3
+ clc
+ptr2 lda lba,x
+ adc parts+PT_START,y
+ sta lba,x
+ iny
+ dex
+ bpl ptr2
+
+ ldy #PRW_NSEC
+ lda (pp),y
+ sta nsec+1
+ lda #0
+ sta nsec
+
+ ldx apart
+ lda parts+PT_DEV,x
+ tax
+ ldy #PRW_BUF
+ lda (pp),y
+ pha
+ iny
+ lda (pp),y
+ tay
+ pla
+ rts
+
+ .)
+
diff --git a/dump/oa-2.0.9/devices/scsi/part.i65 b/dump/oa-2.0.9/devices/scsi/part.i65
new file mode 100644
index 0000000..7983f3c
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/part.i65
@@ -0,0 +1,36 @@
+
+/*
+ * Definitions for using the partition interface
+ */
+
+#ifndef _PART_I65_
+#define _PART_I65_
+
+/* parameter for pread/pwrite */
+
+#define PRW_PART 0 /* 1 byte partition number */
+#define PRW_NSEC 1 /* 1 byte number of sectors to rd/wr */
+#define PRW_SECTOR 2 /* 4 byte 1st sector to rd/wr (Lo-hi) */
+#define PRW_BUF 6 /* 2 byte address of buffer */
+#define PRW_SLEN 8
+
+/* definition of the partition table entries */
+
+#define PT_ID 0
+#define PT_FLAG 1
+#define PT_DEV 2
+#define PT_RESERVED 3
+#define PT_BSIZE 4
+#define PT_START 8
+#define PT_LEN 12
+#define PT_SLEN 16
+
+/* partition type (ID) definitions */
+
+#define PI_NONE 0
+#define PI_FAT16 4 /* 16 bit FAT < 32M */
+#define PI_FAT16L 6 /* 16 bit FAT >= 32M */
+#define PI_EXTENDED 5
+
+#endif
+
diff --git a/dump/oa-2.0.9/devices/scsi/pcpart.a65 b/dump/oa-2.0.9/devices/scsi/pcpart.a65
new file mode 100644
index 0000000..d125e76
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/pcpart.a65
@@ -0,0 +1,372 @@
+
+/*
+ * PC-style partition scanner for Generic SCSI interface
+ *
+ *
+ * scanpart <- a/y address of buffer
+ * x = length of buffer in 256-byte blocks, >=2
+ * -> a/y address of partition table
+ * also available in "parts"
+ * x = max. number of entries in partition table
+ *
+ * scandev calls initscsi
+ *
+ * $Log$
+ *
+ */
+
+
+#define PE_ID 4
+#define PE_START 8
+#define PE_LEN 12
+
+#define NPART 12 /* maximum number of useable partitions */
+
+#define LASTPART (NPART*PT_SLEN)
+
+#ifdef DEBUG
+#define PRINT
+#endif
+
+#ifdef PRINT
+#define log(a) ldx #a:jsr slogout
+#define hout(a) lda a:jsr hexout
+#else
+#define log(a)
+#define hout(a)
+#endif
+
+#ifdef DEBUG
+#define lc(a) php:pha:lda #a:jsr cout:pla:plp
+#else
+#define lc(a)
+#endif
+
+ .(
+
+/***************************************************************************
+ * Scan SCSI bus for partitions
+ */
+
+&scanpart
+ sta pp
+ sty pp+1
+ stx blen
+
+ ; clear partition table (all ID becomes 0)
+ lda #0
+ sta apart
+cp tax
+ lda #0
+ sta parts,x
+ txa
+ clc
+ adc #PT_SLEN
+ sec
+ cmp #LASTPART
+ bne cp
+
+ lda pp
+ ldy pp+1
+ jsr initscsi
+ stx ndev
+
+ log(0)
+
+ ldx #0
+ stx adev
+
+sl1 ldx adev
+ cpx ndev
+ bne scandev
+ clc
+sle ldx ndev
+ lda #parts
+ rts
+
+next2 jmp next
+
+scandev lda devtype,x
+ cmp #<-1
+ beq next2
+
+ cmp #0 ; direct access
+ bne next2
+
+ log(1)
+ hout(adev)
+ log(2)
+
+ lda #devpar
+ ldx adev
+ jsr getsize
+ bcs next2
+
+ lda devpar+4
+ ora devpar+5
+ bne next2 ; byte/block >= 64k
+ lda devpar+6
+ cmp blen
+ bcc lenok
+ bne next2
+ lda devpar+7
+ bne next2
+lenok
+ ldy #3
+ lda #0
+sl2 sta offset,y
+ dey
+ bpl sl2
+
+slread ldy #0
+ sty mbrfl
+ ldx #3
+slr1 lda offset,y
+ sta lba,x
+ ora mbrfl
+ sta mbrfl
+ iny
+ dex
+ bpl slr1
+
+ ldy #0
+ sty nsec
+ iny
+ sty nsec+1
+
+ lda pp
+ ldy pp+1
+ ldx adev
+ jsr readblock
+ bcs next
+
+ lda pp
+ clc
+ adc #$be
+ sta dp
+ lda pp+1
+ adc #1
+ sta dp+1
+eloop
+ jsr getentry
+ beq nextx
+
+ cmp #PI_EXTENDED
+ beq extended
+
+ pha
+ jsr compnext
+ pla
+
+ cmp #PI_FAT16
+ beq getit
+ cmp #PI_FAT16L
+ beq getit
+nextx
+ lda #0
+ sta parts+PT_ID,x
+ jmp nexte
+
+extended
+/* This has been used but the first block entry is not relieable!
+ ldy #PE_START
+ clc
+ php
+ex1 plp
+ lda (dp),y
+ adc offset-PE_START,y
+ sta offset-PE_START,y
+ php
+ iny
+ cpy #PE_START+4
+ bcc ex1
+ plp
+*/
+ ldy #0
+ex1 lda nextlba,y
+ sta offset,y
+ iny
+ cpy #4
+ bcc ex1
+ jmp slread
+
+nexte lda dp
+ clc
+ adc #16
+ sta dp
+ bcs next
+ adc #16
+ bcc eloop
+
+next inc adev
+ jmp sl1
+
+getit
+ lda apart
+ clc
+ adc #PT_SLEN
+ sta apart
+ cmp #LASTPART
+ beq pmemerr
+ jmp nexte
+pmemerr log(7)
+ sec
+ jmp sle
+
+getentry
+ ldy #PE_ID
+ lda (dp),y
+ ldx apart
+ sta parts+PT_ID,x
+ lda adev
+ sta parts+PT_DEV,x
+ lda #0
+ sta parts+PT_FLAG,x
+ ldy #PE_START
+ clc
+ php
+gi1 plp
+ lda (dp),y
+ adc offset-PE_START,y
+ sta parts+PT_START,x
+ php
+ iny
+ inx
+ cpy #PE_START+4
+ bcc gi1
+ plp
+gi2 lda (dp),y
+ sta parts+PT_START,x
+ inx
+ iny
+ cpy #PE_LEN+4
+ bcc gi2
+
+ ldy #7
+ ldx apart
+gi3 lda devpar,y
+ sta parts+PT_BSIZE,x
+ inx
+ dey
+ cpy #4
+ bcs gi3
+
+ ldx apart
+ lda parts+PT_ID,x
+
+#ifdef PRINT
+ beq noprint
+ pha
+ jsr printpt
+ pla
+noprint
+#endif
+ rts
+
+compnext ; compute lba of next partition block
+ ldy #$fc
+ ldx apart
+ clc
+cn1 lda parts+PT_START,x
+ adc parts+PT_LEN,x
+ sta nextlba-$fc,y
+ inx
+ iny
+ bne cn1
+ rts
+
+/***************************************************************************
+ * print stuff
+ */
+
+#ifdef PRINT
+
+printpt
+ log(3)
+ ldx apart
+ lda parts+PT_ID,x
+ jsr hexout
+ log(4)
+ ldx apart
+ lda parts+PT_DEV,x
+ jsr hexout
+ ldx apart
+ lda parts+PT_ID,x
+ cmp #PI_EXTENDED
+ beq endpr
+ log(5)
+ ldy #4
+ lda apart
+ clc
+ adc #PT_START+3
+ tax
+pt1 lda parts,x
+ jsr hexout
+ dex
+ dey
+ bne pt1
+ log(6)
+ ldy #4
+ lda apart
+ clc
+ adc #PT_LEN+3
+ tax
+pt2 lda parts,x
+ jsr hexout
+ dex
+ dey
+ bne pt2
+ log(2)
+ rts
+endpr log(8)
+ rts
+
+slogout txa
+ asl
+ tax
+ lda tadr+1,x
+ tay
+ lda tadr,x
+ jmp txtout
+
+tadr .word slog0, slog1, slog2, slog3, slog4, slog5, slog6, slog7, slog8
+
+slog0 .asc 13,10,"Scanning for PC-type partitions",13,10,0
+slog1 .asc 13,10,"Found Direct Access Device ",0
+slog2 .asc 13,10,0
+slog3 .asc "Partition Type ",0
+slog4 .asc ", Device ",0
+slog5 .asc ", First ",0
+slog6 .asc ", Len ",0
+slog7 .asc "No more partition table entries!",13,10,0
+slog8 .asc " (extended)",13,10,0
+
+#endif
+
+/***************************************************************************
+ * data
+ */
+
+ .zero
+&pp .word 0
+
+ .bss
+
+blen .byt 0
+&apart .byt 0
+ndev .byt 0
+adev .byt 0
+mbrfl .byt 0
+
+offset .dsb 4
+nextlba .dsb 4
+
+devpar .dsb 8 /* 8 bytes for GET_CPACITY */
+
+&parts .dsb NPART * PT_SLEN /* partition table */
+
+ .text
+ .)
+
diff --git a/dump/oa-2.0.9/devices/scsi/printc64.a65 b/dump/oa-2.0.9/devices/scsi/printc64.a65
new file mode 100644
index 0000000..476588d
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/printc64.a65
@@ -0,0 +1,68 @@
+
+/*
+ * Print routines for Generic SCSI driver
+ *
+ * cout
+ * crlfout
+ * txtout
+ * hexout
+ *
+ * $Log$
+ */
+
+#ifdef PRINT
+
+ .(
+
+/*************************************************************************
+ * Generic Subroutines
+ */
+
+ .zero
+p .word 0
+ .text
+
+
+&crlfout
+ lda #13
+ jsr cout
+ lda #10
+
+&cout jmp $ffd2
+
+&txtout sta p
+ sty p+1
+ ldy #<-1
+to1 iny
+ clc
+ lda (p),y
+ beq toend
+ jsr cout
+ bcc to1
+toend rts
+
+&hexout pha
+ lsr
+ lsr
+ lsr
+ lsr
+ jsr nibout
+ pla
+ and #$0f
+nibout clc
+ adc #"0"
+ cmp #"9"+1
+ bcc ho
+ adc #"A"-"9"-1-1
+ho jmp cout
+
+ .bss
+
+ .text
+ .)
+
+#endif /* PRINT */
+
+
+
+
diff --git a/dump/oa-2.0.9/devices/scsi/printcsa.a65 b/dump/oa-2.0.9/devices/scsi/printcsa.a65
new file mode 100644
index 0000000..c1299b7
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/printcsa.a65
@@ -0,0 +1,90 @@
+
+/*
+ * Print routines for Generic SCSI driver
+ *
+ * cout
+ * crlfout
+ * txtout
+ * hexout
+ *
+ * $Log$
+ */
+
+#ifdef PRINT
+
+#include "kdefs.i65" /* error codes */
+#include "kernel.i65" /* test system is OS/A 1.3... */
+/*
+#define PUTC $f01b
+#define YIELD $f03c
+*/
+ .(
+
+/*************************************************************************
+ * Generic Subroutines
+ */
+
+ .zero
+p .word 0
+ .text
+
+
+&crlfout
+ lda #13
+ jsr cout
+ lda #10
+
+&cout
+ stx xr
+ ldx #STDERR
+cout1
+ pha
+ jsr PUTC
+ bcc ce
+ jsr YIELD ; give other tasks chance to run
+ cmp #E_NUL
+ beq ce
+ pla
+ jmp cout1
+ce pla
+ ldx xr
+ rts
+
+&txtout sta p
+ sty p+1
+ ldy #<-1
+to1 iny
+ clc
+ lda (p),y
+ beq toend
+ jsr cout
+ bcc to1
+toend rts
+
+&hexout pha
+ lsr
+ lsr
+ lsr
+ lsr
+ jsr nibout
+ pla
+ and #$0f
+nibout clc
+ adc #"0"
+ cmp #"9"+1
+ bcc ho
+ adc #"A"-"9"-1-1
+ho jmp cout
+
+ .bss
+
+xr .byt 0
+
+ .text
+ .)
+
+#endif /* PRINT */
+
+
+
+
diff --git a/dump/oa-2.0.9/devices/scsi/ramdscsi.a65 b/dump/oa-2.0.9/devices/scsi/ramdscsi.a65
new file mode 100644
index 0000000..7bf811f
--- /dev/null
+++ b/dump/oa-2.0.9/devices/scsi/ramdscsi.a65
@@ -0,0 +1,582 @@
+
+/*
+ * Generic SCSI driver for CS/A SCSI card
+ *
+ * emulating a SCSI interface by using a disk image on the ramdisk
+ * emulation of the xcsa emulator
+ *
+ * Hardware:
+ *
+ * 2 addresses, $e870-$e871
+ *
+ * $e870 : read SCSI data bus; write data for SCSI data bus
+ *
+ * $e871 : read status
+ * bit 0: I/O (SCSI in)
+ * 1: -ACK (SCSI out, from latch)
+ * 2: -RST (SCSI out, from latch)
+ * 3: BSY (SCSI in)
+ * 4: MSG (SCSI in)
+ * 5:
+ * 6: REQ (SCSI in)
+ * 7: C/D (SCSI in)
+ * write control
+ * bit 0: 1 = -SEL active
+ * 1: 1 = activate ID bit for arbitration
+ * 2: 1 = -BSY active
+ * 3: 1 = -ATN active
+ * 4:
+ * 5:
+ * 6:
+ * 7: 1 = /RST active
+ *
+ * $e872 : write any value -> pulse on /SEL (SCSI out)
+ *
+ * Software:
+ *
+ * This is a stateless SCSI driver with the following routines:
+ *
+ * initscsi <- a/y address of buffer (>=256 byte)
+ * -> a/y address of (static) table with device type
+ * of each device in it (0=disk, ff=none)
+ * also available as "devtype"
+ * x = number of table entries
+ *
+ * inquiry <- a/y address of buffer (>=256 byte)
+ * x = device SCSI ID
+ * -> buffer contains SCSI return
+ *
+ * getsize <- a/y address of buffer (>=8 byte)
+ * x = device SCSI ID
+ * -> buffer contains 4 byte # of blocks (hi-low format)
+ * and 4 byte byte/blocks (hi-lo)
+ *
+ * readblock <- a/y address of buffer (>= N * byte/block)
+ * x = SCSI device address
+ * lba (4 byte) LBA of first block to read (hi-lo)
+ * nsec (2 byte) # of blocks to read (consecutively)
+ * -> buffer contains data
+ * writeblock <- see readblock, buffer contains data
+ *
+ *
+ * $Log$
+ *
+ */
+
+#define DEBUG
+/* #undef PRINT */
+/* #undef STANDALONE */
+
+#define RAMD_DRV $e870
+#define RAMD_SECTOR $e871
+
+#define RAMD_DATA $ec00
+
+#ifdef DEBUG
+#define PRINT
+#endif
+
+#ifdef PRINT2
+#define PRINT
+#endif
+
+/**********************************************************************
+ * system defines
+ */
+/*
+#define DATA $e870
+#define CTRL $e871
+#define STATUS $e871
+
+#define DATA $de70
+#define CTRL $de71
+#define STATUS $de71
+*/
+
+#define DATA 0+SCSIBASE
+#define CTRL 1+SCSIBASE
+#define STATUS 1+SCSIBASE
+
+#define S_IO %00000001
+#define S_ACK %00000010
+#define S_RST %00000100
+#define S_BSY %00001000
+#define S_MSG %00010000
+#define S_REQ %01000000 /* check BVC/BVS */
+#define S_CD %10000000 /* check BMI/BPL */
+
+#define S_PHASEMASK S_IO+S_CD+S_MSG
+#define S_DATAIN S_IO
+#define S_MSGIN S_IO+S_CD+S_MSG
+#define S_STATUS S_IO+S_CD
+#define S_COMMAND S_CD
+
+#define C_RST %10000000
+#define C_SEL %00001000
+#define C_BSY %00000100
+#define C_IDENT %00000010
+#define C_ATN %00000001
+
+#define MYID 7 /* hardcoded in controller */
+
+#ifdef PRINT
+#define log(a) ldx #a:jsr logout
+#define hout(a) lda a:jsr hexout
+#define crlf() jsr crlfout
+#else
+#define log(a)
+#define hout(a)
+#define crlf(a)
+#endif
+
+#ifdef DEBUG
+#define lc(a) php:pha:lda #a:jsr cout:pla:plp
+#else
+#define lc(a)
+#endif
+
+/*************************************************************************
+ * load addr and Jump table
+ */
+
+#ifdef STANDALONE
+
+ lda #buffer
+ jsr initscsi
+
+ lda #0
+ sta task+2
+ sta task+3
+ sta task+4
+ sta task+5
+
+ sta task+7
+ lda #1
+ sta task+8
+
+ lda #buffer
+ ldx #0
+ jsr readblock
+ rts
+
+#endif
+
+ .(
+
+/*************************************************************************
+ * globals
+ */
+
+ ; powers of 2
+
+pow2 .byt 1, 2, 4, 8, 16, 32, 64, 128
+
+
+ .zero
+&dp .word 0
+ .text
+
+
+/*************************************************************************
+ * Read a block from the device
+ * task+2/3/4/5 has block number (hi-lo), task+7/8 has number of blocks to rd
+ * a/y has memory address of buffer where to write block to
+ */
+
+&readblock
+ sta dp
+ sty dp+1
+ stx actdev
+
+#ifdef PRINT2
+ .(
+ log(10)
+ hout(actdev)
+ log(11)
+ ldy #0
+rdll lda lba,y
+ jsr hexout
+ iny
+ cpy #4
+ bcc rdll
+ log(12)
+ hout(nsec)
+ hout(nsec+1)
+ log(13)
+ hout(dp+1)
+ hout(dp)
+ log(14)
+nopr2
+ .)
+#endif
+ lda #0
+ sta task+1
+ sta task+9
+
+ lda #0
+ sta RAMD_DRV
+ lda lba+3
+ sta RAMD_SECTOR
+ lda lba+2
+ sta RAMD_SECTOR+1
+ lda lba+1
+ sta RAMD_SECTOR+2
+ lda lba
+ bne rderr
+ ; sta RAMD_SECTOR+3
+
+ ldy #0
+rdloop lda RAMD_DATA,y
+ sta (dp),y
+ iny
+ bne rdloop
+ inc dp+1
+rdl2 lda RAMD_DATA+$100,y
+ sta (dp),y
+ iny
+ bne rdl2
+ clc
+ rts
+
+rderr sec
+ rts
+
+/*************************************************************************
+ * Read a block from the device
+ * task+2/3/4/5 has block number (hi-lo), task+7/8 has number of blocks to rd
+ * a/y has memory address of buffer where to write block to
+ */
+
+&writeblock
+ sta dp
+ sty dp+1
+ stx actdev
+
+#ifdef PRINT2
+ .(
+ log(15)
+ hout(actdev)
+ log(11)
+ ldy #0
+rdll lda lba,y
+ jsr hexout
+ iny
+ cpy #4
+ bcc rdll
+ log(12)
+ hout(nsec)
+ hout(nsec+1)
+ log(13)
+ hout(dp+1)
+ hout(dp)
+ log(14)
+nopr2
+ .)
+#endif
+ lda #0
+ sta task+1
+ sta task+9
+
+ lda #0
+ sta RAMD_DRV
+ lda lba+3
+ sta RAMD_SECTOR
+ lda lba+2
+ sta RAMD_SECTOR+1
+ lda lba+1
+ sta RAMD_SECTOR+2
+ lda lba
+ bne wrerr
+ ; sta RAMD_SECTOR+3
+
+ ldy #0
+wrloop
+ lda (dp),y
+ sta RAMD_DATA,y
+ iny
+ bne wrloop
+ inc dp+1
+wrl2
+ lda (dp),y
+ sta RAMD_DATA+$100,y
+ iny
+ bne wrl2
+ clc
+ rts
+
+wrerr sec
+ rts
+
+/*************************************************************************
+ * Initialization (a/y = buffer)
+ */
+
+&initscsi
+ sta dp
+ sty dp+1
+
+ log(0)
+
+; scan SCSI bus for devices
+
+ lda #0
+ sta actdev ; start with first device
+iniloop
+ lda actdev
+ cmp #MYID
+ beq nodev
+
+ cmp #0
+ beq iniok
+
+ log(1)
+ hout(actdev)
+ crlf()
+ jmp next
+
+iselerr cli
+ log(4)
+ hout(actdev)
+ crlf()
+ jmp nodev
+
+iniok log(3)
+ hout(actdev)
+ crlf()
+
+ lda dp
+ ldy dp+1
+ ldx actdev
+ jsr inquire
+#ifdef PRINT
+ pha
+ jsr loginquire
+ pla
+#endif
+ .byt $2c
+nodev lda #$ff
+ ldx actdev
+ sta devtype,x
+
+#ifdef PRINT
+ cmp #5
+ beq print
+ cmp #0
+ bne next
+print
+ lda dp
+ ldy dp+1
+ ldx actdev
+ jsr getsize
+ jsr printsize
+#endif
+next
+ inc actdev
+ lda actdev
+ cmp #8
+ bcc iniloop
+
+ lda #devtype
+ ldx #8
+ clc
+ rts
+
+selerr cli
+ log(4)
+ hout(actdev)
+ crlf()
+ sec
+ rts
+
+/*************************************************************************
+ * Inquire device status/info into buffer (addr=a/y)
+ */
+
+inqdata .byt 0, 0, 1, 0, 0, 0, 0, 0
+ .byt "VICE XCSA EMU "
+
+&inquire
+ sta dp
+ sty dp+1
+ stx actdev
+
+ ldy #0
+inl lda inqdata,y
+ sta (dp),y
+ iny
+ cpy #32
+ bne inl
+indone
+#ifdef DEBUG
+ lc("d")
+ tya
+ jsr hexout
+#endif
+inrts ldy #0
+ lda (dp),y ; 0 = disk, 1 = Tape, 5 = CDROM
+ rts
+
+
+/*************************************************************************
+ * Get Medium capacity, a/y = buffer
+ * returns 4 byte # of blocks (hi-low format) + 4 byte byte/block in
+ * buffer
+ */
+
+getsdata .byt $00, $01, $38, $80
+ .byt $00, $00, $02, $00
+
+&getsize
+ sta dp
+ sty dp+1
+ stx actdev
+ ldy #0
+gsl lda getsdata,y
+ sta (dp),y
+ iny
+ cpy #8
+ bne gsl
+ clc
+ rts
+
+/*************************************************************************
+ * Print data subroutines
+ *************************************************************************/
+
+#ifdef PRINT
+
+/*************************************************************************
+ * Print inquiry data
+ */
+
+loginquire
+ ldy #8
+li1 lda (dp),y
+ jsr cout
+ iny
+ cpy #32
+ bcc li1
+ log(5)
+ ldy #0
+ lda (dp),y
+ and #%00011111
+ jsr hexout
+ log(6)
+ ldy #2
+ lda (dp),y
+ and #%00000111
+ jsr hexout
+liret log(7)
+ rts
+
+/*************************************************************************
+ * Print media size
+ */
+
+printsize
+ log(8)
+
+ ldy #0
+pl1 lda (dp),y
+ jsr hexout
+ iny
+ cpy #4
+ bcc pl1
+
+ log(9)
+
+ ldy #4
+pl2 lda (dp),y
+ jsr hexout
+ iny
+ cpy #8
+ bcc pl2
+
+ jmp liret
+
+
+/*************************************************************************
+ * Generic Subroutines
+ */
+
+logout txa
+ asl
+ tax
+ lda laddr+1,x
+ tay
+ lda laddr,x
+ jmp txtout
+
+laddr .word logt0, logt1, logt2, logt3, logt4, int0, int1, int2, ps1, ps2
+#ifdef PRINT2
+ .word rd1, rd2, rd3, rd4, rd5, rd6
+#endif
+
+logt0 .asc 13,10,"CS/A65 SCSI driver",13,10
+ .asc 13,10,"Resetting SCSI bus",13,10,0
+logt1 .asc "Device not ready ",0
+logt2 .asc "Device error bit set",13,10,0
+logt3 .asc "Device found ",0
+logt4 .asc "Device select timeout ",0
+
+int0 .asc "[Type ",0
+int1 .asc ", SCSI Rev. ",0
+int2 .asc "]",13,10,0
+
+ps1 .asc " [Blocks: ",0
+ps2 .asc ", Byte/Block: ",0
+
+#ifdef PRINT2
+
+rd1 .asc "Read Block Dev: ",0
+rd2 .asc ", Sect: ",0
+rd3 .asc ", nsec: ",0
+rd4 .asc " To: ",0
+rd5 .asc 13,10,0
+rd6 .asc "Write Block Dev: ",0
+
+#endif
+
+#endif /* PRINT */
+
+/*************************************************************************
+ * Data structures (no extended read/writes)
+ */
+
+ .bss
+
+; active device number (0-7)
+
+actdev .byt 0
+
+; contains the device type for each SCSI ID
+
+&devtype .dsb 8
+
+; this structure is sent as it is for one command
+
+task .byt 0 ; command code
+ .byt 0 ; LUN
+&lba .byt 0 ;
+ .byt 0 ;
+ .byt 0 ;
+ .byt 0 ;
+ .byt 0
+&nsec .byt 0
+ .byt 0
+ .byt 0
+
+ .)
+
+#ifdef STANDALONE
+
+buffer =*
+
+#endif
+ .text
+
+
+
diff --git a/dump/oa-2.0.9/devices/ser_acia.a65 b/dump/oa-2.0.9/devices/ser_acia.a65
new file mode 100644
index 0000000..8f20660
--- /dev/null
+++ b/dump/oa-2.0.9/devices/ser_acia.a65
@@ -0,0 +1,325 @@
+/****************************************************************************
+
+ OS/A65 Version 1.3.3
+ Multitasking Operating System for 6502 Computers
+ ACIA 6551 device
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
+ *
+ * This device lacks the BRKKEY feature of the 1.4 kernel
+ *
+ * It also doesn't handle the broken handshaking of the 6551
+ */
+
+/*
+ * This is a ACIA 6551 serial line driver for CS/A65. It uses the
+ * hardware installed in my personal C64. The 6551 is at address $d600.
+ *
+ * The ACIA 6551 has a real bad 'feature'. The RTS/CTS lines are not
+ * independent from the transmitter and receiver. Instead, making
+ * RTS high automatically disables receiver _and_ transmitter!
+ * Also an incoming CTS high immediately disables the transmitter.
+ * That's why I use the DSR input for the CTS modem line. This line
+ * can be checked independently.
+ */
+
+#include "chips/acia6551.i65"
+
+#ifdef ACIABASE
+#define ACIA ACIABASE
+#else
+#define ACIA $d600
+#endif
+
+#define Anzdev 1
+
+ .(
+ .word devend2
+ jmp prg1
+ .asc "ser", sernr ,0
+-sernr += 1
+
+/*
+ * status: Bit 0 = 1= handshake enabled
+ * 1 : 1= no ACIA found
+ * 5 : 1= set RTS hi
+ * 6 : 1= we are transmitting
+ * 7 : 1= we are receiving
+ *
+ */
+
+ .bss
+dev .byt 0
+div .byt 0
+status .dsb Anzdev
+instr .dsb Anzdev
+outstr .dsb Anzdev
+ .text
+
+prg1 ldx #0
+
+ stx dev
+ cmp #DC_RES
+ beq devini
+ pha
+ lda status,x
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+prgok pla
+ cmp #DC_IRQ
+ beq devirq
+ jmp others
+
+devini
+ lda #0
+ sta status,x
+ sta instr,x
+ sta outstr,x
+
+ STA ACIA+ACIA_SR ; programmed reset
+ LDA #%00011000 ; 1200 BAUD, 1 stop bit, 8 data bits
+ STA ACIA+ACIA_CTRL
+ cmp ACIA+ACIA_CTRL
+ bne devx
+ LDA #%00000101 ; no parity, normal receiver mode,
+ ; RTS low, Tx interrupt enabled
+ STA ACIA+ACIA_CMD
+ cmp ACIA+ACIA_CMD
+ bne devx
+ LDA ACIA+ACIA_SR ; clear interrupt
+
+ clc
+ rts
+
+devx lda status,x
+ ora #2
+ sta status,x
+ lda #E_NOTIMP
+ sec
+ rts
+
+devirq
+ .(
+ lda ACIA+ACIA_SR
+ bpl irqend ; not this ACIA
+ tay
+ bit status ; check if receiving
+ bpl tx ; no -> tx
+ and #%00001000 ; Rx data register full?
+ beq nobyt ; no -> nobyt
+ ldx outstr
+ lda ACIA
+ jsr PUTC
+ bcs test
+
+nobyt ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+test bcc tx
+ cmp #E_NUL
+ bne tstwater
+ jsr rxoff
+ jmp tx
+tstwater cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SFULL
+ beq wh
+ cmp #E_SHWM
+ bne twl
+wh ldx #0
+ jsr rtshi
+ jmp tx ; unbedingt
+twl cmp #E_SLWM
+ bne tx
+wl ldx #0
+ jsr rtslo
+
+tx bit status
+ bvc irqhs
+ tya
+ and #%00010000 ; transmit data register empty?
+ beq irqhs ; no then -> irqhs
+
+ lda #32
+ bit status
+ bne endsend ; do not send any more to make RTS high.
+
+ tya
+ and #%01000000 ; DSR high?
+ bne irqhs ; -> irqhs
+
+ ldx instr ; send new data byte
+ jsr GETC
+ bcs test2
+ sta ACIA
+ bcc irqhs
+test2 cmp #E_EOF
+ bne irqhs
+ jsr txoff
+
+irqhs lda ACIA+ACIA_SR
+ lda #E_OK ; irq source removed
+ rts
+irqend lda #E_NOIRQ ; no irq source found
+ rts
+
+endsend
+ lda ACIA+ACIA_CMD
+ and #%11110011
+ sta ACIA+ACIA_CMD
+ jmp irqhs
+
+ .)
+
+rtshi
+ lda status,x
+ ora #%00100000
+ sta status,x
+ rts
+
+rtslo
+ lda ACIA+ACIA_CMD
+ ora #%00000100
+ sta ACIA+ACIA_CMD
+ lda status,x
+ and #%11011111
+ sta status,x
+ rts
+
+others cmp #DC_GS
+ bne o1
+ lda status,x
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr,x
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS
+ bne o2
+ lda status,x
+ and #DC_SW_RX
+ bne devonx
+ tya
+ sta outstr,x
+okx jmp ok
+o2 cmp #DC_RX_ON
+ bne o3
+ jsr rtslo
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON
+ bne o4
+ lda #DC_SW_TX
+o2a ora status,x
+ sta status,x
+ bne okx
+o4 cmp #DC_RX_OFF
+ bne o5
+rxoff ldx dev
+ lda status,x
+ and #DC_SW_RX
+ beq devoffx
+ lda outstr,x
+ tax
+ lda #SC_EOF
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_RX
+ sta status,x
+
+rx1off ;jsr rts1hi
+ ;bcc okx
+ jmp okx
+devoffx jmp devoff
+o5 cmp #DC_TX_OFF
+ bne o6
+txoff ldx dev
+ lda status,x
+ and #DC_SW_TX
+ beq devoffx
+ lda instr,x
+ tax
+ lda #SC_NUL
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_TX
+ sta status,x
+ jmp ok
+o6 cmp #DC_HS
+ bne o6a
+ lda status,x
+ and #255-1
+ sta status,x
+ tya
+ and #1
+ ora status,x
+ sta status,x
+ jmp ok
+o6a cmp #DC_SPD
+ bne o7
+ tya
+ and #%00001111
+ sta div
+
+ lda ACIA+ACIA_CTRL
+ and #%11110000
+ ora div
+ sta ACIA+ACIA_CTRL
+ jmp ok
+
+o7 cmp #DC_ST
+ beq ok
+ cmp #DC_EXIT
+ bne onotimp
+ jsr rxoff
+ jsr txoff
+ ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+ sta ACIA+ACIA_SR ; programmed reset
+ bne ok
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+devend2 .)
+
diff --git a/dump/oa-2.0.9/devices/ser_uart.a65 b/dump/oa-2.0.9/devices/ser_uart.a65
new file mode 100644
index 0000000..ec21b5f
--- /dev/null
+++ b/dump/oa-2.0.9/devices/ser_uart.a65
@@ -0,0 +1,506 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+ Generic UART 16550 serial line device
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+/*
+ * This is an UART 16550A serial line driver for CS/A65.
+ * It uses the hardware installed in my personal C64. The
+ * 16550A is mapped at $d600, above the SID.
+ *
+ * The 16550 is not really an easy chip, but it has 16 byte
+ * input and output FIFO buffers, which allows much higher
+ * interrupt latencies.
+ */
+
+#ifdef UARTBASE
+#define UART UARTBASE
+#else
+#define UART $d600
+#endif
+
+#ifdef UARTXTAL
+#define XTALMULT UARTXTAL
+#else
+#define XTALMULT 1
+#endif
+
+#include "chips/uart16550.i65"
+
+#define Anzdev 1
+
+ .(
+ .word devend2
+ jmp prg1
+ .asc "ser",sernr, 0
+
+-sernr += 1
+
+/*
+ * status: Bit 0 = 1= handshake enabled
+ * 1 : 1= no ACIA found
+ * 5 : 1= set RTS hi
+ * 6 : 1= we are transmitting
+ * 7 : 1= we are receiving
+ *
+ */
+
+/*
+ * 16550 divisor values for BAUD rates ?, 50, 75, 110, 134.5, 150,
+ * 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200
+ */
+divisor .word -1, 2304 * XTALMULT, 1536 * XTALMULT, 1047 * XTALMULT
+ .word 857 * XTALMULT, 768 * XTALMULT, 384 * XTALMULT
+ .word 192 * XTALMULT, 96 * XTALMULT
+ .word 64 * XTALMULT, 48 * XTALMULT, 32 * XTALMULT
+ .word 24 * XTALMULT, 16 * XTALMULT, 12 * XTALMULT
+ .word 6 * XTALMULT
+
+ .data
+dev .byt 0
+div .byt 0
+status .dsb Anzdev
+instr .dsb Anzdev
+outstr .dsb Anzdev
+brkkey .dsb Anzdev
+ .text
+
+prg1 ldx #0
+
+ stx dev
+ cmp #DC_RES
+ beq devini
+ pha
+ lda status,x
+ and #2
+ beq prgok
+ pla
+ lda #E_NOTIMP
+ sec
+ rts
+prgok pla
+ cmp #DC_IRQ
+ beq devirq2
+ jmp others
+devirq2 jmp devirq
+
+/*****************************************************************/
+
+devini lda #0
+ sta status,x
+ sta instr,x
+ sta outstr,x
+
+ lda #3
+ sta brkkey,x
+
+ ldy UART+UART_MCR
+ lda #$10
+ sta UART+UART_MCR
+ lda UART+UART_MSR
+ and #$f0
+ bne nodev
+ lda #$1f
+ sta UART+UART_MCR
+ lda UART+UART_MSR
+ and #$f0
+ cmp #$f0
+ bne nodev
+ sty UART+UART_MCR
+
+ ldy UART+UART_SCR
+ lda #%10101010
+ sta UART+UART_SCR
+ cmp UART+UART_SCR
+ bne dev8250
+ lsr
+ sta UART+UART_SCR
+ cmp UART+UART_SCR
+ bne dev8250
+ sty UART+UART_SCR
+
+ lda #1
+ sta UART+UART_FCR
+ lda UART+UART_IIR
+ ldy #0
+ sty UART+UART_FCR
+ asl
+ bcc dev16450
+ asl
+ bcc dev16550
+ ; else dev16550A; currently only this one is supported
+
+ lda #%10000000
+ sta UART+UART_LCR
+ ldx #14*2 ; 9600 BAUD
+ lda divisor,x
+ sta UART+UART_DLL
+ lda divisor+1,x
+ sta UART+UART_DLH
+ lda #%00000011 ; 8N1
+ sta UART+UART_LCR
+
+ lda #7 ; no FIFO enable and clear FIFOs,
+ sta UART+UART_FCR ; trigger at 1 byte
+ lda #0
+ sta UART+UART_IER ; polled mode (so far)
+ lda UART+UART_MCR
+ and #%00001100 ; keep OUT1, OUT2 values
+ sta UART+UART_MCR ; reset DTR, RTS
+
+ clc
+ rts
+
+nodev ; no UART at all
+dev8250 ; no Scratchpad, no FIFO
+dev16450 ; scratchpad, no FIFO
+dev16550 ; FIFO bug
+ lda status,x
+ ora #2
+ sta status,x
+ lda #E_NOTIMP
+ sec
+ rts
+
+/*****************************************************************/
+
+devirq
+ .(
+ lda UART+UART_IIR
+ lsr
+ bcc intr
+irqend lda #E_NOIRQ ; no irq source found
+ ;rts ; not this one
+ jmp irqe
+
+ ;-----------------------------------------------
+
+intr
+ and #%00000011 ; interrupt mask - makes four possible IRQs
+ tay
+ bne int_tx
+
+ lda UART+UART_MSR
+ jmp checkint
+
+int_tx
+ dey
+ bne int_rx
+tx_loop
+ jsr tx2
+ jmp checkint
+
+int_rx
+ dey
+ bne int_status
+rx_loop
+ jsr rx2 ; get one char
+ lda UART+UART_LSR
+ lsr
+ bcs rx_loop
+; and #$20 ; THRE ($40/2)
+; bne tx_loop
+ jmp checkint
+
+int_status
+ lda UART+UART_LSR
+
+checkint
+ lda UART+UART_IIR
+ lsr
+ bcc intr ; irq still pending
+
+; lda UART+UART_LSR
+; and #$40
+; beq nbyt
+; jsr tx2
+;nbyt
+ jsr nobyt
+
+irqok lda #E_OK ; irq source removed
+irqe pha
+
+ lda UART+UART_LSR
+ and #$40
+ beq nbyt
+ jsr tx2
+ jsr nobyt
+nbyt
+ pla
+ rts
+
+ ;-----------------------------------------------
+
+rx2 .(
+ lda UART+UART_RXTX
+ bit status
+ bpl rx2end
+ ldx outstr
+
+ cmp brkkey
+ bne nobrk
+ lda #SC_SSTAT
+ ldy #SCE_BRK
+ jsr STRCMD
+ lda brkkey
+nobrk
+ jsr PUTC
+ bcc rx2end
+ cmp #E_SLWM ; this happens most and is caught by nobyt
+ bne test
+rx2end rts
+
+&nobyt ldx outstr
+ bit status
+ bpl rx2end
+ lda #SC_STAT
+ jsr STRCMD
+ bcc rx2end
+test
+ cmp #E_NUL
+ bne tstwater
+ jmp rxoff
+tstwater
+ cmp #E_SEMPTY
+ beq wl
+ tax
+ lda status
+ and #1
+ bne wh
+ txa
+ cmp #E_SHWM
+ beq wh
+ cmp #E_SFULL
+ bne twl
+;inc $d020
+wh ldx #0
+ jmp rtshi
+twl cmp #E_SLWM
+ bne rx2end
+wl ldx #0
+ jmp rtslo
+ .)
+
+ ;-----------------------------------------------
+
+tx2 .(
+ bit status
+ bvc txrt ; reading IIR should clear this line
+
+ lda UART+UART_MSR
+ and #%00110000
+ cmp #%00110000 ; cts or dsr inactive
+ bne txrt
+
+ ldy #15
+txloop
+ ldx instr ; send new data byte
+ jsr GETC
+ bcs test2
+ sta UART+UART_RXTX
+ dey
+ bne txloop ; fill up FIFO
+ bcc txrt
+
+test2 cmp #E_EOF
+ bne txrt
+ jmp txoff
+txrt rts
+ .)
+
+ .)
+
+/*****************************************************************/
+
+dtrhi
+ lda UART+UART_MCR
+ and #%11111110
+ sta UART+UART_MCR
+ lda #0
+ sta UART+UART_IER
+ rts
+
+dtrlo
+ lda UART+UART_MCR
+ ora #%00000001
+ sta UART+UART_MCR
+ lda #3
+ sta UART+UART_IER
+ rts
+
+rtshi
+ lda UART+UART_MCR
+ and #%11111101
+ sta UART+UART_MCR
+ lda status,x
+ ora #%0010000
+ sta status,x
+ rts
+
+rtslo
+ lda UART+UART_MCR
+ ora #%00000010
+ sta UART+UART_MCR
+ lda status,x
+ and #%11011111
+ sta status,x
+ rts
+
+/*****************************************************************/
+
+others cmp #DC_GS ; set stream to get data from
+ bne o1
+ lda status,x
+ and #DC_SW_TX
+ bne devonx
+ tya
+ sta instr,x
+ jmp ok
+devonx jmp devon
+o1 cmp #DC_PS ; set stream to put data to
+ bne o2
+ lda status,x
+ and #DC_SW_RX
+ bne devonx
+ tya
+ sta outstr,x
+okx jmp ok
+o2 cmp #DC_RX_ON ; switch receiver on
+ bne o3
+ ; lda #3
+ ; sta brkkey
+ jsr rtslo
+ jsr dtrlo
+ lda #DC_SW_RX
+ bne o2a
+o3 cmp #DC_TX_ON ; switch sender on
+ bne o4
+ jsr dtrlo
+ lda #DC_SW_TX
+o2a ora status,x
+ sta status,x
+ bne okx
+o4 cmp #DC_RX_OFF ; switch receiver off, send eof to stream
+ bne o5
+rxoff ldx dev
+ lda status,x
+ and #DC_SW_RX
+ beq devoffx
+ jsr rtshi
+ lda outstr,x
+ tax
+ lda #SC_EOF
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_RX
+ sta status,x
+ jmp checkdtr
+
+devoffx jmp devoff
+
+o5 cmp #DC_TX_OFF ; switch sender off, send nul to stream
+ bne o6
+txoff ldx dev
+ lda status,x
+ and #DC_SW_TX
+ beq devoffx
+ lda instr,x
+ tax
+ lda #SC_NUL
+ jsr STRCMD
+ ldx dev
+ lda status,x
+ and #255-DC_SW_TX
+ sta status,x
+checkdtr
+ and #DC_SW_TX+DC_SW_RX
+ bne active
+ jsr dtrhi
+active jmp ok
+
+o6 cmp #DC_HS ; set handshake -- currently ignored (TODO)
+ bne o6a
+ lda status,x
+ and #255-1
+ sta status,x
+ tya
+ and #1
+ ora status,x
+ sta status,x
+ jmp ok
+
+o6a cmp #DC_SPD ; set speed
+ bne o7
+ tya
+ and #%00001111
+ asl
+ tax
+ beq ok
+
+ lda UART+UART_LCR
+ ora #$80
+ sta UART+UART_LCR
+ lda divisor,x
+ sta UART+UART_DLL
+ lda divisor+1,x
+ sta UART+UART_DLH
+ lda UART+UART_LCR
+ and #$7f
+ sta UART+UART_LCR
+
+ jmp ok
+
+o7 cmp #DC_ST ; get status...
+ beq ok
+ cmp #DC_EXIT ; disable everything
+ bne o8 ; onotimp
+ jsr rxoff
+ jsr txoff
+ ldx dev
+ lda status,x
+ ora #2
+ sta status,x
+ bne ok
+o8
+ cmp #DC_BRKKEY
+ bne onotimp
+ lda brkkey
+ sty brkkey
+ tay
+ ; jmp ok
+
+ok lda #E_OK
+ .byt $2c
+devon lda #E_DON
+ .byt $2c
+devoff lda #E_DOFF
+ .byt $2c
+onotimp lda #E_NOTIMP
+ cmp #1
+ rts
+
+#undef UART
+#undef XTALMULT
+
+devend2 .)
+
diff --git a/dump/oa-2.0.9/devices/spooler.a65 b/dump/oa-2.0.9/devices/spooler.a65
new file mode 100644
index 0000000..11b655f
--- /dev/null
+++ b/dump/oa-2.0.9/devices/spooler.a65
@@ -0,0 +1,169 @@
+/****************************************************************************
+
+ OS/A65 Version 2.0.0
+ Multitasking Operating System for 6502 Computers
+ Generic spooler device
+
+ Copyright (C) 1989-1998 Andre Fachat
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+****************************************************************************/
+
+
+#define ANZINSTR 16
+
+ .(
+ .word spoolend
+ jmp spoolprg
+ .asc "spooler",0
+
+ .data
+anzinstr .byt 0
+outstr .byt 0
+status .byt 0
+byte .byt 0
+instr .dsb ANZINSTR
+ .text
+
+spoolprg cmp #DC_RES
+ bne sp1
+
+ lda #0
+ sta anzinstr
+ sta status
+ clc
+ rts
+
+sp1 cmp #DC_IRQ
+ bne sp2
+
+ lda status
+ and #DC_SW_RX
+ beq spi1
+ lda status
+ and #DC_SW_TX
+ beq spi4
+spil lda status
+ and #1
+ bne spi2
+ ldx instr
+ jsr GETC
+ bcc spi2b
+ cmp #E_EOF
+ bne spi4
+
+ ldx instr
+ lda #SC_NUL
+ jsr STRCMD
+
+ dec anzinstr
+ beq rxoff
+ ldx #0
+spi3 lda instr+1,x
+ sta instr,x
+ cpx anzinstr
+ bcs sp4
+ inx
+ bne spi3
+
+spi2b sta byte
+ lda #1
+ ora status
+ sta status
+spi2 lda byte
+ ldx outstr
+ jsr PUTC
+ bcs spi5
+ lda status
+ and #%11111110
+ sta status
+ jmp spil
+
+spi4 ldx outstr
+ lda #SC_STAT
+ jsr STRCMD
+
+spi5 cmp #E_NUL
+ beq rxoff
+spi1 clc
+ lda #E_NOIRQ
+ rts
+
+sp2 cmp #DC_RX_OFF
+ beq rxoff
+ cmp #DC_TX_OFF
+ bne sp3
+rxoff lda status
+ and #DC_SW_RX
+ beq spe4
+ ldx outstr
+ lda #SC_EOF
+ jsr STRCMD
+spe4 lda status
+ and #DC_SW_TX
+ beq spe1
+ ldx #0
+spe2 cpx anzinstr
+ bcs spe1
+ lda #SC_NUL
+ jsr STRCMD
+ inx
+ bne spe2
+spe1 lda #0
+ sta anzinstr
+ sta status
+ beq ok
+
+sp3 cmp #DC_RX_ON
+ bne sp4
+ lda #DC_SW_RX
+ bne setst
+sp4 cmp #DC_TX_ON
+ bne sp5
+ lda #DC_SW_TX
+setst ora status
+ sta status
+ok lda #0
+ .byt $2c
+spdevon lda #E_DON
+ .byt $2c
+sp7 lda #E_NOTIMP
+ cmp #1
+ rts
+
+sp5 cmp #DC_GS
+ bne sp6
+ lda status
+ ldx anzinstr
+ cpx #ANZINSTR
+ bcs spdevon
+ tya
+ sta instr,x
+ inc anzinstr
+ jmp ok
+
+sp6 cmp #DC_PS
+ bne sp7
+ lda status
+ and #DC_SW_RX
+ bne spdevon
+ sty outstr
+ jmp ok
+
+#undef ANZINSTR
+
+spoolend .)
+
diff --git a/dump/oa-2.0.9/doc/BUGS b/dump/oa-2.0.9/doc/BUGS
new file mode 100644
index 0000000..d104c1f
--- /dev/null
+++ b/dump/oa-2.0.9/doc/BUGS
@@ -0,0 +1,92 @@
+
+Here is a list of known bugs of version 2.0.0-pre1
+--------------------------------------------------
+
+- starting ROM program is only possible in the old-style shell
+ and it doesn't fill in the command line. Starting o65 files is ok.
+
+- lib6502 does not use SBRK when memory is exhausted.
+
+- slipd libip routines seem to be buggy still - very weird effects!
+ I have no idea where they come from. When I start hunting one, it
+ disappears and another pops up. Amongs them were:
+ - closing telnet seems to set nthreads in kernel tables to $ff!!!!
+ - also opening a telnet connection prints some weird characters on the
+ wrong screen (stream gets "$ff $ff $c6 $07 $07 $07..." bytes sent,
+ I have no idea where from...)
+ - telnet works on telnet port somehow - bug hangs if streams are closed...
+ should comply to rfc1143
+ - httpd doesn't work although using almost all the same routines as
+ rsh which work
+ - SC_ESTAT does not seem to recognize E_EOF the same way as SC_STAT?
+ (slipd, in rsh.a65, label newpkt)
+ I have found and fixed a bug in the lib6502 fread/fwrite that could
+ probably have caused this bug, but have not (yet) checked this.
+
+- using inet apps without registering an inet task blocks those programs
+ (kernel problem as not-registered task is not recognized)
+
+- listen does not check if port already in use
+ also there is no way to free listenports in use by crashed/killed
+ programs - probably when reuse, overwrite old listenport such
+ that table does not fill up?
+
+- telnet doesn't really implement local echo mode.
+
+- slipd uses accesses to $dc** (C64 CIA timers) to generate initial
+ pseudo-random sequence numbers.
+
+- when getting tcp signal, set error flag in associated streams
+
+- SLIPD: wwwroot path given to chdir, but not used when opening a file;
+ only the first letter is used as drive.
+
+- FSIEC does not recognize chdir paths when reading directories
+ from the bus (i.e. C64 reads from IEEE488 bus and CSA drive is the
+ fsibm drive), files are ok.
+
+- more diagnostics ("why the beep...", i.e. why the "?") in lsh
+
+- keyboard layout into docs
+
+- when fsiec on C64 is parallel but doesn't find the interface, it
+ dies too ungracefully...
+
+- when path overflows, behaviour is undefined
+
+- C64 sbrk always returns ROMSTART instead of RAMSIZE?
+
+- a semaphore can be released when a process is waiting for it
+
+- console: control-character printed?
+
+- (multiple) errors on non-existant IEC drives are not handled correctly:
+ gecko may break, C64 sometimes reads empty stream...
+
+- FSIEC hangs on disk full with C64 parallel IEC bus interface (and probably
+ others too)
+
+- FSIEC (on CS/A65) seems not to release the interface semaphore after
+ init every time?
+
+- serial line drivers ignore handshake value (i.e. rts/cts vs. xon/xoff)
+
+- serial IEC bus for CS/A65 architecture only works with 1MHz (is this a bug?)
+
+- The CS/A65 console doesn't work when interrupting the device is enabled.
+ (could be kernel or device problem...)
+
+- C64 fsiec filesystem (serial/parallel?) reads one byte from file even
+ when it's not found (in VICE)
+
+- C64 console doesn't generate the F1 key with shift and shift/ctrl?
+
+- CS/A65: non-ROM-started devices don't work.
+
+- spooler device doesn't forward BRK and PUSH flags
+
+- fsiec, fsibm and fsdev ignore stream brk/push/pull flags, and don't set
+ stream error flags (only fsiec sets SCE_[RW]ERRM flags).
+
+- PET don't do shifted characters on keyboard
+
diff --git a/dump/oa-2.0.9/doc/COPYING b/dump/oa-2.0.9/doc/COPYING
new file mode 120000
index 0000000..012065c
--- /dev/null
+++ b/dump/oa-2.0.9/doc/COPYING
@@ -0,0 +1 @@
+../COPYING
\ No newline at end of file
diff --git a/dump/oa-2.0.9/doc/IDEAS b/dump/oa-2.0.9/doc/IDEAS
new file mode 100644
index 0000000..47137d5
--- /dev/null
+++ b/dump/oa-2.0.9/doc/IDEAS
@@ -0,0 +1,33 @@
+
+- vt100 control codes for the console
+
+- native C128 port
+
+- use STDIN stream as 'controlling terminal', i.e. when break flag on
+ STDIN stream is set, send SIG_BRK to task (to be done in scheduler?).
+
+- slipd/rsh should interpret telnet commands and options transparently
+ when telnet port is used. Set the stream break flag for example.
+ This would make slipd the controlling terminal for the remotely started
+ process.
+
+- map $e8** to some other place when entering the kernel to gain
+ two more kB for CS/A65 architecture
+
+- stream receiver sets special bit to indicate it can receive block
+ commands -> sender can send parameter for a BLKCPY call where the
+ receiver directly copies data from sender memory.
+ When this bit is not set, sender does not send block but only byte data.
+ Problem: serialization of block command byte sequence read/write,
+ i.e. multiple readers/writers have to content for the stream
+
+- move the WD1772 stuff from fsibm to some other file and abstract it
+ to a kind of block device interface. Then have some SCSI disk
+ block device, RAMdisk block device, VC1571 MFM mode block device...
+
+- clean up out-of-band data path, i.e. CTRL-C in terminal, SIGINT,
+ lib6502 kill -> SIG_KILL, ...
+
+- lib6502 call "loader" to load overlays and remove overlays again,
+ including binding etc. Probably in different steps?
+
diff --git a/dump/oa-2.0.9/doc/LOG-1.3 b/dump/oa-2.0.9/doc/LOG-1.3
new file mode 100644
index 0000000..a492db8
--- /dev/null
+++ b/dump/oa-2.0.9/doc/LOG-1.3
@@ -0,0 +1,332 @@
+
+******** OS/A 1.00 ******** 23sep90, Andre Fachat
+
+Multitasking Operating system for the 6502 CPU.
+The system has a memory manager, stream handler and device handler.
+Also there is an environment handler with a scheduler.
+The whole stuff works like a kind of virtual machine, with the only
+difference that hardware accesses are done via the kernel.
+But each task and each device has its dedicated memory area.
+Each task can think of having its own CPU concerning memory environment
+and esp. stack and zeropage.
+This only works with the CS/A builtin MMU, where the upper 4 bit are
+expanded to 8 bit, thus allowing 1 MByte of virtual memory.
+The memory block size is 4kByte. The possible 1 MByte is divided into
+256 blocks, which can be mapped at any of the 16 possible positions
+in the 64k size 6502 address space.
+Each task can have up to 58 kByte of linear address space, which is
+64k minus 4 kByte kernel ($f***) and 2 kByte I/O ($e800-$efff).
+The communication between the tasks work via streams, i.e. asynchronous
+first-in-first-out buffer. For example, a device can write into the
+stream that is being used as STDIN stream, while tasks puts its data
+to the STDOUT stream that might be written to file on a filesystem.
+Devices are a set of subroutines that can have up to 4 kBytes, i.e.
+one memory block. They are mostly called during an interrupt, which they
+have to serve.
+Tasks can also have their own interrupt routine. Semaphores to
+synchronize different tasks are also available. As long as a
+semaphore has a Pass (P) operation done on it and no Free (V),
+another task trying to Pass it will be set asleep.
+With SEND and RECEIVE messages up to 256 byte can be passed from one
+to another task. When receiving, the sending task can also be specified.
+READ and WRITE allow a task to manipulate another tasks memory.
+
+Currently available are the NULL, SPOOLER, CENTRONICS, SER(1-2) and VIDEO(1-4)
+devices. The NULL device empties all streams, until there is no further
+data available (EOF). The spooler copies all input streams one after
+the other to its output stream (serialization).
+File handling is done with the filesystems. Currently available are
+the FSDEV and the FSIEC filesystems. Filesystems are called with
+SEND on task $fe. FSDEV allows the handling of devices as files.
+FSIEC handles Commodore disk drives with device address 8 and 9.
+
+******** OS/A 1.01 ******** 1oct90, Andre Fachat
+
+Video device and shell/monitor overhauled, mainly because of better
+cooperation on full screen editor.
+
+******** OS/A 1.30 ******** 14apr91, Andre Fachat
+
+Complete reworking:
+Several negative task numbers can be assigned an
+specific 'real' tasks. For each negative number only one task can
+be assigned.
+The operating system now even works in a computer without MMU. All tasks
+work in the same environment, so that identical programs cannot be
+invoked twice.
+For speed reasons the task interrupts can be disabled at assemble time.
+Also the availability of a system port can be flaged at assmble time.
+The IEC bus filesystem can also work as a drive for the IEEE bus.
+That means that e.g. a C64 can use the internal filesystems of the
+CS/A computer as a disk drive.
+With a new hardware board, the computer can now handle IBM PC style
+disks with FSIBM. Disks from 360k up to 1.44 MByte can be handled,
+with block sizes up to 1 kByte (what you get from a WD1770).
+A Basic interpreter has been ported from the C64, thus making it possible
+to run BASIC programs in parallel...
+
+******** OS/A 1.31 ******** 25jun91, Andre Fachat
+
+A special MCOPY program to copy multiple files one after each other
+is available in the ROM. (Starting the copies in the shell in the
+background would eat up resources). Also filename jokers (*, ?) are
+available with this program.
+
+******** OS/A 1.31 ******** (19jan92) 21feb92, Andre Fachat
+
+Introduced some kind of STDIO library below $e800, i.e. below the I/O
+area. These library routines run in the tasks own memory and handle some
+things happening in most tasks.
+The centronics device finally works, and FSIEC now accepts an additional
+drive number for dir and and the disk commands, for the handling of
+dual disk drives for example.
+
+******** OS/A 1.31 ******** 10may92 Andre Fachat
+
+Two new options when compiling: BATMEM allows some battery buffered
+memory ($0000-$8000) to not be erased on boot. NOMIRRORMEM saves a few
+byte in the kernel if it's sure that we have no mirrored memory
+(no open address lines).
+
+******** OS/A 1.31 ******** 12jul92 Andre Fachat
+
+When using PSEM, the Carry flag now says, if the task should block
+(C=0) or if the task should return immediately with an error if it
+could not get the semaphore (C=1).
+Negative semaphores can be used as system semaphores.
+
+********* OS/A 1.31 ******** 15oct92 A.Fachat
+
+Another bug in the STDIO library is fixed: The drive is set correctly
+with Usedir. In the monitor, when setting registers or parameters, the
+"." to ignore an entry (leave byte untouched) has been replaced by
+a dash ("-"). Now it is possible to enter decimal numbers (with leading
+".").
+A bug in the shell DEVCMD introduced with the STDIO lib has been fixed.
+The programs got too big, so now MCOPY is not in the ROM anymore.
+Exchanged FSIEC and FSIBM in the ROM, so that drive C: is IEC drive 8,
+which normally is the harddisk of my Atari.
+
+******** OS/A 1.32 ******** 16oct92 A.Fachat
+
+In the shell and in the monitor now RAM extensions are accepted not only
+till $8000 but till program start. Also, if no more memory available,
+the block is not set to $20 anymore.
+Without an MMU, the NMI interrupt can now also be used.
+If NOSINPORT is set when assembling, the system port is only used
+for output, so that plugging a debug card into the bus enables debug
+output (if any).
+
+******** OS/A 1.33 ******** 17oct92 A.Fachat
+
+In this version the previous kernel task tables (task data and the
+task name) are put into two tables with the same offset for a task.
+(previously the task number had to be multiplied by 24 and 8, now
+by 16 for both tables). Thus now with MMU, 16 instead of 10 tasks can
+be running.
+The 'SYSBUF' has been eliminated. Instead of copying data from PCBUF to
+SYSBUF and vice versa for (system) SENDs, REGDEV,... the MMU is now used.
+Now the PCBUF is used by the kernel ony during startup and can later
+be used by the programs.
+
+******** OS/A 1.3.3 ******** apr1996 A.Fachat
+
+Put the source code into a Unix tar archive, html-ized the docs and
+put it on the World Wide Web.
+
+******** OS/A 1.3.5 ******** apr1996 A.Fachat
+
+Introduced a version for the C64 (on public demand... ;-)
+The FSIEC has been changed to handle the original Commodore C64 IEEE488
+bus interface. The terminal device handles the C64 screen and keyboard.
+The kernel uses the CIA1 timer B for interrupts.
+Many things have now only been ported to a system without MMU, because
+that's a lot of work. Everything has to be check if using global
+variables, esp. when called from different tasks, like the STDIO lib...
+Development took place on the vice C64 emulator.
+
+******** OS/A 1.3.6e ******** 09jun1996 A.Fachat
+
+The C64 is now real 'breadbox C64' tested and debugged. The parallel
+port (IEEE488) stuff had bugs that are now fixed. The serial bus is now
+working as well. Some more bugs in the NOMMU port have been fixed. A
+semaphore for the use of the global PCBUF send buffer has been
+introduced. All filesystems and tasks now try to get the SENDBUF
+semaphore first before trying to write to the send buffer.
+Also system semaphores for some hardware (IEEE488 interface, WD1770 PC
+disk controller) have been introduced.
+
+******** OS/A 1.3.6f ******** 09jun1996 A.Fachat
+
+Changed the maximum number of tasks for systems without MMU from 6 to 5.
+This gives 40 instead of 32 bytes of stack space for each task.
+Hopefully now occasional BRKs are gone.
+FSIEC does now recognize the "/" DIRSIGN at the beginning of a directory
+search mask and removes it - all filenames are global.
+
+******** OS/A 1.3.7 ******** 30jun1996 A.Fachat
+
+Introduced return code for device interrupt routines. It is returned
+if an interrupt source has been cleared (E_OK) or not (E_NOIRQ).
+This is checked, and if a source has been removed, the interrupt
+routine is left - if we cannot check the irq line directly with SYSINPORT.
+The C64 got a ACIA 6551 device, if it is built into the C64.
+
+******** OS/A 1.3.8 ******** 13oct1996 A.Fachat
+
+Added two routines (PUTB, GETB) to handle block transfers to Stream
+buffers. SBLK transfers a block of data (length in a) to (c=1) or from
+(c=0) a stream (xr) buffer to memory (address in zeropage address
+pointed to by yr). The routine returns the number of actually
+transfered data in a (?). The data must not cross page (4k) boundaries
+on MMU systems.
+This procedure (hopefully) avoids a lot of context switches.
+
+******** OS/A 1.3.8d ******** 16oct1996 A.Fachat
+
+a log says more than thousand words :-)))
+----------------------------------------------------------------
+root:/root>ping -c 1 192.168.0.13
+PING 192.168.0.13 (192.168.0.13): 56 data bytes
+64 bytes from 192.168.0.13: icmp_seq=0 ttl=64 time=4673.4 ms
+
+--- 192.168.0.13 ping statistics ---
+1 packets transmitted, 1 packets received, 0% packet loss
+round-trip min/avg/max = 4673.4/4673.4/4673.4 ms
+root:/root>date
+Wed Oct 16 18:07:58 MET 1996
+root:/root>
+----------------------------------------------------------------
+Well, there still is a lot to do:
+- problems with lost characters
+- memory management buggy
+- removing DEBUG output (gets down to 1.6s for a ping reply)
+
+******** OS/A 1.3.8e ******** 16oct1996 A.Fachat
+
+Ironed out some bugs in SLIP memory handling, which seems stable now.
+SLIP behaves strange when packet buffer is _not_ empty (i.e. filled
+with zero)
+
+******** OS/A 1.3.8f ******** 18oct1996 A.Fachat
+
+SLIP IP layer is stable now. Added serial device driver for UART 16550A.
+with FIFO. But still lost chars above 2400 baud :-(
+Fixed another bug in GETB, but GETB version of SLIP is way _slower_
+than GETC version!? GETC version gives PING replies in 860ms (@ 2400 baud),
+GETB version in around 1750ms.
+Serial line interrupts still increase cursor speed.
+
+******** OS/A 1.3.9 ******** 19oct1996 A.Fachat
+
+A new compile option STACKCOPY for systems without MMU allows the stack
+to be copied into a save area on context switch (i.e. $80-$ff is system,
+$00-$7f for task, the stack is copied only when a real task change takes
+place). This now allows more than 5 tasks in systems without MMU.
+
+******** OS/A 1.3.9a ******** 19oct1996 A.Fachat
+
+Optimized UART 16550A driver. Now works for 9600 baud (if not much other
+work to do). Then we still loose characters. Running SLIP with 19200
+crashes the system :-(
+
+******** OS/A 1.3.9b ******** 20oct1996 A.Fachat
+
+I managed to get my selfbuilt hardware running again! So the current
+stdrom is checked with MMU. OLDROM will from the next version on
+refer to 1.3.9b
+
+******** OS/A 1.3.9d ******** 21oct1996 A.Fachat
+
+Serial device driver for the fast (i.e. 9600 baud) RS232 interface by
+Daniel Dallmann started. Transmitting works.
+
+******** OS/A 1.3.9e ******** 22oct1996 A.Fachat
+
+Now receiving at slow byterate (though 9600 baud) works. Too many bytes
+(i.e. NMIs) in a short time kill the machine...
+
+******** OS/A 1.3.9f ******** 22oct1996 A.Fachat
+
+Made NMI driver a bit faster, receiving at fast RS232 works better now
+for low byterates, although still crashes at high byterates.
+SETNMI now returns the old NMI vector, and the NMI routine has not to
+RTS, but to JMP(old_vector).
+
+******** OS/A 1.3.9g ******** 23oct1996 A.Fachat
+
+Fixed the bug in the serial driver IRQ (not NMI!) routine, which messed
+up the stack when getting above the stream low water mark...
+SETNMI now sets the NMI routine directly, i.e. ($fffa) jumps to
+jmp (vector), where vector can be set with SETNMI; so registers have to
+be saved in the NMI routine.
+TODO now: a means to disable NMI during disk or whatever access.
+Maybe redefine $f003 jmp, because NMI vector is known anyway: jmp ($fffa).
+PING now gives around 10 seconds reply time, dropping every second packet
+due to full tx queue: tx byterate is slow due to 16 used bits per byte
+(i.e. 6 additional stop bits) and interrupt latency. But usually receiving
+should have higher byterate than receiving. With PING, the SLIP task
+tries to send as fast as it receives, which doesn't work...
+
+The same bug as in the fast serial driver was in the UART driver, which
+now works at 19200 baud, only very occasionally loosing characters.
+Also some more handshake bugs in these drivers have been fixed.
+
+******** OS/A 1.3.10a ******** 25oct1996 A.Fachat
+
+Added CTRLNMI system call, together with the NMI chain. There is still
+a way missing to remove a driver from the chain.
+The C64 fast serial driver uses this method now. Although flooding the
+computer with bytes slows it down to near unusability.
+
+******** OS/A 1.3.11 ******** jan1997 A.Fachat
+
+Been working on TCP implementation. discard & echo ports work.
+Also connection closing ceremonies. Packet Retransmission works.
+Retransmission timeouts, timewait timeouts work.
+chargen port works. program registers itself as filesystem.
+
+TODO: 32-bit-modulo, some timeouts...
+
+******** OS/A 1.3.12 ******** 2mar1997 A.Fachat
+
+Implemented the Gecko OS ROM. It features a shell (with monitor),
+the irtx program to send commands to IR devices (like CD players or
+TV sets), a serial IEC filesystem. The shell runs over the serial
+line (with 16550).
+
+******** OS/A 1.3.13 ******** 09mar1997 A.Fachat
+
+The fstcp filesystem works for reading files and directories.
+Directories without directory mask, though.
+The fstcp server accepts connections only from a given address now,
+and (hopefully) doesn't allow accesses outside the given directory.
+TODO: 32-bit modulo, fstcp writes, bugfixes
+
+******** OS/A 1.3.13a ******** 10mar1997 A.Fachat
+
+Writing to the fstcp filesystem seems to work now.
+FSTCP can now be disabled in main.a65.
+
+******** OS/A 1.3.13b ******** 11mar1997 A.Fachat
+
+hacked a small (and dirty) WWW server...
+
+******** OS/A 1.3.13d ******** 14mar1997 A.Fachat
+
+Bug fixes...:
+- It is now possible to run the WWW server together with the
+ FSTCP filesystem at the same time - it is _not_ allowed to let the
+ WWW server access a file on the FSTCP filesystem - it hangs the SLIP
+ process!
+- The problem with the aborts is gone: I forgot to release the STREAMS
+ in the WWW server
+- the transition from LASTACK to CLOSED wasn't detected, because ackxmit
+ overwrote the "tmp" variable that holds the checkack return value...
+- LASTACK now also has a timeout to close the TCB after a while
+- FINW2 was not resolved to TIMEW because there was no check...
+ so the available number of TCBs decreased...
+- FINW2 now also has a timeout to closed, as when the FIN is ack'd, we
+ cannot resend it (removed from queue...). This is probably not as it should
+ be, but it works anyway.
+
diff --git a/dump/oa-2.0.9/doc/LOG-2.0 b/dump/oa-2.0.9/doc/LOG-2.0
new file mode 100644
index 0000000..27a43e4
--- /dev/null
+++ b/dump/oa-2.0.9/doc/LOG-2.0
@@ -0,0 +1,56 @@
+
+2.0.9 - 06oct2013 - A. Fachat
+
+- fixed an uninitialized variable bug in the console driver that only showed
+ on the real machine
+
+- fixed build problems for the c64 ("notimp" code in lib6502 jump table)
+
+- lsh got cmdline option where to CHDIR on start, ROMs set it to boot drive
+ Also got a new "reset" command
+
+- adapt new c1541 command syntax for formatting an x64 file
+
+
+2.0.8 - 20dec1998 - A. Fachat
+
+- console device now implements TC_CPOS multibyte control code
+ to place cursor directly on screen.
+
+- init features MMU mode to scan second bank for the ROM link
+ chain to execute. It uses the "magic" non-sysapp to determine
+ if it found one.
+
+- break fsibm into parts, especially separate the hardware (WD1770)
+ driver from the rest. Implement a RAMdisk driver for fsibm.
+
+- moved computation of DPB and translation of linear address -> C/H/S
+ into hardware driver. Implemented "linear" ramdisk driver.
+
+- made fsibm loadable as o65 file.
+ increase memory size for CS/A65 lib6502 files from 4 to 12k.
+ loading sometimes doesn't work...
+
+- fix kernel/init to make booting TESTROM image work
+
+- init now handles second ROM image in INIT_MMU_BANK
+ Started work on SCSI driver for FSIBM
+
+- continued working on SCSI driver for FSIBM.
+ + Now formating hangs at the
+ _end_ of the sequence, probably disk name error? (test with emulator?)
+ + formating only sets to small disk size...
+
+- formating works for ramdisk device - leaving the old boot sector.
+
+- continued working on SCSI driver. Had to use div32 instead of div at
+ several places because cluster/sector >= 0x8000 bugged out!
+ Now computes right number of sectors when formating SCSI harddisk.
+ TODO: - copying a file to FSIEC stops after 128 byte - Stream problem?
+ - bytes free decrease by approx. double the used amount
+
+- FSIBM can now use FAT16 partitions above 32M, but boot sector is
+ not standard and FSIBM_SECTOR24BIT has to be defined.
+
+- The scsi/hd driver can now us the xcsa ramdisk
+
diff --git a/dump/oa-2.0.9/doc/LOG-pre-2.0 b/dump/oa-2.0.9/doc/LOG-pre-2.0
new file mode 100644
index 0000000..e945ff0
--- /dev/null
+++ b/dump/oa-2.0.9/doc/LOG-pre-2.0
@@ -0,0 +1,312 @@
+
+Now the transition from 1.3.x to 1.4.0 takes place
+
+1) 1.3.90: make new directory structure, and use segments:
+
+ - include directory overhauled. 20mar1997
+
+ - kernel now assembles standalone (with xa >= 2.1.3)
+
+ - fsdev now assembles standalone (with xa >= 2.1.3)
+
+ - C64 is working now (w/o fsiec)
+
+ - removed many global variables (mostly from kernel)
+
+ - made fsiec assemble, checked C64 serial and parallel (fixed a bug
+ in the serial code)
+
+ - now all architectures (c64, csa65, gecko) are converted,
+ although only c64 is tested now.
+
+ - all apps are converted, although not tested
+
+2) 1.3.91: cleanup more archtecture dependend stuff
+
+ - moved hardware stuff from oa1si.a65 to arch/*/devices/kinit.a65
+ C64 works again
+
+ - put Gecko fsiec back to mainstream fsiec. added getif and freif
+ to fsiec device interface
+
+ - divided console code into hardware independent (devices/console.a65)
+ and hardware dependent (arch/*/devices/con_*.a65) code.
+ C64 should work (does on VICE), csa also, but this is not tested.
+ C64 cannot give the F1 switch key with shift+ctrl (bug!)
+
+ - CS/A architecture (with ROMTEST) works, except for the console
+
+ - CS/A console works, when not interruptable.
+
+3) 1.3.92: dynamic memory management / relocatable loader
+
+ - added memory management from slip to stdlib. It is initialized
+ from the kernel on startup. New GETPID system call added to allow
+ owner identification for memory blocks
+
+ - new zeropage memory management in stdlib. Added o65 loader from xa
+ to stdlib
+
+ - made loader work. loads o65 files now, but no undefined symbols
+ (like KERNEL and STDIOADDR) are relocated.
+
+4) 1.3.93: started kernel rewrite...
+
+ - removed: memory management, signals
+
+ - added error state byte for streams (untested)
+
+ - rewrote env handling to allow threads etc. Use different tables
+ removed send/(x)receive, setirq, getenv, freenv, setblk, wterm, getinfo,
+ treset, read/write and signal from kernel in this process.
+
+ - reimplemented send/receive/xreceive.
+
+ - implemented signals
+
+ - reimplemented STACKCOPY option.
+
+ - started working on CS/A65 MMU architecture
+
+ - implemented SLOCK and RENICE kernel calls
+
+ - cleaned up kernel init routines, added zerotest.a65 and ramtest.a65
+
+ - worked on SEND/RECEIVE for MMU.
+
+ - real memory handling for MMU
+
+ - cleanup device handling code (with and w/o MMU)
+ but: in CS/A65, non-ROM-started devices don't work!
+
+ - fixed a bug in setnam (device handling kernel code).
+
+ - moved [load|save][thread|task] all to setthread, which is
+ now completely in kenv
+
+ - runs on the Gecko now.
+
+ - made all calls to memtask from JSR to JMP (for NOMMU, keep a
+ dummy for CS/A). return from interrupt needs special care, though.
+
+ - The debugging speed when running on the xcsa emulator is impressing,
+ compared to the time to find an error on the real machine.....
+ CSA debugging done (multitasking works, video device too, so works
+ send/receive)
+
+5) 1.3.94: support code and glue fixes
+
+ - console and serial devices support SCE_PUSH (console only) and
+ SCE_BRK bits. fsdev and fsiec support the error code bits SCE_?ERRM.
+
+ - shortened CS/A65 part a bit to get more kernel space
+
+ - sbrk for CS/A65, GETINFO (short version...)
+
+ - SHORTRAMTEST - only check one value besides MEMINIVAL, probably
+ MEMINIVAL ^ $ff, to still allow mirrorcheck in CS/A
+
+ - fixed nasty bug in CS/A65 setthread.
+
+ - removes stream read/write counter handling from FORK and from
+ ROM init. Introduced new ROM file format.
+ Introduced "init" process to start ROM processes with command line
+ FORK now copies the PCBUF to the started process, which has to releas
+ the SENDBUF semaphore after reading the command line
+
+ - removed stdlib calls from most sysapps (fs*, mon)
+ Also put "sh" from "apps" to "sysapps" and renamed it to "mon".
+ So far there is still a link from "apps/sh" to "sysapps/mon",
+ as long as there is no new shell.
+
+ - included fileformat.html (for o65 files) and lib6502.html for the
+ new stdlib in the doc directory.
+ moved the "stdlib" directory to "oldlib"
+
+ - moved libsave to THREADSAVE, TASKSAVE and ENVSAVE
+ all are now cleared on respective allocation
+
+ - removed bogus kernel calls. updated kernel docs (kernel.html).
+ improved GETINFO call and adapted the Shell code for it.
+
+ - fixed small bugs in fork and kill. (revealed by GETINFO...)
+
+ - SLOCK (scheduler lock) is optional now.
+
+ - reordered error codes
+
+ - made some more stuff for the proto directory
+
+ - when a process terminates and the parent waits for sigchld,
+ TT_NTHREADS is set to -1 and sigchld is sent. If parent is killed
+ or checkchld is called from parent, then task is freed.
+ checkchld returns the process ID of the terminated child
+
+ - init process now has restart ability - a ROM task can be restarted
+ when the task has terminated.
+
+ - fixed a bug in the console code that didn't check for E_NUL
+ in any case...
+
+ - also fixed a little bug in asetxy...
+
+ - kernel seems to work on real CS/A65 too now...
+ (fixed a little bug in BRK handling of csa65/devices/oa1sd.a65)
+
+6) 1.3.95: stdlib handling
+
+ - SUSPEND kernel call renamed to YIELD
+
+ - realloc added to lib6502
+
+ - implemented file handling, signal handling, semaphores
+ according to lib6502 specs
+
+ - changed command line parameter format for ROM
+
+ - fixed a bug in arch/c64/kernal/kenv.a65 for stack address overflow
+ with more than 4 threads.
+
+ - stdlib handling
+ When task is killed (from other task, or BRK), how to clear all
+ lib resources? Call signal exit handler on _any_ exit, and lib
+ clears then?
+
+ - implemented almost all (except network and environment) feasible
+ lib6502 calls.
+
+ - moved the lib6502 to version 0.5
+
+ - init now boots (i.e. loads and starts) o65 file from lib6502 :-))
+
+ - exec now passes command line parameter to program
+
+ - dup works with stdio
+
+ - added cwd to lib6502 definition
+
+ - changed names from "oa1*" to more descriptive names
+
+ - lsh parses command line and redirects stdio
+
+ - lsh now executes builtin commands as well as external commands :-))
+
+ - streams are now 64 instead of 128 byte long (gives double the number
+ of streams on a C64)
+
+ - FSIEC opens files now without ",P"
+
+ - lsh can now combine stdout and stderr with ">!" or "!>! redirectors.
+ replacing ">" with ">>" does an append.
+
+ - giving the shell a filename should make it read from the file and
+ put it into quiet mode (untested)
+
+ - shell now receives sigchld from started tasks
+
+ - added sigchld to signal definition in lib6502
+
+ - added yield to lib6502 definition
+
+ - shell understands "&" and ";"
+
+ - added some simple file utilities (rmdir, mkdir, rm, format, chkdsk)
+ but more info has to be put here.
+
+ - added simple "ls" command
+
+ - added "cat" command
+
+ - changed return values for fread/fwrite
+
+ - added "mv" command (only to same device)
+
+ - forkto now copies the cwd to the child process, which makes it
+ run programs from relative path.
+
+6) 1.3.96: inet handling
+
+ - mon and slipd can now also be run from lsh
+
+ - slipd now works as before. It now takes its IP address from the first
+ packet received.
+
+ - implemented traceroute protocol: ICMP port unreachable for udp
+
+ - some TCP bugfixes: does not eat up tcbs anymore when errorneous packets
+ arrive while listening. Detected some weird end of connection bug
+ triggered by high traffic...
+
+ - seem to have fixed the all end-of-connection problems.
+
+ - added one more virtual terminal to C64 console device
+
+ - slipd seems to be fixed...?
+ slipd can now redirect its stderr (away from stdout and to a file given
+ on the command line) -> rom startable.
+
+ - wwwsrv prefixes a file with the content-type header, depending on file
+ extension.
+
+ - fixed a nasty old bug in ackxmit (slipd)
+
+ - added flib2osa_[rw] calls to stdlib to map from lib6502 fileno to
+ OS/A65 stream.
+
+ - rsh working
+
+ - simple tlogin
+
+ - fixed bugs in lib6502 exec and bcleanpida code
+
+ - tlogin now sends the telnet WILL ECHO and WON'T ECHO options to
+ hide password
+
+6) 1.3.97: lib6502 inet handling
+
+ - fixed a bug in lib6502 fopendir
+
+ - made fstcp working again
+
+ - console is in no-echo mode by default. mon now switches console to
+ fullscreen mode with TC_ECHO
+
+ - telnet works
+
+ - getenv/putenv work
+
+ - shell now has "echo" and "set" builtins, including variable substitution
+
+ - added "getos" lib6502 call and "uname" shell builtin.
+
+ - listen works
+
+ - rewrote fcntl to use checkfd_* - makes it shorter and works with STDIO
+
+ - fixed a really nasty bug that decreased system stack when receiving
+ a message that is already prepared.
+
+ - implemented lib6502 httpd, and lib6502 accept/listen works
+
+ - fixed a bug in slipd that killed it when no memory available. Now a
+ random connection is closed to get more memory.
+
+ - mon now recognizes STDOUT E_NUL as break condition, which makes
+ it stop much faster when it is in an endless loop... :-)
+
+ - loader does now align, and relocates LIB6502 and OSA2KERNEL, and calls
+ "main" to start
+
+ - overhauled docs
+
+6) 2.0.0-pre*: ports and bugfixes
+
+ - added CBM8x96 support
+
+ - added support for PET with 32k RAM
+
+
+TODO:
+
+ - tons of bugfixes
+
diff --git a/dump/oa-2.0.9/doc/README b/dump/oa-2.0.9/doc/README
new file mode 100644
index 0000000..e20310e
--- /dev/null
+++ b/dump/oa-2.0.9/doc/README
@@ -0,0 +1,21 @@
+
+This is the source code for the OS/A65 multitasking operating system for
+6502 computer. It is designed to work with a CS/A65 computer system or
+a Commodore 64. But then the kernel is almost completely hardware
+independent, so that it should be quite easy to port it to other 6502
+computer. See oa1.html for more details.
+
+The source is copyrighted by Andre Fachat and is released under the
+GNU public license. See the file COPYING for more details.
+
+To build the binaries, a 6502 cross compiler has to be used. The source
+is written to work with my 'xa' (version >= 2.1.4e), see my WWW page for the
+source (it's under GNU public license).
+
+The doc directory contains the english html documentation.
+
+Andre Fachat
+a.fachat@physik.tu-chemnitz.de
+http://www.tu-chemnitz.de/~fachat
+
+
diff --git a/dump/oa-2.0.9/doc/README.c64 b/dump/oa-2.0.9/doc/README.c64
new file mode 100644
index 0000000..7daaf05
--- /dev/null
+++ b/dump/oa-2.0.9/doc/README.c64
@@ -0,0 +1,139 @@
+
+ OS/A65 v2.0.0
+ --- C64 version ---
+
+
+These are the instructions how to load and run OS/A65 on a C64.
+
+
+At the moment the main development takes place on the C64 emulator
+VICE. I did not have the time to test everything on the real machine.
+So beware (but VICE has become quite accurate in the meantime!)
+
+I have an original C64 parallel IEEE488 expansion board, so that
+I use this for better performance. I also implemented the hardware
+emulation for the CBM IEEE488 interface for the C64 in the VICE
+Commodore emulator (from version 0.11 on). So if you have this interface,
+use it for better file transfer performance on the real C64 or
+for file access in VICE. Change the line in c64rom/c64rom.a65 from
+'#undef PARALLEL' to '#define PARALLEL'. For the C64, the
+devices 9 to 11 are mapped to the drives c: to f:
+
+As the C64 doesn't have an MMU, there are other restrictions.
+If you don't want to have the application stack being copied
+to a save area at every thread switch the stack can be parted
+amongst the threads, allowing a maximum of 5 threads running
+concurrently. But then if you allow copying, you can have up
+to 16 threads running. The main configuration file (arch/c64/config.a65)
+has the definitions for that.
+
+If you change something there and reassemble, check from the file65
+output that the data and bss segments don't overlap. Also the
+memory that is dynamically allocated starts at $1600 (see
+arch/c64/c64rom.a65). Only if nothing overlaps there is no danger.
+
+I don't think I can get the BASIC to work - it wants
+too much stack space to run without MMU.
+
+The programs have to use the PCBUF to send and receive messages.
+If two or more programms access this 'shared' memory without
+protection, bad things can happen. Imagine one task preparing a
+FORK call and then getting interrupted. Another task is then
+scheduled and using the buffer for something else, causing the
+FORK of the first task to go bad...
+Because of this, a system semaphore is defined that has to be
+allocated (PSEM) before accessing the send buffer and released
+(VSEM) after using it. More on this issue in doc/nommu.html.
+
+There still are some glitches, but the system itself is stable. Some
+things might happen, because there's no MMU. I have tried to
+fix all this, but remnants are there...
+(When you have a 'virtual machine' for a program, you get some kind
+of lazy about where to put the variables sometimes...)
+
+How to get started
+------------------
+
+To build the program, you have to have my 6502 cross assembler 'xa-2.1.4e'
+Current testing takes place on 'VICE' (x64), the versatile Commodore emulator.
+Better get the newest version because the IEEE488 interface is not
+yet in vice-0.10.0.
+
+In the file c64rom/c64rom.a65, a few options can be set by setting
+the defines appropriately. See doc/build.html.
+
+Go to the arch/c64/boot directory and type "make" this will build
+all necessary files in this directory, including links to all
+important applications. Typing "make osa.d64" will produce a
+d64 disk image with all necessary files. This disk image can be
+transfered to a C64 and used.
+
+In VICE (i.e. x64) or on the C64 load the (BASIC) program 'loader', which
+is in the boot directory and the osa.d64 disk image. When run, this
+program loads the charom, the program ROM and
+a small machine language program (boot.obj, which is made from
+boot.a65). It then starts the boot routine that copies the ROMs to
+their places and jumps to the kernel RESET routine.
+
+When using osa.d64 in VICE, you have to enable the true1541 emulation.
+
+The current ROM contains the video device, the device filesystem, an
+IEC filesystem and a 'small' monitor.
+The video device is able to handle up to four screen output windows.
+The F1 key switches between the different windows (You can change the
+switch key in arch/c64/devices/con_c64.a65, but when you're using
+the "C=" key, don't try to use the Ctrl-Alt-Fx keys in XFree when the
+mouse cursor is in the vice window. OS/A will detect a Ctrl-Switchkey
+and therefore send an EOF to the program....)
+On the first window, a lib6502 "lsh" is started. On the second one, the
+small monitor is started. As the C64 has no MMU, these two programs
+have to use different memory locations. The monitor is assembled into the
+ROM and can be started only once from the ROM. The lsh is a lib6502
+program and is loaded by the init process. The ROM only contains a
+command to the init process to start the lib6502 program. It uses
+a relocatable fileformat and can thus started more than once.
+
+In the shell you can use "c:ls" on drives a: (registered devides) and
+b: (rom inventory). If the iec bus works, then drive c: is disk unit 8
+and drive d: is disk unit 9, till drive f: is device 11.
+
+For the shell/monitor commands see the docs.
+The memory map is described below. When writing and using lib6502
+programs they are relocated automagically.
+
+Internals:
+----------
+
+The arch/c64/devices and arch/c64/kernel directories contain the only
+C64 specific stuff.
+
+fsiec uses CIA2 timer b as serial bus timer.
+
+Due to the deficiencies of the C64 hardware, the C64 cannot serve as
+a disk drive on the bus, giving access to its devices to other
+computers (as my selfbuilt one does).
+
+Memory Map.
+-----------
+
+The area below $70 is used by the ROM. The same holds true between
+$300 and $1600. The exact values can be seen in the assembler screen
+output (file65 - comes with xa)
+
+$1600-$8000 free memory - i.e. lib6502 malloc-able
+$8000-$d000 ROM (well, the RAM contains what should be in the ROM of
+ a CS/A computer...)
+$d000-$e000 I/O area and the RAM under it contains the charrom
+$e000-$e400 screen buffer 1
+$e400-$e800 screen buffer 2
+$e800-$ec00 screen buffer 3
+$ec00-$f000 screen buffer 4
+$f000-$10000 OS/A65 kernel.
+
+The kernel and lib6502 addresses are automatically relocated
+when loading a lib6502 program.
+
+--------------
+Any suggestions and comments welcome
+Andre Fachat (a.fachat@physik.tu-chemnitz.de)
+
diff --git a/dump/oa-2.0.9/doc/README.lsh b/dump/oa-2.0.9/doc/README.lsh
new file mode 120000
index 0000000..d380c0e
--- /dev/null
+++ b/dump/oa-2.0.9/doc/README.lsh
@@ -0,0 +1 @@
+../apps/lsh/README
\ No newline at end of file
diff --git a/dump/oa-2.0.9/doc/README.slip b/dump/oa-2.0.9/doc/README.slip
new file mode 100644
index 0000000..c709bd0
--- /dev/null
+++ b/dump/oa-2.0.9/doc/README.slip
@@ -0,0 +1,281 @@
+
+ TCP/SLIP implementation for the OS/A65
+ --------------------------------------
+ (c) 1997-1998 A. Fachat
+
+
+0) Warning: This code is experimental and in a late Beta now!
+ It has bugs, and may damage files on your computer!
+ The programs are provided "as is", there is no warranty at all,
+ and the usual disclaimers apply.
+
+ I you are a beginner, forget it. This is (still) advanced stuff.
+
+1) Never, never ever run the "fstcp" server on a computer connected
+ to the Internet!
+ It has no other security protection than checking the IP address of
+ an incoming connection request!
+
+ Never, never ever run the WWW server on the OS/A computer (C64), if
+ it is connected to more than your home PC. It reads all files from
+ the specified (C64 or OS/A) drive!
+
+2) Now that you're warned: What's it for?
+
+ The TCP/SLIP implementation can be used for telneting to and
+ from an OS/A65 computer. Now it's used to transfer files between an
+ OS/A65 computer and a (Unix) computer. It can also be used as a simple
+ WWW server now.
+
+ I use it on a C64, to transfer files between a PC and a VC1541 disk.
+
+ The lowest level you can see is the icmp (internet control message
+ protocol) level. If you "ping" the OS/A65 computer, it replies.
+ See "man ping" on a Unix machine. It also replies to "traceroute"
+ packets appropriately.
+
+ Then there are the simple test TCP ports "echo" (7), "discard" (9) and
+ "chargen" (19). You can telnet to these ports on the OS/A65 computer.
+ See "man telnet" on how to telnet to a different port.
+
+ Another special port is the http port (80). This port is used to
+ transfer html pages for the World Wide Web (WWW). A special server
+ is listening on this port and serves requests from a given directory.
+
+ The next level is a client-server-application. The server "fstcp"
+ runs on a connected (unix) system. The client "slipd" runs on the
+ OS/A65 machine. It tries to connect to a remote server (the fstcp
+ program on the unix machine) and establishes a TCP connection to the
+ server. This connection is then used to transfer file data.
+
+ The "slipd" internet daemon exports internet capabilities to the
+ lib6502 library. This is actually the only part that still seems
+ to be buggy. The www server built into slipd is quite stable, as
+ is the rest of the OS (has been running for several days without
+ problems)
+
+ The default configuration for slipd (see sysapps/slipd/main.a65)
+ is to run the builtin WWW server, the telnet server (starts
+ the apps/inet/tlogin program for login) and the lib6502 stuff.
+ You have to change login/password/shell in tlogin.a65 to your
+ preferences.
+
+ With the lib6502 inet stuff the apps/inet/telnet program opens
+ a telnet connection to the host given at the command line
+ (in doted quad notation).
+
+ The procedures described here are for a Linux machine and a C64
+ with OS/A65 running. For the serial line setup you need root
+ (superuser) access to the unix machine. It should run without
+ any changes on any OS/A65 machine with a serial line.
+
+3) IP concepts
+
+ a) addresses
+
+ In an IP (internet protocol) network, each computer has an IP number.
+ Normally you have to formally apply at the network information center
+ for an IP number or net. But there are numbers assigned to be used
+ in private, non-connected networks.
+
+ IP addresses are usually noted in the "doted quad" notation, i.e.
+ four decimal values from 0-255 each, separated by dots.
+
+ The private network I use is are the numbers
+
+ 192.168.0.*
+
+ i.e. the numbers 192.168.0.1 - 192.168.0.254. There are two numbers
+ missing, they are used as network address (0) and normally as broadcast
+ address (255).
+
+ My unix (i.e. Linux) computer at home has the IP 192.168.0.10. This is
+ the IP the fstcp server is running on.
+ My C64 (with the OS/A65 operating system) has the IP 192.168.0.64.
+ So if the C64 has the slipd program running, I can do a
+ "ping 192.168.0.64" on my unix machine and get a reply!
+
+ b) routing
+
+ The internet protocol is a packet oriented network. A packet is
+ sent from one host to another, which is normally not the final
+ destination. Each host decides where to send a packet next, to get
+ the packet to its destination. This process is called routing.
+ Normally the program "route" is used to tell the computer which packets
+ to put where.
+
+ c) preparing a serial port
+
+ If you connect a serial line from the C64 to the unix machine, the
+ unix machine has to know that it has to send and which IP packets to
+ send there. There are some ways to achieve this.
+
+ The first way is with the command "slattach", which puts the
+ serial line from "terminal mode" to "SLIP" mode. Then "ifconfig"
+ configures the "sl0" interface with the IP address. The last command
+ is "route", which tells the unix OS that is has to send packets to the
+ C64's IP address to the interface sl0, which goes to the serial line.
+ The small script "csaip", provided in the oaslip directory, does
+ everything.
+ Warning: this script assumes you have network device "sl0" for the
+ OS/A65 link. If you have a SLIP connection somewhere else already.
+ this might not be true! The script then mangles your routing tables!
+
+ Another way is the program "diplogin" or "sliplogin" which does everything,
+ see the appropriate man pages.
+
+ I have added a program "term9600" which is a little C64 BASIC terminal
+ program to run the serial line at 9600 - if the kernel ROM allows that.
+ It can be used to login to the remote host if necessary.
+
+
+4) TCP concepts
+
+ a) addresses
+
+ TCP addresses not only contain the IP address of the host, but also
+ the "port". The Port is like the number of the flat in a house, when the
+ IP number is the address of this house. Certain port numbers are
+ registered for a special use. Port 7 (echo) for example will send
+ all data you send to it back.
+ When you open a connection to a port on a remote computer, your own
+ computer also assigns a local port number to the connection, to have
+ a full TCP address at the sender side.
+
+ b) connections
+
+ In contrary to the IP protocol, the TCP is a connection based protocol.
+ A connection always takes place between two TCP "ports" or
+ two "pairs of IP and TCP port numbers". This connection is defined
+ with the properties:
+ - no data "overtakes" data sent before
+ - no data is lost
+ - no data is doubled
+ (which are all effects that can occur on IP)
+ With retransmissions, sequence numbers and lots of other things the
+ TCP ensures that the data is received in order and nothing is missing.
+
+ c) establishing a connection
+
+ Normally one side creates a "socket" and "binds" it to a specific
+ local TCP/IP address. It can then either "connect" to a remote
+ socket, or "listen" for remote connect requests. If the socket
+ listens on a port, the "accept" call will bind the local and remote
+ socket to a valid connection.
+
+ Normally a server program listens on a socket while the client tries
+ to connect to it.
+
+ d) used ports
+
+ I chose to use port "8090" as the port where the fstcp server is
+ listening at.
+ The WWW server built into slipd listens at the standard port 80,
+ and the telnet connection is listening at the standard telnet port (23).
+
+
+5) Building the programs
+
+ a) the "fstcp" server
+
+ The fstcp server is a C program, in sysapps/slipd/fstcp.c. Going to the
+ slipd directory and typing "make fstcp" should work on unix (linux)
+ machines. In the first lines the port is defined where the server is
+ listening at.
+
+ b) the "slipd" client.
+
+ Most other files in the oaslip directory are to build the slip client.
+ In the first lines of "main.a65" the OS/A65 IP address (MY_IP) is defined.
+ (note the comma instead of the dots!). But the slipd server listens
+ for incoming packets and sets its own IP address if necessary.
+ Also the fstcp server TCP address (IP and port) are defined there.
+ The WWW server defines its drive and directory it will read the files
+ from. Do _never_ specify a drive on the fstcp filesystem. The slipd prg
+ will hang on the first access!
+
+ To assemble the files, you have to have my 6502 crossassembler "xa"
+ in you path, with version above 2.1.4d.
+
+ The slipd program is built when running "make" in the sysapps/slipd
+ subdirectory.
+
+
+6) running the program
+
+ To run the program, do the following steps:
+
+ - connect the C64 (either with Daniel Dallmans 9600 baud interface,
+ or any other RS232 interface supported by OS/A65) and a serial
+ port of the (Linux-) PC with a Nullmodem cable.
+ The standard C64 configuration allows an UART16550 at address
+ $d600. To change that have a look at arch/c64/c64rom.a65, which
+ holds the configuration for the C64.
+
+ - enable SLIP on the serial line by running something similar to
+ the script oaslip/csaip (does slattach, ifconfig, route).
+
+ - If you want fstcp services, start the fstcp server on the unix
+ host. As arguments it needs the directory (relative from the
+ starting directory) to export and the IP address to which to export
+ the directory.
+ As fstcp might very well be buggy, try to be as cautions as
+ possible. Never ever run it on a computer connected to the internet.
+ Never ever run it as root (superuser).
+
+ - Transfer the slipd file to a disk accessible to the C64 when running
+ OS/A65 (using an x1541 cable, for example)
+
+ - start OS/A65 on the C64 (see other files, like README.c64)
+
+ - You should have a shell prompt (">") with a binking cursor.
+ Now start the slip.obj program by typing
+
+ c:slip.obj a:video4 c: c:tlogin a:ser1 &
+
+ This starts the slip client from drive c: (usually Commodore serial
+ IEC device #8, the floppy disk), piping the STDIO
+ to the C64 serial line ser1 (in standard C64 OS/A65 it's Daniel
+ Dallmanns 9600 baud interface). STDERR is sent to the 4th virtual
+ console (first command line parameter). The second parameter
+ is the drive to use as WWW server file source. The third parameter
+ is the program to start at a remote login on the telnet port.
+ The ampersand makes the slip program running in the background.
+ The slip program receives and sends its SLIP data via STDIO.
+ STDERR prints (currently a horrible lot of) debugging output.
+
+ You can also start the slipd program directly from the C64
+ ROM, see c64rom.a65
+
+ - If enabled, the slip client registers a filesystem with one drive.
+ On a standard C64 OS/A65 system, it will be drive g:.
+ If a connection to the server cannot be found, or breaks
+ later, the fstcp tries to reconnect in periodic intervals.
+
+ - You should now be able to ping the C64, and do telnets to the
+ echo, discard and chargen ports.
+
+ - when telneting to the http port (80)
+ (When the WWW server is enabled in oaslip/main.a65), you can issue
+ the "GET" command, followed by an URL on the OS/A65 computer.
+ You then get the specified file.
+ You can also point your Web browser (netscape) to the C64
+ with the URL "http://192.168.0.64/index.html". Replace the IP
+ number with the one you have chosen for your system.
+
+ - If fstcp is enabled, it should now also be possible to show the
+ directory of drive g:, and to read files from or write files to
+ drive g: This drive will be the contents of the directory given to
+ the fstcp server, i.e. on your Unix machine!
+
+
+7) (Known) Bugs
+
+ - The WWW server only understands "GET filename" requests. No "http://"
+ or host prefixes are allowed. At least with Netscape it seems to work.
+
+ - The implementation is bloated, and horribly slow.
+
+ - Tons of others, I'm sure
+
+ - lib6502 binding seems to bug.
diff --git a/dump/oa-2.0.9/doc/TODO b/dump/oa-2.0.9/doc/TODO
new file mode 100644
index 0000000..5e37618
--- /dev/null
+++ b/dump/oa-2.0.9/doc/TODO
@@ -0,0 +1,33 @@
+
+TODO-List for 2.1.0
+-------------------
+
+- FSIBM:
+
+ + ignore VFAT long filenames (or handle them... :-)
+ + I had problems copying file from HD to IEC? Stream error feature?
+ + implement OSA2 stream error feature
+ + check filesystem structure (esp. on FAT16)
+ (bytes free count differs from what is expected)
+
+- ramtest:
+
+ + make a small program to be able to test RAM on non-standard
+ places and make it available to the kernel.
+
+- lib6502:
+
+ + memory handling should use SBRK call to incerease memory size
+ if necessary
+
+- FSDEV:
+
+ + fix _AS_INIT handling (release SEM_SENDBUF etc appropriately)
+ + use alternate ROM pages as file source (like in init)
+ + allow reading of binary files from ROM
+
+- FSIEC:
+
+ + fix _AS_INIT handling (release SEM_SENDBUF etc appropriately)
+ + fix protocol bugs when talking to a PET on IEEE488
+
diff --git a/dump/oa-2.0.9/doc/announce-2.0.0-pre1 b/dump/oa-2.0.9/doc/announce-2.0.0-pre1
new file mode 100644
index 0000000..d63ab4f
--- /dev/null
+++ b/dump/oa-2.0.9/doc/announce-2.0.0-pre1
@@ -0,0 +1,58 @@
+
+This is the release note for the GeckOS/A65 operating system for
+6502 computers, version 2.0.0. This is a new major release
+as the kernel has been partly rewritten, a complete new lib6502
+implementation has been done and the o65 relocatable fileformat
+is now supported, as well as multithreading.
+
+Also a sophisticated "slipd" daemon supports internet connectivity
+by using a SLIP connection, with a telnetd, a WWW server and related
+programs. The lib6502 network connectivity is supported, although
+this seems to be the only buggy part left...
+
+What's new:
+
+ - major kernel rewrite:
+ improved speed, now supports threads and task priorites.
+ Signals are now unix-like (they even can interrupt blocking
+ system calls :-)
+
+ - much improved porting ability:
+ _all_ system dependend stuff has been moved to a directory
+ in an "arch" subdirectory. Currently there are
+ "arch/csa65", "arch/gecko" and "arch/c64" subdirectories
+ (waiting for more contributions, hint, hint!)
+
+ - better kernel doc in "doc/kernel.html"
+
+ - lib6502 implementation
+
+ - dynamic memory management with lib6502
+
+ - relocatable fileformat
+
+ - telnet in and out from OS/A65
+
+ - stable WWW server (built into slipd daemon)
+
+What's still to do:
+
+ - Tons of bugfixes - but in general quite stable already.
+
+What do I want from you:
+
+ - Comments: How do you like it?
+
+ - new lib6502 applications!
+
+ - new ports!
+ If you want to port the kernel to a new system without
+ real memory management, it's almost only copying two files,
+ editing one of them and then writing the device drivers.
+ Taking the existing C64 stuff, that shouldn't be difficult.
+
+Any comments welcome!
+
+Thanks!
+Andre
+
diff --git a/dump/oa-2.0.9/doc/basic.html b/dump/oa-2.0.9/doc/basic.html
new file mode 100644
index 0000000..a2e1392
--- /dev/null
+++ b/dump/oa-2.0.9/doc/basic.html
@@ -0,0 +1,82 @@
+
+
+ OS/A65 BASIC interpreter
+
+
+
Warning!
+
+The BASIC interpreter is derived from copyrighted code!
+So the basic interpreter is only an
+educational example of how to port other programs from the C64
+or other PET computers to the OS/A65 operating system.
+Do not try to assemble it or run it!
+
+
+The basic interpreter is taken from the C64. I de-assembled it into
+normal source code and patched it to work with OS/A65 and multitasking.
+Several commands are changed and others, most notably the BASIC V4
+commands, are added.
+
changed commands
+
+
OPEN fnr, drv, mode, name
+'drv' has changed from the commodore specific device id to the OS/A
+drive number. 'mode' then is the command to open a file, i.e.
+FS_xxx.
+
LOAD name, drv
+
SAVE name, drv
+'drv' has changed to the OS/A drive number
+
LIST name, drv [,a-b]
+You can now list a program directly to a file. a and b are filenumbers
+and optional (as usual with list)
+
SYS adr
+'adr' is checked for some C64 specific addresses and changes them
+to the routines where they are now. Detected addresses are
+$ff90, $ff99, $ff9c, $ffb7-$ffe7, $fff0, $fff3.
+
+
new commands
+Some parameter can be left off, I was just to lazy to write all the brackets...
+
+
DIR [mask,] drv
+print directory of a drive
+
MKDIR name, drv
+creates new subdirectory
+
RMDIR name, drv
+remove (empty) subdirectory
+
SCRATCH name, drv
+remove file
+
RENAME name1 TO name2, drv
+rename a file 'name1' to 'name2'.
+
DELETE a-b
+remove BASIC lines a-b; syntax is the same as with list
+
RENUMBER start, step, a-b
+change basic line numbers of the lines a-b (syntax as with list) to
+start, start+step, start+2*step,... All GOSUB and GOTO statements are
+changed appropriately in the whole program.
+
RENEW
+Gets a BASIC program back that has been deleted with NEW. It only works if
+the program has not been overwritten by e.g. setting a new variable in
+memory.
+
DUMP
+prints all variables
+
FIND text
+list the lines where 'text' occurs.
+
HIMEM adr
+sets a new end of basic ram address and executes a CLR.
+
LOMEM adr
+sets a new basic program start address and executes a NEW.
+
QUIT
+In contrast to the original C64 Basic interpreter this one can be left...
+
ENTER name, drv
+redirects STDIN to the given file, so that e.g. a complete basic program
+can be read in from an ASCII (not tokenized) file.
+
CALL adr, a, x, y, c, ra, rx, ry, rc
+Calls a machine language routine at adr, with a,x,y,c in accumulator,
+x- and y-register and in the status register. Return values are put into
+ra, rx, ry, rc.
+
SPUT adr, string
+Write a string directly into memory at adr, end with nullbyte.
+
SGET adr, len, stringvar
+reads len bytes from memory at adr and saves it in string variable.
+
+
+
diff --git a/dump/oa-2.0.9/doc/build.html b/dump/oa-2.0.9/doc/build.html
new file mode 100644
index 0000000..5f4f29f
--- /dev/null
+++ b/dump/oa-2.0.9/doc/build.html
@@ -0,0 +1,101 @@
+
+ OS/A65 Building Procedure
+
+
OS/A65 Building Procedure
+
(c) 1989-98 Andre Fachat
+
+
+Building the object files for use on an OS/A65 machine should really
+be only a 'make', as long as my cross assembler
+xa
+is in the path.
+If there weren't these many options one can change.
+
+The options below can be set in the appropriate files. But if the
+programs are assembled as part of a ROM, then "ROM" is defined and
+the 'local' options are ignored and overwritten by the ones defined
+in stdrom/rom.a65 or c64rom/c64rom.a65. These two files are
+the files to build a rom for a CS/A computer with MMU or the C64
+respectively.
+
+global options, to be set in stdrom/rom.a65 or c64rom/c64rom.a65:
+
+ROM mandatory for a rom build. All local options are ignored.
+
+ROMSTART Where in CPU memory (with MMU with the upper 4 bits set
+ to zero, i.e. $00000-$0ffff) starts the ROM.
+
+
+
+C64 specific options, to be set in arch/c64//c64rom.a65:
+
+CLEARMEM if defined, the memory is set to the value CLEARMEM is defined
+ to when booting.
+C64NEEDCIA1 if defined, disables reading the CIA1 icr in the kernel.
+ Therefore it has to be assured that a device reads this
+ register to clear the interrupt line again.
+ Undefine this for use with the fast RS232 driver.
+
+C64_BGND_COL
+C64_TEXT_COL
+C64_BORDER_COL colors to use
+
+C64SWITCH The terminal switch key, 61= C= key, 4= F1
+
+C64NMIRESET makes the Restore key a RESET key. Doesn't work with fast
+ serial driver!
+STACKCOPY If defined in non-MMU systems, save stack area somewhere else
+ when doing a task switch. If a task switch is done, the stack
+ is copied back. If not defined, divide the 6502 stack
+ from $100 to $1ff into pieces, one for each task and one
+ for the system. It's faster without, but with this option
+ there is much more stack space per task and more tasks
+ are available.
+
+
+
+kernel options in kernel/kernel.a65:
+
+ROM with ROM all options are set globally or somewhere else
+ROMTEST with ROMTEST the MMU is not loaded, but the contents of
+ the MMU registers secured with GETBLK. Also memory is
+ not tested (to test a new system ROM)
+CMOSCPU for (Rockwell) CMOS CPU
+NOMMU system for a computer without MMU
+NOSYSPORT system has no SYSPORT (at $efe0)
+NOSINPORT system has no SYSPORT, but LED is driven, if a board is
+ plugged in
+NOENVIRQ to build system where tasks cannot have an own irq routine
+BATMEM main memory is not erased at memory test (for battery buffered
+ RAM)
+NOMIRRORMEM if the memory chip is definitely not mirrored (i.e. no
+ unconnected CPU address lines), one can
+ disable the test for this.
+CLK2MHZ if NOSYSPORT or NOSINPORT, the CPU clock has to be set here
+NMIDEV enables NMI routine (without MMU only)
+
+
+shell options in oash/sh.a65:
+
+SHORTMON no assembler/disassembler in monitor
+NOSYSFKT no file/system calls in monitor
+NOMON no monitor
+NOSH no shell
+NOPRG without PRG header
+SHORTLINE use 40 columns instead of 80
+
+
+fsiec options in oafs/fsiec.a65
+
+INVERT parallel IEEE488 port output lines are inverted
+PARALLEL do it for IEEE488 interface, not serial interface
+ (works for CS/A computer and C64). NOLOOP has then
+ to be defined also.
+NOCMD do not interpret other fs commands than FS_OPEN_*
+NOFS do not register as fs - listen on bus only
+NOLOOP do not listen on bus - register as fs only
+STDTST include STDIO lib if needed.
+NOPRG without PRG header
+
+The Commodore PET 8096 and 8296 (also known as CBM 8096 and CBM 9296) computers
+have at least 96 kByte of RAM and can remap the ROM area with RAM. This
+makes them a nice base for OS/A65. Although they don't have many I/O devices
+at least they provide an 80 columns screen.
+
+
Memory Map
+
In the CBM 8x96 one can remap the upper 32k of CPU address space by
+writing certain values to $fff0. The blocks $8000-$bfff and
+$c000-$ffff can be remapped to two different banks of RAM
+each. The screen memory ($8000-$9000) and I/O
+($e800-$efff) can be set to `peek-through' separately.
+In the OS/A65 memory configuration the lower 32k and one bank of the upper
+32k of RAM are used for the OS image (the `ROM') and the lib6502 managed
+application memory. The screen memory and I/O area are not accessible for
+lib6502 applications. The second upper 32k RAM bank is used (with screen
+and I/O mapped through) as system memory area, together with some RAM
+from $300-$b00. Also there are the mirrors of the other
+virtual console screen areas - when switching screens they are copied around.
+
Building the 8x96 ROM image is simple. Just go to the arch/cbm8x96/boot
+directory and type "make". This should build all files.
+"make osa.d64" should make a d64 VC1541 disk image with all necessary files.
+You have to have my new XA version in the path, though.
+
+To customize the ROM, change edit rom.a65 in arch/cbm8x96. You can gain some
+memory when you remove the shell/monitor from the ROM image.
+(You could replace it with the lib6502 monitor "mon" to be loaded like
+"lsh".)
+When running "make" then the command "file65" should print the addresses
+used for the different segments. They must not overlap. In addition the
+data segment must be below $8000, as it is needed by lib6502 that can
+be called from both RAM banks.
+To move the lib6502 RAM area, edit the values for Memstart, Memend
+and Zerostart at the end of rom.a65.
+To move the segments, edit the Makefile and change the addresses for the
+segments in the XA calls. The text segment address must be two below
+the actual start as it also counts the two byte starting address used
+for loading. In addition you have to edit the value for the definition
+of ROMSTART in rom.a65.
+
+
Boot
+
Put the files "loader", "lsh" and "rom" on a disk accessible by the
+PET 8x96. load "loader" into BASIC memory and start it (probably edit
+it for the right load device number). This boots OS/A65.
+
+
Any 80 columns PET with 32k
+
Build a version for this computer is a bit more difficult because of
+the restricted memory. I have now tried to build such a version.
+The device does not (yet) check for 40 columns but can now use only 80 cols.
+
+
Memory Map
+
The memory map is straightforward. First zeropage, stack, then
+system memory (all of it), then OS image, then lib6502 memory. At the end
+($7800) a second virtual screen, and at $8000 the normal screen area.
+At $90-$93 in the zeropage the PET ROM IRQ and BRK vectors are located
+and have to be used.
+
+
+This file gives a description of the so far implemented device drivers
+for OS/A65.
+
+
video Device
+The video device incorporates not only one but four devices, video1-video4
+(with 2MHz, only 2 devices are working).
+As hardware it needs the video card and the keyboard card with a CBM 3032
+keyboard attached to it. If available,
+the piezo beeper on the IEEE488 card is used to generate bell signals.
+ The video card has one video port only, so the video is shared
+between the four possible video devices. The "@" key is used to switch between
+the different terminals. As there is no way to send some kind of ioctl
+message along a stream, this key has some more functions:
+with Control (RVS/OFF key on CBM 3032 keyboard), the key closes the stream
+from the sender side, thus signaling an EOF. With control and shift,
+the the device is switched between the two modes.
+
+
indirect mode: keyboard events are printed on the
+screen only, not sent to the stream. If a Return occurs, the actual
+line is sent to the stream. This is default.
+
direct mode: all keyboard events are directly
+passed to the stream.
+
+Supported terminal control codes are Bell, Backspace, Carriage Return,
+Line Feed and Form Feed.
+
par Device
+This device handles the (simple) centronics port on the shugart bus
+board.
+
nuldev Device
+This device reads a given stream until end, i.e. EOF and then closes
+the stream. Like /dev/null for writing. You cannot read from it. Only
+a certain number of streams can be handled before an error is returned
+on open.
+
spooler Device
+This is a kind of serializer. You can copy one file after the other
+to this device, even if the first files are not yet through. When copying
+the output of the spooler to another file, e.g. the spooler
+device, they appear in the same order as copied into and intact, i.e.
+the files are not mixed.
+
ser Device
+Ser stands for serial device and that's what it's doing. It handles the
+two serial device ACIAs on the BIOS and on the keyboard board of the CS/A65
+computer. There are
+some watch outs, though. From the serial device, only RTS/CTS are handled.
+A low on an incoming /RTS stops sending. If the stream to write the data
+to is above the high water mark (3/4 fifo size), then /CTS is set low.
+After the stream going below the low water mark (1/4 fifo size), /CTS
+is set high again.
+With DC_SPEED, the baud rate of the device can be set:
+
+With version 1.3.10 we now also have driver for an UART 16550A, with 16
+byte builtin FIFO (oa1ds3.a65). There also is a RS232 driver for the
+fast RS232 interface for the C64 by Daniel Dallmann, as
+described on his homepage or in the comp.sys.cbm FAQ.
+
+
diff --git a/dump/oa-2.0.9/doc/embedded.html b/dump/oa-2.0.9/doc/embedded.html
new file mode 100644
index 0000000..0bc364e
--- /dev/null
+++ b/dump/oa-2.0.9/doc/embedded.html
@@ -0,0 +1,42 @@
+
+ OS/A65 Embedded Application Notes
+
+
OS/A65 Embedded Application Notes
+
(c) 1989-98 Andre Fachat
+
+
OS/A65 Embedded Version 2.0
+
Introduction
+
+Embedded applications normally don't have the amount of RAM and ROM
+that a "normal" (whatever this means) system has. Therefore I have tried
+to make some parts of the kernel removable, allowing for a much smaller
+kernel to fit into embedded applications.
+
+This way the more interesting features are still available, like
+multithreading, signals and the device code. Some of the more sophisticated
+kernel features can be removed however. For how to do this see
+the config section of the kernel
+description. The application can be tested on a full-featured
+system while the embedded kernel provides compatibility where necessary.
+
+Parts of the kernel that can be removed are
+
+
streams
+
memory management
+
file manager
+
send/receive
+
semaphores
+
+
+This shortens the kernel to almost 2k in size.
+Also the used amount of RAM is $bc = 188 byte normal RAM,
+plus $e = 14 byte zeropage (not counting the environment, task and
+thread-save 6 bytes from addresses 2-8), also not counting
+the possible use of PCBUF by fork and devcmd.
+1k RAM total should now be sufficient for simple applications.
+
+Using the PCBUF without locking with a semaphore should be handled with
+care, however.
+
+
+
diff --git a/dump/oa-2.0.9/doc/fileformat.html b/dump/oa-2.0.9/doc/fileformat.html
new file mode 100644
index 0000000..eaccfb2
--- /dev/null
+++ b/dump/oa-2.0.9/doc/fileformat.html
@@ -0,0 +1,584 @@
+
+ 6502 binary relocation format
+
+
+
+The order for saving the undefined reference and the low byte of a
+high byte relocation entry has changed. This makes the OS/A65 lib6502
+implementation easier. How many other people use this format anyway...?
+
+
+
+
0) Preface
+
+With some new 6502/C64/C128 operating systems comes the need for a new
+binary format. In multitasking operating systems like Lunix, SMOS, or
+OS/A65, a binary file cannot be loaded to a fixed location that might
+already be used by another program. Therefore it must be possible to
+relocate the program to an arbitrary address at least at load time.
+In addition to that, more specific information might be stored in a
+binary executable file, like interrupt vectors for example.
+
+This text gives a good solution to this problem for the 6502 CPU and an
+assembler source format to use this format in a general manner. The file
+format can even be used as an object file format, i.e. a format a linker
+can use as an input file. It is also usable as a 65816 file format.
+Instead of zeropage addressing modes, the 65816 has direct addressing
+modes, that add the contents of the direct register to the zeropage
+address in the opcode.
+
+
+
1) 6502/65816 specifics
+
+The 6502 has the special feature of a 'zeropage', i.e. a very limited
+memory address range used for special addressing modes. So the format
+should not only provide a means to relocate absolute addresses but also
+zeropage addresses. The 65816 replaces zeropage addressing with direct
+addressing modes.
+
+The stack space is also very limited. A binary format has to provide a
+measure of how much stack space is needed for the application.
+
+Such limits should be defined as 2 byte values, even if the 6502 only has
+a range of 8 address bits for zeropage and stack. But the 65816 behaves
+differently, it has a 16 bit stack pointer for example. For further
+expandability, a 32 bit format should be provided, although the 16 bit
+format suffices for the 65816 already.
+
+Another problem is, that an address can be 'split', i.e. you can just use
+the high byte or the low byte separately in an opcode. This gives need
+to a special relocation table format, that can cope with half-address
+references. The 65816 can even have three byte addresses, i.e. address
+in a segment and segment number.
+
+
+
2) binary format
+
+
2.1) General
+
+The file differs from the known Commodore file formats, in that a lot
+more information is stored in the file. First the data is structured
+in separate segments to allow different handling of text (program code),
+data (like tables) and bss (uninitialized data).
+
+Also tables are included to allow late binding, i.e. linking the
+file with other files at load time, and relocation, i.e. executing
+the file at different addresses in 6502 address space.
+
+
2.2) Segments
+
+As already used in other formats, the assembler uses three different
+segment types, i.e. text (the actual program code), data (initialized
+variables), and bss (uninitialized variables).
+To have these different segments seems to be 'overdesigned', but they
+actually make memory handling easier in more complex operating systems
+on systems with virtual addresses (OS/A65, for example).
+
+The text segment is defined to be read-only memory. This doesn't allow
+self-modifying code in this segment, but allows memory sharing in virtual
+memory architectures. The data segment actually is like the text segment,
+only it is allocated writable. This segment might not be shared between
+different processes. The contents of these two segments are loaded from
+the file. The bss segment is uninitialized data, i.e. upon program start,
+it is not defined - and not loaded from the file. This area is read-write
+and can be used during program execution. It is also not shared between
+processes. In addition to these segments, the 6502 format also includes a
+zeropage segment type, to allow zeropage variables to be relocated. This
+zeropage segment is like a bss segment, in that only the length, but
+not the data is saved. For the 65816 the zeropage segment changes its
+meaning to a bank zero segment.
+
+The different segments hold different type of data and can be located
+anywhere in memory (except zero segment, which has to be in the zeropage
+resp. bank zero). The program must therefore not assume anything about
+the relative addresses between different segments.
+
+
2.3) Relocation
+
+In general, there are three ways to handle the relocation problem so far:
+
+- Tables: have a relocation table for a text segment
+ if the relocation table is put in front of code
+ you have to save the table in a side-storage
+ if table is behind, you still cannot relocate 'on the fly'.
+
+- Deassembling: go through the code, deassemble it and change all absolute
+ addresses. Problem: needs to know or have hints about where some
+ data is in the code.
+
+- Relocation info in the code: here each address is preceeded with an
+ 'escape' code and is relocated when loading. But this disallows block
+ oriented transfer from storage media to memory.
+
+This binary format uses the first method, with the table after the
+code/data. This way block oriented transfer for the text/data segment can
+be used. And while reading the relocation tables bytewise, the relocation
+can be done without the need to save the table somewhere.
+
+
2.4) External References & Exported Globals
+
+As this file format should not only be used as an executable format, but
+also as object file format, it must provide a way to define references
+- references exported from this object and labels referenced in this
+object. The external references list (also called 'undefined list') lists
+the addresses where labels not defined in this object are referenced.
+The exported globals list lists the addresses that are available for
+other objects. The labels are named by null-terminated ASCII strings.
+
+Even an executable file can have non-empty globals and externals lists,
+but only if the operating system allows this. In this case, so called
+'late binding' is used to link the object with some global libraries
+at link time.
+
+
2.5) File extension
+
+The proposed standard extension for the described format is ".o65" when
+used as an object file.
+
+
2.6) Format description
+
+The binary format is the following:
+
+ (
+ header
+
+ text segment
+
+ data segment
+
+ external references list
+
+ relocation table for text segment
+
+ relocation table for data segment
+
+ exported globals list
+ )
+
+The description of the parts follows:
+
+
2.6.1) Header
+
+The header contains the minimum needed data in a fixed struct.
+The rest of the necessary information is put into the header options.
+[Note: .word is a 16 bit value, low byte first, .byt is a simple byte.
+.long is a 32 bit value, low byte first. .size is a 16 or 32 bit
+value according to .word and .long, depending on the size bit in the
+mode field ]
+
+This is the fixed struct:
+
+ (
+ .byt $01,$00 ; non-C64 marker
+
+ .asc "o65" ; o65 MAGIC!
+ .byt 0 ; version
+
+ .word mode ; mode word
+
+ .size tbase ; address to which text is assembled to
+ ; originally
+ .size tlen ; length of text segment
+ .size dbase ; originating address for data segment
+ .size dlen ; length of data segment
+ .size bbase ; originating address for bss segment
+ .size blen ; length of bss segment
+ .size zbase ; originating address for zero segment
+ .size zlen ; length of zero segment
+ .size stack ; minimum needed stack size, 0= not known.
+ ; the OS should add reasonable values for
+ ; interrupt handling before allocating
+ ; stack space
+ )
+
+The mode word currently has these defined bits:
+
+The CPU bit tells the loader for which CPU the file was made. This has
+implications on the zero segment, for example. Also a system can check
+if the program will run at all (on a 6502 that is).
+The reloc bit defines if an object file can be relocated bytewise,
+or if it must be page-aligned. A page has 256 bytes. The restriction to
+pagewise relocation simplifies the relocation table and also allows
+simpler compilers/assemblers.
+The size bit determines the size of the segment base address and length
+entries. Currently the 16 bit size (size bit = 0) works for 6502 and
+65816 CPUs.
+
+The obj bit distinguishes between object files and executables.
+An object file is used as assembler output that can be linked with
+other object files to build an executable or an object library.
+The two align bits give the address boundary the segments can be
+placed. Even the 6502 needs this, as, for example, "jmp ($xxFF)" is
+broken. The align bits are valid for all of the segments.
+[Note: if reloc=1, then align should be 3. But if align=3, reloc need
+not be 1, because reloc switches to a simpler version of the relocation
+table. The reloc bit might be obsoleted in newer versions of this
+format. Though it should be set, if necessary.]
+
+All unused bits in the mode field must be zero.
+
+Note that the header size is 26 if the size bit is zero and 44 if the
+size bit is one.
+
+The fixed sized struct is immediately followed by a list of header options.
+Each header option consists of a single byte total length, a type byte
+and some data bytes if needed. A single length byte of $00 ends the
+header option list.
+
+ (
+ { ; optional options, more than one allowed
+ .byt olen ; overall length (including length and type
+ ; byte
+ .byt otype ; option type
+ [ .byt option_bytes ]
+ }
+ .byt $00 ; end of options marker (i.e. option len=0)
+ )
+
+The header options currently defined/proposed are:
+
+- Filename:
+ type=0; len=strlen(filename_in_ascii)+3; content="filename_in_ascii",0
+ The string contains the name of the object.
+
+- Operating System Header
+ type=1; len=?
+ the first data byte is the OS type:
+ 1 OSA/65 header supplement
+ 2 Lunix header supplement
+ [others to follow?]
+ the following data contains OS specific information.
+ A suggested data byte is the OS version as second byte.
+
+- Assemblerprogram:
+ type=2; len=strlen(ass)+3; content="ass",0
+ The string contains the name of the assembler resp. linker that produced
+ this file/object.
+ For example (syntax see below)
+ .fopt 2, "xa 2.1.1g",0
+ becomes
+ 0c 02 78 61 20 32 2e 31 2e 31 67 00
+ in the file.
+
+- Author:
+ type=3; len=strlen(author)+3; content="author",0
+ The string contains the author of the file.
+
+- Creation data:
+ type=4; len=strlen(date)+3; content="date_string",0
+ The string contains the creation date in format like:
+ "Sat Dec 21 14:00:23 MET 1996", where we have the day, Month, date,
+ time, timezone and year. See output of `date`...
+
+
2.6.2) text and data segments
+
+The text and data segments are just the assembled code.
+The only difference between text and data segments is the read/write mode
+of the two segments. Therefore, to be compliant to this file format,
+self-modifying code goes into the data segment.
+
+
2.6.3) Undefined references list
+
+The next list is an ASCII list of labels that are referenced in this file
+but not defined. The lists is preceeded with the number of undefined labels
+(16 or 32 bits, according to the mode.size bit).
+
+The relocation tables are the same format for the two segments, text and
+data. In general a relocation entry consists of the offset from the
+previous relocation address to the next one, the type of the relocation
+and additional info. Relocation not only defines the relocation when
+moving object code to a different address, but also filling in the
+undefined references.
+
+Each table starts at relocation address = segment base address -1.
+I.e. if the segment base address is $1000 for example, the first entry
+has an offset computed from base address-1 = $0fff.
+The offset to the next relocation address is the first byte of each
+entry. If the offset is larger than 254 (i.e. 255 or above), than a
+255 is set as offset byte, the offset is decremented by 254 (note the
+difference) and the entry is started again.
+
+{ [255,...,255,] offset of next relocation (b), typebyte|segmentID [, low_byte] }+
+
+where typebyte has the bits 5, 6 and 7 and is one of
+
+WORD $80 2 byte address
+HIGH $40 high byte of an address
+LOW $20 low byte of an address
+SEGADR $c0 3 byte address (65816)
+SEG $a0 segment byte of 3 byte address
+
+The segmentID stands for the segment the reference points to:
+
+0 undefined
+1 absolute value
+2 text segment
+3 data segment
+4 bss segment
+5 zero segment
+
+(Of course the absolute value will never appear in a relocation table,
+but this value is necessary for the exported list)
+
+If the type is HIGH, the low byte of the value is stored behind the
+relocation table entry, if bytewise relocation is allowed (header mode
+field bit 14). If only pagewise relocation is allowed, then only HIGH
+relocation entries can occur, and the low byte is implicitely set zero
+(i.e. it is _not_ saved in the relocation table).
+
+If the type is SEG, then the two lower bytes of the three byte segment
+address are stored behind the entry in the relocation table, lower byte
+first.
+
+
+
+If the segment is "undefined", the typebyte is immediately followed
+by the two (mode size=0) or four (mode size=1) byte value index
+in the undefined references list. If it is a high byte relocation,
+the low byte is saved behind the index value. The index value
+determines the undefined reference, which must be looked up by the
+loader.
+
+The value taken from the relocation address in the segment, together with
+the low byte from the relocation table (if HIGH entry) form the address
+used if the segment would be used unrelocated. To relocate the segment,
+the difference between the relocated segment base address and the segment
+base address from the file is then added to the above address. The result
+is again saved in the segment.
+
+A zero offset byte ends the relocation table. The first offset is computed
+from the segment base address-1, to avoid a 0 value in the first entry.
+
+Note that direct addressing modes do not generate entries in the
+relocation table. instead it is assumed that the 65816 direct register
+holds the correct value (i.e. zero segment base address) when running
+this program.
+
+Example:
+
+Segment Base address in file (header.tbase) is $1000.
+The start address of the text segment after relocation is real.tbase = $1234.
+
+Now the first (unrelocated) address at which a relocation should take
+place is here:
+
+$1222 A9 23 lda #>vector
+
+This generates the offset: $1222-($1000-1) = $223. This is larger than
+254 ($fe), so the first byte is 255 ($ff). The offset is decremented
+by $fe, and gives $125. This again is larger than $fe, so the next byte
+is $ff again. After substracting $fe again, we have $27. But this is
+the address of the opcode. To get the address of the address byte, we
+have to add 1 to get $28, which becomes the third byte.
+The next offset is then computed from $1223, because this is the
+last relocation address.
+
+Now we reference the high byte of an address, lets say vector=$23d0 (not
+relocated), in the text segment. Therefore the relocation type becomes
+'HIGH | text_segmentID = $42', which is the next byte. Because we are
+referencing a high byte of an address, the low byte of the unrelocated
+address is saved behind the typebyte in the relocation entry. This byte
+is missing when referencing a low byte or address.
+
+The relocation table entry is now:
+
+$ff, $ff, $28, $42, $d0.
+
+When actually doing the relocation, the relocation pointer is initialized
+to real.tbase-1 = $1233. Then we compute the offset to $224, which brings
+us to $1457, where the address byte of the above opcode is after loading
+the file to $1234. We now have to compute the new address, where vector
+is after relocation. So we take the unrelocated low byte from the
+relocation table ($d0) and the high byte from $1457 ($23).
+
+vector_file = ($23 << 8) + $c0
+
+To this value we add
+the difference between the address the program is assembled to and the
+real load address:
+
+From this value the high byte is then written back to the address $1457.
+Had we not saved the low byte in the relocation table, and only added
+the high bytes, we would have missed the carry bit that increments
+the high byte in this case!
+
+Had "vector" now been an undefined reference, and "vector" would be
+the second label in the undefined references list, we would get the
+following relocation table entry (assuming mode.size=0):
+
+$ff, $ff, $28, $40, $00, $02, $00
+
+The value computed with the above formula for vector_file is now added
+to the address the label "vector" now really has (This must of course
+be looked up into an external table or list).
+Had the opcode been "LDA #>vector+$567", then the low byte in the relocation
+table would be $67, while the high byte in the opcode would be $05.
+This value would result in vector_file and the real address of "vector"
+would be added before wrting back the high byte to the opcode.
+
+
+
2.6.5) exported globals list
+
+The global list is a list of names, together with the target segment
+and the offset in the segment for each name. It is preceeded with the
+number of exported labels. This allows the loader to allocate a table
+large enough, if needed. The number of labels and the offset value
+are 16 bit or 32 bit values according to the size bit in the header mode
+field. The segmentID is a byte value and the same as in the relocation
+table entry (see section 2.6.3).
+
+The assembler source format is a suggestion only. It will be implemented
+in xa65, a cross assembler for 6502 CPUs running on Unix/Atari ST/Amiga
+as a reference platform.
+
+The assembler provides a way to embed absolute address code in relocatable
+code. This is needed when code should be copied to a specific location
+known at assemble time.
+There also is a way to make a file 'romable'. You can give the start
+address of the _file_ in ROM, and the assembler automatically sets
+the text segment start address to where the code will be in the ROM.
+Of course, the other segments must be taken care of with -b? command
+line parameter, that set the segment start address.
+
+
3.1) embed absolute code in relocatable files
+
+When the assembler is started in relocatable mode, everything is put into
+a .o65 relocatable file. All address references generate relocation table
+entries. If a "*= value" pseudo opcode is encountered,
+then the assembler switches to absolute mode. The following opcodes don't
+generate relocation table entries. If a "*=" without a value is read,
+then the assembler switches back to relocatable mode. The relocation
+program counter is increased with the length of the absolute part and
+the absolute code is embedded between the relocatable parts.
+
+
3.2) embed relocatable code in absolute files
+
+This is dropped - too complicated. Should better be done with some
+objdump or linker programs or so.
+
+
3.2) Header options
+
+Before any opcode (after starting in relocatable mode, or after a .reloc
+opcode), a header option can be set by:
+
+ .fopt byte1, byte2, ...
+
+The header option length is automatically set by the assembler.
+An example for an file author entry:
+
+ .fopt 3, "Andre Fachat",0
+
+The 3 is the type byte for the author header option. The last zero ends
+the name. The assembler can be configured to automatically include an
+assembler header option into a file header.
+
+
3.3) allocation of data segment/zeropage segment address space
+
+The assembler switches between the different segments by the means of
+".text", ".data", ".bss" and ".zero" pseudo opcodes. After starting in
+relocatable mode, the assembler is in the text segment.
+
+The text segment contains the program code. Data holds the initialized data,
+while bss and zero segments contain uninitialized data for normal/zeropage
+address space.
+Everything that is between one of these segment opcodes and the next segment
+opcode gets into the corresponding segment, i.e. labels, assembled code etc.
+The text and data segments are saved in the file, while for the bss and
+zero segments only the length is saved in the file.
+
+The assembler should issue a warning when a direct addressing mode
+is used without a zero segment address and vice versa for 65816 CPUs.
+
+
3.4) referencing data/bss/zeropage addresses
+
+One problem with the 6502 is, that it cannot load an address within one
+step or assembler opcode. So an address is loaded with standard byte
+opcodes, like "lda #
+
(c) 1989-98 Andre Fachat
+
+The kernel filesystem interface should not be used by normal applications
+anymore. Instead the lib6502 calls should be used.
+
+
+The interface to the filesystems is handled by the standard send/receive
+and stream routines. To access a file, a message has to be sent to the
+filesystem manager, i.e. to task id SEND_FM.
+To 'mount' a filesystem to a drive, the task has to register itself with
+the filesystem manager. To do this, it sends a message of type FM_REG
+to the filesystem manager. In PCBUF ($0200), the message contains
+the number of drives to register (FM_REG_DRVS) and the task id of
+the filesystem task (FM_REG_ENV).
+
+/* FileManager */
+
+#define SEND_FM $fe
+
+#define FM_REG 0
+
+#define FM_REG_DRVS 0
+#define FM_REG_ENV 1
+
+
+All other messages to the filesystem manager have to have the drive in
+PCBUF+FM_OPEND_DRV to allow easy redirection. '/' is used to separate
+dirs from each other in a filename.
+
+#define FM_OPEN_DRV 0
+
+#define DIRSIGN "/" /* Trennzeichen zwischen Verzeichnissen */
+
+
+The following message types are defined, although not all have been
+implemented.
+
+#define FS_OPEN_RD 1 /* Open file for reading only */
+#define FS_OPEN_WR 2 /* Open file for writing only (with error
+ if file exists) */
+#define FS_OPEN_RW 3 /* Open file for read and write */
+#define FS_OPEN_OW 4 /* Open file for overwriting */
+#define FS_OPEN_AP 5 /* Open file for append */
+#define FS_OPEN_DR 6 /* Open directory for reading */
+#define FS_RENAME 7 /* rename file */
+#define FS_DELETE 8 /* remove file */
+#define FS_FORMAT 9 /* format disk */
+#define FS_CHKDSK 10 /* check disk */
+#define FS_CLOSE 11 /* close file (only for FS_OPEN_RW) */
+#define FS_RMDIR 12 /* remove subdirectory */
+#define FS_MKDIR 13 /* create subdirectory */
+#define FS_CHDIR 14 /* ---- */
+#define FS_ASSIGN 15 /* ---- */
+
+/* struct, that has to be sent in PCBUF for any FS_OPEN_* message */
+/* after a successful open with FS_OPEN_RD/WR/OW/AP, the filesystem
+tries to read data from stream or write to it. It ends when it
+gets an E_EOF on reading streams or E_NUL on writing streams.
+If a file is read to the end, the filesystem decrements the write
+task counter (thus signaling the end of file) and closes the file
+internally */
+
+#define FS_OPEN_DRV 0 /* drive = FM_OPEN_DRV */
+#define FS_OPEN_STR 1 /* stream over which the data is
+ transfered */
+#define FS_OPEN_PFAD 2 /* ---- */
+#define FS_OPEN_NAME 3 /* name of the file to be opened */
+
+/* struct to be sent for any message except FS_OPEN_* */
+
+#define FS_CMD_DRV 0 /* target drive */
+#define FS_CMD_PFAD 1 /* --- */
+#define FS_CMD_FIL 2 /* --- */
+#define FS_CMD_NAME 3 /* for rename, the original filename has to
+ be sent as usual, but after the nullbyte
+ at the end of the first name follows the
+ name the file has to be renamed to,
+ ended with a nullbyte */
+
+/* struct that is sent back by the filesystem task */
+
+#define FS_X_ERR 0 /* error code, that is also returned
+ in the accumulator */
+#define FS_X_ENV 1 /* task id of filesystem task */
+#define FS_X_FIL 2 /* file handle (for FS_OPEN_RW only) */
+#define FS_X_SLEN 3 /* length of this struct (not sent) */
+
+
+A directory is being read as a normal file, but the file has a structrure,
+that is being described here.
+
+/* struct of a directory entry in a directory file */
+
+#define FS_DIR_LEN 0 /* length of file, 4 byte, lo byte first */
+#define FS_DIR_YEAR 4 /* year -1900, */
+#define FS_DIR_MONTH 5 /* month, */
+#define FS_DIR_DAY 6 /* day, */
+#define FS_DIR_HOUR 7 /* hour, */
+#define FS_DIR_MIN 8 /* minute, */
+#define FS_DIR_SEC 9 /* and second of last change */
+#define FS_DIR_MODE 10 /* type of file */
+#define FS_DIR_NAME 11 /* name, ended with a nullbyte */
+
+/* file types */
+
+#define FS_DIR_MOD_FIL 0 /* normal file */
+#define FS_DIR_MOD_NAM 1 /* disk name */
+#define FS_DIR_MOD_FRE 2 /* number of free bytes in FS_DIR_LEN */
+#define FS_DIR_MOD_DIR 3 /* subdirectory */
+
+
+Now comes the definition of an executable file, as interpreted by the ROM
+startup and by the shell.
+
+/* Prg-Header */
+
+#define P_KIND 0 /* type of program */
+#define P_MEM 1 /* memory size in kByte */
+#define P_RES 2 /* --- */
+#define P_ADR 4 /* start address of program */
+#define P_TAB 6 /* memory relocation table: a series of two
+ bytes, the first describing the position
+ in the MMU map, the second the memory block
+ to map in this position. This is used
+ to map the ROM in the memory for
+ autostart executables. The table is ended
+ with a single $ff. */
+
+/* Prg-types */
+
+#define PK_PRG 0 /* program executable */
+#define PK_DEV 1 /* device block - memory size is ignored and
+ exactly one position in the relocation table
+ has to be set. These values are given to
+ REGDEV.
+#define PK_FS 2 /* filesystem - STD* streams are set to
+ STDNUL */
+
+
+Appendix
+--------
+
+For the FAT filesystem, several disk sizes have been defined for the
+format command. The disk size is stored in the FS_CMD_PFAD byte in PCBUF.
+
+dsize kByte pages tracks sectors blocksize dd/hd comment
+------------------------------------------------------------
+ 0 360 1 80 9 512 dd Atari ST single sided
+ 1 720 2 80 9 512 dd 3.5"
+ 2 1440 2 80 18 512 hd 3.5"
+ 3 1200 2 80 15 512 hd 5.25"
+ 4 1280 2 80 8 1024 hd 5.25"
+ 5 360 2 40 9 512 dd 5.25"
+
+
+This is a completely new version of my 6502 operating system GeckOS/A65.
+From version 2.0.0 on it has a lot of new features:
+
+
multithreading
+
dynamic memory management
+
relocatable fileformat
+
lib6502 standard library
+
internet support
+
+
+
Description
+
+OS/A65 is a full-featured Multitasking/Multithreading operating system
+for the 6502. It is preemptive and implements some Unix-like features,
+like signals, semaphores,
+relocatable fileformat,
+standard library, internet support via
+a kind of simplified sockets and last but not least virtual consoles.
+
+It is extremly scalable. Stripped down to the scheduler and interrupt
+handling the kernel is only slightly above 2k. In normal
+embedded systems
+the kernel has around 4k, with only application programs running.
+Full featured systems have a 4k kernel, and several support tasks
+provided system services like TCP/SLIP and (different) filesystems.
+
+The kernel is almost completely hardware independent. All the
+architecture-specific stuff is in a separate subdirectory
+for each architecture.
+
+The lib6502 as standard library allows easy
+access to the system services. Parts of this library are already
+implemented in another 6502 operating system, Lunix by Daniel Dallmann.
+This way source code compatibility is achieved.
+
+Version 2.0.0 features a "slipd" server process that brings easy internet
+access to all lib6502 programs, that can now access TCP connections
+like files. A stable WWW server running on the OS is built into the
+slipd daemon. Also a remote login can be done. This way the OS can run
+programs to for example read sensors and write the stuff to files, which
+are exported by the WWW server.
+
+The relocatable o65 fileformat used by the lib6502 standard library
+in version 2.0.0 allows more than one instance of a program being run
+at the same time without interference, even without virtual memory.
+Also the very same binaries runs on all supported platforms (if they do not
+use architecture specific stuff, but lib6502 calls only).
+
+
Architectures
+
+Architectures supported are the C64, as well as my
+CS/A65
+MMU selfbuilt computer and my
+CS/A65 Gecko board.
+Also supported are the Commodore CBM8096 and CBM8296 computers, as well as
+any 32k RAM PET (the 3032, 4032 and 8032)
+
+
+
CBM PET documentation. Supported are 40 and
+80 column models 3032, 4032, 8032, 8096 and 8296.
+
Embedded systems need not all features. Here is some doc to strip the OS down to the basics (with around 2.5k in the end...)
+
+
Development
+
+For the development of OS/A65 programs there are two possibilities:
+
+
lib6502 with the
+o65
+file format. This allows source compatibility (to some degree) with Lunix, as
+well as that the program runs on all supported platforms.
+lib6502 programs are simply assembled with my xa65 crossassembler with the
+including the file "lib6502.i65" and the assembler option "-LLIB6502" set.
+This tells the compiler to put "LIB6502" into the
+file as undefined reference that is resolved when loading. The lib6502
+jump table is relative to this address.
+
+
A system application not only uses lib6502 calls (if it uses them)
+but also kernel calls. The kernel can be at
+different addresses for different
+architecture as well. Therefore you have to add "-LOSA2KERNEL" to the assembler
+line. This address is also resolved when loading. If the file should also
+be used as a ROM file, then it has to have a ROM boot header, see the
+kernel description.
+
+
More Docs
+
+
+
Here is the cross assembler
+xa
+you need to assemble the whole stuff
+
Overview over the Computer System and its Software
+
The old standard library has been
+replace with the lib6502 and is not longer supported.
+
+
The old summary of shell has been replaced
+by the lib6502 lsh and will no longer be developed.
+
The old monitor is still supported, but not actively developed any more.
+
summary of features and extensions of the
+BASIC interpreter (c) Commodore
+
The ChangeLog for version 1.3.* and for
+the development of 2.0.0.
+
+
History
+
+I didn't dream of this becoming such a nice project when I started
+building this computer in 1989.
+
+After someone asked me to release it to the public, I decided
+to put it under the GNU public license.
+(Which, of course, doesn't hold true for the ported BASIC interpreter, which
+is taken from the C64.
+See this file for more.) Also the
+character ROMs are taken from the C64. However, Commodore in its old
+form doesn't exist anymore and attempts to contact the new right holders
+have not brought any success, so I put them here.
+
+Well, when I did this project, it was just for fun. But now I find it
+quite nice. Well, if you know some magazin that would like to publish
+some of it, I will be glad writing an article or so (if anybody really
+wants it ;-)
+But on the other hand my interests have moved.
+Occasionally I still work on the project - when I have the time (or take
+the time ;-)
+But after all, I don't really have time for it.
+
+
Ideas for later versions
+
+
vt100 control codes for the console.
+
native C128 port
+
in this process abstract a kind of block device from fsibm and use
+it for the VC1571 as well
+
+
+Last modified 14 march 1997 by A. Fachat
+This Page has been read approx.
+
+times since march 14, 1996.
+
+
diff --git a/dump/oa-2.0.9/doc/kernel.html b/dump/oa-2.0.9/doc/kernel.html
new file mode 100644
index 0000000..504a7fc
--- /dev/null
+++ b/dump/oa-2.0.9/doc/kernel.html
@@ -0,0 +1,1000 @@
+
+ OS/A65 Kernel Interface Description
+
+
OS/A65 Kernel Interface Description
+
(c) 1989-98 Andre Fachat
+
+
OS/A65 Version 2.0
+
Introduction
+
+The change from kernel 1.3 to kernel 2.0 is radical in some things, but
+conservative in others. The complete environment handling has been
+rewritten to make it easier to port to different platforms. Also threads
+have been introduced. Therefore all the memory management and
+interprocess communication calls have changed as well.
+The scheduler is now a lot faster, as no more checks are done for threads
+in the waiting list.
+
+Although most routines have been rewritten, many of these calls still
+have the same parameters and behave the same way.
+Also the PCBUF is still used (unfortunately). This is the general
+communications buffer needed for filesystem operation and some kernel
+calls. It is a global buffer, and as such it is protected by the
+SEM_SENDBUF system semaphore. Each task that wants to use
+has to allocate this semaphore with PSEM before using the
+buffer.
+
+Also there still is no block oriented communication, although the
+stream based communication has been improved by the out-of-band
+error, brk and push/pull flags.
+
+I try to keep this documentation as correct and up-to-date as possible,
+but if in doubt, read the source... :-)
+
+There are now some comments like "this need not be available in all
+OS implementations". These comments mostly refer to the embedded
+versions of the OS where the kernel can be shortened to (almost)
+2k in size by leaving out some stuff not necessary for the particular
+application.
+
+
+Most kernel routines return an error code in the accumlator (a), if the
+carry flag is reset upon return. Otherwise the ac might contain data.
+
+
+
+
+
+$f000 RESET System reset
+
+
+
+$f003 ENMEM Enable 4k memory block, no in xr, for memory management -
+ MMU version only
+$f006 SETBLK set memory block ac at MMU entry yr - returns old entry
+ in ac. MMU version only
+
+
+
+The Stream functions have not changed much. The only addition compared to
+kernel 1.x is the error code byte, that allows passing of error conditions
+and push/pull signals as "out-of-band" data.
+
+In the embedded versions the stream functions
+are not necessarily implemented.
+
+
+
+$f009 GETSTR Get a free stream. increase read and write task counter,
+ returns stream number in x
+
+$f00c FRESTR decreases read and write task counter, thus freeing the
+ stream, if both result in zero. parameter: stream number in x
+
+$f00f PUTC puts a byte on the stream. parameter: stream number in x,
+ data byte in a. returns errorcode in a
+
+$f012 GETC Get a byte from the stream. parameter: stream number in x,
+ returns data byte in a (with carry=0) or error code
+ (carry=1)
+
+$f015 UNGETC Gives byte from stream back. parameter: stream number in x,
+ data byte in a, returns error code in a
+
+$f018 STRCMD executes a stream command. parameter: stream number in x,
+ stream command in a, returns error code in a.
+
+ possible stream commands are:
+
+ SC_GET 0 same as GETSTR
+ SC_REG_RD 1 increase read task counter by one
+ SC_REG_WR 2 increase write task counter by one
+ SC_CLR 3 empty the stream
+ SC_EOF 4 closing the stream from the sender
+ side, i.e. decrease write task
+ counter by one
+ SC_NUL 5 closing the stream from the receiver
+ side, i.e. decrease read task
+ counter.
+ SC_FRE 6 same as FRESTR
+ SC_STAT 7 read stream status into ac
+ SC_GANZ 8 returns number of bytes in stream in a
+ SC_RWANZ 9 returns the stream write pointer in
+ a and the stream read pointer in y
+
+ SC_ESTAT 10 Get the error code byte in yr,
+ and the normal (i.e. what you get
+ with SC_STAT) stream state in ac.
+ SC_SSTAT 11 Set bits in the error code byte
+ each bit set in yr is set in error byte
+ SC_CSTAT 12 Clear bits in the error code byte
+ each bit set in yr is cleared in error
+ byte
+
+
+ Possible stream status are:
+
+ E_NUL Noone reading from stream
+ (i.e. read task counter is zero)
+ E_EOF stream is empty and noone is writing anymore
+ (i.e. write task counter is zero)
+ E_SEMPTY stream buffer is empty
+ E_SFULL stream buffer is full
+ E_SLWM number of bytes below Low Water Mark
+ (1/4 buffer size)
+ E_SHWM number of bytes above Hogh Water Mark
+ (3/4 buffer size)
+
+ The error code byte has the following bits:
+
+ SCE_PULL %10000000 reader pulls data from sender
+ SCE_PUSH %01000000 writer pushes data to receiver
+ SCE_BRK %00100000 writer sends 'break' signal
+ SCE_RERRM %00001100 reader error condition mask
+ SCE_WERRM %00000011 writer error condition mask
+
+
+The error condition byte can be set and read from both ends. This byte is
+cleared when the stream is allocated. If the reader "pulls" data, this is
+a sign for the writer to flush all its internal buffers into the stream.
+When this is done, the writer clears the pull flag.
+
+If the writer wants to push his data (like after an CR on a terminal,
+for example) the reader should get the number of bytes in the stream to
+have an inidcation of how many bytes to read as "pushed" (or urgent in
+Internet speak). Then it removes the push flag and gets the bytes from the
+stream
+
+If an error occurs, e.g. a read error when reading a file, the writer
+sets all the bits in the error code byte masked by SCE_WERRM to 1
+(which is general error code - other codes still have to be defined).
+The reader of the stream then reads this and can handle the error.
+
+If an error on the reading side occurs (like disk full when writing
+a file), The reader sets all the error bits masked by SCE_RERRM to 1
+(which is general error code - other codes still have to be defined).
+The writer can then close the file on his side.
+
+If the writer wants to send a Break (i.e. a ^C equivalent)
+code to the reader, it sets
+the SCE_BRK bit. The reader must clear it itself.
+
+
+
+$f01b DEVCMD executes device commands. parameter: device number in x,
+ device command in a, optional parameter in y.
+ returns error code in a.
+
+ possible stream commands are:
+
+ DC_IRQ 0 execute IRQ routine
+ the interrupt routine has to return
+ E_OK if an interrupt source is cleared
+ or E_NOIRQ if not.
+ DC_RES 1 initialize device
+ DC_GS 2 sets the stream (in y) the device
+ reads from
+ DC_PS 3 sets the stream (in y) the device
+ writes to
+ DC_RX_ON 4 switch on receive
+ DC_TX_ON 5 switch off receive
+ DC_RX_OFF 6 switch on send
+ DC_TX_OFF 7 switch off send
+
+ DC_SPD 8 set speed (in y), device dependend
+ DC_HS 9 set handshake (in y), device dependend
+ DC_ST 10 get device status, device dependend
+ DC_EXIT 11 disable device, including IRQ sources
+
+ DC_GNAM 16 get the name of a device, parameter:
+ device number in x, returns
+ name PCBUF ($0200)
+ DC_GNUM 17 get number of a device from name,
+ parameter: name in PCBUF, length
+ of name in x, returns device number
+ in x
+ DC_REGDEV 18 register new device(s)
+
+
+ With the registration of the device the system has to know
+ what to do with it and where to put it in memory.
+ Therefore you have to put the address of the following
+ struct into x/y registers.
+
+ With this method it is possible to register several devices,
+ as long as they are in one memory block, with one call.
+
+ The devices are started with DC_RESET. In y they get a
+ system feature byte. Currently only bit 7 is defined,
+ where $00 is 1 MHz system clock and $80 is 2 MHz system clock.
+
+
+$f01e FORK start a new task. parameter: yr = length of the following
+ struct in PCBUF
+
+ FORK_SIZE 0 The size of the needed memory
+ in 256 byte blocks, from botton up
+ FORK_SHARED 1 number of 256 byte blocks that
+ share the mapping with the current
+ task, from top down.
+ FORK_PRIORITY 2 priority of new task (0=inherit
+ from parent)
+ FORK_STDIN 3 stdin stream
+ FORK_STDOUT 4 stdout stream
+ FORK_STDERR 5 stderr stream
+ FORK_ADDR 6 start address of task
+ FORK_NAME 8 name of the program, ended by a
+ nullbyte. After that follows the
+ command line that started the program.
+
+ FORK returns the PID of the new task in xr.
+
+ The commandline is put into the PCBUF of the starting
+ task. The new task gets its own task id in x
+ The stream read/write task counter are not changed.
+ I.e. a thread that wants to use the end given to fork too
+ has to increase the read/write counters itself.
+
+ The priority is a hack to allow to run tasks with different
+ execution priorities. The priority
+ counts the number of interruptions before a thread
+ switch occurs. Default value is 3. A value of 0 lets
+ the new task inherit the priority of the current task.
+
+ It is now somewhat difficult to really start a new task, as
+ the READ/WRITE routines to access another tasks memory
+ have been removed.
+ One standard procedure could be to write a boot routine
+ into the current PCBUF, after the command line, and
+ jump to this boot routine when the FORK parameters are
+ copied to the target PCBUF. The length parameter
+ to FORK must of course include this routine.
+ You could also use a routine in the ROM, which then
+ should be shared between the calling and the called
+ task. The boot routine can then load the executable.
+ For a stdlib with null-separated command line parameters,
+ they may also be included after the name, as long as the
+ length byte includes them too.
+
+ In fact, the FORK_NAME entry is somewhat arbitrary at this
+ time, as it is not used within the kernel. In fact,
+ one could write anything there. But to keep compatible,
+ the name and command line must have the same format
+ as for the ROM startup, i.e. a nullbyte separated list
+ of program name and parameter, with a zero-length parameter
+ at the end.
+
+ The newly created task must release
+ the SEM_SENDBUF semaphore for the PCBUF.
+
+
+
+$f021 TERM <- a = return code
+ ends the current thread. If still threads in the tasks are
+ running, the return code is ignored. Otherwise the return
+ code is sent to the parent with SIGCHLD.
+
+$f024 KILL <- a = return code, x = task id
+ ends a complete task, with all threads in them.
+ ac is return code, xr is task ID to kill.
+ The return code is sent to the parent with SIGCHLD.
+
+$f027 YIELD just give control back to the scheduler, as there is nothing
+ to do at the moment - but keep running (not needed for
+ preemtive multitasking, an interrupt interrupts any task!)
+
+$f02a FORKT forks a new thread in the current task. Execution start
+ address must be in a/y.
+ returns c=0 for ok and new thread no in xr;
+ or c=1 for error (errno in AC).
+
+$f02d SBRK (carry=1): sets the freely available RAM area in the
+ active environment to ac blocks with 256 byte
+ each, by adding memory to or removing memory
+ from the end of the already available memory
+ area. Returns in ac the length
+ of the available memory in 256 byte blocks,
+ if c=0 on return. Otherwise returns error.
+ (carry=0): returns in ac the length of the available
+ memory in 256 byte blocks.
+
+$f030 GETINFO getinfo returns process information about all (up to 16)
+ running processes in the PCBUF (which must be allocated
+ by the process before)
+
+ May not be available in all OS implementations.
+
+ There are ANZ_ENV valid entries in the table, a
+ 0 in the TN_NTHREADS field indicates an empty slot.
+
+ The fields are as follows:
+
+ TN_PID 0 PID of process in this entry
+ TN_NTHREADS 1 Number of threads for process
+ TN_ENV 2 Environment number for process
+ TN_PARENT 3 Parent process
+ TN_MEM 4 amount of allocated RAM
+ TN_SIGNAL 5 signal address
+ TN_STDIN 7 STDIN stream
+ TN_STDOUT 8 STDOUT stream
+ TN_STDERR 9 STDERR stream
+ TN_SIGMASK 10 signal mask value
+ TN_NAME 11 start of prog name (if available)
+
+ each field is TN_SLEN bytes long and the
+ length of the name field is TNAMLEN. If the name is longer
+ than TNAMLEN-1, the the last characters are cut off, and in
+ the table the ending nullbyte is missing.
+
+
+
+$f033 DUP (carry=1): set new STD* stream. parameter: STD* number in x,
+ new stream in a, returns old stream in ac;
+ read/write task counters are not touched!
+ (carry=0): get redirected STD* stream number. parameter:
+ STD* number in x, returns stream in a
+
+
+
+The semaphore calls need not be available in all OS implementations.
+
+
+
+$f036 GETSEM gets a free semaphore. returns semaphore number in x
+
+$f039 FRESEM frees a semaphore. parameter: semaphore number in x
+ negative (system) semaphores cannot be freed (nor are they
+ returned by GETSEM)
+
+$f03c PSEM 'PSEM' operation on a given semaphore. task waits till
+ semaphore is freed. parameter: semaphore number in x
+ carry=0: block till semaphore is free
+ carry=1: do a test&set operation and return with
+ E_OK if semaphore gotten, or E_SEMSET if semaphore is in use.
+
+$f03f VSEM 'VSEM' operation on semaphore, allows other tasks
+ to grab the semaphore.
+ parameter: semaphore number in x
+
+
+
+
+$f042 SEND send a message to another task
+ parameter: optional message type in a, target task in x,
+ length of data in PCBUF in y; y=0 means 256 byte in PCBUF
+ The data is in PCBUF ($0200-$02ff). returns a and y as
+ given and the 'redirected' target (e.g. from filesystem
+ manager) in x
+
+$f045 RECEIVE receives a message.
+ (carry=1): waits for any message
+ (carry=0): returns immediately, with an error if no message
+ received. Otherwise if a message is received,
+ return sender task id in x, length of
+ data in PCBUF in y (0 means 256) and the optional message
+ type as given with SEND in a.
+
+
+
+$f048 SETSIG sets the signal address and the signal mask
+ (carry=1): sets signal address in a/y
+ (carry=0): sets signal mask
+ returns the old mask resp. the old signal address
+ in the same registers.
+
+$f04b SENDSIG c=1: ac contains the signal mask to be sent to the task ID
+ given in xr
+ c=0: set thread to sleep until it receives a signal
+
+
+Signal handling works as follows: With SETSIG the signal address and the
+signal mask can be set. There is only one signal address, that is the
+address of a subroutine that is called on a signal. When the routine is
+called, it has the current pending signal mask in AC.
+The routine must return with a code sniplet
+
+ pla
+ rti
+
+which jumps directly to the code executed before the signal occured.
+Note that the x and y register must not be changed or must be preserved
+during the signal routine. The current thread execution is changed
+to run the signal handler and to immediately return with the code like above.
+
+SENDSIG can be called from other tasks or from devices, not from a thread
+in the same task. When SENDSIG is called, first the signal mask is checked
+to see if the signal is allowed. If it is not, SENDSIG just returns.
+If the signal is allowed, threads in the receiving task can be
+in different states: Ready, Interrupted, or Waiting. If ready or
+interrupted, the thread is directly set up to execute the signal
+routine. If the thread is waiting, it depends on the INT bit in the
+signal mask what happens.
+
+If the INT bit is set, then any system call that lets the thread block
+(i.e. wait for Semaphore, wait for Receive, wait for Send)
+will be interrupted. They then return E_INT in ac - after the signal routine
+has been called. The other registers are bogus after an interrupted
+system call.
+
+If the INT bit is not set, then the signal is pending, and the
+signal routine is called when a thread of the task is set to running
+again.
+
+Signal mask values are
+
+ SIG_INT %10000000 /* allow interruptable kernel calls */
+ SIG_CHLD %01000000 /* Child process has terminated */
+ SIG_TERM %00100000 /* Child process has terminated */
+
+ SIG_USR4 %00001000 /* user signal 4 - used for STDLIB */
+ SIG_USR3 %00000100 /* user signal 3 */
+ SIG_USR2 %00000010 /* user signal 2 */
+ SIG_USR1 %00000001 /* user signal 1 */
+
+When a SIG_CHLD is executed, the receiving task is notified that a child
+has died. This means it should call CHECKCHLD to see which child has
+died with what error code.
+
+The SIG_TERM code should be used by "standard" libraries. Currently there
+is no way to inform a task about its death and let it clean up all
+resources - that are not bookkept by the kernel! - before it dies.
+So other libraries should, instead of calling "KILL", send a SIG_TERM signal
+when they want to kill a process. The signal routine of the receiving
+process should catch this signal and clean up and then call
+TERM itself.
+
+SENDSIG with carry clear (wait for signal) must be called by threads only,
+not by devices. Also the SIG_INT bit must be set before this call is done.
+If there is only one thread in the task, then the thread is sleeping until
+a signal is received. When a signal is received, the signal handler is
+called, then the thread is awakened and returns with E_INT.
+The other registers are not preserved.
+
+
+
+$f04e TDUP register a task for a (negative) system task number.
+ parameter: (negative) task number to replace in x,
+ new task number to be used instead in a
+
+$f051 XRECEIVE receives a message from a specified task only. parameter as
+ with RECEIVE, plus sender task id in x
+
+$f054 SETNMI in systems without MMU, set the system NMI routine address.
+ (carry=1): set the new NMI routine address (in a/y)
+ returns the old NMI address in a/y.
+ The old address is saved in the place pointed
+ to by (newadress-4) (see below) by this routine.
+ (carry=0): clear NMI routine.
+ The NMI routine has to save all registers by itself!
+
+ At NMI address -2 there must be the address of a ctrl routine
+ that can be called via CTRLNMI. Expect that the
+ ctrlnmi routine is called during this SETNMI with either
+ NMI_ON of NMI_OFF in AC, to set the initial state.
+ The ctrlnmi routines is called with JSR, i.e. return with RTS.
+
+ At NMI address -4 is a pointer to a memory location
+ where the address of the next NMI routine can be found.
+ If the address found there is $ffff, then the list is at
+ its end.
+
+ A possible scenario then is:
+
+ Task calls SETNMI with NEWNMI in a/y. We then have the
+ structure:
+
+ (NEWNMI-4) address of oldvec --> address of OLDNMI
+ (NEWNMI-2) address of nmictrl
+ NEWNMI --> NMI routine code
+
+ This way the structure can be held in ROM, and still allow
+ flexible NMI chaining. If CTRLNMI is called, each of the
+ nmictrl routines is called with the given value in AC.
+
+$f057 CTRLNMI Send command in AC to all currently chained NMI ctrl
+ routines as described with SETNMI. Possible values are:
+
+ NMI_ON = allow NMIs
+ NMI_OFF = disallow NMIs
+
+ This routine is called when initiating and ending an
+ IEC serial bus transfer, for example.
+
+
+
+$f05a GETPID returns the current task ID in x and the current thread ID
+ in y
+
+$f05d SLOCK c=1: locks scheduler to actual task.
+ c=0: unlocks scheduler
+ returns c=0 when ok, c=1 with E_NOTIMP if error.
+
+ May not be available in all OS implementations.
+
+$f060 RENICE changes the priority of the current task.
+ ac = value to add to the priority.
+ returns ac = old priority.
+
+ May not be available in all OS implementations.
+
+$f063 CHECKCHLD
+ returns:
+ c=0: returns a child process ID in x and child return code
+ in a of a child process that has died. Only works
+ if the SIGCHLD signal mask has been set when the
+ child died.
+ c=1: no child that has died found.
+
+
+On bootup the system is tested and possible errors are detected.
+On systems with a system port, the hardware error is shown by the number
+of flashes the LED makes before the system reboots
+
+
+/* Hardware-Errors */
+
+#define HE_ZP <-1 /* zeropage mem test */
+#define HE_RAM <-2 /* RAM test (to few RAM) */
+#define HE_ROM <-3 /* Couldn't start a program */
+#define HE_DEV <-4 /* device returns error upon init */
+#define HE_TASK <-5 /* all programs have terminated - reboot */
+
+
+possible error codes are (from oadef/oa1str.def, where most things,
+except filesystem stuff are defined)
+(These codes must be reordered):
+
+
+/* Software-Errors */
+
+#define E_OK 0 /* no error */
+#define E_NOTIMP <-1 /* feature/function not implemented */
+#define E_CONFIG <-2 /* in this configuration not available */
+#define E_ILLPAR <-3 /* illegal parameter */
+#define E_NOMEM <-4 /* no more memory */
+
+/* stream handling errors */
+#define E_NOSTR <-5 /* no more streams available */
+#define E_SFULL <-6 /* stream is full */
+#define E_SEMPTY <-7 /* stream is empty */
+#define E_SLWM <-8 /* stream below low-water-mark (1/4) */
+#define E_SHWM <-9 /* stream above high-water-mark (3/4) */
+#define E_EOF <-10 /* last byte read, other side has closed */
+#define E_NUL <-11 /* noone listening on stream */
+
+/* device handling errors */
+#define E_NODEV <-12 /* illegal device number */
+#define E_DON <-13 /* device already in use */
+#define E_DOFF <-14 /* device not in use */
+#define E_NOTX <-15 /* device doesn't send */
+
+/* misc errors */
+
+#define E_NOENV <-16 /* no more free environment/task ID */
+#define E_NOSEM <-17 /* no more free semaphore */
+#define E_SEMSET <-18 /* semaphore is already set (with PSEM) */
+
+#define E_NOIRQ <-19 /* irq routine has not removed irq source */
+#define E_VERSION <-20 /* wrong (executable file) version */
+
+#define E_NOTASK <-21 /* no more free task */
+#define E_INT <-22 /* interrupted (by signal) system call */
+
+#define E_ILLSIG <-23 /* illegal signal number */
+
+#define E_TRYAGAIN <-24 /* try again */
+
+/* file handling errors */
+
+#define E_FNODRV <-32 /* illegal drive number */
+#define E_FNOPATH <-33 /* wrong path */
+#define E_FILLNAM <-34 /* illegal name (joker "*","?","\"") */
+#define E_FNAMLEN <-35 /* name too long */
+#define E_FNOFIL <-36 /* file not found */
+#define E_FWPROT <-37 /* file write protected */
+#define E_FILEXIST <-38 /* file exists */
+#define E_FDISKFULL <-39 /* disk full */
+#define E_FDNEMPTY <-40 /* subdirectory not empty when rmdir */
+#define E_FLOCKED <-41 /* file locked */
+#define E_FMEDIA <-42 /* media error */
+#define E_FLOGICAL <-43 /* bad logical structure on media */
+#define E_FINTERNAL <-44 /* internal error - should not happen! */
+
+/* lib6502 errors */
+
+#define E_ILLADDR <-64 /* illegal address for lib6502 mfree */
+#define E_NOFILE <-65 /* illegal file number for lib6502 */
+#define E_NOSEEK <-66 /* file not seekable */
+#define E_NOREAD <-67 /* read on file would block */
+#define E_NOWRITE <-68 /* write on file would block */
+#define E_FVERSION <-69 /* file version number not supported */
+
+
+#define E_LASTERR <-96 /* for customized error numbers */
+
+
+During bootup, the kernel initializes the memory and sets up the standard
+system memory configuration. This includes mapping the system ROM from
+the top of memory down, and the system RAM is mapped from the lower end up.
+
+When the system initialization is done, the ROM is searched for executable
+files. The first two bytes of the ROM are taken as an address.
+If this address is not $ffff, then directly after the first two
+bytes follows the program ROM structure described below.
+After starting the first file, the address at the beginning is taken
+as a pointer to the next file and so forth, until the kernel finds
+a $ffff.
+
+The program ROM structure looks like:
+
+ P_KIND 0 /* byte, type of file */
+ P_ADDR 1 /* word, start address of execution */
+ P_RAM 3 /* byte, amount of RAM needed from
+ lower end of memory in 256-byte
+ blocks */
+ P_SHARED 4 /* byte, size of memory shared with
+ parent counted from top of memory,
+ in 256-byte blocks */
+ P_PRIORITY 5 /* byte, priority of the task to be
+ started */
+ P_DEV 6 /* 2 byte, the first byte gives the
+ device number that is opened for the
+ stdin stream, the second gives the
+ device number for stdout/stderr */
+ P_NAME 8 /* name of the program, ended by
+ nullbyte. After the nullbyte is the
+ commandline the program is started
+ with. The parameter are separated
+ by nullbytes. After the last parameter
+ follow two nullbytes to indicate
+ the end of the command line. */
+
+
+There are several program types available:
+
+
+ PK_PRG 0 /* simple program */
+ PK_DEV 1 /* device block */
+ PK_FS 2 /* filesystem */
+ PK_INIT 3 /* ROM init process */
+
+
+These file types have to be filled into the P_KIND field above.
+In addition they can be or'd by the following flags.
+
+
+ PK_AUTOEXEC $80 /* autoexecution */
+ PK_RESTART $40 /* restart when died */
+
+
+When the PK_AUTOSTART bit is not set, the file is ignored by
+the kernel.
+
+The ROM only starts device blocks (PK_DEV) and init processes
+(PK_INIT), because they are set up before the scheduler starts
+and therefore the PCBUF is (on non-MMU systems) not available.
+I.e. init processes do not check their command line, and do not release
+the PCBUF.
+Also PK_INIT tasks get no stdin, stdout and stderr streams
+and have to set them up themselves.
+
When starting device blocks, the address given in the
+P_ADDR field is given to the DEVCMD command to register
+the devices.
+
+When using the special init process (init v1.0 from the sysapps directory),
+the other entries are started by the init process.
+PK_PRG tasks are started with their stdin/out/err opened
+to the devices given by the PK_DEV field.
+The name and command line are copied from the P_NAME field
+to the FORK_NAME field for the fork.
+
+PK_FS are started as programs, but with the stdin/out/err
+streams set to STDNUL, which is ignored.
+
+If the init process is configured for it, and the PK_RESTART
+bit is set, it registers the task id of the started process and
+restarts it when the task dies.
+
+ROM tasks are started from the init task and have no way to
+determine which RAM locations are used by other tasks.
+Therefore the variable allocation must be done when the ROM is
+assembled. When using an MMU-based system, where each task has its
+own memory environment there need not be much caution. But when
+all tasks use the same environment (like in the C64) care has to be
+taken not to use a memory location twice. Especially shared libraries
+must use an own memory range, and they must be thread-save.
+This allows for different threads of one task as well as threads
+of different tasks to use the same library in one memory environment.
+
+For each environment, task and thread the kernel saves two bytes that
+are guaranteed to be unique within the environment, task or thread
+respectively. The bytes at addresses 2 and 3 are set to zero when
+a memory environment is created and are unique to this environment.
+The bytes at addresses 4 and 5 are unique to the task and can be
+used for task-specific data, like a pointer to a task structure.
+The bytes at addresses 6 and 7 are unique to the thread and
+can be used for thread data.
+
+The kernel is configurable in a wide range. Many options are available
+for all versions, but also many options are architecture dependent.
+The options are generally set in a global file that builds a
+system ROM. Therefore, to not set the options in the kernel file
+itself, the macro ROM must be defined.
+
+General options:
+
+ CMOSCPU /* have (rockwell) R65C02 */
+ NMIDEV /* allows handling of NMI in devices
+ (only for non-MMU systems, untested) */
+ NMIRESET /* calls RESET when an NMI arrives */
+
+ STACKCOPY /* on non-MMU systems the stack can
+ either been split up or, with this
+ options, copied to a save area */
+
+Memory options:
+
+ RAMSIZE /* size of checked RAM during bootup,
+ in 256-byte blocks */
+ MIN_MEM /* minimum memory size to boot */
+ RAMTEST /* if set, RAM is tested, if not RAMSIZE
+ is taken to be the real RAM size */
+ BATMEM /* memory is not cleared but kept during
+ memory test */
+ NOMIRRORMEM /* can be set if we _know_ that we do
+ not have mirrored memory */
+ MEMINIVAL /* value with which to set the memory at
+ boot. If not set, 0 */
+
+Some Architecture specific options:
+
+ NOSYSPORT /* The CS/A65 computer has a certain */
+ port where it can read the IRQ line
+ for example. Not available if set */
+ ROMTEST /* on CS/A65 systems allow booting from
+ a running OS/A65 (replacing it) */
+
+Kernel configuration options for various system calls are the following.
+The second half is mostly used to customize for embedded applications.
+
+ NEED_CHECKCHLD /* checkchld available if set */
+ NEED_GETINFO /* getinfo available if set */
+ NEED_RENICE /* renice available if set */
+ NEED_SLOCK /* slock available if set */
+
+ NO_STREAMS /* streams not available if set */
+ NO_FSM /* filesystem manager not avail. if set */
+ NO_SEM /* semaphores not available if set */
+ NO_SEND /* no send/receive/xreceive if set */
+
+ EOK_SEPARATE /* kernel is not at end of ROM - */
+ /* kernel/end.a65 is included extra. */
+ EOK_NOFILL /* don't fill between kernel and end of */
+ /* it. kinit _must_ copy the stuff from */
+ /* eok_addr to $fff* */
+
+Porting has been made much easier with this kernel version.
+In general, there is a proto architecture subdirectory that holds
+some prototype files for a non-MMU system. that can easily be changed to
+fit own needs.
+
+The kernel needs two files in the arch/*/kernel subdirectory, namely
+kenv.a65 and kinit.a65. The kinit.a65
+file is included in the kernel startup code, i.e. after setting
+the interrupt flag and clearing the decimal flag this file is
+executed, and it is expected that the
+CPU gets out of this file at the end of it.
+
+
kinit.a65
+
+This file must initialize the stack, the memory management and mapping of the
+system ROM and RAM.
+Then the system preemption timer must be set up.
+When including kernel/zerotest.a65 and kernel/ramtest.a65 here
+all the memory options from above are available.
+Also the ramtest file returns the size of memory found in 256-byte blocks
+in a. This value must be passed to the end of the init routine in this file.
+
+In addition to this some Macros have to be defined, that are used
+in the kernel later.
+
+ GETFREQ() returns a=0 for 1Mhz, a=128 for 2MHz
+ LEDPORT address of LED port to signal hardware failures
+ LED_LED bit of LED bit in LEDPORT address
+ H_ERROR() if LEDPORT is not defined, then H_ERROR replaces
+ the LED toggle routine if needed.
+ CLRTIMER() clear the system preemption timer interrupt
+ KERNELIRQ() returns if an interrupt occured in the kernel
+ or outside. Is checked by "BNE IRQ_in_Kernel"
+ SAVEMEM() save system mem config for interrupt
+ RESTOREMEM() restore system mem config after interrupt
+ STARTMEM() This is used to alloc/enable memory pages found
+ during kernel init. Takes mem size in AC as given
+ by the kernel init. It is called _after_ inimem!
+
+For the most systems without MMU, most of these macros can be
+taken from the C64 kinit.a65 file.
+If you have a more complicated mapping, you can have a look at the
+CS/A65 kinit.a65 file.
+
+
kenv.a65
+
+The kenv.a65 file is included in another part of the kernel.
+It is the part that maps the memory according to the environment
+number for each task.
+Several routines must be defined here:
+
+ inienv init environment handling
+ setthread set active thread
+ initsp init task for thread (no in xr)
+ push push a byte to active threads stack
+ pull pull a byte from active threads stack
+ memtask jump to active thread
+ memsys enter kernel
+
+ getenv get e free environment
+ freenv free an environmen
+ sbrk reduce/increase process memory in an environment
+
+ enmem enable memory blocks for environments
+ (this kernel call is used for MMU systems and
+ heavily system specific)
+ setblk sets a specific memory block in the memory map
+ of the active task. Also for MMU systems only
+
+Also some macros must be defined:
+
+ MEMTASK2() This is equivalent to memtask above, but it
+ is used for returns from interrupt
+ MAPSYSBUF maps the PCBUF of the active task to the
+ address given by SYSBUF in system memory
+ SYSBUF mapped tasks PCBUF
+ MAPENV() maps the address given in a/y in env x to somewhere
+ in the kernel map, returns mapped address in a/y
+ MAPAENV() as MAPENV, but does it for actual env.
+ GETTASKMEM returns (in AC) how much memory a task has
+ (task id in y)
+ CPPCBUFRX copies PCBUF from other task (yr) to active one
+ CPPCBUFTX copies PCBUF from active task to another one (yr)
+ CPFORKBUF() copies the PCBUF from the FORK call to the task.
+ GETACTENV() returns active environment in ac
+
+The full descriptions can be found in the C64 kenv file for example.
+This may look complicated, but it isn't. If you have a simple 6502 system
+without memory management, just copy (or set a link) to the C64 file.
+If you have a more complicated system, have a look at the CS/A65 file.
+
+
+Terminal devices should understand the following terminal control codes
+(But the currently implemented device driver doesn't understand them all,
+though...)
+
+
+/* Terminal Commands */
+
+#define TC_BEL 7 bell
+#define TC_BS 8 backspace
+#define TC_HT 9 horizontal tabulator
+#define TC_LF 10 line feed
+#define TC_VT 11 vertical tabulator
+#define TC_FF 12 form feed
+#define TC_CR 13 carriage return
+#define TC_ESC 27 Escape code
+
+#define TC_CLFT $80 cursor left
+#define TC_CRGT $81 cursor right
+#define TC_CUP $82 cursor up
+#define TC_CDWN $83 cursor down
+#define TC_HOME $84 cursor to the upper left edge
+#define TC_CLR $85 clear screen
+#define TC_DEL $86 delete char
+#define TC_INS $87 insert
+#define TC_WLO $88 set upper left window corner by cursor pos
+#define TC_WRU $89 set lower right window corner by cursor pos
+#define TC_WCLS $8a clear window
+#define TC_EOL $8b put cursor to the end of line
+#define TC_CLL $8c clear rest of line from cursor
+
+#define TC_ECHO $8d switch on local (device) echo mode
+#define TC_NOECHO $8e device only sends, application has to echo
+
+#define TC_CPOS $8f next two chars are row and column of new
+ cursor position
+
+
+FORK, SETIRQ and TRESET can NO MORE be called via a SEND
+system call, when
+the receiver address is SEND_SYS and the message type is SP_* !!
+
+
+/* SysProcCalls */
+
+#define PCBUF $200
+
+
+
+STD* stream number are replaced by the numbers saved in the environment
+struct.
+
+
This file has been written to define a certain compatibility level between
+different operating systems for 6502 computer. It defines, on a more abstract
+level that can be fitted to different real OSes, an interface for system
+services. The goal of this definition is, to be able to fit into various
+different environments, like
+
+
+
Computers like the C64 or the Gecko computer, with a single 6502, without
+advanced memory management.
+
+
Computers like the C128, with a more enhanced memory management (two
+banks with 64kByte each, relocatable zeropage and stack)
+
+
The CS/A65 computer, with a 6502 and a fully virtualized address management.
+
+
+
Computers with the 65816 CPU, for programs running in 8 bit emulation
+mode.
+
+
+
The possible operating systems also differ in style and features:
+
+
+
Single-tasking OSes, like the ones provided with the C64, or other
+6502 computers (if interprocess communication and process management calls
+are not used, lib6502 programs can even run on such a machine).
+
+
'Monolithic' multitasking systems, that have all system services in
+the kernel
+
+
Microkernel based OSes, that communicate with system servers via kernel
+communication paths, providing this functionality to the program via the
+lib6502.
+
+
+
This interface offers a common level for all these scenarios. Programs
+written for this library can run on any of these platforms, a simple recompile
+on the proprietary 6502 assembler/compiler will be enough. If people can
+agree on a standard file format, not even recompiling might be necessary.
+
+
+
In this library there still is a certain degree of freedom in the implementation.
+System process IDs can still be 8 bit, as long as the library offers a
+16 bit interface to the application. Memory allocation can still be pagewise
+(in 256 byte blocks), as long as an application does not rely on that -
+in other OSes it can probably allocate smaller chunks. The purpose of this
+interface is, to hide the system OS behind. The application, on the other
+hand, should never assume any implementation specifics, that are not documented
+in this definition.
+
+
Most of the calls are modeled along the standard libc C library, but
+there also are some calls from the Unix world.
+
+
This file does not make any assumptions about the implementation of
+the calls, although the behaviour is (i.e. should be :-) noted as exactly
+as possible.
+
The file interface uses file numbers. These file numbers are valid in
+the local environment, and need not be globally valid. But the lib6502
+always has to accept these numbers, and then tranforms them internally
+wo whatever appropriate for the given OS. Of course an implementation where
+both are identical should be better in performance.
+
+
file-nrs in lib6502 are treated as uni-directional or bi-directional
+channels, i.e. an application can either read or write to a provided uni-directional
+file-nr, and both at a time to a bi-directional file-nr. The OS can provide
+bi-directional (with read/write operations possible on the same file-descriptor
+in one task) or uni-directional (where a write to one end can be read from
+the other end even in the same task.) file-descriptors. Only the latter
+case is difficult. The stdlib must check the fileno and remap it to different
+filenos for reading or writing.
+
+
When an application is started, three uni-directional file-nrs do already
+exist and are open: STDIN, STDOUT, and STDERR. STDOUT gives the file-nr
+for writing task output, STDERR is for error output, while STDIN is for
+reading program input.
+
+
All open files are closed when the process terminates.
Files are named as: "Device:directory/filename", where Device
+depends on the OS. There might be OSes where it's a single character (like
+A: or 8:), others might have a real name. The lib needs to be able to parse
+its own, implementation dependent namespace only. And the application should
+not assume anything about the length of the device name. Directory separator
+is "/". Escape sequence for the directory separator is "\/".
+For the filename interpretation see the beginning of the directory
+section. Character set is ASCII (i.e. all codes between 0x20 and 0x7f must
+be useable, others are not allowed).
+
+
The filesystem might imply other limitations on filename length, if
+there are directories at all, or the allowed characters. Wildcards are
+"*" that match any string and "?" that match exacly
+one character. The interpretation might depend on the filesystem, i.e.
+may not even be the same on the same system, but on different devices.
+Escape sequences are "\*" and "\?". Escape sequence
+for "\" is "\\".
+
+
The mode byte can be one of the abovementioned, which map to
+
+
OPEN_RD 0
+ OPEN_WR 1
+ OPEN_RW 2
+ OPEN_AP 3
+
+
+
Append means, that before any write to the file, the file pointer is
+positioned at the end of the file. The mode can be or'd with some other
+bits, like
+
+
OPEN_TRUNC $80 If the file already exists, it will
+ be truncated (when writing).
+ OPEN_EXCL $40 Only one process may have this file
+ open at one time.
+ OPEN_NOCREAT $20 Do not automatically create when
+ writing (OPEN_WR, _RW, _AP).
+
+
+
Default is to automatically create the file when it does not exist and
+it is opened for writing.
+
+
fclose
+ <- x = file-nr
+ Closes the given file-nr. Pushes all remaining data
+ to the receiver, and waits till it is written.
+ -> c=0 : everything ok
+ c=1: a = error code E_NOFILE
+ E_WERROR
+ E_NUL
+
+ fgetc
+ <- x = file-nr
+ c=0 : return immediately, c=1 : block till byte
+ -> c=0 : a = data byte
+ c=1 : a = error code E_NOFILE
+ E_EMPTY
+ E_EOF
+ fputc
+ <- x = file-nr, a = data byte
+ c=0 : return immediately, c=1 : block till byte
+ -> c=0 : ??
+ c=1 : a = error code E_NOFILE
+ E_FULL (E_TRYAGAIN?)
+ E_NUL (noone reads it)
+
+ fread
+ <- x = file-nr, a/y = address of struct:
+ .word address_of_buffer, length_of_buffer
+ c = 0 : return immediately, even if nothing read or
+ buffer only partially read.
+ c = 1 : wait till buffer is full or EOF (or error)
+ -> c = 0 : ok
+ struct given holds address+a/y, length-a/y,
+ such that it can directly given to fread again.
+ c = 1 : error code E_NOFILE
+ E_EMPTY (E_TRYAGAIN?)
+ E_EOF
+
+ fwrite
+ <- x = file-nr, a/y = address of struct:
+ .word address_of_buffer, length_of_buffer
+ c = 0 : return immediately, even if nothing written,
+ or buffer only partially written.
+ c = 1 : wait till buffer is empty (or error)
+ -> c = 0 : ok
+ struct given holds address+a/y, length-a/y,
+ such that it can directly given to fwrite again.
+ c = 1 : error code E_NOFILE
+ E_FULL (E_TRYAGAIN?)
+ E_NUL (noone reads it)
+ fseek
+ <- x = file-nr, a/y = address of struct:
+ .byt mode ; offset is relative to
+ 0 = start of file
+ 1 = end of file
+ 2 = actual position
+ .word 0,0 ; 32 bit offset
+ -> c = 0 : ok;
+ c = 1 : error code E_NOFILE
+ E_NOSEEK
+
+
+
fgetc and fread, and fputc and fwrite can be used interchangeably. fread/fwrite
+don't guarantee that the whole buffer is really read/written, even with
+carry set. For this, see fcntl below.
+If fread returns an E_EOF there can still be bytes that
+have been read during this call, so the returned struct has to be checked.
+
+
When opening
+a file read-write, then when changing between read and write, there always
+has to be an fseek operation.
+
+
There are, however, files that cannot be seeked, namely character devices.
+If trying to use fseek on such a device, E_NOSEEK is returned. If a seekable
+file is given to STDIN and STDOUT/STDERR, the behaviour is not defined.
+Only non-seekable files should be given to STDIN and STDOUT/STDERR, when
+opened read-write.
+
+
pipe
+ -> x = file-nr for reading
+ y = file-nr for writing
+
+ opens a uni-directional pipe with two file numbers,
+ one for writing, and one for reading. To close the pipe,
+ each end has to be closed separately.
+
+ flock
+ <- x = file-nr
+ a = operation: LOCK_SH, LOCK_EX, LOCK_UN
+ c = 0: don't block
+ c = 1: block till you get it
+ -> c = 0: ok, got lock
+ c = 1: a = error code E_NOTIMP
+ E_NOFILE
+ E_LOCKED
+
+
+
The flock call locks a file for other tasks access. If locked shared,
+then other tasks may also aquire shared locks - for reading, for example.
+An exclusive lock can only be aquired by exactly one task at a time - for
+writing. An exclusive lock can not be obtained when there are other shared
+locks, but a pending exclusive lock blocks all other attempts to lock it,
+even for shared locks. The flock implementation should be fair, i.e. lock
+attempts are served in the order they arrive, except that exclusive get
+served before shared locks. The flock call is optional. If not implemented,
+return E_NOTIMP
+
+
fcntl
+ <- x = file-nr, a = operation
+ a = FC_PUSH 0 all buffers are flushed and sent
+ FC_PULL 1 actively try to get everything
+ that has already been sent
+ FC_RCHECK 2 checks if there is data to read
+ FC_WCHECK 3 checks if at least one byte can be
+ written.
+ -> c = 0: ok
+ c = 1: a = error code E_NOFILE
+ E_NOTIMP
+ E_NOREAD
+ E_NOWRITE
+
+
+
The fcntl return code should be ignored, as it is probably not implemented
+in most of the systems, except for RCHECK/WCHECK calls of course.
Other important calls are the stddup and the dup call.
+
+
stddup
+ <- x = old stdio file-nr (STDIN, STDOUT or STDERR)
+ y = new file-nr for stdio file.
+ -> c = 0: ok, x = old stdio file
+ c = 1: a = error code E_NOFILE
+
+
+
This call replaces a stdio file-nr (the pre-defined STDIN, STDOUT, and
+STDERR file-nrs) with a new file-nr. The old file-nr must not be closed,
+as it is when the process terminates. Instead the new file-nr returned
+must be closed.
+
+
dup
+ <- x = old file-nr
+ -> c = 0: ok, x = new file-nr
+ c = 1: a = error code E_NOFILE
+
+
+
This call 'reopens' a file, i.e. it returns a new file-nr that is used
+as the old one. They share the same read/write pointers etc. Both file-nrs
+must be closed. This way the same file can be given to STDOUT and STDERR
+in a fork call, for example.
+
+
If dup is given a read-write file-nr, both sides are duped and the returned
+file-nr is bi-directional again.
+
+
+
+
+
+
+
Directory Interface
+
+
The library maintains a path that is used for each file system operation.
+If a filename does not start with a "/" and not with a drive,
+the path is put in front of the filename. If the filename starts with a
+drive, it is always taken as an absolute filename, even if the "/"
+is missing. If only the drive is missing, it is taken from the path.
+
+
A special case is the directory call with a filename as "*:".
+It does not use the path, but returns, in each entry, an available device
+name. The length attribute should give the available amount of storage
+space on the device. A wildcard in the device field is not allowed otherwise.
+
+
+
fopendir
+ <- a/y = address of filename
+ -> c = 0: ok, x = file-nr
+ c = 1: a = error code E_NOFILE
+ E_NOTDIR
+
+ freaddir
+ <- x = file-nr a/y = address of buffer
+ blocks until read, otherwise use fcntl(FC_RCHECK)
+
+ reads _one_ directory entry into the buffer, which is
+ of length (FD_NAME + MAX_FILENAME)
+ One entry consists of a directory struct
+
+ .word 0 ; valid bits
+ .word 0 ; owner ID
+ .word 0 ; group ID
+ .word 0 ; permissions (drwxrwxrwx) (2 byte)
+ .word 0,0 ; file length in byte (4 byte)
+ .byt 0,0,0,0,0,0 ; last modification date
+ ; (year-1990, month, day, hr, min, sec)
+
+ The valid bit say, which entry in the struct is valid.
+ bit 0 is for the permissions, bit 1 for the file length, bit 2
+ for the date. The file length, if not zero, is an
+ approximate value (like the blocks *254 in a vc1541)
+ this struct is followed by the null-terminated filename.
+ The valid bits are:
+
+ FDV_PERM 1
+ FDV_LENGTH 2
+ FDV_MDATE 4
+ FDV_OWNER 8
+ FDV_GROUP 16
+
+ If permissions are valid, but not group/owner, then
+ the permissions for user and group are invalid, and the
+ permissions for others should be taken.
+
+ The directory entry struct definitions are:
+
+ FD_VALID 0 /* 1 byte */
+ FD_PERM 1 /* 2 byte */
+ FD_LENGTH 3 /* 4 byte */
+ FD_MDATE 7 /* 6 byte */
+ FD_NAME 13 /* null-terminated */
+
+ The permission bits are actually a copy from the Linux
+ man pages...:
+
+ S_ISUID $800 /* set user ID on execution */
+ S_ISGID $400 /* set group ID on execution */
+ S_ISVTX $200 /* -- (sticky bit) */
+
+ S_IRWXU $1c0 /* rwx mask for user */
+ S_IRUSR $100 /* read by owner */
+ S_IWUSR $080 /* write by owner */
+ S_IXUSR $040 /* exexute by owner */
+
+ S_IRWXG $038 /* rwx mask for group */
+ S_IRGRP $020 /* read by group */
+ S_IWGRP $010 /* write by group */
+ S_IXGRP $008 /* execute by group */
+
+ S_IRWXO $007 /* rwx mask for others */
+ S_IROTH $004 /* read by others */
+ S_IWOTH $002 /* write by others */
+ S_IXOTH $001 /* execute by others */
+
+ S_IFMT $f000 /* file type mask */
+ S_IFSOCK $c000 /* socket */
+ S_IFLNK $a000 /* symbolic link */
+ S_IFREG $8000 /* regular file */
+ S_IFBLK $6000 /* block device */
+ S_IFDIR $4000 /* directory */
+ S_IFCHR $2000 /* character device */
+ S_IFIFO $1000 /* fifo */
+
+ S_IFMNAME $3000 /* media name */
+ S_IFMFREE $5000 /* free are on media */
+ S_IFMSIZE $7000 /* media size */
+
+ Most of the file types are probably not implemented
+ on a 6502 system. But before defining new types, one
+ should keep the already defined values save.
+ That's for the last three entries, which are not
+ Posix standards.
+
+ The length field can be an approximate if it is not zero
+ and the length is not valid (For VC1541 block lengths).
+
+ fgetattr
+ <- a/y = address of dir struct, incl filename (like in freaddir)
+ -> c = 0: ok,
+ c = 1: a = error code E_NOTIMP
+
+ This tries to fill in the bits that are _not_ valid in a
+ dir struct. For example, if freaddir returned
+ the filelength only, but no permissions, then calling
+ fgetattr should get the file permissions.
+ But it is not guaranteed, that all fields are filled,
+ as some are not implemented on a certain filesystem.
+ So even after fgetattr, a check of the valid bits is needed.
+ The filename must be completed with the device and path.
+
+ fsetattr
+ <- a/y = address of dir struct, incl. filename
+ -> c = 0: ok
+ c = 1: a = error code E_NOTIMP
+
+ Tries to write new file attributes (the ones where the
+ valid bits are set). Need not succeed. Clears the valid bits
+ for the attributes it has successfully set.
+ The filename must be completed with the device and path.
+
+ chdir
+ <- a/y = address of new path, relative to the old one
+ -> c = : ok
+ c = 1: a = error code E_ILLDRIVE
+ E_ILLPATH
+ cwd
+ <- a/y = address of buffer, x = length of buffer
+ -> c = 0: ok, buffer contains the current working directory.
+ c = 1: a = error code E_NOTIMP
+ E_FNAMLEN
+
+
+
The chdir call changes the saved path in the library. A "."
+filename means the same directory, while ".." means the parent
+directory.
+
cwd gives the address of the path. However, the path pointed to by
+the returned address must not be changed.
+
+
Network Interface
+
+
Network streams are used as well as any other file, so we only need
+opening calls. Currently only TCP/IP is defined and thought of, but there
+should be no problem allowing other networks.
+
+
connect
+ <- a/y address of : byte length of address (incl. length byte),
+ plus 4 byte inet addr (+2 byte port for TCP/UDP)
+ x = protocol (IPV4_TCP, IPV4_UDP,...)
+ -> c = 0: x = (non-seekable, bi-directional) file-nr
+ for read/write
+ c = 1: a = error code E_NOTIMP
+ E_PROT
+ E_NOROUTE
+ E_NOPERM
+
+ listen
+ <- c = 0: a/y = addr of:
+ byte length of port, 2 byte port number
+ (for TCP/UDP on IP)
+ x = protocol
+ -> c = 0: ok, x = listenport
+ c = 1: a = error code E_NOTIMP
+ E_PROT
+ E_PORTINUSE
+ opens a port to listen at
+
+ <- c = 1: x = listenport
+ -> c = 0: ok
+ c = 1: a = error code E_NOTIMP
+ E_NOPORT
+ closes the listenport again.
+
+
+ accept
+ <- a/y = address of buffer for struct:
+ 1 byte length of buffer (incl. length byte),
+ the rest of the buffer need not be set.
+ for IPV4 TCP and UDP we need place for:
+ 4 byte IP address +
+ 2 byte port,
+ x = listenport
+ c = 0: don't block
+ c = 1: block
+ -> c = 0: x = file-nr for read/write
+ The buffer contains the address that the remote
+ machine uses. The 1st byte contains the length of the
+ address (should not differ from the length indicated
+ by the protocol number in listen.
+ c = 1: a = error code E_NOTIMP
+ E_ADDRLEN
+ E_NOMEM
+ E_TRYAGAIN
+
+
+
connect is something like Unix socket() and connect() together. listen
+is something like socket(), bind() and listen() together. listen tells
+the network layer, that the application is going to accept connections
+on a certain port. Therefore, when a connection is requested from remote,
+the network layer can accept them already and hold them "on line"
+until the task gets the connection with accept. The maxmimum number of
+acceptable connections is implementation specific.
+accept gets the first connection waiting for an accept. the other sides
+IP and port are stored in the buffer given in a/y If a connection is refused
+after checking IP or port, the 'accepted' connection should be closed immediately.
+
+
+
Memory Management
+
+
It is possible to have an allocation at byte boundaries, or at page
+boundaries - an application does not have to rely on a certain alignment!
+
+
+
malloc
+ <- a/y length of block needed
+ -> c=0: a/y address of block allocated
+ c=1: a = error code E_NOMEM
+
+ mfree
+ <- a/y address of block released
+ -> c=0: ok
+ c=1: error code E_ILLADDR
+
+ realloc
+ <- a/y address of block, x position of new length
+ in zeropage (2 byte)
+ -> c=0: ok
+ c=1: error code E_ILLADDR
+
+
+
+
Allocated memory blocks are automatically freed on process termination.
+
+
+
Process Management
+
+
Process management is a bit more complicated. Process ID interface is
+16 bit, although they need not all be used, of course.
+
+
exec
+ <- a/y = addr of filename,0 [, parameter1, 0 ...] ,0
+ -> if no error, then the new program starts and gets
+ a/y = address of filename,0 [, parameter1, 0 ...],0
+ otherwise return:
+ c=1: a = error code E_NOTFOUND
+ E_NOMEM
+ allocates new environment and removes old environment.
+ starts newly loaded executable file.
+
+ forkto
+ <- a/y addr of struct: '.byte STDIN, STDOUT, STDERR, exec_struct
+ -> c=0: x/y = child pid
+ c = 1: a = error code E_NOMEM
+ E_ILLSTR
+ E_NOTFOUND
+
+ This is not really a fork like in Unix, but it creates a
+ new process, so it still 'forks'. The new process is
+ started with executing the file given in the exec_struct
+ - which is the same struct as given to exec.
+ The file-nrs given for STDIN, STDOUT and STDERR share the same
+ read/write pointers as the ones in this process.
+ They are internally 'duped', and the calling task has to
+ close them after calling forkto. No other file-nos are
+ inherited.
+
+ forkthread
+ <- a/y addr of execution for new thread
+ -> c = 0: ok, xr = new thread number
+ c = 1: a = error code E_NOTIMP
+
+ forkthread sets up a new thread to run in the same
+ memory environment as the calling thread/process.
+ The new thread is started at the given address, with
+ an empty stack. This means the thread has to explicitely
+ call term when terminating.
+
+ term
+ <- a = return code
+
+ kill
+ <- a = return code, x/y = pid (or MYTASK = myself -> suicide)
+ -> c=0: ok (except for MYTASK)
+ c=1: a = error code E_ILLPID
+
+
+
The term call terminates the current thread only. The memory etc is
+only freed when all threads in this environment have terminated. Kill terminates
+all threads in the environment indicated by the process ID.
+
+
getpid
+ -> x/y = own PID
+
+
+
When forking, the files still share the same seek pointer (address in
+the file where they read/write). When one process writes to a file, the
+other processes write pointer moves on too, same for the read pointer.
+Otherwise file sharing with the 1541 would be impossible, for example.
+
+
+
STDIN/STDOUT and STDERR file-nrs appear to be opened before process
+start. They can be closed as any other file, though. When calling forkto,
+the file-nrs given to it are `duped' internally, such that they have to
+be closed in the calling process, as well as in the newly created process.
+
+
+
All files opened by this task are closed when it terminates. All memory
+blocks allocated by this task are freed when it terminates.
+
+
The newly created process is started by calling the "main"
+function, with a/y pointing to a list of arguments:
+
+
.byt "arg0",0, "arg1",0, ... ,"argn",0,0
+
+
+
The "main" function can either call "term", "kill"
+or return with a "rts" opcode.
+
+
yield
+
+
yield gives the process control back to the scheduler. It need
+not be called at all. But if a process is doing a busy loop (or spin-lock)
+waiting for a certain condition, it might call yield to give
+other tasks the opportunity to run. It is not necessary to call
+yield at all! The scheduler interrupts any thread and
+takes control back when the thread has used its timeslice. But if the thread
+knows that it waits for something to be done by another task, instead
+of waiting for the end of its timeslice it can call yield to give other tasks
+the immediate opportunity to run.
+
+
+
Interprocess Communication
+
+
Interprocess communication heavily depends on the system underneath
+the library, so it's not that easy. So far we handle semaphores, signals,
+and send/receive.
+
+
Semaphores
+
+
semget
+ <- c = 0: don't block, c = 1: wait till you get one
+ -> c = 0: ok, x = semaphore number
+ c = 1: a = error code E_NOTIMP
+ E_NOSEM
+ gets a new semaphore
+
+ semfre
+ <- x = semaphore number
+ -> c = 0: ok
+ c = 1: a = error code E_NOTIMP
+ E_NOSEM
+ E_INUSE
+ releases a used semaphore. If a process is waiting for
+ the semaphore, returns E_INUSE
+
+ semgetnamed
+ <- c = 0: a/y = name of semaphore
+ x = 0 : if not found, return error,
+ x = 1 : if not found, alloc name and return ok
+ -> c = 0 : ok, x = semaphore number
+ c = 1 : a = error code E_NOTIMP
+ E_NOTFOUND
+ E_NOSEM
+ This calls tries to allocate a 'named' semaphore.
+ If the name already exists, the associated semaphore number
+ is returned. If the name doesn't exist, and x=0, then an
+ error is returned. If a name doesn't exist, and x=1, then
+ the new name is allocated, a semaphore is allocated and
+ associated with the name.
+
+ <- c = 1: a/y = name of semaphore
+ -> c = 0: ok
+ c = 1: a = error code E_NOTIMP
+ E_NOTFOUND
+ The named semaphore is de-allocated. The named semaphore
+ handler counts the number of allocations and frees a semphore
+ if the name is totally deallocated.
+
+ With this call, one can system-independently allocate
+ system and hardware resources, if they are protected by
+ semaphores.
+ predefined semaphore names are:
+
+ SEM_C64_SERIEC, SEM_C64_PARIEC, SEM_C64_SID,
+ SEM_C64_VID, SEM_C64_KEYBOARD,
+ SEM_C64_CIA1TA, SEM_C64_CIA1TB, SEM_C64_CIA1TOD,
+ SEM_C64_CIA2TA, SEM_C64_CIA2TB, SEM_C64_CIA2TOD,
+
+ SEM_CSA_SERIEC, SEM_CSA_PARIEC, SEM_CSA_WD1770,
+
+ SEM_GECKO_SERIEC, SEM_GECKO_IRTX
+
+
+ psem
+ <- x = semaphore number
+ c = 0: don't block; c = 1: wait till gotten
+ -> c = 0: got semaphore
+ c = 1: a = error code E_NOSEM
+ Pass operation on a semaphore. Locks the semaphore.
+
+ vsem
+ <- x = semaphore number
+ Free operation on a semaphore. Lets other threads "pass".
+
+
+
+
+
+
Signals
+
+
Signals are some kind of 'remote procedure call' - a signal handler
+for a certain signal is called upon another threads' request.
+
+
signal
+ <- x = signal-number
+ a/y = address of signal handler
+ -> c = 0: ok
+ c = 1: a = error code E_NOTIMP
+ E_ILLSIG
+ installs a signal handler for a signal
+ signal handler address NULL de-installs a handler.
+
+ sendsignal
+ <- a/y pid of receiving process
+ x = signal number
+ -> c = 0: ok, sent
+ c = 1: a = error code E_ILLPID
+ E_ILLSIG
+ sends a signal to another process. A signal is an emulated
+ interrupt to the address specified as the signal handler
+ address.
+
The signal handler gets the signal mask for the signal in ac
+(They may or may not be combined if the same signal handler is used for
+more than one signal type).
+A SIG_CHLD is used to get information about child processes
+that died. If it is received, the
+xr/yr registers holds the PID of the dead child and ac holds the return
+code of the child. Only child processes are registered that died when the
+signal handler mask was set. You can only receive, but not send a
+SIG_CHLD.
+
+
+
Send/Receive
+
+
This section is very preliminary, as the SEND/RECEIVE interface in OS/A65
+is not really useable without MMU, and Lunix doesn't have SEND/RECEIVE.
+
+
+
send
+ <- a/y = address of
+ .word receiver_pid
+ .word address_of_data
+ .word length_of_data
+ c = 0: don't block
+ c = 1: wait till accepted
+ -> c = 0: block sent
+ c = 1: a = error code E_ILLPID
+ E_NOTIMP
+ sends a message to another process. The data sent is not
+ changed, or freed or whatever.
+
+ receive
+ <- a/y = address of three words, second and third word
+ give address and length of receiver buffer
+ x = 0 : accept any sender
+ x = 1 : first word in (a/y) contains the sender
+ c = 0 : don't block
+ c = 1 : wait till received
+ -> c = 0 : message received, (a/y) has
+ .word sender_pid
+ .word address_of_data
+ .word length_of_data
+ c = 1 : a = error code E_NOTIMP
+ E_ILLPID
+ E_NOMEM
+ The data is stored in the buffer, and length_of_data is
+ changed to the length actually received. If the buffer
+ is too short, length_of_data is set to the length needed,
+ and E_NOMEM is returned.
+
+
+
+
+
+
+
Environment Handling
+
+The process environment is a table of strings handled by the lib6502
+on a per-task basis. When a task forks a new task, the environment
+is inherited by the new task. Strings here are null-terminated ASCII
+character arrays.
+
+
+ getenv:
+ <- a/y name of env. variable
+ -> a/y = address of value or NULL if not set.
+
+ putenv:
+ <- a/y addr of "name=string"
+ -> c=0: ok
+ c=1: error E_NOMEM
+ E_NOTIMP
+ add or change env var. If the variable is empty, it is
+ unset and will return either a NULL pointer with getenv
+ or a pointer to an empty string.
+
+ getenvp:
+ -> a/y addr of null-terminated list of null-terminated
+ strings with "varname=value" in each string, describing
+ all environment variables. It is NOT allowed
+ to change these variables 'by hand'.
+
+ getos:
+ -> a/y addr of operating system string
+
+
+The operating system string is a string containing the
+
+
operating system name (OS/A65)
+
operating system version (2.0.0)
+
CPU type (6510)
+
architecture type (C64)
+
library type (lib6502)
+
library version (0.6)
+
+separated by spaces and ended by a nullbyte.
+
+
Implementation Notes
+
+
Implementation notes are currently available for the o65
+file format only. This file format is rather flexible, and some of the
+ideas can be taken for other lib6502 file formats.
+
+
o65 file format
+
+
The o65 file format is defined in another file format specification.
+It allows the use of undefined references. In order to simplify the relocation
+procedure, lib6502 files have one undefined reference, namely "STDLIB".
+This reference defines the base of the lib6502 jump table. At STDLIB+0
+there is a JMP opcode pointing to the code for fopen. At STDLIB+3 is a
+JMP opcode pointing to the code for fclose etc. The order is determined
+by the order given in the index of this definition.
+
+
A global variable is the "main" address, which is the start
+address for any lib6502 executable. If the "main" address is
+not given in the object file as a global variable, the start of the text
+segment is assumed to be the "main" address.
+
+
The lib6502 file format allows the use of "header options",
+where some OS specific options may be saved. The lib6502 files can - but
+don't need to - use a lib6502 header option (as defined in the o65 file
+format specification). This lib6502 header option contains the following
+struct:
The version numbers are hints as to which library version the file is
+compiled with. The level is a new number that describes which functions
+are used, and which are not. A library may provide a certain amount of
+lib calls in the library call table (STDLIB). The maximum number of calls
+used is given in the "possible_level" value. The maximum number
+that must be functional (and with only few exceptions not just return "E_NOTIMP")
+is given by the "needed_level" number.
+
+
The level numbers are defined as:
+
+
+
Level 1: fopen - chdir
+
+
Level 2: connect - accept
+
+
Level 3: malloc - mfree
+
+
Level 4: exec - getpid
+
+
Level 5: semget - receive
+
+
+
If the file needs a Possible Level greater than the level provided by
+the library, an "E_LIBLEVEL" error code should be returned by
+forkto or exec.
+
For example, a program that needs the file functions, and can optionally
+(i.e. if available) use the exec and fork calls, should have "1"
+as a Needed Function, and level 4 as Possible Functions.
+
+
service numbers conversion from text to number by generalized getxxxfromname?
+
+
+
listen + accept to _one_ call with local space for remote address?
+
+
+
+
+
+
+
+
Acknowledgements
+
+
Acknowledgements go to
+
+
+
Daniel Dallmann, author of Lunix, for discussions and comments on the
+library
+
+
Craig Bruce, the author of ACE, for some comments and bugfixes
+
+
+
+
diff --git a/dump/oa-2.0.9/doc/mon.html b/dump/oa-2.0.9/doc/mon.html
new file mode 100644
index 0000000..ac23a83
--- /dev/null
+++ b/dump/oa-2.0.9/doc/mon.html
@@ -0,0 +1,79 @@
+
+ OS/A65 Machine Language Monitor
+
+
OS/A65 Machine Language Monitor
+
(c) 1989-98 Andre Fachat
+
+This machine language monitor owns the most standard commands together
+with some interesting features taken from my C64
+assembler and some commands to
+do system calls easier.
+All addresses and data bytes can be given in hex, decimal (with
+preceding "."), octal (with preceding "&") or in binary (with
+preceding "%"). The output of the commands M, B, R, D, G and C can
+be piped to a file with "> filename", like in the shell.
+
+
+X exits monitor (goes to shell)
+D a b disassemble from address a to b
+B a b binary list
+M a b hex dump
+R shows register contents
+; a mnem
+A a mnem assembles 6502 mnemonic to address a
++ pc ac xr yr sp sr
+ sets registers to a new value. a "-" instead of a
+ value leaves the register unchanged
+E a b exchanges environment block a (the a'th MMU register) with
+ with memory block b
+S "name" a b save memory from a (included) to b (not included)
+ in file "name". The first two bytes in the file are the
+ memory address
+G a Goto address (executes a JSR)
+L a b reads b bytes from STDIN and saves them at address a
+L "name" a Load file "name" to address a or the included load
+ address if a is left out
+C a b c Compare memory area from a to b with the area starting at c
+T a b c Transfer (copy) memory from a to b to the address c
+O a b c Occupy (fill) memory from a to b with c
+P a b c sets system parameter: a becomes the standard drive (for
+ load/save), b is the number of bytes printed in a line
+ with hex dump and c becomes the number of available
+ memory blocks (a 4kByte) for this task. A "-" leaves the
+ value unchanged.
+U a b c d e change in the memory area from a to b all three byte
+ assembler opcode addresses pointing to the area between
+ c and d to the area starting at e
+I a b c ...
+, a b c ... writes bytes b, c, ... into the memory at address a
+F a b string tries to Find the string (which is mixed from bytes,
+ separated by spaces and strings, enclosed in double quotes)
+ in the address area from a to b
+FA a b addressing
+ search all assembler codes in memory from a to b, that have
+ the given addressing mode: "FA a b (**AB)" means to search
+ all absolute indirect addressing modes with low byte
+ equal to $AB
+FR a b search for relative jumps
+F- a b c search in memory from a to b for bytes that are not equal to c
+
+YD a b c DEVCMD with device a, command b and parameter c
+YM GETMEM
+YF a FREMEM memory block a
+YS GETSTR
+YR a FRESTR stream a
+YE GETENV
+YP adr env stdin stdout stderr
+ FORK
+YW sem PSEM
+YV sem VSEM
+YG a tries to get memory block a with GETBLK
+YC d:mask show directory
+
+
Memory Map
+The shell and the monitor both use the zeropage addresses
+from 64-128 ($40-$80) and memory addresses from 768-1024 ($300-$400).
+In addition to this, of course the stack ($0100-$01ff) and the PCBUF
+Send buffer ($0200-$02ff) are being used.
+
+
diff --git a/dump/oa-2.0.9/doc/nommu.html b/dump/oa-2.0.9/doc/nommu.html
new file mode 100644
index 0000000..2ff8b60
--- /dev/null
+++ b/dump/oa-2.0.9/doc/nommu.html
@@ -0,0 +1,78 @@
+
+ OS/A65 Operation without MMU
+
+
OS/A65 Operation without MMU
+
(c) 1989-98 Andre Fachat
+
+Using OS/A65 without an MMU used to require some special measures. One of it
+was to coordinate all running tasks concerning their memory usage.
+With the new relocatabel o65 fileformat the lib6502 implemetation
+takes care of that.
+
+This means when building lib6502 programs, you do not have to actively
+care about the stuff below, but it is probably good to know anyway.
+
+There is one thing that's difficult to handle on a 6502, the stack.
+It's only 256 byte large (small that is...). And with a multitasking
+OS the stack has to be used by several programs at the same time.
+One approach is to copy the stack contents to another place every time
+a task switch is done. But that's a big speed penalty.
+Instead I split the stack into 6 pieces, 5 of them for a task and the
+last one for the system. So on a system without MMU, only five tasks
+can be running concurrently.
+
+With version 1.3.9 we got a new config option, STACKCOPY. With this option
+the stack of a task is saved in some save area when doing a task switch.
+This is slower, but allows much more stack space in a task and much more
+tasks.
+
+There is one other thing that cannot easily be coordinated - the SEND buffer.
+This buffer is used for communication with the kernel. As
+OS/A65 originated from a system with MMU, there was no real need not to
+use an absolute address for the buffer,
+thus saving registers for other purposes.
+For all systems now the usage of the SEND buffer
+has to be coordinated between the tasks. Therefore
+a system semaphore is used.
+
+#define SEM_SENDBUF <-1
+
+Before accessing the SEND buffer at $02**, the task has to allocate
+it with a PSEM operation on the SEM_SENDBUF semaphore.
+After the system call, it has to be freed with a VSEM operation.
+
+Well, and here we are with the known resource allocation problem.
+Imagine two tasks communicating via send/receive. Then, if the order
+in which messages are sent is not fixed and therefore predictable,
+precautions against a lock have to be taken: task 1 allocating the
+send buffer to send a message to task 2. The same time task 2 tries
+to allocate the send buffer to send a message to task 1. If it not
+tries to receive messages while waiting for the semaphore, it will lock.
+
+Therefore the filesystems, for example, do not release the send buffer
+while executing a command or open a file. In the meantime another
+task could send a message to the filesystem, locking the send buffer.
+But the buffer is needed by the filesystem to send the reply message.
+The filesystems in their current form are not prepared for this situation,
+so that they don't release the send buffer.
+
+Be careful when using the send buffer - you are warned!
+
+
+The lib6502 library is thread-save. It can be used by any thread at any
+time. Internal locks (semaphores) are used to avoid any interference if
+necessary.
+
+
+Suggested reading: "Operating Systems, design and implementation", Andrew S.
+Tanenbaum, Prentice-Hall
+
+
diff --git a/dump/oa-2.0.9/doc/oa1.html b/dump/oa-2.0.9/doc/oa1.html
new file mode 100644
index 0000000..8edcb73
--- /dev/null
+++ b/dump/oa-2.0.9/doc/oa1.html
@@ -0,0 +1,656 @@
+
+ OS/A65 Multitasking OS for 6502
+
+
OS/A65 Multitasking OS for 6502
+
(c) 1989-96 Andre Fachat
+
+
+This is the description of a small operating system for the 6502 CPU.
+It is a microkernel design, with preemtive multitasking, without
+memory protection and swapping though. With a page mapped MMU the
+different tasks are paged out and memory up to 1 MByte is supported.
+Available software includes a shell with piping and I/O redirection,
+filesystems for (Commodore serial and parallel) IEEE488 interface,
+as well as for PC-style disks. Devices can be handled as files as well.
+A BASIC interpreter has been ported from the C64.
+A version for the C64 is available with version 1.3.5.
+
+A description of the kernel interna, the kernel interface and the
+standard library is given.
+Some of the devices and filesystems are introduced.
+
+OS/A65 has been written from somewhere in 1989 or 1990 up to the end of 1992
+and is currently in version 1.35. It runs on a selfbuilt 6502 computer
+with (or without) a 74ls610 MMU to allow task paging.
+
+This system has been written for a special 6502 computer, as described
+below. But then the kernel is completly hardware independent,
+device drivers doing all the hardware interface stuff.
+A special MMU is used to allow task paging, which gives lots
+of interesting features. A version for computers without MMU
+is available, though. In this version the different tasks
+have to be cooperative, in that different zeropage/RAM addresses
+have to be used.
+
+All tables, like environment tables, or streams etc are static, i.e.
+their sizes are fixed at compile time. Otherwise a very sophisticated
+memory allocation/free handler for kernel memory would have been necessary.
+This would have used much of the CPU power and of the system RAM for
+administrative needs only. I didn't want this.
+
+If an IRQ occurs, the current process is marked interrupted and
+the next runnable task is being started, thus providing preemptive
+multitasking. A simlpe round robin scheduler is being used.
+No threads are available, as the CPU needs to have its stack
+in $01xx in memory. The non-MMU version is a kind of threaded
+system, as the memory is the same for all tasks, but the stack
+at $01xx being divided into several parts for the different tasks.
+
+The MMU maps memory pages of 4k size. The kernel is within the uppermost
+4k, to include the 6502 Reset, IRQ and NMI vectors. I/O ports are
+mapped to $e800 to $efff. The rest of the memory can be mapped from
+the maximum total available memory of 1 MByte in 4k Blocks.
+Each task has its own memory environment, i.e. has its own view of the
+memory. It communicates with the system only by the means of kernel
+calls. Therefore the kernel provides a message-sending interface, as well
+as simple signals and semaphores.
+
+Data transfer is done via 128 byte sized fifos, called streams. The
+stream management as well as the memory manager are within the kernel,
+although it wouldn't be necessary. For performance reasons the filesystem
+manager is in the kernel as well. It dispatches the messages sent to
+the filesystem to registered filesystem tasks.
+
+The system structure looks like the following diagram.
+
+The CS/A hardware consists of several boards, one for the CPU and MMU,
+one for the ROM, 32k RAM and
+some basic I/O hardware. A video board with 64k RAM gives PAL
+(european video standard, as opposed to NTSC) b/w video output. A high
+resolution mode is available. There is a standard PC floppy drive
+interface, two serial interfaces (unfortunately without fifo), a
+parallel printer output, a keyboard interface, and a parallel IEEE 488
+interface. A serial - Commodore compatible - IEC bus interface is
+available as well.
+Most interfaces, i.e. chip addresses and I/O connections are compatible
+to the old Commodore CBM 3032 computer. Some things have been changed
+to avoid connections between different boards, though (A 3032 emulator
+is working).
+And of course new interfaces have been added, e.g. an infrared LED to
+control audio or other equipment by infrared commands.
+A special interface card and cable allows to replace a 6502 in an existing
+computer and make its 64k memory part of the CS/A memory.
+
+The size of the kernel is 4 kByte and it is located at $f000 in
+CPU address space. Kernel entry takes place with an IRQ, an NMI
+or via kernel call. These calls take place via a jumptable
+located at $f000, the beginning of the kernel.
+
+It is possible to get into the kernel through an CPU interrupt or a
+direct kernel call. After an IRQ the CPU registers are saved on the
+stack and the kernel is entered via a special routine 'memsys'.
+This transparent (i.e. no registers except stack pointer are changed)
+routine switches from Task environment to system memory environment.
+Each kernel call has, as one of the first instructions, a call to this
+routine to enter kernel address space. A similar routine, 'memtask',
+is called at kernel exit to enter task memory space.
+
+A task can be described by the memory map it is using and the CPU registers.
+Interrupting a task and saving this information allows to restart the task
+later. Here, in addition to this, a task has some additional properties.
+The mapping of the STD* streams is saved in the environment table as well
+as an optional task interrupt routine (if enabled at compile time).
+The task status shows if a task is blocked, interrupted, runnable
+or has executed a BRK opcode (which stops the task).
+No resource bookkeeping is done. A task has to release all resources
+it has allocated by itself, except for the STD* streams.
+
+GETENV allocates a new environment struct in the kernel (which
+can be freed with FREENV). With SETBLK the MMU mapping of
+bus address space to CPU address space for an environment can be
+manipulated. READ and WRITE allow other tasks to manipulate the
+contents of another environments memory.
+
+With FORK an environment then becomes a task, i.e.
+starts to live. TERM and KILL allow the task itself or another task
+to remove the task and free the environment struct. WTERM waits until
+a task has terminated. TRESET resets the PC of a (running) task to
+another address (really dirty trick...).
+
+GETINFO gives an overview of how many tasks are in use and what is
+their status. At the moment a maximum of 16 tasks (with MMU) is
+possible.
+
+Devices are a different kind of object. They have their memory
+mapping as well, it just simply consists of one memory page.
+Then devices are not really running tasks but they are
+waiting for a message, that is passed through the DEVCMD system call.
+The DEVCMD call registeres new devices and provides an interface to
+the devices. When calling a device, the device memory mapping is
+established and the device entry point is called as a subroutine.
+After the return the control goes back to the calling task.
+The DEVCMD interface is even reentrant: the video device allows
+interrupts to occur during device execution so that, for example,
+serial devices can be served without loosing characters (Of course
+the video device itself has a mutex construct builtin to avoid
+confusion).
+
+The memory management routines are independent from all other
+routines. For performance reasons they are in the kernel and not
+put into a separate task. At startup no memory is available.
+The kernel then tests the memory, gets its size and calls ENMEM
+to register usable RAM to the memory handler. The video
+driver does the same at startup when adding the video RAM to the
+system. GETMEM can then be used to get a free block of RAM.
+GETBLK tries to allocate a specific memory block where, for example,
+some special hardware like the video buffer is mapped in.
+FREMEM releases an allocated memory block. According to the system
+hardware a set of 256 memory blocks can be handled, which make up
+1 MByte of memory. The memory routines can not be called from within
+an interrupt.
+
+Streams, as this word is used here, are 128 byte FIFO buffers to allow
+easy data transfer. The stream routines can be called from within an
+interrupt. Each stream counts how many tasks are writing and reading
+from it. If both counters are zero, the stream is free. If only one is
+empty, special return codes are generated to indicate the situation.
+At a fork, for example, the number of writing tasks is incremented for
+STDOUT and STDERR, while the number of reading tasks is incremented
+for STDIN. After a task has exited, the STD* counters are decremented.
+A filesystem listening on the tasks STDOUT stream then
+gets the return code E_EOF, because no task is writing on the stream
+anymore.
+STD* streams are negative stream numbers and are the same
+for all tasks. They are mapped to the real stream numbers that are being
+kept in the environment table for each task. All other stream numbers are
+global and there is only a limited set of stream, as they are
+statically allocated.
+
+The message interface provides another easy means of interprocess
+communication. Messages are exchanged using the rendez-vous technique,
+i.e. both involved tasks have to be in the SEND respectively RECEIVE
+routine. The SEND routine always blocks until the given message is
+taken over by the receiving task. RECEIVE either waits for a
+message or returns with E_NOTX if no message has been found.
+The message is then copied from the senders message buffer (at $02xx)
+to the receivers message buffer (at $02xx). The return values are set
+and both tasks are marked runnable.
+If a RECEIVE blocks and a SEND takes place, both tasks are marked
+waiting at first, but the scheduler detects that and lets them
+exchange the messages.
+While RECEIVE gets messages from
+any task, XRECEIVE allows to receive messages from a certain task
+only.
+
+Negative task numbers are used for special purposes. Certain system
+calls, that need more parameter than fit into the CPU registers
+can be called not only via jumptable but also via the SEND interface.
+For this, the -1 ($ff) is used for system calls. -2 ($fe) is
+used for the file system manager. -3 to -12 ($fd-$f4) can be
+mapped to any other task by the TDUP system call. -3 is reserved
+for an error exception handler and -4 for a timer task. Messages
+to these task numbers are internally redirected to the registered task.
+
+As the 6502 CPU has no idea about atomic operations, semaphores have to
+be provided by the system to allow mutex constructs
+(Well, there are atomic instructions, like INC or the shift opcodes. But
+then there is - in not-CMOS versions - no test-and-set). Semaphores
+can be allocated using GETSEM
+and released with FRESEM. Then with a PSEM operation on a certain
+semaphore a task can enter a critical region of the program. All other
+tasks block when they try to do the same PSEM operation. Only after
+a VSEM on the semaphore another task waiting in a PSEM is revived
+and can enter the critical region.
+Negative semaphore numbers cannot be allocated but can be used as some kind
+of system semaphores. What they mean has yet to be defined, though.
+
+Signal handling consists of a single system call. With the carry flag
+cleared, the calling task is blocked until a specified signal is received.
+With the carry flag set, a signal is sent. Only listening tasks receive
+the signal.
+
+Disks are
+administered as drives, as a virtual filesystem with mounts etc
+would have been to much for this system.
+The filesystem manager should actually be another task and is in the
+kernel only for performance and resource limitation reasons.
+The TDUP interface would provide an easy way to register a filesystem manager,
+if it were an extra task.
+But then the used filesystem manager just redirects the send message
+'on the fly'. An extra task would have to receive the message,
+redirect it and send it to the filesystem task - blocking until
+the message is taken over!
+
+When a filesystem task, e.g. for IBM PC disks, is started, it registers
+itself with the filesystem manager by sending an appropriate message
+to task -2 ($fe). The filesystem then knows about how many drives are
+supported by the filesystem and adds them to its list. A request to, e.g.
+open a file is sent to the filesystem manager. From the drive number
+the file system manager knows to which task to redirect the message.
+It also remaps the drive number to the ones used in the filesystem
+task.
+
+Once a read-only or write-only file is opened, all communication takes
+place via streams. Another interface, using read and write messages
+is planned, but has not yet been implemented. Some filesystems (like
+fsiec for Commodore floppy drives) wouldn't even support it.
+
+The standard library of OS/A65 v1 has been replaced by the
+lib6502.
+The so called standard library is a set of
+subroutines that tasks may
+map into their memory or not. The library is below the
+I/O area, at $e800. Directly below $e800 the jumptable for the
+library is located. All routines run in task space, and have no
+connection to the kernel, except for calling normal system calls.
+
+All filesystem tasks use a common Filesystem
+Interface to communicate with other tasks. The SEND/RECEIVE
+calls are used to open files, while the Streams are used to transfer the
+data. The filesystem manager redirects the SENDs to the right
+filesystem tasks automatically.
+
+The device filesystem provides an easy interface to devices, in allowing
+them to be used as files. A request to open the device, for example,
+is served by calling the appropriate DEVCMD commands.
+
+fsdev also provides an easy interface to the ROM structure. The
+programs stored in the system can be started from there. They cannot
+be read, as only a header is being provided. This header, when used
+to start the program, remaps the ROM into the task memory. This way
+one need not move all the program through the stream interface.
+
+This filesystem can be used in two directions. First it provides an
+interface for CS/A to access Commodore disk drives on an IEEE 488
+interface. Reading directories as well as renaming and deleting files and
+formating and checking disks is supported.
+
+The other way around with fsiec the CS/A computer can be used as a disk
+drive for Commodore computers. The filesystem drives are mapped to the
+drives 0-? of a single drive unit on the IEEE 488 bus. In addition to the
+standard IEC floppy commands directory handling is supported. For
+programs that only understand one drive, drives can be remapped with
+assign.
+
+The FAT filesystem is used to control and handle PC-style formatted disks
+on standard PC disk drives on the CS/A floppy board. Several
+3.5" and 5.25" formats are supported, up to 1.44 MByte 3.5" HD disks.
+As hardware a WD1770 floppy controler at address $e8e0 is used. A 6522 VIA
+at $e8f0 provides some additional control lines for drive select, motor on,
+etc.
+
+For those who remember: I wrote the program 'bdos' for the german 64er
+magazin, which allowed the C128 to read and write PC disks. fsibm
+has not a byte of code from this project, instead it is completely
+rewritten.
+
+One flaw of this filesystem is that it assumes it has the floppy
+controller for itself. So there is no way to share it, e.g.
+with a disk monitor. The next revision should define a semaphore
+for this.
+
+The shell is a command line interpreter that
+provides an easy to use interface to the system. A scripting language is
+not available, though. For external commands and some internal commands
+like DIR and more I/O redirection is possible. I.e. that the STD*
+streams can be redirected to a file or even piped to other programs.
+
+'mon' is a full featured 6502 assembly and
+machine language monitor. Among the usual standard commands other
+features like, for example, relocating 6502 in a certain area or
+searching for opcodes with specified addressing modes is possible.
+
+The BASIC interpreter is an extended Commodore
+Basic V2 interpreter as found in the C64. In fact it is de-assembled
+from the C64 and patched to make it work on CS/A. In addition, some
+commands have been changed and new commands have been added, amongst
+them the Commodore Basic V4 commands. In contrast to the C64 basic
+interpreter, it runs in multitasking and you can quit ;-)
+
+The used CPU is a quite old one: the MOS 6502 or one of its clones,
+like the Rockwell R65C02, for example. This 8 bit CPU has been designed
+in the early 70s (?) but is still in use. The Rockwell modem chipset,
+for example, is based on a R65C02 core. The CPU has one general purpose
+8 bit register, the accumulator. Two 8 bit index registers, x and y, help with
+addressing modes. The PC is 16 bit wide, as is the address bus to the
+outside of the chip. The stack pointer is only 8 bit, thus confining
+the stack to the area $01xx in memory. The so called zeropage ($00xx)
+is used with special addressing modes to allow smaller code and
+faster execution times by leaving out the address high byte.
+An 8 bit status register completes the register set.
+
+The hardware interface is quite simple. In fact it is compatible to the
+motorola 6800 series chips. Commodore lost a lawsuit started by Motorola
+where commodore
+was forbidden to use the number 6500 (or was it 6501) and the same
+pinout as the 6800 chip, thus making it a plug in replacement for the
+Motorola chip. But then they could use the hardware interface,
+though. Which means that one can simply use any 68xx interface chip
+with a 6502 and vice versa.
+
+Phi2 is the CPU clock output. During Phi2 high all address lines and
+the read/write line are valid. Data is given on the data bus for write
+somewhere in the middle of Phi2 high and it stays valid until the
+Phi2 high-low transition. During read the data lines are latched
+at the same transition. The CPU always reads some memory addresses,
+even if its really doing something else.
+
+/RESET, /NMI and /IRQ are the most important input lines. They are
+low active and the I/O chips have open collector outputs so that
+they can be wire-or'd together.
+
+The hardware consists of several boards, connected by a 64 pin
+bus interface (DIN 41612, rows a+c). On the bus are 20 address
+lines and 8 data lines. /NMI, /IRQ, /RESET, /SO, RDY, SYNC and R/W
+are the usual (buffered) 6502 control lines. Phi0, Phi1 and Phi2
+are on the bus as well as a 2Phi2, which is a frequency doubled
+phi2. Each low-high transition on 2Phi2 gives a
+transition on Phi2. This can, for example, directly be connected
+to /RAS of dynamic RAMs.
+
+The CPU boards detects any access to a 4 or 2 kByte sized Area
+from $e000 or $e800 to $efff and automatically selects the bus
+line /IOSEL, and /MEMSEL otherwise. This way a simple 8 bit
+compare with, for example, a single 74688 with the address
+lines A4 to A11 selects a 16 byte I/O window for any interface
+chip.
+/IOINH(ibit) disables this feature, but therefore the I/O
+memory has to be detected from normal memory access
+(via /MEMSEL) and /EXTIO be activated therefore from an
+external circuit.
+(Well, the next revision should see /IOSEL as an open collector
+output...)
+
+All interface circuits, even including the MMU on the CPU
+board, are connected to the bus lines. The CPU
+can be cut off from the bus with /BE, thus allowing other
+CPUs or bus masters to take the bus and even access the MMU.
+The CPU has to be shutdown with
+RDY for this, though.
+
+The 74ls610 (used to be on the COCOM list, haha...) is
+a set of 16 12 bit registers, where only 8 bit are used
+here. During Phi2 low the CPU address lines A12 to A15
+are used to select the appropriate register and latch its
+contents to the output address lines A12-A19. Unfortunately
+this chip is quite slow (I'd say that a hand-constructed thing
+would be much faster...) so that for 2 MHz CPU clock
+a 4 MHz (CMOS) CPU has to be used.
+During Phi2 high the I/O access
+to read and write the registers from the bus takes place.
+At RESET the MMU is set to 'through' mode, i.e. the
+CPU address lines A12 to A15 are passed through and
+A16 to A19 are left zero, to allow a defined RESET
+condition. The first I/O write on the MMU registers
+then enables it.
+Then the CPU memory is divided into 16 4 kByte blocks, that
+can each be mapped from one of the 256 4 kByte Blocks in the
+1 MByte bus address space by setting the MMU registers.
+
+
+The video board has 64 kByte dynamic RAM that is used as
+video and CPU memory and a 6545/6845 video CRT controller.
+The memory access is twice as fast as the CPU access, so that
+during Phi2 low the video readout is done and at Phi2 high
+the usual CPU access takes place. The lowest address bits
+are connected to the row, so that the video access
+automatically refreshes the RAM. With 1 MHz CPU clock
+40 columns are displayed, with 2 Mhz 80 columns can
+be seen. The CRT is located at $e880 in I/O space, and
+a write only control port at $e888. This port gives the
+missing address lines A14 and A15 for the CRT, 2 bits
+to select the charset (located in an EPROM on the board
+that can not be read by the CPU) and 2 bits to invert
+the HSYNC and VSYNC signals if necessary.
+The last used bit maps the CRT row select lines
+RA0 and RA1 (that normally select the character row
+in the charset)
+to the RAM/CPU address lines A12 and A13. This way -
+and with a 1 to 1 charset - some high
+resolution mode with 640x200 pixel is possible, with
+a rather strange memory map, though.
+This is necessary due to the 127 row limit in the CRT.
+
+An IEEE 488 board with a 6821 PIA at $e82x and a 6522 VIA
+at $e84x makes up a mostly Commodore PET 3032 compatible
+IEEE 488 interface. The PIA is used for the data transfer,
+while the VIA port A is used for the control lines.
+VIA port B controls a Commodore serial IEC bus interface.
+Both interfaces can be used as master or slave, i.e.
+the have the circuitry to set NRFD/NDAC on the IEEE 488
+and the DATA (?) line on the serial bus, if ATN on the bus
+is set. So the master can see that there is a device on
+the bus, even if it isn't ready to serve the request.
+VIA CA2 can be externally connected to the
+video card to allow PET compatible switching between
+upper/lowercase and uppercase/graphics charset.
+VIA CB2 drives, PET compatible of course, a piezo beeper ;-)
+
+At $e810-$e817 is, as in a PET, a 6821 PIA to handle the
+keyboard, while on the same board, at $e818-$e81f, a
+6551 ACIA (which is not in a PET ;-) to handle a serial
+interface is located.
+
+The same ACIA is also located on the BIOS board, that also contains
+32k ROM and 32k RAM that make up the lowest 64 kByte of the
+Megabyte bus address space. This BIOS card together with
+the CPU makes up a complete computer. The ACIA is at $efe8-$efef,
+while at $efe0 a control port is located.
+One bit allows the detection of an IRQ (e.g. to stop the irq
+routine if all interrupts are served), two others are used
+to control and sense a 50 Hz (line frequency in Europe, which
+is put on the bus by the power supply) interrupt.
+Two other bits control the /IOINH line and allow the I/O address
+space to be located in $0e000-$0effff in bus (!) address space,
+so that it can be mapped anywhere in CPU address space.
+
+On the floppy board a WD 1770 (like in the Commodore
+VC1571) chip at $e8fx can control PC compatible disk drives.
+A 6522 VIA at $e8fx supplies the timers and some additional
+I/O lines and also gives a simple 8 bit parallel interface
+(for e.g. printers).
+
+A special interface board emulates a 6502 in another computer
+(restricted to 1 MHz or below). A 40 line cable is used
+to connect the socket for the 6502, e.g. in a VC1541, with the
+board. The 64 kByte address space of this VC1541 is then
+mapped into the bus address space $02000-$02ffff. So you can,
+for example, test new ROMs by putting the new ROM image in
+the CS/A RAM and then remapping it for the old ROMs.
+
+The C64 uses 8 select lines to select the keyboard rows.
+The return value is then read in by 8 column port lines.
+This simply is a RAM readout scheme - so that a
+RAM can simulate a keyboard for the C64.
+The keyboard simulator board provides such a RAM. It can
+be written or read by the CPU during Phi2 high, and the
+row select address from the C64 is read at Phi2 low and
+latched. So, for example, the C64 can be controlled remotely.
+
+Currently two ports have been done. One is a port to the CS/A65 without
+MMU, to use it in embedded applications I had in mind. The other one
+is the C64 port.
+
+The port to a system without MMU is one of the more difficult.
+The problem is, that global variables cannot be mapped to different
+physical memory locations for different tasks. So this has to be
+avoided. Unfortunately there are global variables used to communicate
+with the kernel nearly everywhere. So these variables have to be
+protected by semaphores. Another thing is that a binary can normally
+only be invoced once. All variables would otherwise be the same for all
+invocations and running different tasks on them would normally
+give a real mess. More on this issue can be found in
+nommu.html.
+
+After porting it to a system without MMU, there was only a small step
+porting it to the C64. The first implementation used the Commodore
+parallel IEEE488 interface, as it's easier to program - and simulate
+in an emulator... But after all, it has the same deficiencies as any
+other system without MMU. More details on the actual implementation
+can be found in README.c64.
+On the other hand, to be really useful without an MMU besides
+embedded applications, some things are still missing.
+A program relocator, for example, would make it much easier in that
+the applications don't have to be assembled to a certain memory area.
+Instead they could be relocated to some free memory when being loaded.
+
+The C128, for example, would surely be a good candidate for a new
+version: It can map the zeropage and the stack anywhere in memory and
+can thus have different ones for each task. In addition to this, a
+relocator would have to be implemented, to be able to load programs to
+any address. The (to be implemented new) memory manager then has to
+keep track of which memory is used for each program. If one says that
+read/write memory (i.e. global variables, except zeropage) should only
+be dynamically allocated, one could even use shared read only binaries.
+I.e. several invocations would only use one copy of the binary while
+running. Global variables used would be global to all invocations,
+giving some kind of task shared memory. A flag in the file header could
+indicate the relocator and/or shared binary mode.
+
+Well, a next version is not planned currently. But then the whole
+stuff is under the GNU public license and could be used by anyone.
+
+The new binary format with relocation would surely justify a jump
+to version 1.4. This would make it much more usable for the C64. But
+for this not only the relocator has to be written, but also the assembler
+has to be changed to write out a relocatable file format.
+This would also imply an extended memory manager, that keeps track
+which memory is used by which task. And it would also use a smaller
+block size than 4kByte.
+
+Well, there used to be some very few spurious BRK executions in a task.
+That's why I reduced the maximum number of tasks from 6 to 5, increasing
+the individual stack size to 40. The previously smaller stack size of
+32 seemed to cause this problem, which seems to be gone now. The problem
+is that a normal
+interrupt alone needs 10 bytes on each tasks stack - one can reduce
+that, but with some effort only.
+When pressing the return key, sometimes the invers cursor stays on the
+screen, causing the program to give a syntax error or whatsoever
+when it reads a $a0 from its input stream.
+
+But other than that, none. But I haven't tested the C64 version
+as much as the one for my selfbuilt computer. So there might still
+be bugs in the serial bus handling or in the stuff special to computers
+without MMU.
+
+Ok, when starting up the ROM, the initial tasks are set up and then the
+scheduler is started. This might cause problems when e.g. a filesystem
+is not fast enough detecting its drives during the first scheduled
+timeslice. Another filesystem might come in between so that the drive
+numbers could be assigned in a different order.
+
+Possible improvements are:
+
+
A malloc() equivalent, that could be located in the STDIO lib.
+At least some kind of sbrk() call we already have in the kernel.
+
A relocator to be able to load binaries to different memory locations,
+esp. for the versions without an MMU.
+
There currently is no way to handle shared memory (in the MMU version)
+in a generalized manner. I think of somethink like a Unix (Linux) mmap()
+equivalent.
+
The data transfer via streams is quite slow. Another interface
+to handle block transfer would surely improve things. Something like
+'copy memory from task A, address x length l to task B, address y'.
+
Starting a new task from within the shell is way too slow. Reading
+a file and writing it to another environments memory with the WRITE
+system function takes its time. Instead the shell should just load a small
+loader program into the new environment. This then reads the program
+from the stream and executes it.
+
+
+
diff --git a/dump/oa-2.0.9/doc/oldlib.html b/dump/oa-2.0.9/doc/oldlib.html
new file mode 100644
index 0000000..9d20c72
--- /dev/null
+++ b/dump/oa-2.0.9/doc/oldlib.html
@@ -0,0 +1,59 @@
+
+ OS/A65 Standard Library
+
+
OS/A65 Standard Library
+
(c) 1989-98 Andre Fachat
+
+
+The CS/A65 standard library is a set of routines that run in user space and
+can be called if the appropriate memory page ($e000-$e7ff) is mapped in
+from the system ROM (at $0e000 bus address space).
+The zeropage addresses $10-$28 are being used by the library at this
+time.
+
+$e7fd Fgetc Get a byte from a stream, and wait until the byte is ready,
+ using YIELD. parameter: stream number in x, returns
+ the read byte in a
+$e7fa Fputc Write a byte on a stream, waiting until it can be delivered
+ parameter: stream number in x, data byte in a
+$e7f7 Getc same as Fgetc, for STDIN
+$e7f4 Putc same as Fputc, for STDOUT
+$e7f1 Txtout Write a null terminated string up to 254 byte to STDOUT
+ parameter: a/y=address of string (a=lowbyte, y=highbyte)
+$e7ee Hexout Write a byte to STDOUT in hex. parameter: byte in a
+$e7eb Crlfout Write carriage return and line feed to STDOUT
+$e7e8 Serbrk reads the status of STDIN and tests if it is E_SEMPTY
+ If it is, carry is cleared, otherwise it is set.
+$e7e5 Dezbout writes a byte in decimal to STDOUT
+$e7e2 Assign handles a 10 byte table, that is e.g. used to implement
+ the assign command in fsiec
+ (carry=0): reads a table entry. parameter: table index in x,
+ returns new value in x (a and y are preserved)
+ (carry=1, x<0): initialize table with a[i]=i
+ (carry=1, 0<=x<10): write new table value
+ parameter: table index in x, new value in a
+$e7df Getname reads a string from memory and tries to interpret it as
+ a filename (with possibly leading 'drive:' and paths...)
+ leading spaces are ignored. The filename is saved in
+ PCBUF+FS_OPEN_NAME. If a drive is given, it is put
+ into PCBUF+FS_OPEN_DRV. Otherwise this is set to -1
+ parameter: a/y=address of string, returns PCBUF+...
+$e7de Chdir takes the contents of PCBUF+FS_CMD_* and interprets it as
+ a 'change directory' operation, to be done to a given
+ path. "." and ".." are interpreted as usual.
+ parameter: a/y=address of path, x maximal length of path
+$e7d9 Usedir Takes a path and applies it to a filename in PCBUF.
+ If the filename in PCBUF contains a drive or an absolut
+ filename is given, nothing is done. Otherwise the
+ the path is put in front of the filename and is put
+ into PCBUF again. The path is not changed. "." and ".."
+ are not removed here.
+ parameter: a/y=address of path, PCBUF+...
+ returns new filename in PCBUF+...
+$e7d6 Set2name copies a string into PCBUF
+ parameter: a/y=address of null terminated string,
+ position the name has to be copied to in PCBUF in x.
+
+
+The shell reads its commands from STDIN line by line and executes them.
+First internal commands are compared with the input. Then, if no
+internal command has been found, the actual directory is searched
+for the file to be executed. The file is then loaded and executed
+in its own environment. The shell waits for its completion, if the
+command line is not ended with an ampersand '&'. Then the command
+is executed in the background. The STD* streams can be redirected
+with "<", ">", "!" for STDIN, STDOUT and STDERR respecitvely.
+A "|" between two external comands pipes the STDOUT of the first
+program to the STDIN of the second command.
+
+Shell commands:
+
+x: sets drive to 'x:'
+DIR d:name?.* shows directory
+TYPE filename print file on STDOUT
+DEL filename delete file
+FORMAT/x d:name format disk in drive d:, format x (which is a
+ number, see fsibm), and gives it a the name
+ 'name'.
+CHKDSK d: check disk
+RENAME name1 name2 renames 'name1' to 'name2'
+B filename
+BATCH filename Switches STDIN to filename, until an EOF is
+ read, then returns to normal STDIN
+MONITOR switch to machine language monitor
+LOGOFF exit shell
+COPYCON filename writes the terminal input to a file, until
+ a line with a "@" is read.
+DUP >file1 <file2 !file3
+ redirects STDOUT to file1, STDIN to file2, and
+ STDERR to file3. STDOUT and STDERR can be redirected
+ to the same file with ">!".
+CHDIR newdir
+CD newdir change to a new directory
+DEVCMD dev cmd par calls the DEVCMD kernel call. The device is given
+ as name, cmd as one of IRQ, RES, GETSTR, PUTSTR,
+ RXON, RXOFF, TXON, TXOFF, SPEED, HANDSHAKE, STATUS
+ and EXIT.
+COPY file1 file2 copy file1 to file2 in background
+ (for multiple files better use mcopy, as
+ copying in the background eats up system resources
+ if too many files are copied)
+GETSTR get a free stream
+FRESTR x release the stream
+SETMEM x set memory size of task to x times 4kByte
+INFO prints the information given by GETINFO kernel
+ call bug: currently only ten tasks are printed
+ due to earlier revision restrictions.
+KILL x kill task x
+MKDIR dirname make a new directory
+RMDIR dirname remove a directory
+ROM filename reads memory mapping information (like the OS/A65
+ ROM boot entry) and starts the file from ROM.
+