Merge branch 'public'

This commit is contained in:
Alexander Myltsev 2024-02-03 16:55:16 +04:00
commit 52fe2a02a3
2 changed files with 28 additions and 3 deletions

View File

@ -10,14 +10,23 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: build disk image
run: make image.bin
llvm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install lld
run: sudo apt-get install -y lld
- name: LLVM build
run: make LLVM=on image.bin
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: install llvm
run: brew install llvm x86_64-elf-binutils x86_64-elf-gcc
- name: LLVM build
run: make LLVM=on image.bin

View File

@ -10,13 +10,14 @@ OBJCOPY=x86_64-elf-objcopy
endif
CFLAGS = -fno-pic -ffreestanding -static -fno-builtin -fno-strict-aliasing \
-mno-sse \
-Wall -ggdb -m32 -Werror -fno-omit-frame-pointer
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
ASMFLAGS = -m32 -ffreestanding -c -g
ifeq ($(LLVM),on)
#AS=llvm-as
LD=ld.lld
LD=PATH=/usr/local/opt/llvm/bin:$(PATH) ld.lld
CC=clang
CFLAGS += -target elf-i386
ASMFLAGS = -target elf-i386 -ffreestanding -c -g
@ -33,6 +34,21 @@ run: image.bin
run-nox: image.bin
qemu-system-i386 -nographic -drive format=raw,file=$< -serial mon:stdio
ejudge.sh: image.bin
echo >$@ "#!/bin/sh"
echo >>$@ "base64 -d <<===EOF | gunzip >image.bin"
gzip <$^ | base64 >>$@
echo >>$@ "===EOF"
echo >>$@ "exec qemu-system-i386 -nographic -drive format=raw,file=image.bin -serial mon:stdio"
chmod +x $@
diag:
-uname -a
-$(CC) --version
-$(LD) -v
-gcc --version
-ld -v
debug-boot-nox: image.bin mbr.elf
qemu-system-i386 -nographic -drive format=raw,file=$< -s -S &
$(GDB) mbr.elf \