Skip to content

Commit 5239a1a

Browse files
committed
Support i386/32-bit kernel builds
1 parent 71deff5 commit 5239a1a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ifeq ($(ARCH),aarch64)
2626
else ifeq ($(ARCH),x86)
2727
$(warning $(YELLOW)Incorrect architecture 'x86', using 'x86_64' instead $(NC))
2828
ARCH := x86_64
29-
else ifeq ($(filter x86_64 arm64,$(ARCH)),)
29+
else ifeq ($(filter x86_64 arm64 i386,$(ARCH)),)
3030
$(error Invalid architecture $(ARCH))
3131
endif
3232

@@ -39,7 +39,7 @@ clean: linux_clean tools-vm_clean
3939
.PHONY: help
4040
help:
4141
@echo '$(GREEN)General Environment Variables:$(NC)'
42-
@echo ' ARCH - Specify one of the supported architectures: x86_64, arm64 (default: x86_64)'
42+
@echo ' ARCH - Specify one of the supported architectures: x86_64, i386, arm64 (default: x86_64)'
4343
@echo ' ACK - Set to 1 if building ACK instead of the Linux kernel. Does not need to be set for `ack` and `run-ack` targets (default: 0)'
4444
@echo ' VERBOSE - Set to 1 to enable verbose output (default: 0)'
4545
@echo ''
@@ -139,6 +139,9 @@ LINUX_CONFIG := $(LINUX_OUT)/.config
139139
ifeq ($(ARCH),x86_64)
140140
TARGET := x86_64-pc-linux-gnu
141141
KERNEL_IMAGE := $(LINUX_OUT)/arch/$(ARCH)/boot/bzImage
142+
else ifeq ($(ARCH),i386)
143+
TARGET := i386-pc-linux-gnu
144+
KERNEL_IMAGE := $(LINUX_OUT)/arch/$(ARCH)/boot/bzImage
142145
else ifeq ($(ARCH),arm64)
143146
TARGET := aarch64-linux-gnu
144147
KERNEL_IMAGE := $(LINUX_OUT)/arch/$(ARCH)/boot/Image
@@ -382,7 +385,9 @@ ifeq ($(ARCH),x86_64)
382385
ifneq ($(CI),true)
383386
QEMU_ARGS += -accel kvm
384387
endif
385-
388+
else ifeq ($(ARCH),i386)
389+
QEMU_BIN := qemu-system-i386
390+
QEMU_KERNEL_CMDLINE += console=ttyS0
386391
else
387392
QEMU_BIN := qemu-system-aarch64
388393
QEMU_KERNEL_CMDLINE += console=ttyAMA0
3.01 MB
Binary file not shown.

0 commit comments

Comments
 (0)