OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 10:55 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject: Re: Geri's platform
PostPosted: Fri Oct 25, 2013 1:54 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
done:
-preprocessor seems okay.
-variable hierarchy seems okay
-realising of data types
-realising if and for staments
-realising strings
-processing namespaces
-decoding while's
-relocating global variables
-processing things within catnails
-computing sizeofs (not fully done yet)
-computing static number operations


checklist:
-decoding of for cycles
-decoding of ,,if-else''
-simplyfier of the complex formulas
-converting typedef to #define
-decoding declarations
-implementing ,,switch'' keyword
-implementing structs
-decoding operations


compiler nearly reaching 5000 line

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Sun Nov 10, 2013 7:46 am 
Offline

Joined: Sun Dec 23, 2012 12:13 pm
Posts: 9
Although I have big doubts about its performance (even with loads of cores), I personally think this is a cool project..
designing a CPU *and* having the possibility of building the hardware, for which you write an OS is kind of awesome


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Sun Nov 10, 2013 8:14 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
yeah, thanks, maybe.
however the heavyest part is the c/c++ compiler i guess
so after i finished with that, i pauses the project, i will release the compiler publicly, independently.

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Mon Nov 11, 2013 5:46 am 
Offline
Member
Member
User avatar

Joined: Fri Jul 03, 2009 6:21 am
Posts: 359
abhoriel wrote:
Although I have big doubts about its performance (even with loads of cores), I personally think this is a cool project..
designing a CPU *and* having the possibility of building the hardware, for which you write an OS is kind of awesome

Here's an Alan Kay quote from http://folklore.org/StoryView.py?project=Macintosh&story=Creative_Think.txt
Quote:
People who are really serious about software should make their own hardware.

I agree with abhoriel, this Geri is doing something interesting.

_________________
Every universe of discourse has its logical structure --- S. K. Langer.


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Sat Dec 07, 2013 6:27 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
c to simplifyed c compiler pass shortly will reach milestone1.

this was one of the most hardest programming work probably in my entry life. i mistakenly believed that the assembler will be more heavy, but not (however that seems to be a very heavy work too, but that is at least trivial).

there is some little works left to reach milestone 1:
-convert craps to ,,long'' within [ ] -s (0% done)
-convert craps to proper formats when calling functions (50% done)
-fix converting issue with things within ( ) when calling functions ( e.g. sqrtf(a+b+c+d) )
-short the complex formulas properly (e.g. a=b+c*d (*, so the back starts first))
-blow up the complex formulas (e.g. a=b+c+d -> tmp=b+c;a=d+tmp)

after this, the compiler will be able to properly compile symple *REAL* algorythms like bubble sort or shell sort at lest to simplified c, if this happens, i start to write the c to text assembler (which will probably take lesser time). if assembler is done, i will be finally able to generate binary code.

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Sun Dec 08, 2013 5:06 am 
Offline
Member
Member
User avatar

Joined: Mon Aug 10, 2009 2:54 am
Posts: 27
Location: Slovakia
Geri wrote:
-blow up the complex formulas (e.g. a=b+c+d -> tmp=b+c;a=d+tmp)

This seems like a weird explicit goal...

Quote:
-short the complex formulas properly (e.g. a=b+c*d (*, so the back starts first))

And this just has me wondering.

Do you know what a recursive descent parser is? Do you know anything about formar grammars? (E)BNF? Abstract syntax trees?

Don't get me wrong I don't want to discourage you, but there are very well known ways of accomplishing your goals. It sound to me like you are trying to figure these on your own. (Which is not a bad thing at all!)

_________________
Keep the world with all its sin
It's not fit for livin' in


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Sun Dec 08, 2013 6:25 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
no, i never did compiler before. i dubt those techniques would help me aniway, other c compilers are long and complicated as hell also.

but its does not matters any more since i am almost done.

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Mon Dec 09, 2013 3:16 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
ok lets see the first ,,screenshot'' from the sysetm.

Image

simplifyed C - half way beethwen C and binary code.

it seems from a 60 line long c code, there is a ~200 line length simplifyed c code being produced. i assume that from this, around 1000 instruction long binary code will be compiled. this means 32 kbyte code for executing a 60 line long generic c code. however this can be bigger or slower.

when comparing to x86, where 10.000 line C code creates around 150 kbyte of binary

x86: generally 15 byte binary code per line (with gcc)
my subleq compiler: 533 byte binary code per line

note that most of it used as some kind of local stack in my case, so we can say that x86 (+ gcc) is generally 20x more effective than my subleq architecture.

since i am expecting a 5-10x slower general execution compared to x86 aniway, this does not make it more slower. but i will need a code optimizer later, that decrases the memory demand. i alreday figured out, how to do one, but the first goal is to make it working, and optimize only after that. i hope the memory demand is decrasable with 50%.

but my original suggestion to use 4 kbyte l1 cache seems bad idea, i must lift this number up to 8 kbyte temporally. i will measure the number of the cache misses later.

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Tue Dec 17, 2013 11:34 am 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
i alreday started to write the binary code generator. i hope that shortly i will be able to execute the folowing code:

int a=0;
void main(){
do{
a++;
}loop
}

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Sun Dec 29, 2013 5:35 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
sorry, i not yet was able to build binary

also

just noticed x86-s fake-little crapshit endiannes:
7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24

anybody know what is the point of this?
i plan to use true littleendian representation:

63 62 61 60 59 ..... 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Mon Dec 30, 2013 10:04 am 
Offline
Member
Member
User avatar

Joined: Fri Jul 03, 2009 6:21 am
Posts: 359
Geri wrote:
sorry, i not yet was able to build binary

also

just noticed x86-s fake-little crapshit endiannes:
7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 23 22 21 20 19 18 17 16 31 30 29 28 27 26 25 24

anybody know what is the point of this?

I don't think you understand little endian. When you can explain the output of the following program on a little endian machine, then you will understand little endian.
Code:
/*
* endian.c
*/
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>

main(int argc, char**argv)
{
  int fd;
  unsigned int word = 0x31323334;
  char *string = "1234";
  if(argc != 2)
    {
      fprintf(stderr, "Usage: %s out_file\n", argv[0]);
      exit(-1);
    }
  fd = open(argv[1], O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);
  if(fd < 0)
    {
      perror("open");
      exit(-2);
    }
  if(write(fd, &word, 4) != 4)
    {
      perror("write");
      exit(-3);
    }
  if(write(fd, string, 4) != 4)
    {
      perror("write");
      exit(-3);
    }

  close(fd);
}

Code:
bwat@eeepc:~/slask$ uname -m
i686
bwat@eeepc:~/slask$ make endian
cc     endian.c   -o endian
bwat@eeepc:~/slask$ ./endian endian.output
bwat@eeepc:~/slask$ hexdump -C endian.output
00000000  34 33 32 31 31 32 33 34                           |43211234|
00000008

_________________
Every universe of discourse has its logical structure --- S. K. Langer.


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Mon Dec 30, 2013 12:14 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
i mistakenly believed little endian means

15 14 13 12 .... 8 7 6 5 4 3 2 1 0

and big endian means

0 1 2 3 4 ... .7 8 9 10 ... 14 15

but, okay, then my system is big endian

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Mon Dec 30, 2013 12:18 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
also, wikipedia says there is bit-level endianness exist too.

so if my system is
63 62 61 60 59 ........ 10 9 8 7 6 5 4 3 2 1 0, then my system is a big-endian LSB if i mistaking properly

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Mon Dec 30, 2013 1:48 pm 
Offline
Member
Member
User avatar

Joined: Mon Aug 10, 2009 2:54 am
Posts: 27
Location: Slovakia
Unless you can address individual bits then it doesn't make sense to talk about bit level endianness. x86 has bytes as smallest addressable units of storage so talking about the order of bits in a byte on x86 is irrelevant. Bit level endianness is really only relevant in serial data transfer.

_________________
Keep the world with all its sin
It's not fit for livin' in


Top
 Profile  
 
 Post subject: Re: Geri's platform
PostPosted: Mon Dec 30, 2013 2:47 pm 
Offline
Member
Member
User avatar

Joined: Sun Jul 14, 2013 6:01 pm
Posts: 442
it matters:
-i should be able to somewhat efficently emulate it
-i should keep some compatibility with the existing file formats to be able to load them efficiently
so i think 64bit lsb will be the most proper choose

_________________
Operating system for SUBLEQ cpu architecture:
http://users.atw.hu/gerigeri/DawnOS/download.html


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 65 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 38 guests


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:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group