Contiki OS -get the Vic ONLINE!

Discuss anything related to the VIC
Post Reply
Lord Thag
Vic 20 Newbie
Posts: 9
Joined: Wed Nov 16, 2005 5:11 pm

Contiki OS -get the Vic ONLINE!

Post by Lord Thag »

You guys seen this? A GUI operating system that fits in a few hundred BYTES(!) that will allow you to get just about any classic computer online. No joke! They have a Vic-20 version as well. Anyone fiddled with this? I'm going to screw around with on my apple IIc tonight.

The vic version still lack networking
Link:
http://www.sics.se/~adam/contiki/

Amazing stuff!
Playing the world, one cart at a time.
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Yeah, I have Contiki for my C64. Pretty useless actually, but it's a neat demonstration.

I never realized, is the Anders Carlsson who is doing the VIC20 port our own 'carlsson'?
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Yes, it is. :o

Adam had some initial problems in compiling the VIC-20 version, so I helped him. What we both figured out is this:

* Contiki requires more than 24K memory expansion if networking should be included
* The default cc65 configuration is a continuous memory model
* To compile a program in loadable modules, i.e. one part into BLK5 and the other into BLK0-3, the memory configuration needs to be altered

It probably is rather simple to tweak cc65 like this and make a networked VIC-20 version that loads in two parts, but even 32K memory expansion might not be enough to fit both the desktop system and network stack and some application program. So, Lord Thag's description that it fits in a few hundred bytes is a great exaggeration (or the otherwise, whatever it is called in English).

I even considered the option to hand optimize the assembly code output by cc65. I'm not sure how efficient code it outputs, but I'm sure a few percent could be optimized. However, it means that whenever a new version of Contiki, which is written in the C language, is released, the hand optimized assembly has to be created (or patched) again. Also it breaks the portability idea of having the same OS compilable on many platforms.

Since there was no common VIC-20 networking hardware, I never went further with the VIC port of Contiki. I had some ideas to take advantage of the variable screen size, but the VIC library that comes with cc65 seems very much hard coded at 22x23 display. Groepaz had made some changes to the library, but I didn't find them quite sufficient and gave up that project too.

All this happened in the initial stage of Contiki, right before it was publically announced. Since then, a few new versions have been made, but almost only the C64 port (or origin system rather) has taken advantage of the updates to the core system. If anyone wants to update the VIC port, possibly find a way to fit everything in memory, you're welcome to take over the responsibility.
Anders Carlsson

Image Image Image Image Image
Leeeeee
soldering master
Posts: 396
Joined: Fri Apr 23, 2004 8:14 am

Post by Leeeeee »

6502dude
megacart
Posts: 1581
Joined: Wed Dec 01, 2004 9:53 am

Post by 6502dude »

Leeeeee wrote:Vic 20 networking is nothing new ..
I mentioned your site to about a dozen people when I first saw a demo of Contiki (about 2 years ago).

BTW, you have lots of great ideas for the hobbiest.....Thanks :)
Image Mega-Cart: the ultimate cartridge for your Commodore Vic-20
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I wonder, is Lee's custom TCP stack in assembly more suitable than Adam's uIP implemention? Obviously, one can write an operating or at least desktop system that looks like Contiki, MS Windows 3 or anything else in pure VIC-20 assembly and get a lot of goodies and functionality within reasonable memory configurations.

The Contiki source code in cc65 format is out there, and it compiled almost instantly with a VIC-20 target, so if anyone is keen on seeing how far the project is runnable today, and if it is possible to include support for e.g. Lee's network solutions.
Anders Carlsson

Image Image Image Image Image
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

NEWSFLASH!

After a few messages in comp.sys.cbm, I grew bored and downloaded Contiki v1.2-devel1 and the latest version of the cc65 compiler. It took me all afternoon just to compile cc65 properly (stupid MSYS) and then it took me all evening to tweak Contiki into something executable on VIC-20.

Disk image: http://www.cbm.sfks.se/files/contiki.d64

This version of Contiki requires 24K RAM expansion, and uses it pretty much. It still lacks TCP/IP support, since compiling with uIP made the binary much too large to fit the loadable modules and applications. It might be possible to configure the compiler and OS to load modules into BLK5, but I haven't put any efforts into trying that. It would still be very tight in memory, maybe a bit better if Basic ROM can be sacrificed in a system using e.g. Nicolas Welte's 6502 RAM/ROM expansion board.

The colour scheme was chosen by yours truly. The operating system still is not very useful without networking, but at least the port is somewhat up to date with the latest Contiki release.
Anders Carlsson

Image Image Image Image Image
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Nice job. The colors weren't that bad! :wink:

I only saw two problems. One was that the "Directory" program didn't show anything. Also, most of the windows were sized for a larger screen, so they "spilled over" the 22 columns and overwrote the next line.

But the windows could be moved, and typing in the command shell was kind of fun.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Directory worked from the disk image in emulation.. Odd.

Yes, it is true that the programs are written for a larger screen, and a lot of content scroll off screen before you can see it. I believe somewhere in that maze of source code there is a definition of how large screen one uses. At least I tried to implement something like that three years ago, but back then I found the VIC-20 support in cc65 is not as good as one would wish. Perhaps the extra stuff I would like to have in the library are not supposed to be there though. If I find a place to set the screen size, I'll see if the programs behave differently. Some of the apps are machine specific so they could be adapted to your port, but some are generic compiled.
Anders Carlsson

Image Image Image Image Image
User avatar
Schema
factor
Posts: 1430
Joined: Tue Mar 23, 2004 7:07 am
Website: http://www.jammingsignal.com
Location: Toronto, Ontario

Post by Schema »

Do you mean that the same binary for those programs would work under any port?
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Not sure, but at least all ports compile the apps from the same source. A brief directory structure for those who haven't downloaded the code:

Code: Select all

contiki-1.2-devel1
'-->contiki (common)
    '--> apps (e.g. directory, email, ftp, www)
    '--> ctk (e.g. ctk-conio, vnc)
    '--> lib (e.g. file system, petscii conversion)
    '--> ppp (for dial-up)
    '--> uip (TCP/IP sub-system)
'-->contiki-c64 (port)
'-->contiki-vic20 (port)
    '--> apps (e.g. configedit, shell, welcome)
    '--> conf (system configuration files)
    '--> ctk (custom window systems: hires, mouse driver etc)
    '--> loader (file loading, file system implementation)
    '--> uip (custom network interfaces like TFE64, RRNET, Silversurfer)
'-->contiki-cc65 (semi-common)
    '--> apps, lib, loader (only a few)
    '--> uip (RS232, Slip)
There are more directories and files, but I only wrote about what seems the most important. I suppose if one uses a different C compiler than cc65 (e.g. for a Z80, X86, 68K or other machine), one would not use the code in the cc65 subdirectory.
Anders Carlsson

Image Image Image Image Image
pallas
Vic 20 Devotee
Posts: 212
Joined: Mon Dec 24, 2012 2:38 am

Post by pallas »

Sorry to revive this old thread.
I was wondering if, with contiki 2 (which on the c64 has dropped the desktop in favor of single "program+os" binaries), it is now possible to fit networking on the vic-20 port.
groepaz
Vic 20 Scientist
Posts: 1188
Joined: Wed Aug 25, 2010 5:30 pm

Post by groepaz »

fitting eg the irc client into 24k might be doable - you should get in touch with oliver schmidt incase you want to have a closer look
Post Reply