RetroBSD

2.11BSD operating system for microcontrollers
It is currently Tue Sep 25, 2018 4:41 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Apr 27, 2014 10:39 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
When reading older docs (on PDP-11 etc) one of the selling points was the great real-time multitasking capability, thus good use in technology process control. I even found the system was able to process up to 20kHz real time ADC sampling..
Is there any guide/advice how we can use the interrupts with retrobsd? For example the external one - I have an external system, providing data 100x per second, it will assert an interrupt signal on an input pin, and I will read a port with the new data then.
How the stuff works? Is that even feasible here?

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Mon Apr 28, 2014 5:43 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi PIto,

Yes it IS feasible. And not too hard.

As currently implemented, RetroBSD uses one interrupt address.

I put a RAM link just after interrupt entry that could be turned on by writing an execute address into that RAM link. Depending on what is running you can get 20 Hz or so interrupts or much faster if serial port is active. Of course, your program can ignore anything it wishes.

I am sure you can go MUCH faster than 20kc. You would need to set a timer or external source to tweek an interrupt line and then intercept it when the hardware responds. If you are acquiring non-continuous data you can turn off everything else for your data acquisition phase. I had to do this with my RF stuff since my spi routine was so slow ( as previously noted :).

Further questions?

Lots of fun.

Wiz


Top
 Profile  
 
PostPosted: Wed Apr 30, 2014 8:50 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
There is dependency on the "disabling the interrupts issue" during the access to swap/filesystem.
Long time back Serge indicated the interrupts are disabled during a single 512bytes large sector r/w only - we discussed whether it is 300us or more - but today, with the new rd_sd.c strategy and rdisk.c it seems to me we are disabling the interrupts during the whole file accesses (correct me).
The typical sizes of such i/o transfers to the swap are 1kB - 80kB, with fs files even much more, so the times with disabled interrupts might be quite large.
That has in impact on the internal clock, uart, etc. (ie. Zmodem might be the affected program we use quite often).

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Wed Apr 30, 2014 3:24 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Pito,

What to do when is THE question. We have one CPU core shared among many uses.

Whether code is being executed at a part of an interrupt or plain op codes you only get so much CPU.

And the RAM and flash latency, and user/system issues add real curve balls to real applications.

How can we make the system the most useful? If there is one lesson from Unix and DOS, simplicity and open easy to understand code helps a lot.

The luxury of using interrupts makes much less CPU power available to all programs, but makes it possible to run more things without extensive special purpose programming.

I think we have a pretty good system. I did a patch set which I am using with some ideas that I think are important. I am most impressed to be editing, compiling and debugging without a HUGE support computer attached.

If I can get my RF chip running and doing networking, that would add a lot of additional usefulness.

Another useful feature would be the ability to mount the filesystem of an attached computer, RetroBSD or other into the RetroBSD filesystem. And of course there is telnet, ssh and sftp.

Lots of fun.

Wiz


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

All times are UTC


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:
cron




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission