-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (90 loc) · 3.85 KB
/
amd64-bios.yml
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
name: amd64 BIOS (Release)
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install packages
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository -y "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
sudo apt install -y build-essential cmake ninja-build clang lld llvm libclang-dev mkisofs mtools
- name: Checkout llvm-project
uses: actions/checkout@v3
with:
repository: llvm/llvm-project
ref: release/16.x
path: llvm-project
- name: Checkout palladium
uses: actions/checkout@v3
with:
path: palladium
- name: Configure compiler-rt for Target
run: |
cmake \
-S llvm-project/compiler-rt \
-B llvm-project/build.target \
-G Ninja \
-DCMAKE_AR=/usr/bin/llvm-ar \
-DCMAKE_ASM_COMPILER_TARGET="x86_64-w64-mingw32" \
-DCMAKE_ASM_FLAGS="-I${{github.workspace}}/palladium/src/sdk/crt/include" \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DCMAKE_C_COMPILER_WORKS=true \
-DCMAKE_C_COMPILER_TARGET="x86_64-w64-mingw32" \
-DCMAKE_C_FLAGS="-I${{github.workspace}}/palladium/src/sdk/crt/include -ffreestanding" \
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" \
-DCMAKE_NM=/usr/bin/llvm-nm \
-DCMAKE_RANLIB=/usr/bin/llvm-ranlib \
-DCOMPILER_RT_OS_DIR="baremetal" \
-DCOMPILER_RT_BAREMETAL_BUILD=ON \
-DCOMPILER_RT_BUILD_BUILTINS=ON \
-DCOMPILER_RT_BUILD_CRT=OFF \
-DCOMPILER_RT_BUILD_LIBFUZZER=OFF \
-DCOMPILER_RT_BUILD_MEMPROF=OFF \
-DCOMPILER_RT_BUILD_PROFILE=OFF \
-DCOMPILER_RT_BUILD_SANITIZERS=OFF \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON \
-DLLVM_CONFIG_PATH=/usr/bin/llvm-config
- name: Build compiler-rt for Target
run: cmake --build llvm-project/build.target
- name: Install compiler-rt for Target
run: sudo cmake --build llvm-project/build.target --target install
- name: Configure Host Tools
run: cmake -S palladium/src/sdk/host -B palladium/build.host -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build Host Tools
run: cmake --build palladium/build.host --config ${{env.BUILD_TYPE}}
- name: Configure Target
run: cmake -S palladium/src -B palladium/build.target -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DARCH=amd64
- name: Build Target
run: cmake --build palladium/build.target --config ${{env.BUILD_TYPE}}
- name: Build EFI image
run: |
dd if=/dev/zero of=palladium/build.target/fat.img bs=1k count=184320
mformat -F -i palladium/build.target/fat.img
mmd -i palladium/build.target/fat.img ::/EFI
mmd -i palladium/build.target/fat.img ::/EFI/BOOT
mmd -i palladium/build.target/fat.img ::/EFI/PALLADIUM
mcopy -i palladium/build.target/fat.img palladium/build.target/boot/osloader/osloader.exe ::/EFI/BOOT/BOOTX64.EFI
mcopy -i palladium/build.target/fat.img palladium/build.target/kernel/kernel.exe ::/EFI/PALLADIUM/KERNEL.EXE
mcopy -i palladium/build.target/fat.img palladium/build.target/drivers/acpi/acpi.sys ::/EFI/PALLADIUM/ACPI.SYS
- name: Build ISO image
run: |
mkdir -p _root
cp palladium/build.target/fat.img _root/fat.img
mkisofs -R -f -eltorito-boot fat.img -no-emul-boot -o palladium/build.target/iso9660.iso _root
- uses: actions/upload-artifact@v3
with:
name: fat.img
path: palladium/build.target/fat.img
- uses: actions/upload-artifact@v3
with:
name: iso9660.iso
path: palladium/build.target/iso9660.iso