RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sat Jan 29, 2022 1:27 pm

All times are UTC




Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue Jan 05, 2016 9:52 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
Quote:
This causes the performance of the computer to degrade or collapse.

How can a computer collapse due to thrashing??

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 9:56 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Too much i/o causes SD card (or driver) to fail.


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 10:07 am 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
But we busywait on the sdcard's responses.. How can sdcard be overloaded then?
It may slow down (what happens quite often with Lite imho), but it cannot crash.. (except sdcard's timeouts set to a value X of course).

_________________
Pukao Hats Cleaning Services Ltd.


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 3:43 pm 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
vak wrote:
Current pcc supports only mips1 architecture. I'm not sure anybody still uses so ancient chips these days. Can we replace it with mips32r2? Or should we try to retain the compatibility with mips1?

There is discussion upstream about MIPS ABIs right now. I mentioned that we're only targeting mips32r2 chips.
We don't need to keep backwards compatibility IMO.

_________________
@__briancallahan on Twitter


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 7:48 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi All,

It seems to me that the kernel and most basic applications 'should' work on the oldest hardware. [ MIPS on FPGA with no mult or div for example. ]

While the applications, when speed matters, may 'require' a 'faster' chip.

Look at the whole Linux64 mess. Is 64 really needed?

I think not [IMHO].

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 8:41 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Well, mips1 (actually mips I) vs mips R2 is not just mul/div. MIPS I architecture was introduced in 1985, and MIPS Release 2 in 2002. A lot had been changed during these seventeen years. More detailed picture:
Code:
MIPS I (1985) --> MIPS II (1990) --> MIPS III (1992) --> MIPS IV (1994) --> MIPS V (1996)
                    \
                     \
                      MIPS R1 (1999)
                        \
                         \
                          MIPS R2 (2002)
                            \
                             \
                              MIPS R3 (2010)
                                \
                                 \
                                  MIPS R5 (2012)
                                    \
                                     \
                                      MIPS R6 (2015)

At user level, R2 adds many new instructions, most of which are very useful for the compiler: EXT, INS, MFHC1, MTHC1, ROTR, ROTRV, SEB, SEH, WSBH. It also introduces 64-bit FPU - as implemented in PIC32MZ-EF chip. A performance is enhanced by removing NOP in delay slots for load/store instructions.

Essentially all modern MIPS chips implement MIPS32R2 (or MIPS64R2) architecture. I don't see any reason to continue supporting mips1, or even mips32r1.


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 9:20 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
I used to use MIPS I machines at uni... DECstations - gorgeous machines... Weird mice on them...

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 9:48 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1092
Hi Serge,

I have a dual MIPS running on a Spartan 3E along with a bunch of smaller CPUs. 64MB of DDR. Pretty amazing :).

I played around with what made the core 'much' smaller and eliminating mult/div was the most effective at reducing FPGA size and increasing its speed. Also, mult/div are VERY seldom, if at all used by compiled programs. And can be pretty easily emulated if needed.

The thought was that multiple CPUs and FPGA low level stuff would make doing certain networking tasks MUCH easier.

Not sure that work is relevant today? But I suspect for certain tasks it will prove the ONLY way to move forward while reducing chip count and increasing speed.

I do NOT disagree with your decision. Anyways, that is what was behind my suggestion.

IMHO - An FPGA and a DDR would make a pretty interesting RetroBSD/LiteBSD variation. The FPGA can do certain tasks with speeds that NO CPU can touch :).

Compiling for FPGA makes compiling C look trivial :).

Lots of fun :).

Wiz


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 10:01 pm 
Contributor
User avatar

Joined: Sun Oct 20, 2013 3:15 am
Posts: 322
Back on topic...
I've been sending bug fixes and bug reports upstream. I now have a pcc that can successfully write out an asm file for the c code in the ports/sic directory. We might need that assembler soon :D

I think the question about platform support is a bit of a red herring: for one, pcc can be extended to support any random MIPS version. And second, if Serge's as supports -mips32r2 it almost certainly then supports -mips1. So you can use whichever ISA you want to use (what LiteBSD chooses to officially support, however, is a different question).

_________________
@__briancallahan on Twitter


Top
 Profile  
 
PostPosted: Tue Jan 05, 2016 10:54 pm 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1081
Location: Sunnyvale, CA
Pito wrote:
But we busywait on the sdcard's responses.. How can sdcard be overloaded then?
It may slow down (what happens quite often with Lite imho), but it cannot crash.. (except sdcard's timeouts set to a value X of course).

May be we just wait not long enough, and get wrong data as a result. Incorrect data in the control data structure of a process can easily cause a crash.


Top
 Profile  
 
PostPosted: Wed Jan 13, 2016 7:35 pm 
Contributor
User avatar

Joined: Thu Nov 08, 2012 7:04 am
Posts: 2401
Location: Rapa Nui
I've tried with double..
Code:
// t9.c
// 9 DEG Trigonometric Forensic Calculator Test
// The simulation of the entering "9 SIN COS TAN ATAN ACOS ASIN"
//   into a calculator working in DEG mode.
// For binary coded float/double precision:
//   A good result for single precision would be ~8.9999xx
//   A good result for double precision would be ~8.9999999999999xx
// Mind there are systems using BCD coded (arbitrary) precision floating point
// Try with your pocket calculator :)
// Compiled under PCC
// Pito 1/2016

#include <stdio.h>
#include <math.h>

#define PI 3.1415926535897932384626433832795

double torad(double x) { return x * PI / 180.0; }
double todeg(double x) { return x * 180.0 / PI; }

int main (void) {
   double ninedegree, tmp;

   ninedegree = 9.0;         printf(" 9deg_in= %1.15e \r\n", ninedegree);
   
   tmp = sin( torad( ninedegree));    printf("     sin= %1.15e \r\n", tmp);
   tmp = cos( torad( tmp));      printf("     cos= %1.15e \r\n", tmp);
   tmp = tan( torad( tmp));      printf("     tan= %1.15e \r\n", tmp);
   tmp = todeg( atan( tmp));      printf("    atan= %1.15e \r\n", tmp);
   tmp = todeg( acos( tmp));      printf("    acos= %1.15e \r\n", tmp);
   tmp = todeg( asin( tmp));      printf("    asin= %1.15e \r\n", tmp);
   
   printf("9deg_out= %1.15e \r\n", tmp);
   return 0;
}

Code:
# time cc -S -c t9.c
       27.89 real        21.39 user         0.00 sys
# ls -l
total 32
-rw-r--r--  1 root  wheel   3007 Dec 30 04:50 rc4.c
-rw-r--r--  1 root  wheel   8334 Jan 11 13:41 rc4.s
-rw-r--r--  1 root  wheel   1039 Jan 11 13:58 t9.c
-rw-r--r--  1 root  wheel  11374 Jan 11 14:23 t9.s

See attached t9.s
Interestingly
Code:
$L487:
   .word   1074340347
   .word   1413754136

is the PI .. so really a zero optimization here :)

An attempt to compile with -O2 or -O1 or -O3 or -Os finishes with
Code:
# cc -O2 -S -c t9.c
t9.c, line 35: compiler error: Coalesce: src class 3, dst class 2
error: /usr/libexec/ccom terminated with status 1
#


Attachments:
T9.zip [1.36 KiB]
Downloaded 761 times

_________________
Pukao Hats Cleaning Services Ltd.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3

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