Newer
Older
uBix-Retro / dump / oa-2.0.9 / arch / csa65 / csarom2.a65
/****************************************************************************
   
    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
	.)