Skip to content

Commit 1ae09c0

Browse files
authored
Merge pull request #6 from AKuHAK/master
crt0: gdb fixed to work with latest sdk
2 parents 8f0353d + cb5e735 commit 1ae09c0

File tree

17 files changed

+2067
-2251
lines changed

17 files changed

+2067
-2251
lines changed

.clang-format

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveAssignments: true
6+
AlignConsecutiveBitFields: AcrossEmptyLinesAndComments
7+
AlignConsecutiveDeclarations: false
8+
AlignConsecutiveMacros: AcrossComments
9+
AlignEscapedNewlines: Left
10+
AlignOperands: Align
11+
AlignTrailingComments: true
12+
AllowAllArgumentsOnNextLine: false
13+
AllowAllConstructorInitializersOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: Empty
16+
AllowShortCaseLabelsOnASingleLine: false
17+
AllowShortEnumsOnASingleLine: true
18+
AllowShortFunctionsOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: Never
20+
AllowShortLambdasOnASingleLine: Empty
21+
AllowShortLoopsOnASingleLine: false
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: false
24+
AlwaysBreakTemplateDeclarations: true
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BitFieldColonSpacing : Both
28+
BreakBeforeBraces: Custom
29+
BraceWrapping:
30+
AfterCaseLabel: false
31+
AfterClass: true
32+
AfterControlStatement: false
33+
AfterEnum: false
34+
AfterFunction: true
35+
AfterNamespace: true
36+
AfterObjCDeclaration: false
37+
AfterStruct: true
38+
AfterUnion: true
39+
AfterExternBlock: false
40+
BeforeCatch: false
41+
BeforeElse: false
42+
BeforeLambdaBody: false
43+
BeforeWhile: false
44+
IndentBraces: false
45+
SplitEmptyFunction: true
46+
SplitEmptyRecord: true
47+
SplitEmptyNamespace: true
48+
BreakBeforeBinaryOperators: None
49+
BreakBeforeConceptDeclarations: true
50+
BreakBeforeTernaryOperators: false
51+
BreakConstructorInitializers: BeforeComma
52+
BreakStringLiterals: true
53+
ColumnLimit: 0
54+
CommentPragmas: '^ (IWYU pragma:|NOLINT)'
55+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
56+
ConstructorInitializerIndentWidth: 4
57+
ContinuationIndentWidth: 4
58+
Cpp11BracedListStyle: true
59+
DeriveLineEnding: true
60+
DerivePointerAlignment: false
61+
DisableFormat: false
62+
EmptyLineBeforeAccessModifier: LogicalBlock
63+
FixNamespaceComments: true
64+
ForEachMacros: []
65+
IncludeBlocks: Preserve
66+
IndentExternBlock: NoIndent
67+
IndentCaseBlocks: false
68+
IndentCaseLabels: true
69+
IndentGotoLabels: true
70+
IndentWidth: 4
71+
IndentWrappedFunctionNames: false
72+
KeepEmptyLinesAtTheStartOfBlocks: true
73+
MacroBlockBegin: ''
74+
MacroBlockEnd: ''
75+
MaxEmptyLinesToKeep: 3
76+
NamespaceIndentation: None
77+
ObjCBlockIndentWidth: 2
78+
ObjCSpaceAfterProperty: false
79+
ObjCSpaceBeforeProtocolList: true
80+
PenaltyBreakAssignment: 80
81+
PenaltyBreakBeforeFirstCallParameter: 19
82+
PenaltyBreakComment: 300
83+
PenaltyBreakFirstLessLess: 120
84+
PenaltyBreakString: 1000
85+
PenaltyBreakTemplateDeclaration: 80
86+
PenaltyExcessCharacter: 1000000
87+
PenaltyIndentedWhitespace: 80
88+
PenaltyReturnTypeOnItsOwnLine: 60
89+
PointerAlignment: Right
90+
# uncomment below when clang >13 will be out
91+
# IndentPPDirectives: AfterHash
92+
# PPIndentWidth: 1
93+
ReflowComments: true
94+
SortIncludes: false
95+
SpaceAfterCStyleCast: false
96+
SpaceAfterLogicalNot: false
97+
SpaceAroundPointerQualifiers: Default
98+
SpaceBeforeAssignmentOperators: true
99+
SpaceBeforeCaseColon: false
100+
SpaceBeforeCpp11BracedList: true
101+
SpaceBeforeInheritanceColon: false
102+
SpaceBeforeParens: ControlStatements
103+
SpaceBeforeRangeBasedForLoopColon: true
104+
SpaceBeforeSquareBrackets: false
105+
SpaceInEmptyBlock: false
106+
SpaceInEmptyParentheses: false
107+
SpacesBeforeTrailingComments: 1
108+
SpacesInAngles: false
109+
SpacesInConditionalStatement: false
110+
SpacesInContainerLiterals: true
111+
SpacesInCStyleCastParentheses: false
112+
SpacesInParentheses: false
113+
SpacesInSquareBrackets: false
114+
Standard: Cpp11
115+
TabWidth: 4
116+
UseTab: Never

.github/workflows/compilation.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI-compile
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
container: ghcr.io/ps2dev/ps2dev:latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Install dependencies
16+
run: |
17+
apk add build-base git
18+
19+
- name: Compile build
20+
run: |
21+
make clean all
22+
23+
- name: Upload sample
24+
if: ${{ success() }}
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: sample
28+
path: |
29+
sample/*.elf
30+
31+
- name: Create release
32+
if: github.ref == 'refs/heads/master'
33+
uses: marvinpinto/action-automatic-releases@latest
34+
with:
35+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
36+
automatic_release_tag: "latest"
37+
title: "Latest development build"
38+
files: |
39+
sample/*.elf

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
*.erl
44
*.irx
55
*.o
6+
7+
.*
8+
!.gitignore
9+
!.github
10+
!.clang-format

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
# --------------------------------------------------------------------------
55

66

7-
all:
7+
all:
88
$(MAKE) -C ee
9-
# $(MAKE) -C iop
9+
$(MAKE) -C sample
1010

11+
debug:
12+
$(MAKE) -C ee debug
13+
$(MAKE) -C sample
14+
15+
install:
16+
$(MAKE) -C ee install
1117

1218
clean:
1319
$(MAKE) -C ee clean
14-
# $(MAKE) -C iop clean
20+
$(MAKE) -C sample clean

Makefile.eeglobal

Lines changed: 0 additions & 60 deletions
This file was deleted.

Makefile.pref

Lines changed: 0 additions & 20 deletions
This file was deleted.

README

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2024 Current State by crt0
2+
3+
Writing/Reading variables, memory, registers (only as 32bit), call stack - works.
4+
5+
Usage: run app with ps2link
6+
mips64r5900el-ps2-elf-gdb -ex 'target remote:192.168.0.10:12'
7+
8+
TODO: rewrite metwork stack
9+
10+
111
INTRODUCTION
212
----------------------------------------------------------------------------
313

@@ -39,7 +49,7 @@ COPYRIGHT FOR PS2GDBSTUB
3949
software. However, the author retains a non-exclusive royalty-free
4050
license to any modification to the distribution made by the licensee.
4151
4. Any Licensee wishing to make commercial use of the Softare must
42-
contact the author to execute the appropriate license for such
52+
contact the author to execute the appropriate license for such
4353
commercial use. Commercial use includes
4454
- Integration of all or part of the source code into a product for sale
4555
or commercial license by or on behalf Licensee to third parties, or
@@ -58,3 +68,4 @@ COPYRIGHT FOR PS2GDBSTUB
5868
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
5969
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
6070
THE POSSIBILITY OF SUCH DAMAGE.
71+

ee/Makefile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
#
22
# Makefile template
33
#
4+
DEBUG ?= 0
45

5-
EE_LIB = ../lib/libps2gdbStub.a
6+
EE_LIB_DIR = ../lib/
7+
EE_LIB = $(EE_LIB_DIR)libps2gdbStub.a
68
EE_OBJS = ps2gdbStub.o gdb-low.o
79

8-
EE_CFLAGS += -g
9-
EE_LDFLAGS += -Wl,-Map,ps2gdbStub.map -L. -L../lib -L$(PS2SDK)/ee/lib
10+
EE_CFLAGS += -g -w
11+
# -DDEBUG
12+
EE_LDFLAGS += -Wl,-Map,ps2gdbStub.map -L. -L../lib -L$(PS2SDK)/ee/lib
13+
14+
ifeq ($(DEBUG),1)
15+
EE_CFLAGS += -DDEBUG
16+
endif
1017

1118
all: $(EE_LIB)
12-
$(EE_AR) rcs $(EE_LIB) $(EE_OBJS)
19+
@mkdir -p $(EE_LIB_DIR)
20+
$(EE_AR) rcs $(EE_LIB) $(EE_OBJS)
21+
22+
debug:
23+
$(MAKE) DEBUG=1 all
24+
25+
install: all
26+
cp -f $(EE_LIB) $(PS2SDK)/ports/lib
27+
1328
clean:
14-
rm -f *.a *.o *.map $(EE_LIB)
29+
rm -rf $(EE_OBJS) $(EE_LIB) $(EE_LIB_DIR)
1530

16-
include ../Makefile.pref
17-
include ../Makefile.eeglobal
31+
include $(PS2SDK)/samples/Makefile.pref
32+
include $(PS2SDK)/samples/Makefile.eeglobal

0 commit comments

Comments
 (0)