Get bios calls starting to work

This commit is contained in:
Byron Lathi
2023-08-06 21:41:15 -07:00
parent 6b42843f4b
commit 446f4e7539
12 changed files with 280 additions and 298 deletions

View File

@@ -2,7 +2,7 @@ CC=../cc65/bin/cl65
CFLAGS=-T -t none -I. --cpu "65C02"
LDFLAGS=-C link.ld -m $(NAME).map
NAME=bootloader
NAME=bios
BIN=$(NAME).bin
HEX=$(NAME).hex

View File

@@ -45,7 +45,10 @@ irq: PLA ; Restore accumulator contents
; ---------------------------------------------------------------------------
; BRK detected, stop
break:
break:
pla
plx
jmp (bios_table,x)
bios_table:

View File

@@ -157,7 +157,7 @@ void SD_printBuf(uint8_t *buf)
for(i = 0; i < SD_BLOCK_LEN; i++)
{
cprintf("%2x", *buf++);
if(colCount == 19)
if(colCount == 31)
{
cputs("\r\n");
colCount = 0;

View File

@@ -1,7 +1,8 @@
MEMORY
{
ZP: start = $0, size = $100, type = rw, define = yes;
SDRAM: start = $200, size = $7cf0, type = rw, define = yes;
SDRAM: start = $200, size = $7e00, type = rw, define = yes;
BOOTLOADER: start = $8000, size = $1000, type = rw, define = yes;
ROM: start = $F000, size = $1000, file = %O;
}

View File

@@ -11,7 +11,8 @@
#define KERNEL_LOAD_ADDR 0xD000
uint8_t buf[512];
//uint8_t buf[512];
uint8_t *buf = (uint8_t*)0x8000;
int main() {
// array to hold responses
@@ -50,30 +51,7 @@ int main() {
//SD_printDataErrToken(token);
}
// update address to 0x00000100
// addr = 0x00000100;
// // fill buffer with 0x55
// for(i = 0; i < 512; i++) buf[i] = 0x55;
// cputs("Writing 0x55 to sector: 0x");
// cprintf("%x", (uint8_t)(addr >> 24));
// cprintf("%x", (uint8_t)(addr >> 16));
// cprintf("%x", (uint8_t)(addr >> 8));
// cprintf("%x", (uint8_t)addr);
// // write data to sector
// res[0] = SD_writeSingleBlock(addr, buf, &token);
// cputs("\r\nResponse:\r\n");
// //SD_printR1(res[0]);
// // if no errors writing
// if(res[0] == 0x00)
// {
// if(token == SD_DATA_ACCEPTED)
// cputs("Write successful\r\n");
// }
__asm__ ("jmp (%v)", buf);
}
while(1) ;