6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 10, 2024 4:55 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Wed Aug 27, 2014 7:00 pm 
Offline
User avatar

Joined: Wed Aug 27, 2014 6:05 pm
Posts: 6
Hello there,

some time ago I stumbled over Grant Searle's MULTICOMP pick-and-mix FPGA computer over at http://searle.hostei.com/grant/Multicomp/

My favorite flavor is the 6502 version (having had some previous adventures with C64 programming). By default MULTICOMP has a Microsoft Basic in ROM, which on my instance is replaced with my own ROM that I develop mostly as an exercise to get more practice with 6502 assembly, which I began to pick up for C64 programming, starting in 2012.

The name of my ROM is SKERNAL (Stupid KERNAL - eventually to morph into Silly KERNAL) and I develop it over at https://github.com/maikmerten/SKERNAL

The main features are:

  • Rudimentary command line
  • Supports (and requires) the SD card controller on MULTICOMP
  • Basic support for the FAT16 file system (currently read-only, only 8.3 file names, only root directory)
  • List files in root directory of the FAT16 file system
  • Load files into memory (starting at page 8 until end of RAM or EOF)
  • Execute files loaded from SD card (JSR to the start of page eight)
  • Some facility to inspect and alter memory contents
  • Load and execute the file "autoexec.bin" on boot, if present


It's perhaps the last feature that's most useful. On MULTICOMP, the ROM is baked into the FPGA core, so changing the software basically means recompiling the whole computer. By flashing SKERNAL once and just updating autoexec.bin on the SD card one can have the machine boot into custom software without recompiling/reprogramming of the "hardware".

Attachment:
skernal1.png
skernal1.png [ 20.64 KiB | Viewed 2220 times ]

Attachment:
skernal2.png
skernal2.png [ 27.18 KiB | Viewed 2220 times ]

Attachment:
skernal3.png
skernal3.png [ 21.28 KiB | Viewed 2220 times ]


Here's TinyBasic loaded from FAT16 and executed:

Attachment:
skernal-tinybasic.png
skernal-tinybasic.png [ 18.15 KiB | Viewed 2220 times ]


I develop this in Seth Morabito's Symon emulator (https://github.com/sethm/symon), for which I developed some additions to support the MULTICOMP machine model. I use CA65 as cross-assembler.


Perhaps this is useful for someone. Being a beginner in 6502 assembly clearly the coding style and overall design is quite questionable. For me it's an interesting playground to mess with, so let's see how things develop ;)

Oh, and currently it's not much of a KERNAL, given there's no proper way for external software to find the internal routines.


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 27, 2014 8:29 pm 
Offline
User avatar

Joined: Fri Oct 31, 2003 10:00 pm
Posts: 200
Great development!

Grants work is fantastic already , and you opened it now to a real system!

Thanks for sharing!


Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 28, 2014 1:51 pm 
Offline
User avatar

Joined: Wed Aug 27, 2014 6:05 pm
Posts: 6
Thanks for your kind comment! I hesitate to call it a "real system", but at least it makes getting software to the MULTICOMP a bit easier ;)

I noticed I did no attach a binary for easy experimentation, so here's a random up-to-date version.

The code currently occupies approximately 4K (of the 8K available in MULTICOMP). I do wonder if instead of cramming more stuff into the ROM I should perhaps go the opposite route: Squeezing the "autoload from FAT" into as little room as possible (2K is more than enough for this, but 1K may not fit) so it'll load the rest of the system (console and tools) from storage. This in effect would be a minimal BIOS in ROM, which then loads a proper system from disk. This would enable a 62K RAM + 2K ROM configuration of MULTICOMP (currently it's 56K + 8K), which I guess is a decent amount of RAM for a 6502 computer without memory management.

Hmmm.


Attachments:
skernal.zip [6.33 KiB]
Downloaded 135 times
Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 29, 2014 10:54 am 
Offline
User avatar

Joined: Fri Oct 31, 2003 10:00 pm
Posts: 200
I like the idea of a minimal loader, just enough simple code to load more complex programs. Be it a Basic, or an OS that can execute programs itself/

Complete freedom to load any program/operating system.


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 29, 2014 9:39 pm 
Offline
User avatar

Joined: Wed Aug 27, 2014 6:05 pm
Posts: 6
I forked a new code base for the "small bootloader with FAT-support" idea, called "tinyload". The source is over at https://github.com/maikmerten/tinyload

I'm currently down to 1237 bytes, so 2K of ROM indeed is plenty. I'm sure I can shave off even more, but getting this into 1K may prove difficult. I guess 1.5K ROMs are pretty unusual? (Then again, MULTICOMP is a FPGA project...)


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 30, 2014 10:55 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10975
Location: England
That's a nice achievement. Note that boot code in an FPGA can be pre-loaded into RAM, or into a mixture - so it doesn't have to remain as dedicated ROM, depending on what you want.

Cheers
Ed


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 30, 2014 11:55 am 
Offline
User avatar

Joined: Wed Aug 27, 2014 6:05 pm
Posts: 6
Okay, am now down to 1019 bytes and I can quite possibly chew off some additional bytes. If I manage to get it small enough to clear the I/O-area (which overlaps ROM on MULTICOMP) and the reset/irq vectors one can squeeze it into a 1K ROM, making 63K of RAM available.

As for preloading into RAM: The FPGA used by MULTICOMP only has a few K of RAM, so an external SRAM-Chip is used for the configurations with spacious memory (the wiring of which can be seen on the right-hand side of my avatar picture). That one always starts empty/undefined.


Last edited by kiamnetrem on Sat Aug 30, 2014 1:21 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 30, 2014 12:32 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10975
Location: England
Ah, right - thanks!


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 30, 2014 2:06 pm 
Offline
User avatar

Joined: Wed Aug 27, 2014 6:05 pm
Posts: 6
Okay, tinyload is now 962 bytes. I think that's enough to not reach into the the I/O region starting at 0xffd0. So a 63K RAM + 1K ROM configuration is possible for the MULTICOMP.


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 14, 2014 8:37 am 
Offline

Joined: Tue Oct 14, 2014 8:27 am
Posts: 1
Hello everyone,
i just found this thread. In some weeks i'll get my FPGA-Board, and i'm planning to build the Multicomp too. It would be great to design a fully functional computer system with FAT-Filesystem,Sound and Graphics based on the this design. I just thought about segmented memory: You could copy the bootloader to external RAM and then switch of the internal ROM. Just like the C64.

By the way, this could be interesting: http://papilio.cc/index.php?n=Playground.C64SID

Greetings, SIGINT


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: