Skip to content

Commit

Permalink
Trying to get RV64 glibc binaries able to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
cr88192 committed Sep 7, 2024
1 parent 9ad5011 commit d7906c0
Show file tree
Hide file tree
Showing 111 changed files with 53,373 additions and 43,726 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use cases. It is not intended to be a general purpose processor arch or for the
more acceptable for there to be variations or breaks in binary compatibility between implementations (granted, it is
preferable if breaks in compatibility can be avoided if possible).

My personal use-case is currently mostly in the context of using BSR1 for real-time motor control (Update, 2021-07: BJX2 has mostly taken over this role, as single-wide cores can be fit onto an XC7S25).
My personal use-case is currently mostly in the context of using BSR1 for real-time motor control (Update, 2021-07: BJX2 has mostly taken over this role, as single-wide cores can be fit onto an XC7S25). ( Update, 2024-09: I have mostly dropped these use-cases in favor of using RISC-V instead. I am currently focusing on BJX2 for more computationally oriented tasks, rather than microcontroller tasks. )

As of 2018-05-20, This is still at a fairly early stage of development and is not yet ready for general use, however some
initial results look promising, and I am making better progress than I was with BJX1 (if anything, because BSR1 is a bit simpler
Expand Down Expand Up @@ -58,6 +58,10 @@ Update 2021-07: The core ISA of BJX2 has mostly stabilized, and significant desi
bgbcc22 (BGBCC): C compiler, partly reused from my BJX1 project, but modified to add support for BSR1 and BJX2.
* TODO: Make it more obvious how to use said compiler.

I will add an optional exception to the MIT license for BGBCC:
* One may, at their discretion, choose to disregard the middle clause of the MIT license, allowing derived copies to be understood as-if they were CC0 or Public Domain.


vmbase: Holds an emulator for the BSR1 ISA.

jx2vm: Emulator for the BJX2 ISA.
Expand Down
3 changes: 3 additions & 0 deletions bgbcc22/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ SRCS=\
mm/qoilz_enc.c \
mm/lcif_dec.c \
mm/lcif_enc.c \
mm/tkupic_dec.c \
mm/tkupic_enc.c \
mm/bufpng.c \
\
ccxl/ccxl_cgif.c \
ccxl/ccxl_compile.c \
Expand Down
Binary file modified bgbcc22/bgbcc.bin
Binary file not shown.
Binary file modified bgbcc22/bgbcc.exe
Binary file not shown.
4 changes: 4 additions & 0 deletions bgbcc22/bgbcc_multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
#include "mm/lcif_dec.c"
#include "mm/lcif_enc.c"

#include "mm/tkupic_dec.c"
#include "mm/tkupic_enc.c"
#include "mm/bufpng.c"


#include "ccxl/ccxl_cgif.c"
#include "ccxl/ccxl_compile.c"
Expand Down
18 changes: 18 additions & 0 deletions bgbcc22/bgbmeta.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,24 @@ byte *BGBCC_LoadConvResource(byte *buf, int sz, fourcc lang,
*rsz=sz1;
return(obuf);
}

if( !bgbcc_stricmp(cnv, "upic") )
{
ibuf=BGBCC_Img_DecodeImage(buf, &xs, &ys);
if(!ibuf)
return(NULL);

fl=1<<8;

fl|=100-((qlvl&7)*12);

obuf=malloc(xs*ys*2);
sz1=TKuPI_EncodeImageBufferTemp(obuf, ibuf, xs, ys, fl);

*rfcc=BGBCC_FMT_UPIC;
*rsz=sz1;
return(obuf);
}

return(NULL);
}
Expand Down
3 changes: 2 additions & 1 deletion bgbcc22/ccxl/ccxl_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -4465,7 +4465,8 @@ ccxl_status BGBCC_CCXL_StackLoadSlotAddr(BGBCC_TransState *ctx, char *name)
BGBCC_CCXL_Error(ctx, "Undefined Member %s -> %s\n",
st->decl->qname, name);

BGBCC_CCXL_PushRegister(ctx, dreg);
// BGBCC_CCXL_PushRegister(ctx, dreg);
BGBCC_CCXL_StackPushConstInt(ctx, 0);

BGBCC_CCXL_TagError(ctx,
CCXL_TERR_STATUS(CCXL_STATUS_ERR_BADOPARGS));
Expand Down
14 changes: 9 additions & 5 deletions bgbcc22/docs/2020-06-14_WAD2A.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ WAD2(A) is a container format holding a series of 'lumps'.
* It is closely related to the Quake WAD2 format.

Header {
FOURCC magic; //'WAD2'
U32 numlumps; //Number of lumps in the directory.
U32 diroffs; //Offset of directory, in bytes
U32 typeoffs; //Offset of types table
}
FOURCC magic; //00: 'WAD2'
U32 numlumps; //04: Number of lumps in the directory.
U32 diroffs; //08: Offset of directory, in bytes
U32 typeoffs; //0C: Offset of types table
U32 resv1; //10: Reserved
U32 resv2; //14: Reserved
FOURCC intent1; //18: Intention 1
FOURCC intent2; //1C: Intention 2
}

The header appears at the start of a file, and encodes the location of the directory.

Expand Down
8 changes: 6 additions & 2 deletions bgbcc22/docs/2020-10-15_WAD4.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ A WAD4 Image will begin with a WAD4 File Header:
U32 hashoffs; //0C: Offset of Directory Hash.
U32 bmpoffs; //10: Offset of Allocation Bitmap.
U32 bmpsize; //14: Bitmap Size
U32 resv4; //18: Reserved
U32 resv5; //1C: Reserved
FOURCC intent1; //18: Intention 1
FOURCC intent2; //1C: Intention 2
//...
}

Expand All @@ -42,6 +42,10 @@ Header Fields:
* bmpsize:
** Gives the size of the bitmap in bytes.
** The number of cells in the image may be determined by the bitmap size.
* intent1/intent2:
** Gives an 'intention' for the file.
** These may be used in the creation of derived formats.
** If zero, image is seen as a collection of files.


=== Directory ===
Expand Down
3 changes: 2 additions & 1 deletion bgbcc22/docs/2023-11-15_WDEF0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Where, fmt may be one of:
* qoi: QOI Format
* qoli: QOLI (QOI with inline LZ compression)
* lcif: LCIF Format
* upic: UPIC Format

BMPA is a modified BMP differing mostly in that the fields and image data will be aligned. The headers will have a native 32-bit alignment, whereas the image data will have a 64-bit alignment. The magic will be changed from 'BM' to ' BMP', but apart from the alignment change the format is basically the same.

Expand All @@ -56,7 +57,7 @@ For BMP16 and BMP16A, the MSB of each pixel will encode Alpha:

For QOI and QOLI, a 'q' parameter will speficy a lossy quality level (0=lossless, 1=best, 7=worst). The default will be lossless.

For LCIF, the 'q' parameter will speficy a lossy quality level (0=best, 7=worst). The default will be best.
For LCIF and UPIC, the 'q' parameter will speficy a lossy quality level (0=best, 7=worst). The default will be best.

Both QOI and LCIF will include an full Alpha channel.

Expand Down
Loading

0 comments on commit d7906c0

Please sign in to comment.