sp1: Add kernel C-side groundwork
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (c) 2026, Mirocom Laboratories
|
||||
# All rights reserved.
|
||||
@@ -11,7 +10,11 @@
|
||||
#
|
||||
|
||||
.PHONY: all
|
||||
all: $(ARCH)
|
||||
all: common $(ARCH)
|
||||
|
||||
.PHONY: common
|
||||
common:
|
||||
cd common; $(MAKE)
|
||||
|
||||
.PHONY: $(ARCH)
|
||||
$(ARCH):
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
|
||||
ASMFILES = $(shell find . -name "*.S")
|
||||
ASMOFILES = $(ASMFILES:.S=.S.o)
|
||||
|
||||
MISC_OFILES = $(shell find ../../ -name "*.o")
|
||||
MISC_OFILES = $(shell find ../common -name "*.o")
|
||||
|
||||
CC = \
|
||||
../../../../$(SYS_CC)
|
||||
@@ -25,7 +24,11 @@ CFLAGS = \
|
||||
|
||||
.PHONY: all
|
||||
all: $(ASMOFILES)
|
||||
$(LD) -Tconf/link.ld $(MISC_OFILES) -o ../../../../sp1.sys
|
||||
$(LD) \
|
||||
-Tconf/link.ld \
|
||||
$(MISC_OFILES) \
|
||||
$(ASMOFILES) \
|
||||
-o ../../../../sp1.sys
|
||||
|
||||
%.S.o: %.S
|
||||
$(CC) -c $(CFLAGS) $< -o $@
|
||||
|
||||
@@ -11,11 +11,13 @@
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
.extern main
|
||||
_start:
|
||||
cli
|
||||
cld
|
||||
|
||||
xor %rbp, %rbp
|
||||
call main
|
||||
|
||||
cli
|
||||
1: hlt
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# Copyright (c) 2026, Mirocom Laboratories
|
||||
# All rights reserved.
|
||||
#
|
||||
# The following sources are CONFIDENTIAL and PROPRIETARY
|
||||
# property of Mirocom Laboratories. Unauthorized copying,
|
||||
# use, distrubution or modification of this file, in whole
|
||||
# and in part, is strictly prohibited without the prior written
|
||||
# consent from Mirocom Laboratories.
|
||||
#
|
||||
|
||||
CFILES = $(shell find os/ -name "*.c")
|
||||
OFILES = $(CFILES:.c=.o)
|
||||
|
||||
CC = ../../../../$(SYS_CC)
|
||||
|
||||
CFLAGS = \
|
||||
$(SYS_CFLAGS) \
|
||||
-D_KERNEL \
|
||||
-MMD \
|
||||
-DPRINTF_DISABLE_SUPPORT_PTRDIFF_T \
|
||||
-DPRINTF_DISABLE_SUPPORT_FLOAT
|
||||
|
||||
.PHONY: all
|
||||
all: $(OFILES)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $< $(CFLAGS) -o $@
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright (c) 2026, Mirocom Laboratories
|
||||
* All rights reserved.
|
||||
*
|
||||
* The following sources are CONFIDENTIAL and PROPRIETARY
|
||||
* property of Mirocom Laboratories. Unauthorized copying,
|
||||
* use, distribution or modification of this file, in whole
|
||||
* and in part, is strictly prohibited without the prior written
|
||||
* consent from Mirocom Laboratories.
|
||||
*/
|
||||
|
||||
void
|
||||
main(void)
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user