Skip to content

Commit

Permalink
porting lwip
Browse files Browse the repository at this point in the history
  • Loading branch information
lhw2002426 committed Jun 5, 2024
1 parent 8a729f8 commit a8549ca
Show file tree
Hide file tree
Showing 50 changed files with 2,411 additions and 37 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.rust-toolchain }}
components: rust-src, clippy, rustfmt
- name: Install gcc multilib
run: sudo apt update && sudo apt install -y gcc-multilib
- name: Clippy for the default target
run: make clippy
run: make clippy
- name: Clippy for x86_64
run: make clippy ARCH=x86_64
- name: Clippy for riscv64
Expand All @@ -37,6 +41,8 @@ jobs:
arch: [x86_64, riscv64, aarch64]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -47,6 +53,8 @@ jobs:
crate: cargo-binutils
version: latest
use-tool-cache: true
- name: Install gcc multilib
run: sudo apt update && sudo apt install -y gcc-multilib
# musl toolchain is also needed in non-musl apps
# because we need to build opensbi under riscv64
- uses: ./.github/workflows/actions/setup-musl
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
default-branch: ${{ format('refs/heads/{0}', github.event.repository.default_branch) }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.rust-toolchain }}
components: rust-src
components: rust-src, llvm-tools-preview
- name: Run unit tests
run: make unittest_no_fail_fast

Expand All @@ -28,16 +30,20 @@ jobs:
arch: [x86_64, riscv64, aarch64]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.rust-toolchain }}
components: rust-src
components: rust-src, llvm-tools-preview
- uses: actions-rs/[email protected]
with:
crate: cargo-binutils
version: latest
use-tool-cache: true
- name: Install gcc multilib
run: sudo apt update && sudo apt install -y gcc-multilib
- uses: ./.github/workflows/actions/setup-qemu
with:
qemu-version: ${{ env.qemu-version }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "patches/opensbi"]
path = patches/opensbi
url = https://github.com/Sssssaltyfish/opensbi.git
[submodule "crates/lwip_rust/depend/lwip"]
path = crates/lwip_rust/depend/lwip
url = https://github.com/lwip-tcpip/lwip.git
133 changes: 125 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ members = [
"crates/flatten_objects",
"crates/lazy_init",
"crates/linked_list",
"crates/lwip_rust",
"crates/page_table",
"crates/page_table_entry",
"crates/percpu",
Expand Down Expand Up @@ -58,7 +59,7 @@ members = [

"apps/display/basic_painting",
"apps/display/draw_map",
"apps/fs/shell",
"apps/fs/shell", "crates/lwip_rust",
]

[profile.release]
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,24 @@ ifeq ($(ARCH), x86_64)
ACCEL ?= $(if $(findstring -microsoft, $(shell uname -r | tr '[:upper:]' '[:lower:]')),n,y)
PLATFORM_NAME ?= x86_64-qemu-q35
TARGET := x86_64-unknown-none
TARGET_CFLAGS := -mno-sse
BUS := pci
else ifeq ($(ARCH), riscv64)
ACCEL ?= n
PLATFORM_NAME ?= riscv64-qemu-virt
TARGET := riscv64gc-unknown-none-elf
TARGET_CFLAGS := -mabi=lp64d
else ifeq ($(ARCH), aarch64)
ACCEL ?= n
PLATFORM_NAME ?= aarch64-qemu-virt
TARGET := aarch64-unknown-none-softfloat
TARGET_CFLAGS := -mgeneral-regs-only
else
$(error "ARCH" must be one of "x86_64", "riscv64", or "aarch64")
endif

export TARGET_CC = $(CC)
export TARGET_CFLAGS
export RUX_ARCH=$(ARCH)
export RUX_PLATFORM=$(PLATFORM_NAME)
export RUX_SMP=$(SMP)
Expand Down
Loading

0 comments on commit a8549ca

Please sign in to comment.