-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathjustfile
156 lines (131 loc) · 4.6 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
build:
zig-ashet build
[working-directory: 'src/kernel']
build-kernel:
zig-ashet build -Dmachine=arm-ashet-hc
zig-ashet build -Dmachine=arm-ashet-vhc
zig-ashet build -Dmachine=arm-qemu-virt
zig-ashet build -Dmachine=rv32-qemu-virt
zig-ashet build -Dmachine=x86-pc-bios
zig-ashet build -Dmachine=x86-hosted-linux
build-vhc:
rm -rf zig-out/arm-ashet-vhc
zig-ashet build --summary none -Doptimize-apps=ReleaseSmall arm-ashet-vhc
./src/tools/exe-tool/zig-out/bin/ashet-exe dump zig-out/arm-ashet-vhc/apps/init.ashex -a > /tmp/init.ashex.txt
( \
readelf --dynamic --section-headers --program-headers --wide --relocs --symbols --dyn-syms zig-out/arm-ashet-vhc/apps/init.elf ; \
llvm-objdump -d zig-out/arm-ashet-vhc/apps/init.elf \
) > /tmp/dump.txt
run-vhc: build-vhc
zig-ashet build --summary none -Dmachine=arm-ashet-vhc -Doptimize-apps=ReleaseSmall install run
debug-vhc: build-vhc
zig-ashet build --summary none -Dmachine=arm-ashet-vhc -Doptimize-apps=ReleaseSmall install run -- -S ; stty sane
[working-directory: 'src/tools/exe-tool']
exe-tool:
zig-ashet build
dump-libashet: \
(dump-libashet-target "arm") \
(dump-libashet-target "x86") \
(dump-libashet-target "rv32")
[working-directory: 'src/userland/libs/libAshetOS']
dump-libashet-target target:
zig-ashet build -Dtarget={{target}} install debug
llvm-readelf --dynamic \
--section-headers \
--program-headers \
--wide \
--relocs \
--symbols \
--dyn-syms \
--hex-dump=.ashet.patch \
--hex-dump=.ashet.strings \
--string-dump=.ashet.strings \
zig-out/bin/libAshetOS.{{target}} \
> /tmp/libashet.{{target}}.txt
llvm-objdump -d \
--wide \
zig-out/bin/libAshetOS.{{target}} \
>> /tmp/libashet.{{target}}.txt
dump-init: \
(dump-init-target "arm") \
(dump-init-target "x86") \
(dump-init-target "rv32")
[working-directory: 'src/userland/apps/init']
dump-init-target target: (dump-libashet-target target) exe-tool
zig-ashet build -Dtarget={{target}} install
llvm-readelf --dynamic \
--section-headers \
--program-headers \
--wide \
--relocs \
--symbols \
--dyn-syms \
--hex-dump=.ashet.patch \
--hex-dump=.ashet.strings \
--string-dump=.ashet.strings \
zig-out/bin/init \
> /tmp/init.elf.{{target}}.txt
llvm-objdump -d \
--wide \
zig-out/bin/init \
>> /tmp/init.elf.{{target}}.txt
../../../tools/exe-tool/zig-out/bin/ashet-exe dump \
--all \
zig-out/apps/init.ashex \
> /tmp/init.ashex.{{target}}.txt
@printf "\n %s output:\n |- %s\n '- %s\n\n" \
"{{target}}" \
"/tmp/init.elf.{{target}}.txt" \
"/tmp/init.ashex.{{target}}.txt"
[working-directory: 'research/x86-farcall']
farcall:
zig-ashet build-exe -target x86-linux-musl -O ReleaseSmall -fno-strip -lc --name farcall farcall.S
llvm-objdump -d ./farcall | grep -F '<main>' -A20
gdb ./farcall --quiet --command ./gdbscript
rp2350-build:
zig-ashet build -Doptimize-kernel arm-ashet-hc
llvm-size zig-out/arm-ashet-hc/kernel.elf
arm-none-eabi-objdump -dS zig-out/arm-ashet-hc/kernel.elf > /tmp/arm-ashet-hc.S
# convert kernel image to UF2 file, family=rp2350_arm_s, offset=0M
picotool uf2 convert \
--family 0xe48bff59 \
--offset 0x10000000 \
zig-out/arm-ashet-hc/kernel.elf \
zig-out/arm-ashet-hc/kernel.uf2 \
--verbose
# convert disk image to UF2 file, family=data, offset=8M
picotool uf2 convert \
--family 0xe48bff58 \
--offset 0x10800000 \
zig-out/arm-ashet-hc/disk.img -t bin \
zig-out/arm-ashet-hc/disk.uf2 \
--verbose
rp2350-flash: rp2350-build
picotool load \
--family 0xe48bff59 \
--update \
--verify \
--execute \
zig-out/arm-ashet-hc/kernel.uf2
rp2350-upload-fs: rp2350-build
picotool load \
--update \
--verify \
zig-out/arm-ashet-hc/disk.uf2
rp2350-load: rp2350-build
openocd -s tcl \
-f interface/cmsis-dap.cfg \
-f target/rp2350.cfg \
-c 'adapter speed 5000' \
-c "program zig-out/arm-ashet-hc/kernel.elf verify reset exit"
rp2350-openocd:
openocd -s tcl \
-f interface/cmsis-dap.cfg \
-f target/rp2350.cfg \
-c 'adapter speed 5000'
rp2350-gdb:
gdb \
--command "scripts/gdb-rp2350" \
zig-out/arm-ashet-hc/kernel.elf
rp2350-monitor:
picocom --baud 115200 --quiet /dev/ttyUSB0