Most of you probably know about the operating system Contiki, which was developed primarily for Commodore 64. It has been ported to a lot of other 6502 based systems, as well as other CPUs. The operating system is written in C, tailored for the cc65 compiler. I know Oric developers may prefer a different C compiler though.
Well, lcc65 is quite ANSI compliant.
If Contiki is cleanly writen, there's no reason it could not be compiled with the OSDK.
The fact that Oric developers prefer a different C compiler is not a general case. For example Jede has been using CC65 from the start, and started some basic standard library code.
cc65 today has limited support for Oric Atmos. Simple programs can be compiled, but there is no true file I/O and a lot of other shortcomings in the library. There exists a high resolution graphics driver though.
Well, we have most of the standard library working in the OSDK, thanks to the efforts of my predecessors. The parts that not have been implemented are mostly concerning the filesystem, and mostly because the Oric filesystem is very BASIC oriented, and does not have (for what I know) any concept of file handles or bufferisation.
IMO, in order to get that, the best way is to rewrite the DOS entirely. Keeping the fileformat is not necessary, but would make it possible to deal with existing floppies. Of course it's probably possible to do like on the Amiga, and get a standard default filesystem that can be extended later to support other formats.
While I played around with compiling the latest release of Contiki for VIC-20 (which I'm the port maintainer of), I decided to see how far an Oric port would go. Without file I/O, the dynamically loaded modules would have to be linked statically to the executable. In my attempts so far, I forgot to link the required modules, so when I start the system, almost nothing happens..
Yep, can understand that.
From my experience with the VIC-20 port, it appears that about 40K of available RAM is the least required to get Contiki running with a basic window system and network support. The C64 can switch out the ROMs and get all 64K available. How much memory can I expect to squeeze out from a 48K Oric Atmos? Are there some special tricks, and would they be easy to apply from C?
The advantages is that if we rewrite the DOS, we can get a lot of free memory. We don't need most of what is present in the DOS. A big part of it is just a bunch of code that extend the basic, there's also all the builtin commands to display the directory, stuff like this.
What we need (imo), is just 3 layers of code:
- a hardware level to detect drives, detect disc changes, read and write sectors and format disk. This part could be implemented differently on Jasmin and Microdisc drives.
- a file and disc manager, that understand the concept of files, directory, and disc mapping.
- an implementation of the c standard library, file access (open, read, seek, close), directory acess (opendir, stats),, ...
Correctly done, this would probably use only a fraction of the 16k of overlay memory.
Is anyone interested in Contiki? Is there some support (file I/O, other interesting library functions) in the OSDK that could be transferred to cc65? Which of the compilers generate the best code and is most complete, i.e. is it likely that Contiki would compile with lcc65? I know from attempts to run it on Z80 platforms, that both z88dk and sdcc were incompatible but after much tweaking there was an Amstrad CPC port last year.
All the libraries of the OSDK are available as source code directly in the "lib" folder. Just download and check.
Considering code quality/size, it may be interesting to do some comparisons, and I guess that compiling some parts of Contiki may be a very good idea
