sp1: Add kernel C-side groundwork

Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
2026-04-16 18:54:30 -04:00
parent 4df50a5373
commit 53466e332e
5 changed files with 56 additions and 5 deletions
+5 -2
View File
@@ -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):
+6 -3
View File
@@ -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 $@
+2
View File
@@ -11,11 +11,13 @@
.text
.globl _start
.extern main
_start:
cli
cld
xor %rbp, %rbp
call main
cli
1: hlt
+28
View File
@@ -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 $@
+15
View File
@@ -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)
{
}