mirror of
https://github.com/rdolbeau/NuBusFPGA.git
synced 2024-06-02 03:41:29 +00:00
rework build system
This commit is contained in:
parent
17a9aebd78
commit
4468ffd68c
|
@ -51,6 +51,3 @@ ChunkyIndexed = 0
|
||||||
ChunkyDirect = 16
|
ChunkyDirect = 16
|
||||||
|
|
||||||
defVersion = 0 /* Version = 0 */
|
defVersion = 0 /* Version = 0 */
|
||||||
|
|
||||||
ROMSize = 0x1000 /* 4K byte ROM */
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
AS=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-as
|
AS=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-as
|
||||||
CC=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-gcc
|
CC=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-gcc
|
||||||
|
LD=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-ld
|
||||||
|
STRIP=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-strip
|
||||||
OBJCOPY=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-objcopy
|
OBJCOPY=/home/dolbeau/Retro68/build/toolchain/bin/m68k-apple-macos-objcopy
|
||||||
HOSTCC=gcc
|
HOSTCC=gcc
|
||||||
HOSTCFLAGS=-O2
|
HOSTCFLAGS=-O2
|
||||||
|
@ -29,81 +31,31 @@ gen_mode: gen_mode.c
|
||||||
${GEN_ASM}: gen_mode
|
${GEN_ASM}: gen_mode
|
||||||
./gen_mode ${HRES} ${VRES}
|
./gen_mode ${HRES} ${VRES}
|
||||||
|
|
||||||
all: vid_decl_rom.bin vid_decl_rom.srec
|
all: vid_decl_rom.bin
|
||||||
|
|
||||||
vid_decl_rom.o: vid_decl_rom.s NuBusFPGAPrimaryInit.s NuBusFPGAPrimaryInit_Primary.s NuBusFPGASecondaryInit.s NuBusFPGASecondaryInit_Secondary.s NuBusFPGADrvr.s ${APPLEINCS} ${CSRC_ASM} DepVideo.inc ${GEN_ASM}
|
vid_decl_rom.o: vid_decl_rom.s NuBusFPGAPrimaryInit.s NuBusFPGASecondaryInit.s NuBusFPGADrvr.s ${APPLEINCS} DepVideo.inc ${GEN_ASM}
|
||||||
rm -f res.inc
|
rm -f res.inc
|
||||||
echo -e "HRES=${HRES}\nVRES=${VRES}\n" | tee res.inc
|
echo -e "HRES=${HRES}\nVRES=${VRES}\n" | tee res.inc
|
||||||
${AS} ${ARCHFLAGS} -I${NS816DECLROMDIR} $< -o $@ -a > vid_decl_rom.l
|
${AS} ${ARCHFLAGS} -I${NS816DECLROMDIR} $< -o $@ -a > vid_decl_rom.l
|
||||||
|
|
||||||
NuBusFPGADrvr_OpenClose.s: NuBusFPGADrvr_OpenClose.c NuBusFPGADrvr.h
|
myrle.o: myrle.c
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
${CC} ${ARCHFLAGS} ${CFLAGS} $< -c -o $@ -DSKIP_MAIN
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.OpenClose_\1/g' $@
|
|
||||||
|
|
||||||
NuBusFPGADrvr_Ctrl.s: NuBusFPGADrvr_Ctrl.c NuBusFPGADrvr.h
|
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.Ctrl_\1/g' $@
|
|
||||||
|
|
||||||
NuBusFPGADrvr_Status.s: NuBusFPGADrvr_Status.c NuBusFPGADrvr.h
|
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.Status_\1/g' $@
|
|
||||||
|
|
||||||
|
|
||||||
NuBusFPGARAMDskDrvr_OpenClose.s: NuBusFPGARAMDskDrvr_OpenClose.c NuBusFPGARAMDskDrvr.h
|
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.RDOpenClose_\1/g' $@
|
|
||||||
|
|
||||||
NuBusFPGARAMDskDrvr_Prime.s: NuBusFPGARAMDskDrvr_Prime.c NuBusFPGARAMDskDrvr.h
|
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.RDPrime_\1/g' $@
|
|
||||||
|
|
||||||
NuBusFPGARAMDskDrvr_Ctrl.s: NuBusFPGARAMDskDrvr_Ctrl.c NuBusFPGARAMDskDrvr.h
|
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.RDCtrl_\1/g' $@
|
|
||||||
|
|
||||||
NuBusFPGARAMDskDrvr_Status.s: NuBusFPGARAMDskDrvr_Status.c NuBusFPGARAMDskDrvr.h
|
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.RDStatus_\1/g' $@
|
|
||||||
|
|
||||||
myrle.s: myrle.c
|
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DSKIP_MAIN
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.myrle_\1/g' $@
|
|
||||||
|
|
||||||
dump_cpr.s: dump_cpr.c
|
dump_cpr.s: dump_cpr.c
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DSKIP_MAIN
|
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DSKIP_MAIN
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.dump_cpr_\1/g' $@
|
sed -i -e 's/\.\(L[0-9][0-9]*\)/.dump_cpr_\1/g' $@
|
||||||
|
|
||||||
|
%.o: %.c NuBusFPGADrvr.h
|
||||||
|
${CC} ${CFLAGS} $< -c -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
||||||
|
|
||||||
NuBusFPGAPrimaryInit_Primary.s: NuBusFPGAPrimaryInit_Primary.c NuBusFPGADrvr.h
|
vid_decl_rom.elf: linker.ld vid_decl_rom.o ${CSRC:.c=.o} # linker script must be first
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
${LD} -o $@ -T $^
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.PIPrimary_\1/g' $@
|
|
||||||
|
|
||||||
NuBusFPGASecondaryInit_Secondary.s: NuBusFPGASecondaryInit_Secondary.c NuBusFPGADrvr.h
|
vid_decl_rom.raw: vid_decl_rom.elf
|
||||||
${CC} ${ARCHFLAGS} ${CFLAGS} $< -S -o $@ -DHRES=${HRES} -DVRES=${VRES}
|
|
||||||
sed -i -e 's/^\([^a-zA-Z0-9_]*\.globl.*\)/# --- \1/' $@
|
|
||||||
sed -i -e 's/\.\(L[0-9][0-9]*\)/.PISecondary_\1/g' $@
|
|
||||||
|
|
||||||
vid_decl_rom.srec: vid_decl_rom.o
|
|
||||||
${OBJCOPY} $^ $@ --input-target=elf32-m68k --output-target=srec
|
|
||||||
|
|
||||||
vid_decl_rom.raw: vid_decl_rom.o
|
|
||||||
${OBJCOPY} $^ $@ --input-target=elf32-m68k --output-target=binary
|
${OBJCOPY} $^ $@ --input-target=elf32-m68k --output-target=binary
|
||||||
|
|
||||||
vid_decl_rom.dir: vid_decl_rom.raw append_romdir
|
vid_decl_rom.bin: vid_decl_rom.raw
|
||||||
cp $< $@
|
|
||||||
./append_romdir $@
|
|
||||||
|
|
||||||
vid_decl_rom.bin: vid_decl_rom.dir
|
|
||||||
${NUBUS_CHECKSUM} --input_file $< --output_file $@ --output_size 32768
|
${NUBUS_CHECKSUM} --input_file $< --output_file $@ --output_size 32768
|
||||||
dd if=dump.cpr of=vid_decl_rom.bin bs=1 conv=notrunc
|
dd if=dump.cpr of=vid_decl_rom.bin bs=1 conv=notrunc
|
||||||
|
|
||||||
|
@ -112,4 +64,3 @@ clean:
|
||||||
|
|
||||||
append_romdir: append_romdir.c
|
append_romdir: append_romdir.c
|
||||||
${HOSTCC} $< -o $@
|
${HOSTCC} $< -o $@
|
||||||
|
|
||||||
|
|
|
@ -126,23 +126,25 @@ static inline unsigned int read_reg(AuxDCEPtr dce, unsigned int reg) {
|
||||||
/* ASM */
|
/* ASM */
|
||||||
extern SlotIntServiceProcPtr interruptRoutine;
|
extern SlotIntServiceProcPtr interruptRoutine;
|
||||||
/* ctrl */
|
/* ctrl */
|
||||||
void linearGamma(NuBusFPGADriverGlobalsPtr dStore);
|
void linearGamma(NuBusFPGADriverGlobalsPtr dStore) __attribute__ ((section (".text.fbdriver")));
|
||||||
OSErr changeIRQ(AuxDCEPtr dce, char en, OSErr err);
|
OSErr changeIRQ(AuxDCEPtr dce, char en, OSErr err) __attribute__ ((section (".text.fbdriver")));
|
||||||
OSErr cNuBusFPGACtl(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce);
|
OSErr cNuBusFPGACtl(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.fbdriver")));
|
||||||
OSErr reconfHW(AuxDCEPtr dce, unsigned char mode, unsigned char depth, unsigned short page);
|
OSErr reconfHW(AuxDCEPtr dce, unsigned char mode, unsigned char depth, unsigned short page) __attribute__ ((section (".text.fbdriver")));
|
||||||
OSErr updatePRAM(AuxDCEPtr dce, unsigned char mode, unsigned char depth, unsigned short page);
|
OSErr updatePRAM(AuxDCEPtr dce, unsigned char mode, unsigned char depth, unsigned short page) __attribute__ ((section (".text.fbdriver")));
|
||||||
/* status */
|
/* status */
|
||||||
OSErr cNuBusFPGAStatus(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce);
|
OSErr cNuBusFPGAStatus(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.fbdriver")));
|
||||||
/* open close */
|
/* open close */
|
||||||
OSErr cNuBusFPGAOpen(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce);
|
OSErr cNuBusFPGAOpen(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.fbdriver")));
|
||||||
OSErr cNuBusFPGAClose(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce);
|
OSErr cNuBusFPGAClose(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.fbdriver")));
|
||||||
|
|
||||||
/* primary init */
|
/* primary init */
|
||||||
UInt32 Primary(SEBlock* block);
|
UInt32 Primary(SEBlock* block) __attribute__ ((section (".text.primary")));
|
||||||
|
/* secondary init */
|
||||||
|
UInt32 Secondary(SEBlock* seblock) __attribute__ ((section (".text.secondary")));
|
||||||
|
|
||||||
#define Check32QDTrap 0xAB03
|
#define Check32QDTrap 0xAB03
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
static inline UInt32 revb(UInt32 d) {
|
static inline UInt32 revb(UInt32 d) {
|
||||||
return ((d&0xFFul)<<24) | ((d&0xFF00ul)<<8) | ((d&0xFF0000ul)>>8) | ((d&0xFF000000ul)>>24);
|
return ((d&0xFFul)<<24) | ((d&0xFF00ul)<<8) | ((d&0xFF0000ul)>>8) | ((d&0xFF000000ul)>>24);
|
||||||
}
|
}
|
||||||
|
@ -151,3 +153,4 @@ static inline UInt32 revb(UInt32 d) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,3 @@ _NuBusFPGATitle_StringEnd:
|
||||||
/* A0 pointer to driver parameter block */
|
/* A0 pointer to driver parameter block */
|
||||||
/* A1 pointer to driver device control entry */
|
/* A1 pointer to driver device control entry */
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
|
|
||||||
.include "NuBusFPGADrvr_OpenClose.s"
|
|
||||||
.text
|
|
||||||
.include "NuBusFPGADrvr_Ctrl.s"
|
|
||||||
.text
|
|
||||||
.include "NuBusFPGADrvr_Status.s"
|
|
||||||
.text
|
|
||||||
|
|
||||||
ALIGN 2
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ OSErr cNuBusFPGACtl(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (!(pb->ioTrap & (1<<noQueueBit)))
|
if (!(pb->ioTrap & (1<<noQueueBit)))
|
||||||
IODone(dce, ret);
|
IODone((DCtlPtr)dce, ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
typedef void(*vblproto)(short);
|
typedef void(*vblproto)(short);
|
||||||
|
|
||||||
#pragma parameter __D0 fbIrq(__A1)
|
#pragma parameter __D0 fbIrq(__A1)
|
||||||
short fbIrq(const long sqParameter){
|
__attribute__ ((section (".text.fbdriver"))) short fbIrq(const long sqParameter){
|
||||||
/* AuxDCEPtr dce = (AuxDCEPtr)sqParameter; */
|
/* AuxDCEPtr dce = (AuxDCEPtr)sqParameter; */
|
||||||
/* NuBusFPGADriverGlobalsHdl dStoreHdl = (NuBusFPGADriverGlobalsHdl)dce->dCtlStorage; */
|
/* NuBusFPGADriverGlobalsHdl dStoreHdl = (NuBusFPGADriverGlobalsHdl)dce->dCtlStorage; */
|
||||||
/* NuBusFPGADriverGlobalsPtr dStore = *dStoreHdl; */
|
/* NuBusFPGADriverGlobalsPtr dStore = *dStoreHdl; */
|
||||||
|
@ -21,8 +21,8 @@ short fbIrq(const long sqParameter){
|
||||||
OSErr cNuBusFPGAOpen(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
OSErr cNuBusFPGAOpen(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
||||||
{
|
{
|
||||||
OSErr ret = noErr;
|
OSErr ret = noErr;
|
||||||
/* write_reg(dce, GOBOFB_DEBUG, 0xBEEF0000); */
|
write_reg(dce, GOBOFB_DEBUG, 0xBEEF0000);
|
||||||
/* write_reg(dce, GOBOFB_DEBUG, (unsigned long)dce->dCtlDevBase); */
|
write_reg(dce, GOBOFB_DEBUG, (unsigned long)dce->dCtlDevBase);
|
||||||
|
|
||||||
if (dce->dCtlStorage == nil)
|
if (dce->dCtlStorage == nil)
|
||||||
{
|
{
|
||||||
|
|
|
@ -401,6 +401,6 @@ OSErr cNuBusFPGAStatus(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
||||||
#endif
|
#endif
|
||||||
done:
|
done:
|
||||||
if (!(pb->ioTrap & (1<<noQueueBit)))
|
if (!(pb->ioTrap & (1<<noQueueBit)))
|
||||||
IODone(dce, ret);
|
IODone((DCtlPtr)dce, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
|
|
||||||
BeginPrimary:
|
BeginPrimary:
|
||||||
MOVE.L %A0, -(%A7)
|
MOVE.L %A0, -(%A7)
|
||||||
JSR Primary
|
BSR Primary
|
||||||
MOVE.L (%A7)+, %a0
|
MOVE.L (%A7)+, %a0
|
||||||
rts
|
rts
|
||||||
.include "NuBusFPGAPrimaryInit_Primary.s"
|
|
||||||
.text
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ UInt32 Primary(SEBlock* seblock) {
|
||||||
|
|
||||||
PRIM_WRITEREG(GOBOFB_VBL_MASK, 0);// disable interrupts
|
PRIM_WRITEREG(GOBOFB_VBL_MASK, 0);// disable interrupts
|
||||||
|
|
||||||
/* PRIM_WRITEREG(GOBOFB_DEBUG, busMode);// trace */
|
PRIM_WRITEREG(GOBOFB_DEBUG, 0x87654321);// trace
|
||||||
|
PRIM_WRITEREG(GOBOFB_DEBUG, busMode);// trace
|
||||||
|
|
||||||
hres = __builtin_bswap32((UInt32)PRIM_READREG(GOBOFB_HRES)); // fixme: endianness
|
hres = __builtin_bswap32((UInt32)PRIM_READREG(GOBOFB_HRES)); // fixme: endianness
|
||||||
vres = __builtin_bswap32((UInt32)PRIM_READREG(GOBOFB_VRES)); // fixme: endianness
|
vres = __builtin_bswap32((UInt32)PRIM_READREG(GOBOFB_VRES)); // fixme: endianness
|
||||||
|
|
|
@ -41,7 +41,16 @@ struct RAMDrvContext {
|
||||||
#define DMA_STATUS_CHECK_BITS (0x01F)
|
#define DMA_STATUS_CHECK_BITS (0x01F)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
/* ctrl */
|
||||||
|
OSErr cNuBusFPGARAMDskCtl(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.dskdriver")));
|
||||||
|
/* open, close */
|
||||||
|
OSErr cNuBusFPGARAMDskOpen(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.dskdriver")));
|
||||||
|
OSErr cNuBusFPGARAMDskClose(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.dskdriver")));
|
||||||
|
/* prime */
|
||||||
|
OSErr cNuBusFPGARAMDskPrime(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.dskdriver")));
|
||||||
|
/* status */
|
||||||
|
OSErr cNuBusFPGARAMDskStatus(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce) __attribute__ ((section (".text.dskdriver")));
|
||||||
|
|
||||||
uint32_t rledec(uint32_t* out, const uint32_t* in, const uint32_t len);
|
uint32_t rledec(uint32_t* out, const uint32_t* in, const uint32_t len) __attribute__ ((section (".text.dskdriver")));;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -21,16 +21,3 @@ _NuBusFPGARAMDskTitle_StringEnd:
|
||||||
/* A0 pointer to driver parameter block */
|
/* A0 pointer to driver parameter block */
|
||||||
/* A1 pointer to driver device control entry */
|
/* A1 pointer to driver device control entry */
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
|
|
||||||
.include "NuBusFPGARAMDskDrvr_OpenClose.s"
|
|
||||||
.text
|
|
||||||
.include "NuBusFPGARAMDskDrvr_Prime.s"
|
|
||||||
.text
|
|
||||||
.include "NuBusFPGARAMDskDrvr_Ctrl.s"
|
|
||||||
.text
|
|
||||||
.include "NuBusFPGARAMDskDrvr_Status.s"
|
|
||||||
.text
|
|
||||||
.include "myrle.s"
|
|
||||||
.text
|
|
||||||
|
|
||||||
ALIGN 2
|
|
||||||
|
|
|
@ -28,6 +28,6 @@ OSErr cNuBusFPGARAMDskCtl(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (!(pb->ioTrap & (1<<noQueueBit)))
|
if (!(pb->ioTrap & (1<<noQueueBit)))
|
||||||
IODone(dce, ret);
|
IODone((DCtlPtr)dce, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
/* drVNum to high-order bits of num, drvrRefNum in low-order */
|
/* drVNum to high-order bits of num, drvrRefNum in low-order */
|
||||||
/* not sure how to do "parameter" without output ? */
|
/* not sure how to do "parameter" without output ? */
|
||||||
#pragma parameter __D0 AddDrive(__D0, __A0)
|
#pragma parameter __D0 AddDrive(__D0, __A0)
|
||||||
static inline int dupAddDrive(unsigned long num, DrvQElPtr qEl) {
|
__attribute__ ((section (".text.dskdriver"))) static inline int dupAddDrive(unsigned long num, DrvQElPtr qEl) {
|
||||||
asm volatile(".word 0xA04E" : : "d" (num), "a" (qEl));
|
asm volatile(".word 0xA04E" : : "d" (num), "a" (qEl));
|
||||||
return num; // should cost nothing, num is already in D0
|
return num; // should cost nothing, num is already in D0
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
/* #include <DriverServices.h> */
|
/* #include <DriverServices.h> */
|
||||||
|
|
||||||
static inline void waitSome(unsigned long bound) {
|
__attribute__ ((section (".text.dskdriver"))) static inline void waitSome(unsigned long bound) {
|
||||||
unsigned long i;
|
unsigned long i;
|
||||||
for (i = 0 ; i < bound ; i++) {
|
for (i = 0 ; i < bound ; i++) {
|
||||||
asm volatile("nop");
|
asm volatile("nop");
|
||||||
|
@ -199,7 +199,7 @@ OSErr cNuBusFPGARAMDskPrime(IOParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (!(pb->ioTrap & (1<<noQueueBit)))
|
if (!(pb->ioTrap & (1<<noQueueBit)))
|
||||||
IODone(dce, ret);
|
IODone((DCtlPtr)dce, ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@ OSErr cNuBusFPGARAMDskStatus(CntrlParamPtr pb, /* DCtlPtr */ AuxDCEPtr dce)
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (!(pb->ioTrap & (1<<noQueueBit)))
|
if (!(pb->ioTrap & (1<<noQueueBit)))
|
||||||
IODone(dce, ret);
|
IODone((DCtlPtr)dce, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
|
|
||||||
BeginSecondary:
|
BeginSecondary:
|
||||||
MOVE.L %A0, -(%A7)
|
MOVE.L %A0, -(%A7)
|
||||||
JSR Secondary
|
movea.l #0xfc90001c, %a0
|
||||||
|
move.l #0xcccccccc, (%a0)
|
||||||
|
BSR Secondary
|
||||||
|
movea.l #0xfc90001c, %a0
|
||||||
|
move.l #0xdddddddd, (%a0)
|
||||||
MOVE.L (%A7)+, %a0
|
MOVE.L (%A7)+, %a0
|
||||||
rts
|
rts
|
||||||
.include "NuBusFPGASecondaryInit_Secondary.s"
|
|
||||||
.text
|
|
||||||
|
|
|
@ -1,83 +0,0 @@
|
||||||
// 00 00 10 0a 00 00 00 00 01 01 5a 93 2b c7 00 0f
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
struct dir {
|
|
||||||
uint32_t oslt;
|
|
||||||
uint32_t length;
|
|
||||||
uint32_t crc;
|
|
||||||
uint8_t one;
|
|
||||||
uint8_t appleformat;
|
|
||||||
uint8_t tp0;
|
|
||||||
uint8_t tp1;
|
|
||||||
uint8_t tp2;
|
|
||||||
uint8_t tp3;
|
|
||||||
uint8_t zero;
|
|
||||||
uint8_t bytelane;
|
|
||||||
};
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
struct dir data;
|
|
||||||
struct stat buf;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
if (argc < 2) {
|
|
||||||
fprintf(stderr, "no I/O file\n");
|
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
data.oslt = 0;
|
|
||||||
data.length = 0;
|
|
||||||
data.crc = 0;
|
|
||||||
data.one = 1;
|
|
||||||
data.appleformat = 1;
|
|
||||||
data.tp0 = 0x5a;
|
|
||||||
data.tp1 = 0x93;
|
|
||||||
data.tp2 = 0x2b;
|
|
||||||
data.tp3 = 0xc7;
|
|
||||||
data.zero = 0;
|
|
||||||
data.bytelane = 0x0F;
|
|
||||||
|
|
||||||
if (stat(argv[1], &buf)) {
|
|
||||||
fprintf(stderr, "stat: %d -> %s\n", errno, strerror(errno));
|
|
||||||
exit(-2);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.length = sizeof(data) + buf.st_size;
|
|
||||||
|
|
||||||
printf("size is %u\n", data.length);
|
|
||||||
|
|
||||||
//.long (\entry_type<<24) + ((\label-.) & 0xffffff)
|
|
||||||
data.oslt = 0x00 << 24 | (-buf.st_size) & 0xFFFFFF;
|
|
||||||
|
|
||||||
printf("entry is 0x%08x\n", data.oslt);
|
|
||||||
|
|
||||||
data.length = __builtin_bswap32(data.length);
|
|
||||||
data.oslt = __builtin_bswap32(data.oslt);
|
|
||||||
|
|
||||||
if ((fd = open(argv[1], O_WRONLY | O_APPEND)) == -1) {
|
|
||||||
fprintf(stderr, "open: %d -> %s\n", errno, strerror(errno));
|
|
||||||
exit(-3);
|
|
||||||
}
|
|
||||||
|
|
||||||
write(fd, &data, sizeof(data));
|
|
||||||
|
|
||||||
close(fd);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
44
nubus-to-ztex-gateware/DeclROM/linker.ld
Normal file
44
nubus-to-ztex-gateware/DeclROM/linker.ld
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
OUTPUT_FORMAT("elf32-m68k");
|
||||||
|
ENTRY(DeclROMDir);
|
||||||
|
|
||||||
|
SECTIONS {
|
||||||
|
.text : {
|
||||||
|
/* first the resource dir & related */
|
||||||
|
*(.text.begin)
|
||||||
|
*(.text .sdata .sdata.* .data .data.* .rodata .rodata.*)
|
||||||
|
|
||||||
|
/* then various sections for the various bits of codes */
|
||||||
|
PROVIDE(_sPInitRec = .);
|
||||||
|
PROVIDE(entry_sPInitRec = (0x22000000 | ((_sPInitRec - _sRsrc_Board - 12) & 0xFFFFFF))); /* fixme; offset 12 hardwired */
|
||||||
|
*(.text.primary_init)
|
||||||
|
*(.text.primary)
|
||||||
|
PROVIDE(_EndsPInitRec = .);
|
||||||
|
PROVIDE(size_sPInitRec = _EndsPInitRec - _sPInitRec);
|
||||||
|
|
||||||
|
PROVIDE(_sSInitRec = .);
|
||||||
|
PROVIDE(entry_sSInitRec = (0x24000000 | ((_sSInitRec - _sRsrc_Board - 20) & 0xFFFFFF))); /* fixme; offset 20 hardwired */
|
||||||
|
*(.text.secondary_init)
|
||||||
|
*(.text.secondary)
|
||||||
|
PROVIDE(_EndsSInitRec = .);
|
||||||
|
PROVIDE(size_sSInitRec = _EndsSInitRec - _sSInitRec);
|
||||||
|
|
||||||
|
PROVIDE(_GoboFBDrvrMacOS68020 = .);
|
||||||
|
PROVIDE(entry_GoboFBDrvrMacOS68020 = (0x02000000 | ((_GoboFBDrvrMacOS68020 - _GoboFBDrvrDir) & 0xFFFFFF)));
|
||||||
|
*(.text.fbdriver_init)
|
||||||
|
*(.text.fbdriver)
|
||||||
|
PROVIDE(_GoboFBEnd020Drvr = .);
|
||||||
|
|
||||||
|
PROVIDE(_RAMDskDrvrMacOS68020 = .);
|
||||||
|
PROVIDE(entry_RAMDskDrvrMacOS68020 = (0x02000000 | ((_RAMDskDrvrMacOS68020 - _RAMDskDrvrDir) & 0xFFFFFF)));
|
||||||
|
*(.text.dskdriver_init)
|
||||||
|
*(.text.dskdriver)
|
||||||
|
PROVIDE(_RAMDskEnd020Drvr = .);
|
||||||
|
|
||||||
|
/* and at the end the ROM block, missing only the CRC */
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.romblock)
|
||||||
|
PROVIDE(ROMSize = .);
|
||||||
|
PROVIDE(RsrcDirOffset = ((0-.)+20) & 0xFFFFFF);
|
||||||
|
}
|
||||||
|
/DISCARD/ : { *(*) }
|
||||||
|
}
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
//#include <stdio.h>
|
//#include <stdio.h>
|
||||||
|
|
||||||
|
#include "NuBusFPGARAMDskDrvr.h"
|
||||||
|
|
||||||
#ifndef SKIP_MAIN
|
#ifndef SKIP_MAIN
|
||||||
uint32_t rleenc(uint32_t* out, const uint32_t* in, const uint32_t len) {
|
uint32_t rleenc(uint32_t* out, const uint32_t* in, const uint32_t len) {
|
||||||
uint32_t i = 0, j = 0, p = 0, ib, k;
|
uint32_t i = 0, j = 0, p = 0, ib, k;
|
||||||
|
|
|
@ -9,16 +9,23 @@
|
||||||
sRsrc_Board = 1 /* board sResource (>0 & <128) */
|
sRsrc_Board = 1 /* board sResource (>0 & <128) */
|
||||||
.include "VidRomDef.s"
|
.include "VidRomDef.s"
|
||||||
sRsrc_RAMDsk = 0x90 /* functional sResources */
|
sRsrc_RAMDsk = 0x90 /* functional sResources */
|
||||||
|
|
||||||
|
.global DeclROMDir
|
||||||
|
|
||||||
|
.section .text.begin
|
||||||
|
|
||||||
.include "VidRomRsrcDir.s"
|
.include "VidRomRsrcDir.s"
|
||||||
|
|
||||||
|
.global _sRsrc_Board
|
||||||
_sRsrc_Board:
|
_sRsrc_Board:
|
||||||
OSLstEntry sRsrcType,_BoardType /* offset to board descriptor */
|
OSLstEntry sRsrcType,_BoardType /* offset to board descriptor */
|
||||||
OSLstEntry sRsrcName,_BoardName /* offset to name of board */
|
OSLstEntry sRsrcName,_BoardName /* offset to name of board */
|
||||||
DatLstEntry boardId,NuBusFPGAID /* board ID # (assigned by DTS) */
|
DatLstEntry boardId,NuBusFPGAID /* board ID # (assigned by DTS) */
|
||||||
OSLstEntry primaryInit,_sPInitRec /* offset to PrimaryInit exec blk */
|
/* OSLstEntry primaryInit,_sPInitRec */ /* offset to PrimaryInit exec blk */
|
||||||
|
.long entry_sPInitRec
|
||||||
OSLstEntry vendorInfo,_VendorInfo /* offset to vendor info record */
|
OSLstEntry vendorInfo,_VendorInfo /* offset to vendor info record */
|
||||||
OSLstEntry secondaryInit,_sSInitRec /* offset to SecondaryInit block */
|
/* OSLstEntry secondaryInit,_sSInitRec */ /* offset to SecondaryInit block */
|
||||||
|
.long entry_sSInitRec
|
||||||
OSLstEntry sRsrcVidNames, _VModeName /* video name directory */
|
OSLstEntry sRsrcVidNames, _VModeName /* video name directory */
|
||||||
.long EndOfList
|
.long EndOfList
|
||||||
|
|
||||||
|
@ -35,20 +42,24 @@ _BoardName:
|
||||||
/* _VidICON ; optional icon, not needed */
|
/* _VidICON ; optional icon, not needed */
|
||||||
/* _sVidNameDir ; optional name(s), not needed */
|
/* _sVidNameDir ; optional name(s), not needed */
|
||||||
|
|
||||||
_sPInitRec:
|
.section .text.primary_init
|
||||||
.long _EndsPInitRec-_sPInitRec /* physical block size */
|
/* _sPInitRec: */
|
||||||
|
/* .long _EndsPInitRec-_sPInitRec */ /* physical block size */
|
||||||
|
.long size_sPInitRec
|
||||||
.include "NuBusFPGAPrimaryInit.s" /* the header/code */
|
.include "NuBusFPGAPrimaryInit.s" /* the header/code */
|
||||||
.text
|
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
_EndsPInitRec:
|
/* _EndsPInitRec: */
|
||||||
|
|
||||||
_sSInitRec:
|
.section .text.secondary_init
|
||||||
.long _EndsSInitRec-_sSInitRec /* physical block size */
|
/* _sSInitRec: */
|
||||||
|
/* .long _EndsSInitRec-_sSInitRec */ /* physical block size */
|
||||||
|
.long size_sSInitRec
|
||||||
.include "NuBusFPGASecondaryInit.s" /* the header/code */
|
.include "NuBusFPGASecondaryInit.s" /* the header/code */
|
||||||
.text
|
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
_EndsSInitRec:
|
/* _EndsSInitRec: */
|
||||||
|
|
||||||
|
|
||||||
|
.section .text.begin
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
_VendorInfo:
|
_VendorInfo:
|
||||||
OSLstEntry vendorId,_VendorId /* offset to vendor ID */
|
OSLstEntry vendorId,_VendorId /* offset to vendor ID */
|
||||||
|
@ -89,19 +100,24 @@ _MinorLength:
|
||||||
.long defMinorLength /* frame buffer length */
|
.long defMinorLength /* frame buffer length */
|
||||||
|
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
|
.section .text.begin
|
||||||
|
.global _GoboFBDrvrDir
|
||||||
_GoboFBDrvrDir:
|
_GoboFBDrvrDir:
|
||||||
OSLstEntry sMacOS68020,_GoboFBDrvrMacOS68020 /* driver directory for Mac OS */
|
/* OSLstEntry sMacOS68020,_GoboFBDrvrMacOS68020 */ /* driver directory for Mac OS */
|
||||||
|
.long entry_GoboFBDrvrMacOS68020
|
||||||
.long EndOfList
|
.long EndOfList
|
||||||
|
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
_GoboFBDrvrMacOS68020:
|
.section .text.fbdriver_init
|
||||||
|
/* _GoboFBDrvrMacOS68020: */ /* supplied by linker script */
|
||||||
.long _GoboFBEnd020Drvr-. /* physical block size */
|
.long _GoboFBEnd020Drvr-. /* physical block size */
|
||||||
.include "NuBusFPGADrvr.s" /* driver code */
|
.include "NuBusFPGADrvr.s" /* driver code */
|
||||||
.text
|
/* _GoboFBEnd020Drvr: */ /* supplied by linker script */
|
||||||
_GoboFBEnd020Drvr:
|
|
||||||
|
.section .text.begin
|
||||||
.include "VidRomRes.s"
|
.include "VidRomRes.s"
|
||||||
|
|
||||||
|
.section .text.begin
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
_sRsrc_RAMDsk:
|
_sRsrc_RAMDsk:
|
||||||
OSLstEntry sRsrcType,_RAMDskType /* video type descriptor */
|
OSLstEntry sRsrcType,_RAMDskType /* video type descriptor */
|
||||||
|
@ -122,14 +138,33 @@ _RAMDskName:
|
||||||
.string "RAMDsk_NuBusFPGA" /* video driver name */
|
.string "RAMDsk_NuBusFPGA" /* video driver name */
|
||||||
|
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
|
.section .text.begin
|
||||||
|
.global _RAMDskDrvrDir
|
||||||
_RAMDskDrvrDir:
|
_RAMDskDrvrDir:
|
||||||
OSLstEntry sMacOS68020,_RAMDskDrvrMacOS68020 /* driver directory for Mac OS */
|
/* OSLstEntry sMacOS68020,_RAMDskDrvrMacOS68020 */ /* driver directory for Mac OS */
|
||||||
|
.long entry_RAMDskDrvrMacOS68020
|
||||||
.long EndOfList
|
.long EndOfList
|
||||||
|
|
||||||
ALIGN 2
|
ALIGN 2
|
||||||
_RAMDskDrvrMacOS68020:
|
.section .text.dskdriver_init
|
||||||
|
/* _RAMDskDrvrMacOS68020: */ /* supplied by linker script */
|
||||||
.long _RAMDskEnd020Drvr-. /* physical block size */
|
.long _RAMDskEnd020Drvr-. /* physical block size */
|
||||||
.include "NuBusFPGARAMDskDrvr.s" /* driver code */
|
.include "NuBusFPGARAMDskDrvr.s" /* driver code */
|
||||||
.text
|
/* _RAMDskEnd020Drvr: */ /* supplied by linker script */
|
||||||
_RAMDskEnd020Drvr:
|
|
||||||
|
|
||||||
|
/* Declaration ROM directory at end */
|
||||||
|
.section .romblock
|
||||||
|
ALIGN 2
|
||||||
|
DeclROMDir:
|
||||||
|
.long RsrcDirOffset /* supplied by linker script, replace OSLstEntry 0, _sRsrcDir */
|
||||||
|
DeclROMCRC:
|
||||||
|
.long ROMSize /* supplied by linker script */
|
||||||
|
.long 0 /* crc TBComputed after the fact */
|
||||||
|
.byte 1 /* Revision Level */
|
||||||
|
.byte appleFormat /* Apple Format */
|
||||||
|
.long testPattern /* magic TestPattern */
|
||||||
|
.byte 0 /* reserved */
|
||||||
|
.byte 0x0F /* byte lane marker */
|
||||||
|
DeclRomEnd:
|
||||||
|
.end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user