GNU compiler collection for 6502

You need an actual VIC.

Moderator: Moderators

User avatar
Kakemoms
Vic 20 Afficionado
Posts: 488
Joined: Sun Feb 15, 2015 8:45 am

GNU compiler collection for 6502

Postby Kakemoms » Sat Jul 30, 2016 5:32 am

I found the source code repositry here, but haven't found any post here about it.
Is anyone here using it for the Vic-20?

User avatar
Mike
Herr VC
Posts: 3016
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: GNU compiler collection for 6502

Postby Mike » Mon Aug 01, 2016 2:09 am

I wasn't aware there are implementations of GNU compilers that run on the VIC-20.

User avatar
Kakemoms
Vic 20 Afficionado
Posts: 488
Joined: Sun Feb 15, 2015 8:45 am

Re: GNU compiler collection for 6502

Postby Kakemoms » Mon Aug 01, 2016 5:35 am

Its a general 6502 port, so to run it on a 6502 machine one needs the appropriate libraries (like the ones for cc65g). If no one here knows about it, then there is probably no Vic-20 port yet. From the comments under "issue" section it looks like its at least running on C64.

I also found a Linux variant that runs on C64, but it may not be related: http://lng.sourceforge.net/

Edit: I found some install instructions here that points out that the C64 version is not fully up, but that the package compiles under cc65.

groepaz
Vic 20 Nerd
Posts: 597
Joined: Wed Aug 25, 2010 5:30 pm

Re: GNU compiler collection for 6502

Postby groepaz » Mon Aug 01, 2016 6:48 am

it does NOT run "on" the c64 - it produces code that can then run on the c64. (and lng isnt "a linux variant" at all...)

User avatar
Mike
Herr VC
Posts: 3016
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: GNU compiler collection for 6502

Postby Mike » Mon Aug 01, 2016 11:17 am

If those compilers do not execute on the C64, and supposedly neither do so on VIC-20, this thread here should be moved to the "Emulation and Cross-development" Section.

User avatar
Kakemoms
Vic 20 Afficionado
Posts: 488
Joined: Sun Feb 15, 2015 8:45 am

Re: GNU compiler collection for 6502

Postby Kakemoms » Tue Aug 02, 2016 12:43 am

groepaz wrote:it does NOT run "on" the c64 - it produces code that can then run on the c64. (and lng isnt "a linux variant" at all...)


Thanks for clearing that up. Is there any other "linux" variants (or minix) that run under 6502?

groepaz
Vic 20 Nerd
Posts: 597
Joined: Wed Aug 25, 2010 5:30 pm

Re: GNU compiler collection for 6502

Postby groepaz » Tue Aug 02, 2016 4:28 am

no not really, linux is really a bit too heavy for that :) there are some other projects that use a somewhat similar approach, one of which is LNG (which is dead unfortunately). the most "serious" one i have seen is "fuzix" (find it on github) - but that has not been ported to c64 or vic20 yet.

User avatar
Kakemoms
Vic 20 Afficionado
Posts: 488
Joined: Sun Feb 15, 2015 8:45 am

Re: GNU compiler collection for 6502

Postby Kakemoms » Tue Aug 02, 2016 1:58 pm

groepaz wrote:no not really, linux is really a bit too heavy for that :) there are some other projects that use a somewhat similar approach, one of which is LNG (which is dead unfortunately). the most "serious" one i have seen is "fuzix" (find it on github) - but that has not been ported to c64 or vic20 yet.


Well, someone got Minix to run on his own computer with a home-made cpu (made from 74xx chips) and 64KB. I don't see the Vic-20 as being inferior to that.

User avatar
Mike
Herr VC
Posts: 3016
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: GNU compiler collection for 6502

Postby Mike » Tue Aug 02, 2016 9:42 pm

Kakemoms wrote:Well, someone got Minix to run on his own computer with a home-made cpu (made from 74xx chips) and 64KB. I don't see the Vic-20 as being inferior to that.

Just to set the facts straight: the CPU of this machine (Magic-1) has 22 bits address space with 64K segments/pages and I/O; and the computer contains 4 MB RAM in total.

User avatar
Kakemoms
Vic 20 Afficionado
Posts: 488
Joined: Sun Feb 15, 2015 8:45 am

Re: GNU compiler collection for 6502

Postby Kakemoms » Wed Aug 03, 2016 2:58 am

Mike wrote:
Kakemoms wrote:Well, someone got Minix to run on his own computer with a home-made cpu (made from 74xx chips) and 64KB. I don't see the Vic-20 as being inferior to that.

Just to set the facts straight: the CPU of this machine (Magic-1) has 22 bits address space with 64K segments/pages and I/O; and the computer contains 4 MB RAM in total.


From the homepage: "It's a one-address, microprogrammed machine with one-byte opcodes. It features 8/16-bit data operations, functioning on an 8-bit wide data bus with 16-bit addresses (mapped via 2K-byte pages into a 22-bit physical address space)."

So it sounds like a 6502 with a mapped memory expansion. And there are several of those for the Vic-20. So then the question becomes how much mapped memory one needs to get it running?

User avatar
Mike
Herr VC
Posts: 3016
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: GNU compiler collection for 6502

Postby Mike » Wed Aug 03, 2016 3:59 am

Just because it has an 8 bit data bus doesn't mean a CPU "has" to resemble a 6502 in any way. And, from more careful reading, you could already have deduced by yourself, that the CPU of the Magic-1 has a custom designed instruction set.

For me, there's not much sense to elaborate further if there's a sensible way to get a Unixoid OS running on a 65xx in general, and on the 6502/VIC-20 in particular: just take a look at the Contiki port by Carlsson - that one got to a dead end because the available address space is obstructed by the ROM ranges. He barely got a stack running on it. Or take a look at Lee's web server: it uses a (non-intelligent!) ISA network card - the VIC-20 is able to run a web server on it, barely.

There are no standardized means of memory management and protection. Only a CPU with 8 bit data bus and 16 bit address space (and at 1 MHz). Sloo-oo-oow peripherals. A functional, but (for your intended use woefully) inadequate video system. Etc. Simply the wrong tool for the job!

Doesn't mean you can't do anything on the VIC-20. It just means one needs a sensible judgement of what is possible to achieve with the VIC-20 hardware, and what is not. If you lack that judgement, you'll put just lots of hours into waste because it won't work out.

I had similar discussions with MRaider/FD22, who also concocted that writing an own OS would somehow help to transcend the limits of the VIC-20 hardware. With exactly 0 (read: zero!) results after four years. That track record should speak for itself.

Kakemoms, please don't fall into the same trap. There's still enough to explore on the VIC-20, still something new to try out - with standard h/w, external expansions or moderate modifications of the mainboard; and new algorithms - and here in Denial you have a huge collection of knowledge, and can you ask for collaboration or help. And the best releases of the last years most often were not one-man-shows.

Think about this.

groepaz
Vic 20 Nerd
Posts: 597
Joined: Wed Aug 25, 2010 5:30 pm

Re: GNU compiler collection for 6502

Postby groepaz » Wed Aug 03, 2016 7:52 am

actually fuzix was designed for 8bit CPUs with segmented memory - however it will not work well unless you can provide fast context switching (meaning being able to bank the stack page at least on 6502).

User avatar
Kakemoms
Vic 20 Afficionado
Posts: 488
Joined: Sun Feb 15, 2015 8:45 am

Re: GNU compiler collection for 6502

Postby Kakemoms » Thu Aug 04, 2016 2:06 am

Mike wrote:For me, there's not much sense to elaborate further if there's a sensible way to get a Unixoid OS running on a 65xx in general, and on the 6502/VIC-20 in particular: just take a look at the Contiki port by Carlsson - that one got to a dead end because the available address space is obstructed by the ROM ranges. He barely got a stack running on it. Or take a look at Lee's web server: it uses a (non-intelligent!) ISA network card - the VIC-20 is able to run a web server on it, barely.

There are no standardized means of memory management and protection. Only a CPU with 8 bit data bus and 16 bit address space (and at 1 MHz). Sloo-oo-oow peripherals. A functional, but (for your intended use woefully) inadequate video system. Etc. Simply the wrong tool for the job!

Doesn't mean you can't do anything on the VIC-20. It just means one needs a sensible judgement of what is possible to achieve with the VIC-20 hardware, and what is not. If you lack that judgement, you'll put just lots of hours into waste because it won't work out.

I had similar discussions with MRaider/FD22, who also concocted that writing an own OS would somehow help to transcend the limits of the VIC-20 hardware. With exactly 0 (read: zero!) results after four years. That track record should speak for itself.

Kakemoms, please don't fall into the same trap. There's still enough to explore on the VIC-20, still something new to try out - with standard h/w, external expansions or moderate modifications of the mainboard; and new algorithms - and here in Denial you have a huge collection of knowledge, and can you ask for collaboration or help. And the best releases of the last years most often were not one-man-shows.

Think about this.


What do you mean inadequate video system? It has colors and several bits of resolution!

Thanks for the info & links.

groepaz wrote:actually fuzix was designed for 8bit CPUs with segmented memory - however it will not work well unless you can provide fast context switching (meaning being able to bank the stack page at least on 6502).


Ah, I see. That is interesting. While the 6502 can't do that, my 65C02 expansion can do it. Currently there is only 4 pages, but I have increased that to 16 in the next version (with 1MByte memory). I will keep that in mind for the next layout. Its a simple poke to switch to a different 64KB page.

User avatar
Mike
Herr VC
Posts: 3016
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: GNU compiler collection for 6502

Postby Mike » Thu Aug 04, 2016 5:08 am

Mike wrote:[...] A functional, but (for your intended use woefully) inadequate video system. [...]

Kakemoms wrote:What do you mean inadequate video system? It has colors and several bits of resolution!

From the context, it should have been clear to you that this sentence (and the whole paragraph, and the one preceding it) referred to the VIC-20.

User avatar
Kakemoms
Vic 20 Afficionado
Posts: 488
Joined: Sun Feb 15, 2015 8:45 am

Re: GNU compiler collection for 6502

Postby Kakemoms » Thu Aug 04, 2016 11:22 am

Yes I was talking about the Vic-20 too! What a coincidence..


Return to “Emulation and Cross Development”

Who is online

Users browsing this forum: No registered users and 1 guest