diff --git a/BaS_GNU/BaS_GNU/.cproject b/BaS_GNU/BaS_GNU/.cproject
index c52737e..95711f6 100644
--- a/BaS_GNU/BaS_GNU/.cproject
+++ b/BaS_GNU/BaS_GNU/.cproject
@@ -39,14 +39,9 @@
-
-
-
-
-
@@ -57,6 +52,9 @@
+
+
+
diff --git a/BaS_GNU/BaS_GNU/.project b/BaS_GNU/BaS_GNU/.project
index 95d4b1c..2f0d4f5 100644
--- a/BaS_GNU/BaS_GNU/.project
+++ b/BaS_GNU/BaS_GNU/.project
@@ -17,10 +17,6 @@
org.eclipse.cdt.make.core.append_environment
true
-
- org.eclipse.cdt.make.core.autoBuildTarget
- all
-
org.eclipse.cdt.make.core.buildArguments
@@ -30,8 +26,8 @@
make
- org.eclipse.cdt.make.core.cleanBuildTarget
- clean
+ org.eclipse.cdt.make.core.buildLocation
+ ${workspace_loc:/BaS_GNU}
org.eclipse.cdt.make.core.contents
@@ -49,17 +45,13 @@
org.eclipse.cdt.make.core.enableFullBuild
true
-
- org.eclipse.cdt.make.core.fullBuildTarget
- all
-
org.eclipse.cdt.make.core.stopOnError
true
org.eclipse.cdt.make.core.useDefaultBuildCmd
- true
+ false
diff --git a/BaS_GNU/BaS_GNU/Makefile b/BaS_GNU/BaS_GNU/Makefile
index cf9bdb7..b41eec9 100644
--- a/BaS_GNU/BaS_GNU/Makefile
+++ b/BaS_GNU/BaS_GNU/Makefile
@@ -18,7 +18,7 @@ CC=$(TCPREFIX)gcc
LD=$(TCPREFIX)ld
INCLUDE=-Iinclude
-CFLAGS=-mcpu=5474 -Wno-multichar -Os -fomit-frame-pointer
+CFLAGS=-mcpu=5474 -Wall -Wno-multichar -Os -fomit-frame-pointer
SRCDIR=sources
OBJDIR=objs
diff --git a/BaS_GNU/BaS_GNU/flash.lk b/BaS_GNU/BaS_GNU/flash.lk
index d474d16..84ef261 100644
--- a/BaS_GNU/BaS_GNU/flash.lk
+++ b/BaS_GNU/BaS_GNU/flash.lk
@@ -3,13 +3,9 @@ MEMORY {
}
SECTIONS {
- _Bas_base = ABSOLUTE(0x1FE00000);
-
- /* Board Memory map definitions from linker command files:
- * __SDRAM,__SDRAM_SIZE, __CODE_FLASH, __CODE_FLASH_SIZE
- * linker symbols must be defined in the linker command file.
- */
-
+ _Bas_base = ABSOLUTE(0x1FE00000);
+ _tos_base = ABSOLUTE(0xe00000);
+
/* Init CS0 (BootFLASH @ E000_0000 - E07F_FFFF 8Mbytes) */
___BOOT_FLASH = ABSOLUTE(0xE0000000);
___BOOT_FLASH_SIZE = ABSOLUTE(0x00800000);
@@ -20,12 +16,6 @@ SECTIONS {
/* VIDEO RAM BASIS */
__VRAM = ABSOLUTE(0x60000000);
- /*
- * MCF5475 Derivative Memory map definitions from linker command files:
- * __MBAR, __MMUBAR, __RAMBAR0, __RAMBAR0_SIZE, __RAMBAR1, __RAMBAR1_SIZE
- * linker symbols must be defined in the linker command file.
- */
-
/* Memory mapped registers */
__MBAR = ABSOLUTE(0xFF000000);
__MMUBAR = ABSOLUTE(0xFF040000);
diff --git a/BaS_GNU/BaS_GNU/sources/BaS.c b/BaS_GNU/BaS_GNU/sources/BaS.c
index 77f12ff..9acab54 100644
--- a/BaS_GNU/BaS_GNU/sources/BaS.c
+++ b/BaS_GNU/BaS_GNU/sources/BaS.c
@@ -9,6 +9,7 @@
#include "startcf.h"
extern uint32_t Bas_base[];
+extern uint8_t tos_base[];
/* imported routines */
extern int mmu_init();
@@ -64,9 +65,9 @@ void wait_1us(void)
void BaS(void)
{
int az_sectors;
- int sd_status,i;
+ int i;
uint8_t *src;
- uint8_t *dst;
+ uint8_t *dst = tos_base;
uint32_t *adr;
az_sectors = sd_card_init();
@@ -113,7 +114,7 @@ copy_firetos:
}
}
- if (!DIP_SWITCH & (1 << 6)) /* switch #6 on ? */
+ if (!(DIP_SWITCH & (1 << 6))) /* switch #6 on ? */
{
if (MCF_PSC3_PSCRB_8BIT == 0x81)
{
diff --git a/BaS_GNU/BaS_GNU/sources/exceptions.S b/BaS_GNU/BaS_GNU/sources/exceptions.S
index a8ab724..e1331fd 100644
--- a/BaS_GNU/BaS_GNU/sources/exceptions.S
+++ b/BaS_GNU/BaS_GNU/sources/exceptions.S
@@ -1,6 +1,6 @@
-/********************************************************/
-/* exception vectoren intialisieren
-/********************************************************/
+/*
+ * initialize exception vectors
+ */
#include "startcf.h"
@@ -287,9 +287,9 @@ no_protect_vectors:
lea timer0(pc),a1
move.l a1,0x1f8(a0)
rts
-/********************************************************/
-/* exception vector routinen
-/********************************************************/
+/*
+ * exception vector routines
+ */
vector_table_start:
std_exc_vec:
move.w #0x2700,sr // disable interrupt
@@ -609,9 +609,10 @@ sev_sup6:
movem.l (a7),d0/a5 // register zur�ck
rts
blinker:.long 0
-/**************************************************/
-/* pseudo dma */
-/**************************************************/
+
+/*
+ * pseudo dma */
+ */
acsi_dma: // atari dma
move.l a1,-(a7)
move.l d1,-(a7)
@@ -672,9 +673,9 @@ acsi_dma_end:
move.l (a7)+,d1
move.l (a7)+,a1
rts
-/**************************************************/
-/* irq 7 = pseudo bus error */
-/**************************************************/
+/*
+ * irq 7 = pseudo bus error */
+ */
irq7:
lea -12(sp),sp
movem.l d0/a0,(sp)
@@ -696,9 +697,9 @@ irq7:
move.l (sp)+,a0
rts // Forward to the Access Error handler
-/**************************************************/
-/* psc3 com PIC MCF */
-/**************************************************/
+/*
+ * psc3 com PIC MCF */
+ */
psc3:
move.w #0x2700,sr // disable interrupt
lea -20(a7),a7
@@ -734,9 +735,10 @@ psc3_fertig:
movem.l (a7),d0-d2/a0/a3 // register zur�ck
lea 20(a7),a7
RTE
-/**************************************************/
-/* timer 0: video change later also others
-/**************************************************/
+
+/*
+ * timer 0: video change later also others
+ */
timer0:
move #0x2700,sr
// halt
diff --git a/BaS_GNU/BaS_GNU/sources/mmu.S b/BaS_GNU/BaS_GNU/sources/mmu.S
index a95b47f..d268e70 100644
--- a/BaS_GNU/BaS_GNU/sources/mmu.S
+++ b/BaS_GNU/BaS_GNU/sources/mmu.S
@@ -1,6 +1,6 @@
-/********************************************************************/
- /* INIT ACR und MMU /*
-/********************************************************************/
+/*
+ * INIT ACR and MMU
+ */
#include "startcf.h"
@@ -177,9 +177,9 @@ _mmu_init:
nop
rts
-/********************************************************************/
- /* MMU table search /*
-/********************************************************************/
+/*
+ * MMU table search
+ */
_mmutr_miss:
bsr cpusha
and.l #0xFFF00000,d0
diff --git a/BaS_GNU/BaS_GNU/sources/sd_card.c b/BaS_GNU/BaS_GNU/sources/sd_card.c
index 7295ec2..f49f373 100644
--- a/BaS_GNU/BaS_GNU/sources/sd_card.c
+++ b/BaS_GNU/BaS_GNU/sources/sd_card.c
@@ -19,7 +19,7 @@ uint8_t sd_com(uint32_t cmd)
uint8_t res;
MCF_DSPI_DTFR = cmd;
- while (! MCF_DSPI_DSR & (1 << 7));
+ while (! (MCF_DSPI_DSR & (1 << 7)));
res = MCF_DSPI_DRFR;
MCF_DSPI_DSR = -1L;
@@ -87,9 +87,10 @@ void sd_card_idle(void)
int sd_card_init(void)
{
-
- long az_sectors;
+ return 0; /* for now, just to make the compiler happy */
#ifdef _NOT_USED_
+ long az_sectors;
+
asm
{
lea MCF_PSC0_PSCTB_8BIT,a1
diff --git a/BaS_GNU/BaS_GNU/sources/supervisor.S b/BaS_GNU/BaS_GNU/sources/supervisor.S
index 5e20f85..b3502aa 100644
--- a/BaS_GNU/BaS_GNU/sources/supervisor.S
+++ b/BaS_GNU/BaS_GNU/sources/supervisor.S
@@ -1,6 +1,6 @@
-/********************************************************/
-/* user/supervisor handler
-/********************************************************/
+/*
+ * user/supervisor handler
+ */
#include "startcf.h"
@@ -33,7 +33,7 @@ _privileg_violation:
lea _rt_mod,a0 // zugriff setzen
tst.b (a0) // vom rt_supervisormodus?
bne pv_work // ja->
-// tatsächlich privileg violation
+// tats�chlich privileg violation
mov3q.l #-1,(a0) // sr_mod setzen
move.l usp,a5 // usp holen
move.l a5,8(a0) // sichern
@@ -52,7 +52,7 @@ _privileg_violation:
move.l 12(a0),a5 // rt_vbr
lea 0x18(a5),a5 // vector
move.l (a5),16(a7) // vector privileg violation
- movem.l (a7),d0/a0/a5 // register zurück
+ movem.l (a7),d0/a0/a5 // register zur�ck
lea 12(a7),a7
rte
// privileg violation
@@ -149,7 +149,7 @@ pv_a7_usp: move.l 4(a0),a5 // rt_ssp -> a5
pv_ax_usp:
move.l a5,8(a0) // usp -> rt_usp
addq.l #2,16(a7) // next
- movem.l (a7),d0/a0/a5 // register zurück
+ movem.l (a7),d0/a0/a5 // register zur�ck
lea 12(a7),a7
rte
// usp->a0
@@ -175,7 +175,7 @@ pv_usp_a6:
move.l a5,a6
pv_usp_ax:
addq.l #2,16(a7) // next
- movem.l (a7),d0/a0/a5 // register zurück
+ movem.l (a7),d0/a0/a5 // register zur�ck
lea 12(a7),a7
rte
// rte
@@ -196,7 +196,7 @@ pv_rte:
move.l 8(a0),a5 // rt_usp holen
pv_rte_sup:
move.l a5,usp // usp setzen
- movem.l (a7),d0/a0/a5 // register zurück
+ movem.l (a7),d0/a0/a5 // register zur�ck
lea 12(a7),a7
rte
// stop
@@ -241,7 +241,7 @@ stop7:
stop #0x2700
stop_weiter:
addq.l #4,16(a7) // next
- movem.l (a7),d0/a0/a5 // register zurück
+ movem.l (a7),d0/a0/a5 // register zur�ck
lea 12(a7),a7
rte
// movec ???????
@@ -335,7 +335,7 @@ pv_46:
move.b 1(a5),d0
cmp.b #0xfc,d0 //#d16->sr
beq im_sr //ja->
-//move dx->sr (sr und rt_mod ist supervisor sonst wäre es privileg violation
+//move dx->sr (sr und rt_mod ist supervisor sonst w�re es privileg violation
cmp.b #0xc0,d0 //d0->sr?
bne d1_sr //nein->
move.w 2(a7),d0 //hier ist d0 gesichert
@@ -389,7 +389,7 @@ pv_set_sr_end:
move.l a5,usp // setzen
pv_sre2:
move.w d0,14(a7) // sr setzen
- movem.l (a7),d0/a0/a5 // register zurück
+ movem.l (a7),d0/a0/a5 // register zur�ck
lea 12(a7),a7
rte
// code 0x40xx *****************************************
@@ -442,7 +442,7 @@ nsr_d7:
halt
sr_dx_end:
addq.l #2,16(a7) // next
- movem.l (a7),d0/a0/a5 // register zurück
+ movem.l (a7),d0/a0/a5 // register zur�ck
lea 12(a7),a7
rte
// strldsr
@@ -577,7 +577,7 @@ cfa_setloop:
move.l _rt_cacr,d0 // holen
movec d0,cacr // setzen
move.w d2,sr // alte interrupt maske
- movem.l (a7),d0-d2/a0 // register zurück
+ movem.l (a7),d0-d2/a0 // register zur�ck
lea 16(a7),a7
rts
diff --git a/BaS_GNU/BaS_GNU/sources/sysinit.c b/BaS_GNU/BaS_GNU/sources/sysinit.c
index afa1d53..3e5b670 100644
--- a/BaS_GNU/BaS_GNU/sources/sysinit.c
+++ b/BaS_GNU/BaS_GNU/sources/sysinit.c
@@ -223,7 +223,7 @@ void init_fpga(void)
MCF_GPIO_PODR_FEC1L |= (1 << 1);
MCF_GPIO_PODR_FEC1L |= (1 << 2);
- while ((!MCF_GPIO_PPDSDR_FEC1L & (1 << 0)) && (!MCF_GPIO_PPDSDR_FEC1L & (1 << 5)));
+ while ((! (MCF_GPIO_PPDSDR_FEC1L & (1 << 0))) && (! (MCF_GPIO_PPDSDR_FEC1L & (1 << 5))));
wait_10us();
MCF_GPIO_PODR_FEC1L |= (1 << 2);
@@ -273,7 +273,7 @@ void init_fpga(void)
MCF_GPIO_PODR_FEC1L |= 1;
MCF_GPIO_PODR_FEC1L &= ~1;
}
- } while ((!MCF_GPIO_PPDSDR_FEC1L & (1 << 5)) && (fpga_data < FPGA_FLASH_DATA_END));
+ } while (!(MCF_GPIO_PPDSDR_FEC1L & (1 << 5)) && (fpga_data < FPGA_FLASH_DATA_END));
if (fpga_data < FPGA_FLASH_DATA_END)
{
@@ -460,10 +460,10 @@ void init_PCI(void) {
/* Configure Initiator Windows */
/* initiator window 0 base / translation adress register */
- MCF_PCI_PCIIW0BTAR = PCI_MEMORY_OFFSET + ((PCI_MEMORY_SIZE -1) >> 8) & 0xffff0000;
+ MCF_PCI_PCIIW0BTAR = (PCI_MEMORY_OFFSET + ((PCI_MEMORY_SIZE -1) >> 8)) & 0xffff0000;
/* initiator window 1 base / translation adress register */
- MCF_PCI_PCIIW1BTAR = PCI_IO_OFFSET + ((PCI_IO_SIZE - 1) >> 8) & 0xffff0000;
+ MCF_PCI_PCIIW1BTAR = (PCI_IO_OFFSET + ((PCI_IO_SIZE - 1) >> 8)) & 0xffff0000;
/* initiator window 2 base / translation address register */
MCF_PCI_PCIIW2BTAR = 0L; /* not used */
@@ -725,6 +725,8 @@ void init_ac97(void) {
if ((va & 0x80000fff) == 0x80000800) {
vb = MCF_PSC2_PSCTB_AC97;
vc = MCF_PSC2_PSCTB_AC97;
+
+ /* FIXME: that looks suspicious */
if ((va & 0xE0000fff) == 0xE0000800 & vb == 0x02000000 & vc == 0x00000000) {
goto livo;}
}