Skip to content

Commit b57e8e5

Browse files
committed
fixed in x86 with align
1 parent bff74cd commit b57e8e5

File tree

3 files changed

+61
-61
lines changed

3 files changed

+61
-61
lines changed

.github/workflows/test.yml

Lines changed: 53 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,58 @@
1-
# name: Run tests on ch6
1+
name: Run tests on ch5
22

3-
# on: [push]
3+
on: [push]
44

5-
# env:
6-
# CARGO_TERM_COLOR: always
7-
# rust_toolchain: nightly-2024-01-18
5+
env:
6+
CARGO_TERM_COLOR: always
7+
rust_toolchain: nightly-2024-01-18
88

9-
# jobs:
10-
# run-tests:
11-
# runs-on: ubuntu-latest
12-
# strategy:
13-
# matrix:
14-
# arch: [riscv64, x86_64, aarch64, loongarch64]
15-
# steps:
16-
# - uses: actions/checkout@v3
17-
# - uses: actions-rs/toolchain@v1
18-
# with:
19-
# profile: minimal
20-
# toolchain: ${{ env.rust_toolchain }}
21-
# components: rust-src, llvm-tools-preview
22-
# target: riscv64gc-unknown-none-elf
23-
# - uses: actions-rs/install@v0.1
24-
# with:
25-
# crate: cargo-binutils
26-
# version: latest
27-
# use-tool-cache: true
28-
# - name: Cache QEMU
29-
# uses: actions/cache@v3
30-
# with:
31-
# path: qemu-8.2.1
32-
# key: qemu-8.2.1-x86_64-riscv64
33-
# - name: Install QEMU
34-
# run: |
35-
# echo ${{ github.workspace }}
36-
# wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
37-
# unzip ninja-linux.zip
38-
# sudo mv ninja /usr/local/bin/
39-
# ninja --version
40-
# if [ ! -d qemu-8.2.1 ]; then
41-
# wget https://download.qemu.org/qemu-8.2.1.tar.xz
42-
# tar -xf qemu-8.2.1.tar.xz
43-
# cd qemu-8.2.1
44-
# ./configure --target-list=riscv64-softmmu,x86_64-softmmu,loongarch64-softmmu,aarch64-softmmu
45-
# make -j
46-
# else
47-
# cd qemu-8.2.1
48-
# fi
49-
# sudo make install
50-
# qemu-system-riscv64 --version
51-
# qemu-system-aarch64 --version
52-
# qemu-system-loongarch64 --version
53-
# qemu-system-x86_64 --version
9+
jobs:
10+
run-tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
arch: [riscv64, x86_64, aarch64, loongarch64]
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions-rs/toolchain@v1
18+
with:
19+
profile: minimal
20+
toolchain: ${{ env.rust_toolchain }}
21+
components: rust-src, llvm-tools-preview
22+
target: riscv64gc-unknown-none-elf
23+
- uses: actions-rs/install@v0.1
24+
with:
25+
crate: cargo-binutils
26+
version: latest
27+
use-tool-cache: true
28+
- name: Install QEMU
29+
run: |
30+
echo ${{ github.workspace }}
31+
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip
32+
unzip ninja-linux.zip
33+
sudo mv ninja /usr/local/bin/
34+
ninja --version
35+
if [ ! -d qemu-8.2.1 ]; then
36+
wget https://download.qemu.org/qemu-8.2.1.tar.xz
37+
tar -xf qemu-8.2.1.tar.xz
38+
cd qemu-8.2.1
39+
./configure --target-list=riscv64-softmmu,x86_64-softmmu,loongarch64-softmmu,aarch64-softmmu
40+
make -j
41+
else
42+
cd qemu-8.2.1
43+
fi
44+
sudo make install
45+
qemu-system-riscv64 --version
46+
qemu-system-aarch64 --version
47+
qemu-system-loongarch64 --version
48+
qemu-system-x86_64 --version
5449
55-
# - name: Run usertests in ${{ matrix.arch }}
56-
# run: |
57-
# cd os
58-
# timeout 240 make run ARCH=${{ matrix.arch }} 2>&1 | tee output.log || echo "qemu exited"
59-
# timeout-minutes: 10
50+
- name: Run usertests in ${{ matrix.arch }}
51+
run: |
52+
cd os
53+
timeout 240 make run TEST=1 ARCH=${{ matrix.arch }} 2>&1 | tee output.log || echo "qemu exited"
54+
timeout-minutes: 10
6055

61-
# - name: Checkout output
62-
# run : |
63-
# grep "All applications completed" os/output.log
56+
- name: Checkout output
57+
run : |
58+
grep "Usertests passed!" os/output.log

os/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn insert_app_data() -> Result<()> {
4040
writeln!(
4141
f,
4242
r#"
43-
.align 8
43+
.p2align 3
4444
.section .data
4545
.global _num_app
4646
_num_app:
@@ -72,7 +72,7 @@ _app_names:"#
7272
.section .data
7373
.global app_{0}_start
7474
.global app_{0}_end
75-
.align 8
75+
.p2align 3
7676
app_{0}_start:
7777
.incbin "{2}{1}"
7878
app_{0}_end:"#,

user/src/linker.ld

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@ SECTIONS
1717
*(.srodata .srodata.*)
1818
}
1919
. = ALIGN(4K);
20+
.got : {
21+
*(.got .got.*)
22+
}
23+
. = ALIGN(4K);
2024
.data : {
2125
*(.data .data.*)
2226
*(.sdata .sdata.*)
2327
}
28+
. = ALIGN(4K);
2429
.bss : {
2530
*(.bss .bss.*)
2631
*(.sbss .sbss.*)
2732
}
2833
/DISCARD/ : {
29-
*(.eh_frame)
34+
*(.eh_frame*)
3035
*(.debug*)
3136
}
3237
}

0 commit comments

Comments
 (0)