Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS support #1

Open
ytakano opened this issue Apr 24, 2023 · 0 comments
Open

macOS support #1

ytakano opened this issue Apr 24, 2023 · 0 comments

Comments

@ytakano
Copy link

ytakano commented Apr 24, 2023

On macOS, it can be compiled to modify kernel/Makefile as follows.

CFLAGS = -Wall -Wextra -nostdlib --target=x86_64-w64-mingw32-elf
LDFLAGS = -s -x
LD = lld -flavor ld.lld

all: kernel apps/app1 apps/app2 apps/app3
        make -C ../
        make copy

kernel: kernel.o segmentation.o hardware.o load_gdt.o font.o
        $(LD) $(LDFLAGS) -e start -T kernel.ld -o $@ $+

apps/app1: apps/app1.o
        $(LD) $(LDFLAGS) -T apps/app1.ld -o $@ $+

apps/app2: apps/app2.o
        $(LD) $(LDFLAGS) -T apps/app2.ld -o $@ $+

apps/app3: apps/app3.o
        $(LD) $(LDFLAGS) -T apps/app3.ld -o $@ $+

-e start is required for lld.

However, it fails to boot on macOS.

Required libraries:

$ brew install wget mingw-w64 qemu

To use lld, the following line has been removed from the linker scripts.

OUTPUT_FORMAT("binary");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant