From 1f1cad1a259fe491a18c9605bc403ad5deeb166e Mon Sep 17 00:00:00 2001 From: mintsuki Date: Thu, 19 May 2022 20:12:48 +0200 Subject: [PATCH] Revert "decompressor: Use as instead of nasm" This reverts commit 39559b39ff2b29329f69ddf30cb6dcebf5cbd701. --- decompressor/GNUmakefile | 8 ++++---- decompressor/entry.S | 14 -------------- decompressor/entry.asm | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 18 deletions(-) delete mode 100644 decompressor/entry.S create mode 100644 decompressor/entry.asm diff --git a/decompressor/GNUmakefile b/decompressor/GNUmakefile index b6e828ee..4d11a9ad 100644 --- a/decompressor/GNUmakefile +++ b/decompressor/GNUmakefile @@ -52,8 +52,8 @@ override INTERNAL_LDFLAGS := \ -Tlinker.ld override C_FILES := $(shell find ./ -type f -name '*.c') -override ASM_FILES := $(shell find ./ -type f -name '*.S') -override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(ASM_FILES:.S=.o) $(C_FILES:.c=.o)) +override ASM_FILES := $(shell find ./ -type f -name '*.asm') +override OBJ := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(ASM_FILES:.asm=.o) $(C_FILES:.c=.o)) override HEADER_DEPS := $(addprefix $(call MKESCAPE,$(BUILDDIR))/, $(C_FILES:.c=.d)) .PHONY: all @@ -83,9 +83,9 @@ $(call MKESCAPE,$(BUILDDIR))/%.o: %.c $(call MKESCAPE,$(BUILDDIR))/tinf-copied mkdir -p "$$(dirname '$(call SHESCAPE,$@)')" $(LIMINE_CC) $(LIMINE_CFLAGS) -Os $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)' -$(call MKESCAPE,$(BUILDDIR))/%.o: %.S +$(call MKESCAPE,$(BUILDDIR))/%.o: %.asm mkdir -p "$$(dirname '$(call SHESCAPE,$@)')" - $(LIMINE_CC) $(LIMINE_CFLAGS) -Os $(INTERNAL_CFLAGS) -c '$(call SHESCAPE,$<)' -o '$(call SHESCAPE,$@)' + nasm '$(call SHESCAPE,$<)' -f elf32 -o '$(call SHESCAPE,$@)' .PHONY: clean clean: diff --git a/decompressor/entry.S b/decompressor/entry.S deleted file mode 100644 index 9d5ca7d9..00000000 --- a/decompressor/entry.S +++ /dev/null @@ -1,14 +0,0 @@ -.section .entry - -.globl _start -_start: - cld - - // Zero out .bss - xor %al, %al - mov $bss_begin, %edi - mov $bss_end, %ecx - sub $bss_begin, %ecx - rep stosb - - jmp entry diff --git a/decompressor/entry.asm b/decompressor/entry.asm new file mode 100644 index 00000000..c2b94a97 --- /dev/null +++ b/decompressor/entry.asm @@ -0,0 +1,18 @@ +extern bss_begin +extern bss_end +extern entry + +section .entry + +global _start +_start: + cld + + ; Zero out .bss + xor al, al + mov edi, bss_begin + mov ecx, bss_end + sub ecx, bss_begin + rep stosb + + jmp entry