mirror of
https://github.com/limine-bootloader/limine
synced 2024-12-04 14:11:58 +03:00
misc: Compile stage 2 with -Os and stage 3 with -O3
This commit is contained in:
parent
cbcf3779b6
commit
8939c3421c
@ -20,7 +20,8 @@ E9_OUTPUT = false
|
||||
BUILD_ID := $(shell dd if=/dev/urandom count=8 bs=1 | od -An -t x8 | sed 's/^ /0x/')
|
||||
LIMINE_VERSION := $(shell git describe --exact-match --tags `git log -n1 --pretty='%h'` || git log -n1 --pretty='%h')
|
||||
WERROR = -Werror
|
||||
CFLAGS = -Os -g -pipe -Wall -Wextra $(WERROR)
|
||||
CFLAGS = -O3 -g -pipe -Wall -Wextra $(WERROR)
|
||||
S2CFLAGS = -Os -g -pipe -Wall -Wextra $(WERROR)
|
||||
|
||||
INTERNAL_CFLAGS := \
|
||||
-std=gnu11 \
|
||||
@ -54,7 +55,7 @@ ifeq ($(TARGET), uefi)
|
||||
-mno-red-zone
|
||||
endif
|
||||
|
||||
LDFLAGS = -Os -g
|
||||
LDFLAGS = -O3 -g
|
||||
|
||||
INTERNAL_LDFLAGS := \
|
||||
-fno-lto \
|
||||
@ -133,6 +134,11 @@ limine_efi.elf: $(OBJ) font.o sys/smp_trampoline.o
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
|
||||
|
||||
ifeq ($(TARGET), bios)
|
||||
%.s2.o: %.s2.c
|
||||
$(CC) $(S2CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
|
||||
endif
|
||||
|
||||
%.o: %.asm
|
||||
nasm $< -F dwarf -g -f elf32 -o $@
|
||||
|
||||
|
@ -191,6 +191,9 @@ static int fat32_open_in(struct fat32_context* context, struct fat32_directory_e
|
||||
size_t dir_chain_len;
|
||||
uint32_t *directory_cluster_chain = cache_cluster_chain(context, current_cluster_number, &dir_chain_len);
|
||||
|
||||
if (directory_cluster_chain == NULL)
|
||||
return -1;
|
||||
|
||||
struct fat32_directory_entry *directory_entries = ext_mem_alloc(dir_chain_len * block_size);
|
||||
if (!read_cluster_chain(context, directory_cluster_chain, directory_entries, 0, dir_chain_len * block_size))
|
||||
return -1;
|
||||
|
@ -26,7 +26,10 @@ static void spinup(uint8_t drive) {
|
||||
"mov eax, cr0\n\t"
|
||||
"and al, 0xfe\n\t"
|
||||
"mov cr0, eax\n\t"
|
||||
"jmp 0x0000:1f\n\t"
|
||||
"mov eax, OFFSET 1f\n\t"
|
||||
"push eax\n\t"
|
||||
"push 0\n\t"
|
||||
"retf\n\t"
|
||||
"1:\n\t"
|
||||
"mov ax, 0\n\t"
|
||||
"mov ds, ax\n\t"
|
||||
|
@ -34,7 +34,10 @@ static void spinup(uint16_t real_mode_code_seg, uint16_t kernel_entry_seg,
|
||||
"mov eax, cr0\n\t"
|
||||
"and al, 0xfe\n\t"
|
||||
"mov cr0, eax\n\t"
|
||||
"jmp 0x0000:1f\n\t"
|
||||
"mov eax, OFFSET 1f\n\t"
|
||||
"push eax\n\t"
|
||||
"push 0\n\t"
|
||||
"retf\n\t"
|
||||
"1:\n\t"
|
||||
"mov ds, bx\n\t"
|
||||
"mov es, bx\n\t"
|
||||
|
Loading…
Reference in New Issue
Block a user