Skip to content

[M1] Makefile: build kernel image from asm + C sources #5

Description

@mitsuakki

Single Makefile driving the whole build: assemble .asm files with NASM, compile .c files with the cross-compiler in freestanding mode, link everything against linker.ld, produce kernel.elf (and a bootable image if not using Multiboot2 direct boot). Add a clean target and a run target that calls scripts/run-qemu.sh.

Resources:

  • OSDev wiki: Bare Bones — Makefile section has a working reference Makefile for exactly this setup
  • GNU Make manual, pattern rules section, useful for the .asm → .o and .c → .o rules without repeating yourself per file

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions