Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 2 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,20 @@ on:

jobs:
build-linux:
strategy:
matrix:
linux-version:
- version: 6.6.0-13-generic
deb:
all: http://launchpadlibrarian.net/698860017/linux-headers-6.6.0-13_6.6.0-13.13_all.deb
generic: http://launchpadlibrarian.net/698860014/linux-headers-6.6.0-13-generic_6.6.0-13.13_amd64.deb
- version: 6.11.0-9-generic
deb:
all: http://launchpadlibrarian.net/754119749/linux-headers-6.11.0-9_6.11.0-9.9_all.deb
generic: http://launchpadlibrarian.net/754119748/linux-headers-6.11.0-9-generic_6.11.0-9.9_amd64.deb
runs-on: ubuntu-latest
env:
LINUX_HEADERS: /lib/modules/${{ matrix.linux-version.version }}/build
GNU_EFI: ${{ github.workspace }}/gnu-efi

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Install kernel headers
run: |
wget ${{ matrix.linux-version.deb.all }}
wget ${{ matrix.linux-version.deb.generic }}
sudo apt install -y ./*.deb
- name: Install dependencies
run: |
sudo apt install -y iasl
- name: Install GNU-EFI
run: |
git clone https://git.code.sf.net/p/gnu-efi/code ${{ github.workspace }}/gnu-efi
cd ${{ github.workspace }}/gnu-efi
make -j $(nproc)
git clone https://git.code.sf.net/p/gnu-efi/code $GNU_EFI
make -C $GNU_EFI -j $(nproc)
- name: Build
run: make build
19 changes: 2 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,29 @@ ifdef QEMU_DEBUG
endif

clean:
$(MAKE) -C module clean
$(MAKE) -C core clean
$(MAKE) -C uefi clean
rm -rf module/*_shipped
rm -rf $(VM_MOUNT_DIR)

.PHONY: clean

module/%.o_shipped: core/build/%.o
touch module/.$*.o.cmd
cp $^ $@

uefi/obj/%.o: core/build/%.o
mkdir -p $(dir $@)
cp $^ $@

core/build/core.o:
$(MAKE) -C core

module/switch_os.ko: module/core.o_shipped
$(MAKE) -C module

uefi/build/app.efi: uefi/obj/core.o
$(MAKE) -C uefi

.PHONY: core/build/core.o module/switch_os.ko uefi/build/app.efi

build/vm_mount: module/switch_os.ko
mkdir -p $@
cp -f $^ $@
.PHONY: core/build/core.o uefi/build/app.efi

build/efi: uefi/build/app.efi
mkdir -p $@
mkdir -p $@/EFI/BOOT
cp -f $^ $@/EFI/BOOT/BOOTX64.efi

build: build/vm_mount build/efi
build: build/efi

qemu: build
$(QEMU) \
Expand All @@ -76,7 +62,6 @@ qemu: build
-drive if=pflash,format=raw,file=$(OVMF_VARS) \
-hda fat:rw:build/efi \
-hdb fat:rw:$(LINUX_DISK_PATH) \
-virtfs local,path=build/vm_mount,mount_tag=qemu_root,security_model=passthrough,id=qemu_root,readonly=on \
-drive id=buffer_drive,file=$(BUFFER_DRIVE_IMG),if=none,format=raw -device virtio-blk-pci,drive=buffer_drive \
-enable-kvm \
-vga virtio \
Expand Down
4 changes: 2 additions & 2 deletions core/drivers/virtio/virtio_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static err_t negotiate_virtio_features(struct virtio_blk_dev* virtio_blk_dev) {
err_t init_virtio_blk_dev(struct virtio_blk_dev* virtio_blk_dev) {
err_t err = SUCCESS;

// We expect module to fill the device's pci address for us.
// We expect the UEFI app to fill the device's pci address for us.
virtio_blk_dev->pci_dev.addr.bus = g_core_header.disk_pci.addr.bus;
virtio_blk_dev->pci_dev.addr.device = g_core_header.disk_pci.addr.device;
virtio_blk_dev->pci_dev.addr.function = g_core_header.disk_pci.addr.function;
Expand All @@ -160,7 +160,7 @@ err_t init_virtio_blk_dev(struct virtio_blk_dev* virtio_blk_dev) {
CHECK(virtio_blk_dev->pci_dev.vendor_id == VIRTIO_BLK_VENDOR_ID &&
virtio_blk_dev->pci_dev.device_id == VIRTIO_BLK_DEVICE_ID);

// Restore the device's bars using the bars module filled for us.
// Restore the device's bars using the bars the UEFI app filled for us.
// This is crucial since the device loses power when entering S3 suspend, and
// loses the bar values.
// The BIOS is the one initially responsible for configuring the bars for the
Expand Down
16 changes: 0 additions & 16 deletions module/Kbuild

This file was deleted.

9 changes: 0 additions & 9 deletions module/Makefile

This file was deleted.

47 changes: 0 additions & 47 deletions module/acpi.c

This file was deleted.

18 changes: 0 additions & 18 deletions module/acpi.h

This file was deleted.

33 changes: 0 additions & 33 deletions module/configure_core_header.c

This file was deleted.

12 changes: 0 additions & 12 deletions module/configure_core_header.h

This file was deleted.

93 changes: 0 additions & 93 deletions module/devices.c

This file was deleted.

12 changes: 0 additions & 12 deletions module/devices.h

This file was deleted.

Loading