Commit Graph

242 Commits

Author SHA1 Message Date
Byron Lathi
d2700a64fb Read entire file into memory 2023-08-26 08:10:20 -07:00
Byron Lathi
4b2b1a425e Parse options properly 2023-08-25 21:26:28 -07:00
Byron Lathi
a971e7a717 Start reading options 2023-08-25 20:03:03 -07:00
Byron Lathi
21b456067a Read text and data offset/length 2023-08-25 19:22:21 -07:00
Byron Lathi
becc9094c8 Don't save segments as separate files 2023-08-23 21:12:15 -07:00
Byron Lathi
eb72e83629 Use old offset calculation, save ptr3
Looks like cprintf modifies ptr3, so make sure to save it if you are
calling that.

There also may have been an issue with how the previous sector address
was calculated, the one which does not account for carries seems to
work.
2023-08-23 20:48:57 -07:00
Byron Lathi
8273e01ad8 Read size of file in sectors 2023-08-23 20:45:09 -07:00
Byron Lathi
9b1576774b Factor out relocation code into method 2023-08-23 19:52:11 -07:00
Byron Lathi
cc1d8d2015 Update o65dump to show reloc and undef symbols 2023-08-23 00:11:57 -07:00
Byron Lathi
8bccfed867 Change segment order to make o65 layout valid
VECTORS was messing things up
2023-08-22 20:49:07 -07:00
Byron Lathi
c5b1a47c8e start o65dump.py 2023-08-22 19:27:26 -07:00
Byron Lathi
9972f8cb36 Update order for kernel segments 2023-08-22 19:27:09 -07:00
Byron Lathi
851c26e4dd Print out filenames as we read them 2023-08-21 20:02:57 -07:00
Byron Lathi
de9353a009 Find kernel in second stage bootloader 2023-08-21 19:33:52 -07:00
Byron Lathi
906516c4b5 Add comments and use less magic 2023-08-15 23:06:10 -07:00
Byron Lathi
68ff523b10 Use actual values from sd card 2023-08-15 19:30:11 -07:00
Byron Lathi
dfdb41a875 Automatically copy rom image and warn about rebuild 2023-08-14 23:44:51 -07:00
Byron Lathi
a657957ae2 Load a multi-sector file and execute it 2023-08-14 20:44:27 -07:00
Byron Lathi
3bd022107e Read start cluster 2023-08-14 20:21:03 -07:00
Byron Lathi
937a04c891 Remove some debug info 2023-08-12 19:16:46 -07:00
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
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
6706cc502e Update software to match efinix hw 2023-07-19 21:07:17 -07: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
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
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
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