GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — rustkernel/Makefile at master · manalejandro/rustkernel

Expand file tree

/

Makefile

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
79 lines (61 loc) · 1.81 KB
/

Makefile

Copy path

File metadata and controls

79 lines (61 loc) · 1.81 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# SPDX-License-Identifier: GPL-2.0
# Rust Kernel Makefile
RUST_KERNEL_VERSION := 0.1.0
ARCH ?= x86_64
BUILD_TYPE ?= release
# Enable unstable features on stable compiler
export RUSTC_BOOTSTRAP := 1
# Cargo configuration
CARGO := cargo
ifeq ($(BUILD_TYPE),debug)
CARGO_FLAGS :=
else
CARGO_FLAGS := --release
endif
# Kernel build command
KERNEL_BUILD_CMD := cd kernel && $(CARGO) build $(CARGO_FLAGS) \
--target x86_64-unknown-none \
-Z build-std=core,alloc \
-Z build-std-features=compiler-builtins-mem
# Binary locations
KERNEL_BIN := kernel/target/x86_64-unknown-none/$(BUILD_TYPE)/rust-kernel
ISO_BOOT := iso/boot/rust-kernel
# Default target
all: iso
# Build the kernel binary
kernel:
@echo "Building Rust kernel ($(ARCH), $(BUILD_TYPE))"
@$(KERNEL_BUILD_CMD)
@echo "Kernel binary: $(KERNEL_BIN)"
# Create bootable ISO
iso: kernel
@echo "Creating bootable ISO..."
@mkdir -p iso/boot/grub
@cp $(KERNEL_BIN) $(ISO_BOOT)
@grub-mkrescue -o rust-kernel.iso iso 2>/dev/null && echo "ISO created: rust-kernel.iso"
# Run in QEMU
run: iso
@echo "Starting kernel in QEMU (Ctrl+C to exit)..."
@qemu-system-x86_64 -m 512M -cdrom rust-kernel.iso -serial stdio -no-reboot
# Quick test run
test-run: iso
@echo "Testing kernel (10s timeout)..."
@timeout 10s qemu-system-x86_64 -m 512M -cdrom rust-kernel.iso -serial stdio -no-reboot 2>&1 || true
# Run with debug output
debug: iso
@qemu-system-x86_64 -m 512M -cdrom rust-kernel.iso -serial stdio -no-reboot -d int,cpu_reset
# Clean build artifacts
clean:
@cd kernel && $(CARGO) clean
@rm -f rust-kernel.iso
@echo "Clean complete"
# Format code
fmt:
@cd kernel && $(CARGO) fmt
# Check formatting
fmt-check:
@cd kernel && $(CARGO) fmt --check
# Generate documentation
doc:
@cd kernel && $(CARGO) doc --no-deps
.PHONY: all kernel iso run test-run debug clean fmt fmt-check doc
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.