Commit Graph

204 Commits

Author SHA1 Message Date
Byron Lathi
0256a85acc Create Efinix Adapter
Split the project into two parts, the adapter will connect the cpu
directly to the FPGA, and the shield will house all of the peripherals.

I will get the adapter first so that I can get things like sdram
working first, and then make the shield with things like SD card, USB,
maybe even ethernet and VGA. Basically anthing since it's connected to
an FPGA.
2022-10-12 18:01:58 -05:00
Byron Lathi
6e650e627f Change CI to ignore fpga build, kicad to symlink
Did not automate tests with efinix yet.
2022-10-04 17:25:42 -05:00
Byron Lathi
fcae23785e Throw everything up
I think that previously, I had not actually commited any of this to git.
This adds all of the new effinix stuff that I had been working on for
months.

The gist of all of this is that the intel fpga is expensive and does not
exist, whereas the effinix ones are not as expensive and more existant.
This redoes the project to use the dev board, as well as a custom board
that I may or may not make.
2022-10-04 17:15:49 -05:00
Byron Lathi
5c72c574e5 Change link file to output flat binary 2022-04-21 17:37:12 -05:00
Byron Lathi
fcbf45f7ea Merge branch 'bootloader' into 'master'
Add bootloader, change ci to use custom cc65

See merge request bslathi19/super6502!16
2022-04-20 19:02:02 +00:00
Byron Lathi
1a64fa4d62 Change kernel format to bin for merge
We don't have the bootloader reading o65 files right now, so we need to
keep the kernel as a bin file until that is added.
2022-04-20 13:54:07 -05:00
Byron Lathi
1b08d25ce1 Update makefile for tests
use the local sim65 instead of the installed one which doesn't exist
2022-04-20 12:59:32 -05:00
Byron Lathi
9de3c5b1fa update ci 2022-04-20 12:49:23 -05:00
Byron Lathi
0e98f7536b update ci 2022-04-20 12:46:45 -05:00
Byron Lathi
aa717685e3 Use our own toolchain instead of the one in the image
Now that we are adding our own target we can compile our own toolchain
instead of using the stock one. This does mean that there isn't really a
purpose to using the alpine cc65 image though
2022-04-20 12:41:20 -05:00
Byron Lathi
686630e79f Remove unused code to make code smaller
These might need to be added back eventually.
2022-04-19 15:35:22 -05:00
Byron Lathi
c7ff69a1a0 Update .gitlab-ci.yml file 2022-04-19 20:30:27 +00:00
Byron Lathi
7b84d8a9c2 Update .gitlab-ci.yml file 2022-04-19 20:27:25 +00:00
Byron Lathi
25883aa3cc Update .gitlab-ci.yml file 2022-04-19 20:09:32 +00:00
Byron Lathi
bd748cab86 Update .gitlab-ci.yml file 2022-04-19 20:08:10 +00:00
Byron Lathi
04346ed625 Update .gitlab-ci.yml file
Add bootloader.hex as an artifact for the FPGA build
2022-04-19 20:05:53 +00:00
Byron Lathi
a836643807 Disable in system memory editor for ROM
Now that the ROM is just a bootloader and the kernel is stored on the SD
card, we do not need to be constantly changing the ROM.

Disabling the memory editor dramatically reduces compilation time which
will be useful when implementing FPGA features in the future.
2022-04-19 14:47:19 -05:00
Byron Lathi
ff8078fac7 Program ROM with bootloader
Replaces the ROM image with the bootloader instead of bootrom, which no
longer exists.
2022-04-19 13:46:57 -05:00
Byron Lathi
f3c7ac9696 Replace bios with bootloader, don't use bootsector
Instead of using the bootsector to load a bootloader, just put the
bootloader in the ROM and call it a day. It looks for a file on the SD
card in the root directory named `kernel.bin` and loads it into memory.

This is not a perfect solution, as the kernel will grow larger and the
kernel load address will have to change. At this point I could add back
the bootloader, but that is for later.

Also the bootloader is just a copy of the kernel, so that can be trimmed
down a lot.
2022-04-19 10:34:19 -05:00
Byron Lathi
f664d59497 Copy kernel into root folder after build
This way it gets copied over to the SD card when installing.
2022-04-19 10:33:27 -05:00
Byron Lathi
15a0917bb4 Change kernel to use none target
I forgot that the CI still uses the stock cc65 which doesn't support my
target. The kernel doesn't really need this target though, only the user
programs.
2022-04-18 20:31:11 -05:00
Byron Lathi
4e2e030e52 Add scripts
automates the process of overwriting the boot sector of the SD card and
copying over the filesystem.
2022-04-18 20:29:10 -05:00
Byron Lathi
24d5a8c8ac Add fsdir 2022-04-18 20:29:00 -05:00
Byron Lathi
9f1d527a7c Change kernel link type
Kernel is now compiled and linked into a raw binary instead of intel
hex. This raw binary can be loaded into the correct address by the
bootloader.

I wanted this to be an o65 file, but ld65 kept complaining about it.
Honestly though having this be a straight binary makes it easier to
load, but we can't relocate it.
2022-04-18 20:27:48 -05:00
Byron Lathi
0fadc6a80f Add sw makefile which compiles all subtargets
Usefull now that we have like 4 different folders that need to be
compiled slightly differently
2022-04-18 20:27:05 -05:00
Byron Lathi
72b83d739d Remove unused define 2022-04-18 20:26:59 -05:00
Byron Lathi
9dd460a47f Add preliminary bootloader
This bootloader right now just prints the letter A, but should be
capable of reading blocks from the SD card into memory.
2022-04-18 20:25:08 -05:00
Byron Lathi
54328722ab Rename boot to bios, add sd call
Adds a call that you can make to the BIOS to read sd blocks. Useful for
the bootloader where there is not much space
2022-04-18 20:24:29 -05:00
Byron Lathi
64f6f0b397 Add top level makefile for sw 2022-04-18 12:50:19 -05:00
Byron Lathi
12284d19a9 Create boot environment
The boot environment will read the boot sector from the sd card, verify
that it has the boot signature at the end, then jump to the start of it.

From there, there should be a bootloader written to the boot segment
that can handle the rest.

It might be tight to fit everything into the boot sector but do remember
that you do not have to initialize or select the sd card, and those
functions take up a lot of space.
2022-04-18 12:43:29 -05:00
Byron Lathi
2ff3caccc6 Change user programs to use super6502 target
The target library is a copy of `none` right now but will be built out
later.
2022-04-18 12:12:43 -05:00
Byron Lathi
373fade79f Merge branch 'filesystem' into 'master'
Improve file system code

See merge request bslathi19/super6502!15
2022-04-18 17:10:09 +00:00
Byron Lathi
a9d9bc0619 Allow subdirectories
Can now break apart a filepath into the parent directories and search
for each one of them (not recursively!).
2022-04-17 20:18:43 -05:00
Byron Lathi
52f631e558 Allow finding files in the root directory
This allows you to find the cluster number of a file in the root
directory by name. The main program is a simple demo where you can type
in a filename and it will tell you the cluster number.
2022-04-17 18:12:13 -05:00
Byron Lathi
edd13e9b71 Remove debug information 2022-04-17 18:11:45 -05:00
Byron Lathi
6844c48a3b Update ci 2022-04-16 22:07:19 -05:00
Byron Lathi
8495f1f002 Update ci 2022-04-16 22:02:18 -05:00
Byron Lathi
c6098f2d1f Separate kernel code from test code
Eventually I want the kernel to be loaded from the SD card as well, but
it still needs to separate from user programs.

At some point there should be a folder just for the BIOS, which should
read from the boot block of the SD card and start executing, and thats
it.
2022-04-16 21:58:37 -05:00
Byron Lathi
238a4b6f98 Move devices into devices folder 2022-04-16 21:47:54 -05:00
Byron Lathi
c5f1b64cba Move filesystem code into its own directory
Step one into cleaning up the codebase a little bit.
2022-04-16 21:43:26 -05:00
Byron Lathi
c8ce675d2b Merge branch 'exec' into 'master'
Move code out of main and into their own files

See merge request bslathi19/super6502!14
2022-04-17 02:29:13 +00:00
Byron Lathi
8c9ae78040 Fix file endings 2022-04-16 21:04:39 -05:00
Byron Lathi
f1e71a9461 Move code out of main and into their own files
All of the SD card commands are moved into their own file, with
functions sd_init, sd_get_rca, sd_select_card, sd_get_status, and
sd_readblock.

The FAT functions are movied into fat.c and give functions fat_init and
fat_read. Note that the filename is ignored for now, it always reads the
first file in the root directory.

The loading of o65 files is done in o65.c, and executing is done in
exec.c

This cleans up the main file signifigantly and leaves the project open
to expansion.
2022-04-16 20:52:50 -05:00
Byron Lathi
c02d03bd99 Rename sd_card.s to sd_card_asm.s 2022-04-16 20:52:10 -05:00
Byron Lathi
44fb4cd0d5 Merge branch 'exec' into 'master'
Add reading, parsing, and basic executing of o65 files

See merge request bslathi19/super6502!13
2022-04-17 00:34:40 +00:00
Byron Lathi
a94b26dc3c Change code and data base to be pointers
These are technically pointers, so lets type them as such.
2022-04-16 19:24:21 -05:00
Byron Lathi
2786ec0940 Execute code read from the SD card
This will read the data from the sd card, copy it to the originally
linked address (no relocation), then execute it.

I am lazy and wrote it in C using weird function pointer casting but
this would probably be more efficient if it were to be written in
assembly instead.

The test program simply returns 'A', but that is enough to prove that it
is actually running.
2022-04-16 14:56:41 -05:00
Byron Lathi
585faa023f Remove compilation output files
These were used to help understand the o65 file format, but are not
needed and shouldn't have been commited anyway.
2022-04-16 14:30:34 -05:00
Byron Lathi
4be5366aee Do not track o65 files
These are object files still, which means we do not want to track them.
2022-04-16 14:28:40 -05:00
Byron Lathi
7e7bdd3b4a Use the system cl65, don't use verbose mode
I had used these to try and help figure out the structure of the o65
file but this is not needed anymore
2022-04-16 14:27:18 -05:00