kernel: build.h

This commit is contained in:
Matheus
2024-05-22 21:46:08 -03:00
parent 78492d4b56
commit 7673a365e8
2 changed files with 14 additions and 1 deletions
+4 -1
View File
@@ -28,8 +28,11 @@ The build process only needs xorriso, curl and bsdtar on the host. All other nee
To build the project, run ``make``. This will create a file named ``astral.iso`` To build the project, run ``make``. This will create a file named ``astral.iso``
## Running ## Running
You can download the latest release from github and run it in the virtual machine of your liking.
For QEMU the following command is recommended:
``qemu-system-x86_64 -enable-kvm -M q35 -m 2g -cdrom astral.iso``
There are a few targets in the makefile to run Astral with qemu: There are a few targets in the makefile to run Astral with qemu when built from source:
``make run`` ``make run``
+10
View File
@@ -14,6 +14,16 @@ KERNELCONFIG=#-DX86_64_ENABLE_E9 -DSYSCALL_LOGGING
CFLAGS=-g -ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mgeneral-regs-only -mno-mmx -mno-sse -mno-sse2 -nostdlib -Wall -I "${INCDIR}" -I "$(ARCHINCDIR)" -I "$(FLANTERMINCDIR)" $(PRINTFOPTS) $(KERNELCONFIG) CFLAGS=-g -ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mgeneral-regs-only -mno-mmx -mno-sse -mno-sse2 -nostdlib -Wall -I "${INCDIR}" -I "$(ARCHINCDIR)" -I "$(FLANTERMINCDIR)" $(PRINTFOPTS) $(KERNELCONFIG)
ASFLAGS=-felf64 ASFLAGS=-felf64
.PHONY: all
all:
# build build.h file
echo "#ifndef _BUILD_H" > include/build.h
echo "#define _BUILD_H" >> include/build.h
echo " #define BUILD_DATE \"$(shell date -u)\"" >> include/build.h
echo " #define BUILD_TARGET \"$(TARGET)\"" >> include/build.h
echo "#endif" >> include/build.h
make astral
astral: $(OBJS) astral: $(OBJS)
@echo [LD] $@ @echo [LD] $@
@$(LD) $(LDFLAGS) -o $@ $^ @$(LD) $(LDFLAGS) -o $@ $^