moved PLATFORM and associated definitions from Makefile to kernel/Makefile so the kernel can be built by itself
git-svn-id: svn://anubis/hos/trunk@17 5b3e749e-e535-0410-8002-a9bb6afbdfca
This commit is contained in:
parent
8493002072
commit
1b0da72e5a
19
Makefile
19
Makefile
@ -3,21 +3,6 @@ KERNEL_FILE := hos.gz
|
|||||||
MKISOFS := genisoimage
|
MKISOFS := genisoimage
|
||||||
ISO := hos.iso
|
ISO := hos.iso
|
||||||
QEMU := qemu-system-x86_64
|
QEMU := qemu-system-x86_64
|
||||||
export PLATFORM := $(shell if [[ `uname` =~ "CYGWIN" ]]; then \
|
|
||||||
echo cygwin; \
|
|
||||||
else \
|
|
||||||
echo unix; \
|
|
||||||
fi)
|
|
||||||
ifeq ($(PLATFORM), cygwin)
|
|
||||||
export LD := i586-elf-ld
|
|
||||||
export CC := i586-elf-gcc
|
|
||||||
export CXX := i586-elf-g++
|
|
||||||
else
|
|
||||||
export LD := ld
|
|
||||||
export CC := gcc
|
|
||||||
export CXX := g++
|
|
||||||
endif
|
|
||||||
export NASM := nasm
|
|
||||||
|
|
||||||
# default target: build the kernel and ISO image
|
# default target: build the kernel and ISO image
|
||||||
all: kernel iso
|
all: kernel iso
|
||||||
@ -25,7 +10,7 @@ all: kernel iso
|
|||||||
# build the kernel
|
# build the kernel
|
||||||
.PHONY: kernel
|
.PHONY: kernel
|
||||||
kernel:
|
kernel:
|
||||||
make -C $@
|
$(MAKE) -C $@
|
||||||
|
|
||||||
# build the ISO image
|
# build the ISO image
|
||||||
.PHONY: iso
|
.PHONY: iso
|
||||||
@ -42,5 +27,5 @@ qemu: iso
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
make -C kernel clean
|
$(MAKE) -C kernel clean
|
||||||
-rm -f $(ISO) iso/boot/$(KERNEL_FILE)
|
-rm -f $(ISO) iso/boot/$(KERNEL_FILE)
|
||||||
|
@ -2,6 +2,23 @@
|
|||||||
KERNEL := hos
|
KERNEL := hos
|
||||||
LDFLAGS := -T link.ld
|
LDFLAGS := -T link.ld
|
||||||
|
|
||||||
|
export PLATFORM := $(shell if [[ `uname` =~ "CYGWIN" ]]; then \
|
||||||
|
echo cygwin; \
|
||||||
|
else \
|
||||||
|
echo unix; \
|
||||||
|
fi)
|
||||||
|
ifeq ($(PLATFORM), cygwin)
|
||||||
|
export LD := i586-elf-ld
|
||||||
|
export CC := i586-elf-gcc
|
||||||
|
export CXX := i586-elf-g++
|
||||||
|
else
|
||||||
|
export LD := ld
|
||||||
|
export CC := gcc
|
||||||
|
export CXX := g++
|
||||||
|
endif
|
||||||
|
export NASM := nasm
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(KERNEL).gz
|
all: $(KERNEL).gz
|
||||||
|
|
||||||
|
@ -12,9 +12,13 @@
|
|||||||
%define TEMPORARY_STACK_PHYSICAL 0x01000000-4 ; top of first 16MB
|
%define TEMPORARY_STACK_PHYSICAL 0x01000000-4 ; top of first 16MB
|
||||||
%define TEMPORARY_STACK_VIRTUAL TEMPORARY_STACK_PHYSICAL + VIRTUAL_OFFSET
|
%define TEMPORARY_STACK_VIRTUAL TEMPORARY_STACK_PHYSICAL + VIRTUAL_OFFSET
|
||||||
|
|
||||||
|
%define PAGE_SIZE 0x1000 ; 4KB pages
|
||||||
|
|
||||||
; Get these symbols from the linker
|
; Get these symbols from the linker
|
||||||
extern _end, _bss
|
extern _end, _bss
|
||||||
|
|
||||||
|
|
||||||
|
;-------------------------------------------------------
|
||||||
[section .text]
|
[section .text]
|
||||||
;**************************************************************************
|
;**************************************************************************
|
||||||
;* This is the first symbol in the .text section *
|
;* This is the first symbol in the .text section *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user