Commit Graph

426 Commits

Author SHA1 Message Date
Byron Lathi
053b0d7e3e Find bootloader in FAT 2023-08-12 19:03:24 -07:00
Byron Lathi
fd9389268a Load root directory from sd card 2023-08-12 16:09:03 -07:00
Byron Lathi
7039e649bb Update cc65 2023-08-12 12:28:16 -07:00
Byron Lathi
7ad1079289 Restart kernel 2023-08-12 11:59:45 -07:00
Byron Lathi
069ae5db4b Update format script
I think there may still be some issues with a drive that is formatted
wrong, but it works consistently right now.

When modifying the boot sector, it now leaves alone the partition tables
and the bios parameter block. This does reduce the amount of code from
510 bytes to 380, but this is find as it only takes about 29 bytes to
load a sector into memory.
2023-08-09 22:46:18 -07:00
Byron Lathi
d191c1da5b Modify disk script to leave partition table intact 2023-08-08 23:52:57 -07:00
Byron Lathi
6b0caea84c Link bootloader with bios to get access to symbols
By doing this we don't need to call bios functions, we can just jsr
directly to the addresses. This does mean that everytime the bios
changes the bootloader has to change, but ideally all the bootloader
does is load the bios and then get remapped out of memory. Any important
drivers like file system can be loaded from the bootloader.

This also means that the runtime functions are located in the bios for
the bootloader, so the rom will have to stay mapped in until the kernel
is started, at which point it will have its own runtime and the rom and
bootloader are no longer needed.
2023-08-08 22:16:42 -07:00
Byron Lathi
e73c4e1d08 Rewrite readblock in assembly 2023-08-08 19:28:10 -07:00
Byron Lathi
446f4e7539 Get bios calls starting to work 2023-08-06 21:41:15 -07:00
Byron Lathi
6b42843f4b remote testing code 2023-07-31 20:03:59 -07:00
Byron Lathi
18b8ac7ccf Rename bootloader to bios, add actual bootloader 2023-07-31 19:58:32 -07:00
Byron Lathi
5128fe64b6 Merge branch 'spi_master' into 'master'
add spi controller and sd asm code.

See merge request bslathi19/super6502!17
2023-07-29 22:32:21 +00:00
Byron Lathi
096472e084 Get SD card reads working 2023-07-23 22:44:19 -07:00
Byron Lathi
d16675ed3c Consolidate resp3 and resp7, fix stack issue
wasn't pushing res to stack, which makes stack pointer wrong
2023-07-23 21:45:54 -07:00
Byron Lathi
7e958c8a11 powerupseq assembly rewrite 2023-07-23 19:00:39 -07:00
Byron Lathi
8f3a1a5968 res1_cmd assembly rewrite 2023-07-23 18:43:39 -07:00
Byron Lathi
1c693b029d readres3 assembly rewrite 2023-07-23 18:25:29 -07:00
Byron Lathi
028a431189 readres2 and readbytes assembly rewrite 2023-07-23 18:00:22 -07:00
Byron Lathi
2ef463846f Consolidate another res1 function 2023-07-23 17:30:05 -07:00
Byron Lathi
60072603d9 Rewrite readRes1, consolidate res1 commands 2023-07-23 17:26:40 -07:00
Byron Lathi
709c60cf36 SD_command assembly rewrite 2023-07-23 16:25:13 -07:00
Byron Lathi
5ca5fca29b Get SD card working in SPI 2023-07-23 14:55:14 -07:00
Byron Lathi
6a1a76db35 Implement basic SPI controller 2023-07-21 23:01:37 -07:00
Byron Lathi
85f12c75f1 Start spi controller and tb 2023-07-21 22:10:39 -07:00
Byron Lathi
6706cc502e Update software to match efinix hw 2023-07-19 21:07:17 -07:00
Byron Lathi
6eeecda368 Add wait states during refresh 2023-07-19 21:06:54 -07:00
Byron Lathi
21e3a477c1 Update IP 2023-07-19 21:06:20 -07:00
Byron Lathi
2f11808f11 Change to simpler rom 2023-01-13 13:07:13 -06:00
Byron Lathi
7682dffe3c Change test program to use correct args
Seems to work, when you run the test program it resets the card and
sends the voltage and test pattern, and it does receive a response from
the card.
2023-01-12 21:45:13 -06:00
Byron Lathi
98c07b59b4 Add files from previous version 2023-01-12 17:06:25 -06:00
Byron Lathi
3ff6205e93 Add weak pull up (NEED STRONGER PULLUP)
weak pullup is enabled, but these are only about 40k when 10k is needed.
I added two 10k resistors to the board.
2023-01-12 17:05:06 -06:00
Byron Lathi
519cd19739 Add uart2 test program
Reads input from uart and then writes it back out again immediately.
2023-01-12 14:05:13 -06:00
Byron Lathi
d5bccd46e3 Add write flag and reset logic for read flag 2023-01-12 14:04:44 -06:00
Byron Lathi
ab46236816 First throw at UART. 2023-01-12 13:34:46 -06:00
Byron Lathi
7e97784992 Create UART and uart_wrapper 2023-01-11 21:16:16 -05:00
Byron Lathi
2f37965464 Add labels for sd mode 2023-01-10 16:58:08 -06:00
Byron Lathi
b5fc0587ac Add labels on fpga side 2023-01-10 16:55:14 -06:00
Byron Lathi
2eaf1d948c Add text labels to arduino pins
I finally found the schematics for the 385 board so now there can be
labels for what the pins actually do.
2023-01-10 16:42:44 -06:00
Byron Lathi
4f8e63f463 Update sdram controller with new Efinity version
For some reason the old one did not want to open in the new version.
Even though the version of the IP is the same, something about it being
made with the old Efinity version made it mad.

I just deleted it and made it again with the same settings and now it
lets me open and configure it.
2023-01-06 10:28:08 -05:00
Byron Lathi
8181a3a583 Change divider to pipelined version
The pipelining allows the cpu to run at a faster clock speed but results
in latency. At the current 2 MHz, there is 1 cycle of latency which is
negligible because the 6502 cannot do sequential data memory accesses.

In the future, there will have to be some sort of status flag or
interrupt showing that the divider is ready.
2023-01-05 19:21:00 -05:00
Byron Lathi
5f6657a227 Add divider
Adds a 16x16 divider to go with the multiplier.

The divider is a single stage with no pipelining, which works at the
slow 2MHz frequency. Doing this lowers the maximum clock frequency to 5.

This is acceptable for now but means that the cpu can't be run at 14,
which is the maximum frequency.
2023-01-05 18:35:42 -05:00
Byron Lathi
42ad901ba4 Add multiplier
Add 16x16 multiplier.

Pretty simple. Address 0-1 is multipled by address 2-3 and the result is
in address 4-7, all little endian of course.
2023-01-04 16:15:02 -05:00
Byron Lathi
32a78a4aff Add interrupt based timer and test code 2023-01-03 18:20:34 -05:00
Byron Lathi
1ac3bdf614 update timer
change how timer works, now counter and timer are not separate.
2023-01-03 15:49:56 -05:00
Byron Lathi
9a2f0a4bb4 Create interrupt controller 2023-01-03 14:50:45 -05:00
Byron Lathi
7bb30abaab Remove unused files 2023-01-03 13:35:10 -05:00
Byron Lathi
d9da0d2bf5 Create 385 IO shield adapter 2023-01-03 13:29:51 -05:00
Byron Lathi
ee8cf1fc37 Make adapter for 385 board 2022-12-30 17:42:11 -05:00
Byron Lathi
ca099a5ef2 Finish routing sd card slot, update gitignore 2022-12-30 15:37:14 -05:00
Byron Lathi
8c4102612f Add timer and test program 2022-12-29 11:51:38 -05:00