Commit Graph

101 Commits

Author SHA1 Message Date
Serge Vakulenko
b0705e54ab Virtualmips modified to allow access to SRSCtl register.
When only one GPR set supported, opcodes RDPGPR and WRPGPR
behave like MOVE instruction.
2014-05-15 10:48:33 -07:00
Serge Vakulenko
459e3f09ea Kernel startup code modified to support MZ processor.
Based on official MIPS application note
"Boot-CPS: Example Boot Code for MIPS® Cores".
2014-05-14 21:22:48 -07:00
Sergey
a0d4e7f517 Initialization of interrupt controller simplified.. 2014-05-12 23:52:09 -07:00
Serge Vakulenko
dc1a7a5f25 Merge pull request #27 from alexfru/master
C compiler improvements
2014-05-10 00:15:24 -07:00
Alexey Frunze
17f417f519 C compiler improvements
Fix malloc(0) issue (#26) in cpp.
Reduce cpp size and allow for larger inputs.
Clean up unused variables in Smaller C.
2014-05-09 23:53:52 -07:00
Serge Vakulenko
8871099aab Assembler modified to support local common blocks. 2014-05-08 20:00:57 -07:00
Serge Vakulenko
6a2230d867 Fixed couple of issues in assembler:
(1) incorrect opcodes for bnez and beqz instructions;
(2) macro li simplified when low part of constant is zero.
2014-05-08 19:11:19 -07:00
Serge Vakulenko
688209e604 Using gcc 4.8.1 instead of 4.7.2. 2014-05-08 13:06:26 -07:00
Sergey
b238afb5b9 Fixed bug in stracesecmp left from a previous patch.
Also, a minor issue resolved in proc.h.
tools
2014-05-07 22:33:45 -07:00
Serge Vakulenko
bca48c9a66 Fixed size_t comparison in memxxx and strxxx finctions. 2014-05-07 20:57:09 -07:00
Serge Vakulenko
2395d5a9fa Assembler mode ".set at" enabled by default. 2014-05-07 20:27:09 -07:00
Serge Vakulenko
60c7fe0fd3 Merge pull request #18 from RetroBSD/codesourcery
*.mk files modified for compatibility with Mentor Sourcery CodeBench Lite toolchain
2014-05-07 11:39:51 -07:00
Serge Vakulenko
4be5e54c38 Assembler and spi driver fixed for compatibility with latest gcc. 2014-05-07 11:15:56 -07:00
Serge Vakulenko
5e58ad0f3d Merge pull request #23 from alexfru/master
Smaller C: fixes, improvements
2014-05-07 00:28:08 -07:00
Serge Vakulenko
6ccaa1a940 Merge branch 'master' into codesourcery.
All Matt's advices applied.
2014-05-06 19:55:35 -07:00
Sergey
3c025a1e89 Fixed build errors/warnings for gcc 4.7.2. 2014-05-05 23:35:40 -07:00
Alexey Frunze
cdf8933448 Merge remote-tracking branch 'upstream/master' 2014-05-05 21:14:06 -07:00
Serge Vakulenko
058804256a Fixed bug in assembler: incorrect immediate in subu macro. 2014-05-05 20:17:31 -07:00
Serge Vakulenko
a0d072f271 Skeleton: copyright updated. 2014-05-05 12:00:20 -07:00
Serge Vakulenko
f40da13b35 C skeleton simplified. 2014-05-05 11:45:12 -07:00
Serge Vakulenko
19cf54c0c1 Copyright for skeleton updated. 2014-05-05 11:29:53 -07:00
Serge Vakulenko
ed92365a4c Added a skeleton of generic C program. 2014-05-05 11:19:42 -07:00
Serge Vakulenko
a433085324 Merge branch 'master' of https://github.com/RetroBSD/retrobsd 2014-05-05 11:16:30 -07:00
Serge Vakulenko
f39a1429bf Merge pull request #21 from RetroBSD/cc-use-smallerc
/bin/cc command modified to use SmallerC compiler by default (not LCC).
2014-05-05 11:16:06 -07:00
Alexey Frunze
06d027b4c5 Merge remote-tracking branch 'upstream/master' 2014-05-04 01:23:36 -07:00
Sergey
6f47acb2ae Fixed bug in assembler, introduced by previos patch.
(Negative offsets in LW/SW not recognized)
Also, modified stdlib.h for compatibility with SmallerC.
2014-05-03 23:56:57 -07:00
Alexey Frunze
a2bc88bdb6 fixes, improvements, __interrupt
Fixes/workarounds:
- octal escape sequence is to be terminated no later than after three
octal digits:
"\1011" is now parsed equivalently to "A1"
- workaround truncation of immediate operands to 16 bits in MIPS
instructions addi[u], subi[u], slti[u], andi, ori, xori in RetroBSD's as
(disabled since as is being fixed).

Improvements:
- warn on string literal truncation when initializing array of char
- generate trap/break-less form of MIPS div[u]

New:
- experimental support for __interrupt functions (x86/huge only)
2014-05-03 18:55:18 -07:00
Sergey
e0ba612250 Range check fixed in assembler. 2014-05-03 17:33:56 -07:00
Sergey
babef284ae Assembler: mode ".set at" required to enable wide immediates in 2-red macros. 2014-05-03 16:55:40 -07:00
Sergey
51a8fd3313 Assembler: added support for large constants for 2-reg variants (macros)
of 3-reg instructions (add, addu, and, or, slt, sltu, sub, subu, xor).
When mode ".set at" enabled, an additional LI instruction is inserted
sing $1 as a scratch register.
2014-05-03 16:34:19 -07:00
Sergey
f67b9db8b5 Merge branch 'master' into cc-use-smallerc 2014-05-03 01:31:06 -07:00
Sergey
777ad1471b Smlrc: option -v moved to target-dependent part.
Fixed bug in simulator: read from incorrect file descriptor when
the second SD card not configured.
2014-05-03 01:28:48 -07:00
Sergey
aff46df8dd Merge branch 'master' into cc-use-smallerc. 2014-05-03 00:37:37 -07:00
Serge Vakulenko
6f15f0ba23 Merge branch 'exec-elf' of https://github.com/RetroBSD/retrobsd 2014-05-02 22:04:16 -07:00
Serge Vakulenko
6f8e71c1b8 Include files modified for compatibility with SmallerC.
Fixed bug in C preprocessor: buffer size reduced to avoid allocation failure.
Added option -v for smlrc.
New example stdarg.c: a demo of function with variable arguments.
2014-05-02 22:00:30 -07:00
Serge Vakulenko
f105cb5bbd /bin/cc command modified to use SmallerC compiler by default (not LCC).
For LCC, please use /bin/lcc instead.

I believe SmallerC is mature enough to try to use it as a primary compiler.
System include files might need some changes (ifdefs) to adapt.
2014-05-01 10:41:41 -07:00
Matt Jenkins
037fc65e93 Merge pull request #19 from alexfru/master
Smaller C: Improve pointer initialization
2014-04-29 13:43:35 +01:00
Matt Jenkins
07b6681eef Improve configsys option parsing
Up until now all the options in the config system have only been
able to take one word (or one string with no spaces) as a parameter.
This update improves it so it takes everything after the = up until
the end of the line (or the first #) as the parameter.
2014-04-29 13:37:09 +01:00
Matt Jenkins
ce1f5ce4dc Improved congigsys option parser
Up until now, options have only been able to have one single word
(or string with no spaces) as their value.  This small patch improves
that and includes everything to either the end-of-line or # (for in-line
comments) as the parameter for the option.
2014-04-29 13:33:54 +01:00
Alexey Frunze
b652f52cb6 Smaller C: Improve pointer initialization
The following global/static pointer initialization should now work:

static char* p1 = "abc" + 1;
static char* p2 = "abc" - 1;
static char* p3 = 1 + "abc";
static int a333[3][3][3];
static int* pa333_111 = &a333[1][1][1];

Other seemingly (and in fact actually) functionality preserving changes
are only to reduce code size when self compiling for DOS using -seg16.
Improvements and fixes require space, sigh.
2014-04-26 15:53:41 -07:00
Serge Vakulenko
b98de3368e *.mk configuration files modified for compatibility with latest version
of Mentor Sourcery CodeBench Lite toolchain
(https://sourcery.mentor.com/GNUToolchain/release2641).
All detected issues fixed.
2014-04-24 21:06:37 -07:00
Serge Vakulenko
1b15bcff49 Fixed bug in assembler: incorrect offset in LUI instruction. 2014-04-24 11:56:01 -07:00
Serge Vakulenko
3a38f291a7 Merged kernel support for ELF executable format from karolina.lindqvist.
Now kernel can directly run executables generated by gcc.
2014-04-23 21:43:09 -07:00
Matt Jenkins
8d5a6f60b1 Merge pull request #15 from alexfru/master
Smaller C: Fix a benign typo
2014-04-22 11:15:46 +01:00
Alexey Frunze
bc98f62608 Fix a benign typo 2014-04-22 02:57:42 -07:00
Matt Jenkins
d3e8eefb58 Merge pull request #14 from alexfru/master
Improve variable initialization in Smaller C
2014-04-21 09:25:32 +01:00
Alexey Frunze
fd04710c23 Fix initialization
In the following
typedef struct S0 { char ac[4]; } T1;
int v26 = (int)&((T1*)0)->ac[3];
int v27 = &((T1*)0)->ac[3];
v27 should be initialized to 3 just as v26.
2014-04-21 01:08:49 -07:00
Alexey Frunze
a0a4e242e6 Improve variable initialization in Smaller C
Improvements:
- support initialization of multidimensional arrays
- support initialization of structures
- support initialization of structures and arrays inside functions
- support static inside functions

Notes:
- Only fully-bracketed (sic) initialization of arrays is supported.
- && and || have been partially replaced with & and | to slightly reduce
code size when self compiling for DOS using -seg16.
2014-04-20 20:59:47 -07:00
Matt Jenkins
557a7f6c8f Merge branch 'master' of github.com:RetroBSD/retrobsd 2014-04-20 20:24:33 +01:00
Matt Jenkins
a7d0838ea8 Created global version variable 2014-04-20 20:24:18 +01:00