multiarch compat
This commit is contained in:
parent
0485052b11
commit
a05218fc0d
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM rust:latest as builder
|
||||||
|
WORKDIR /usr/src/gila
|
||||||
|
COPY . .
|
||||||
|
RUN rustup default nightly
|
||||||
|
RUN rustup target add x86_64-unknown-none
|
||||||
|
|
||||||
|
FROM alpine:3.21
|
||||||
|
RUN apk add bash xorriso make limine qemu-system-x86_64
|
||||||
|
CMD ["/bin/bash"]
|
||||||
|
|
14
Makefile
14
Makefile
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
TARGET ?= "x86_64-unknown-none"
|
TARGET ?= "x86_64-unknown-none"
|
||||||
|
QEMU ?= "qemu-system-x86_64"
|
||||||
|
|
||||||
all: clean prepare gila iso run
|
all: clean prepare gila iso run
|
||||||
|
|
||||||
@ -10,7 +11,18 @@ prepare:
|
|||||||
|
|
||||||
# Run the ISO in an emulator.
|
# Run the ISO in an emulator.
|
||||||
run: build/gila.iso
|
run: build/gila.iso
|
||||||
qemu-system-x86_64 -drive file=build/gila.iso,format=raw,index=0,media=disk
|
|
||||||
|
ifeq ($(TARGET),x86_64-unknown-none)
|
||||||
|
QEMU = "qemu-system-x86_64"
|
||||||
|
else ifeq ($(TARGET),riscv64gc-unknown-none-elf)
|
||||||
|
QEMU = "qemu-system-riscv64"
|
||||||
|
else ifeq ($(TARGET),aarch64-unknown-none)
|
||||||
|
QEMU = "qemu-system-aarch64"
|
||||||
|
else ifeq ($(TARGET),loongarch64-unknown-none)
|
||||||
|
QEMU = "qemu-system-loongarch64"
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(QEMU) -drive file=build/gila.iso,format=raw,index=0,media=disk
|
||||||
|
|
||||||
# Build the bootable kernel image.
|
# Build the bootable kernel image.
|
||||||
.PHONY: build/iso/gila
|
.PHONY: build/iso/gila
|
||||||
|
3
src/arch/mod.rs
Normal file
3
src/arch/mod.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
pub mod x86_64;
|
||||||
|
pub use x86_64 as current;
|
1
src/arch/x86_64/mod.rs
Normal file
1
src/arch/x86_64/mod.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
pub mod display;
|
@ -11,5 +11,6 @@ pub mod panic;
|
|||||||
pub mod boot;
|
pub mod boot;
|
||||||
/// Resources accessible from many parts of the code.
|
/// Resources accessible from many parts of the code.
|
||||||
pub mod resources;
|
pub mod resources;
|
||||||
/// Display facilities.
|
|
||||||
pub mod display;
|
/// Architecture dependent.
|
||||||
|
pub mod arch;
|
||||||
|
@ -12,7 +12,7 @@ use gila::process;
|
|||||||
use gila::memory;
|
use gila::memory;
|
||||||
use gila::panic;
|
use gila::panic;
|
||||||
use gila::boot;
|
use gila::boot;
|
||||||
use gila::display::{self, TextWriter};
|
use gila::arch::current::display;
|
||||||
|
|
||||||
#[unsafe(no_mangle)]
|
#[unsafe(no_mangle)]
|
||||||
unsafe extern "C" fn main() -> !{
|
unsafe extern "C" fn main() -> !{
|
||||||
|
Loading…
Reference in New Issue
Block a user