Welcome, Guest. Please login or register.

Author Topic: Contiki: I wonder....  (Read 6828 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Contiki: I wonder....
« on: April 07, 2005, 04:06:35 PM »
Hey all.

Something popped into my head late last night. Thought I'd share it with you.

As you may or may not be aware, there is a little almost-OS called contiki.

It has been ported to heaps of platforms because it is written in C.

Now, even if it were to run as an app, I think it'd be great fo amiga.
Imagine a TCP/IP stack, a (simple) web browser, http, and ftp server, irc client, and a few other things living in probably less than 100kb. I would love that for my 1mb a500.

Main thing that troubles me is contiki's multitasking vs the amigas multitasking. Probably not that hard to get around. preemptive multitasking is so simple.

Anyway, what are everyones thoughts?
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: Contiki: I wonder....
« Reply #1 on: April 07, 2005, 04:22:42 PM »
it does indeed run on a c64. I put it on disk about a year ago and chucked it in. Worked great. It's advanced since then though.

Been wanting to try it on my apple//e too.

someone even ported it to an atmel micro!
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: Contiki: I wonder....
« Reply #2 on: April 08, 2005, 02:54:36 AM »
Ah..here it is. I guess this thread does kind of fit into alternative OSes a bit better.

I do find Adam Dunkels' projects interesting too. I'm always impressed by small, functional programs created in a 3GL language.

Like I said, my a500 only has 1mb of ram, so anything that works in less space is interesting to me.

Unfortunately I have no knowledge of the Amiga APIs, or any of the development tools/docs, so I definitely wouldn't be one to port any of it.

Could also make an interesting replacement for launcher on palm. but not really worth the effort.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: Contiki: I wonder....
« Reply #3 on: April 08, 2005, 12:07:42 PM »
Hm. I thought that contiki was meant to be preemptive. I admit I thought it a little odd though. But if a CPU has interrupts, it can usually have a preemptive multitasking kernel made for it.
The multitasking would need to be changed for different platforms anyway. But it wouldn't need too much alteration if it runs as an app and the programs as loadable modules. That way Amigas OS can do the multitasking.

does anyone remember writing apps for win3.1? It needed bits put into the apps for the kernel to break in and multitask. This was great for jamming up a PC.
Back to the point. The method of cooperative multitasking became moot with the preemptive core. the core just broke in whenever it felt like it. Timed interrupts are a wonderful thing.

edit: Why would you want a c64 emulator on the amiga exactly? Not for the threading I hope? It's all portable you know  :-)
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
wow. Talk about different...
« Reply #4 on: April 11, 2005, 12:48:27 PM »
I just tried the latest release of contiki. It has really changed! Most notably a different menu system and ctk 80 column mode (c64 version).

If it can be ported to native X, I see no reason why it can't work on an amiga!
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #5 on: April 13, 2005, 11:33:31 AM »
It's true, AmigaOS is good. I think contiki is stiff competition against OS 1.x though...

I had a better read about contikis multiprocessing abilities. I see what you mean. Except it uses preemptive multithreading as a loadable library of ~4k when it just can't be done without. Still pretty small, but on a 64k system, pretty big.

what about uIP? for those of you saying "eh?" Look here.

It's tiny!!!!

I'd love to see a port of a small IP stack to amiga. Just make sure it works on 1.3  :-D
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #6 on: April 13, 2005, 12:44:36 PM »
Ohhh... I see. Any idea why the stack's no good?
It's just it's been used for a few ports of contiki, so I thought it would have been more veratile. Ah well. It's not my forte anyway.

Another year older. Happy birthday tooo meeeee.....

It should be interesting to see what you will create!
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #7 on: April 13, 2005, 01:37:47 PM »
You don't have any amiga programming experience either?

About the same as me. Except I'm guessing you're still an active programmer. I'm horribly rusty. Trying to relearn it all again. All I can still really understand is ANSI C and a few assemblers including PIC, and basic, but that doesn't count. I'd rather be tortured than use pascal again.

I think I'm moving again sometime too. I don't know.

I'm going to hassle one of the developers at infogrames for a job tomorrow. It can't hurt  :-D It'll give me more cash for living.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #8 on: April 13, 2005, 03:34:13 PM »
I agree about difficulty with documentation. There are usually books on ebay, but they cost money. Sometimes serious money.

Most of the info I find is sketchy at best.
There's probably a lot in the headers of various compiler packages. But there are some things that can't tell you.

I'm not even sure if the so called amiga developer CD would be much use.

Best of luck though.

There are probably people out there that would donate information to a worthy cause like a nice small IP Stack. Can't hurt asking.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #9 on: April 14, 2005, 01:13:14 AM »
I didn't even think of the obligation. Dont I feel silly. In my defense, I just had a very big meal of filipino takeaway and was feeling kind of sleepy....

I didn't realise 1.3 was that bad! Although I did kind of expect it. When I finish the kickflasher it'll be upgraded anyway. Probably to 3. Then I'll get even more upset with the lack of RAM and upgrade to 9mb total.

Don't blame you for saying no to porting contiki. It'd be interesting but not really worth the hassle unless someone really wanted it. Did I mention it can have a VNC interface?
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #10 on: April 14, 2005, 02:14:37 PM »
It's true. Pre-emptive multitasking is simple.
IIRC it involves the following steps (varies a little from platform to platform). This is a very basic example.

* Induce an NMI. Whether it be from a clock or whatever.
* Jump to handler.
* Save registers, PC, and stack somewhere.
* Grab next process from the list
* load its stack, registers and PC.
* End interrupt

I have nasty memories of doing this in MIPS RISC assembler.

Its what I don't get about contiki. I can only guess why cooperative multitasking was used. Maybe for portability?
It can also help if you don't want to reimplement low level functions. more than one preemptive multitasking OS can't happily coexist on one machine (VMs excluded).

Ohhh. I thought that AmigaOS 2+ made it a bit easier for networking.
That's just a completely uninformed guess.
And 1.3 seems to be fighting me all the way. Everything I find needs wb/ks 2 or later. I'd like FFS for floppies, and the ability to unmount too.

I'm going to have one helluva card under my 68k. I shot myself in the foot with the hard drive controller. If I could un-superglue the connector from my interface card I could add the extra connections I need for the RAM expansion. But I can't.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #11 on: April 14, 2005, 03:37:29 PM »
Heh. I forgot about race and deadlock. You can still get it though with preemptive multiprocessing.
Usually where shared resources, I/O and job control are concerned. There are algorithms to get around all that, but it makes the OS grow.
Even if it is something as simple as a semaphore or a mutex.

I keep getting urges to read through my concurrent systems stuff, but then I realise that my textbook can be fairly impenetrable without the right mindset.

WB1.3 does have some horrible hangovers I agree. It....angers....me. Can't wait to upgrade.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #12 on: April 14, 2005, 04:32:47 PM »
I wouldn't want you going out of your way to do it. Especially if software support is scant. Now that I think of it, the logical progression of thoughts says that if there isn't a TCP/IP stack available that works properly with wb1.3 then there probably won't be any software that uses said stack.

I just feel that 1.3 is incomplete somehow. It does some things, and only half-does others. Sort of like GTA3. There are so many half finished things in that game. If they'd finished off a lot of the things they were putting in, it would have been something extra special.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: wow. Talk about different...
« Reply #13 on: April 14, 2005, 09:48:01 PM »
Not possible with vanilla C. It has to be done with assembler. C, especially of the ANSI variety knows jack about hardware, because that violates the 'platform independence' of ansi C.

I hate to think of what C would do if used for state saving and restoration. hehe. strange concept really.

Gotta say it. ANSI C is platform independent, fast and good at what it does. Java is none of those. Sorry, I just _really_ hate java. It was a good idea (I guess) that went badly astray.

I find contiki inspiring. To my eyes anyway, it is more capable byte for byte than GEOS, which was painfully optimised assembler. Mind you, geowrite still impresses me.

More OSes should be like it.
I get upset that any OS needs more than 1mb RAM. It shouldn't!...unless it does a lot of things like unix/linux which does pretty well at keeping its RAM footprint down.

And windows shouldn't need more than 640k RAM, because nothing should ever need more than that, eh, Mr. Gates?
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3
 

Offline GeneraleTopic starter

  • Full Member
  • ***
  • Join Date: Feb 2005
  • Posts: 233
    • Show all replies
    • http://members.dodo.com.au/~izabellion
Re: Contiki: I wonder....
« Reply #14 on: April 15, 2005, 11:40:52 AM »
I can't use MUI. Either that or I'm doing something wrong.
A500 (salvo): 1Mb RAM (512k chip, 512k SlowFast)
1x880k Floppy Disk, 1xIBM 540Mb 3.5\\"HDD KS1.3, WB1.3
1084S monitor. AT Keyboard!
A500 (Whitey): 512k RAM, 1x880k Floppy Disk, KS1.2, WB1.3