Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
d0p1s4m4 committed Nov 13, 2023
1 parent 86c2522 commit 99e74b7
Show file tree
Hide file tree
Showing 118 changed files with 999 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
key: toolchain-${{ matrix.arch }}

- name: Build toolchain ${{ matrix.arch }}
run: ARCH=${{ matrix.arch }} ./scripts/build_toolchain.sh
run: ARCH=${{ matrix.arch }} ./tools/build_toolchain.sh

- name: Build Fukuro ${{ matrix.arch }}
run: ARCH=${{ matrix.arch }} make
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
run: |
sudo apt-get update
sudo apt-get install build-essential libcmocka-dev
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Build
run: |
make test
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
27 changes: 25 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,30 @@ node_modules/
toolchain/
fukuro.iso
*~
test
*.gcda
*.gcno
docs/
docs/html
*.img

.config
.config.mk
config.h
*.old
test.exe

*.in
/aclocal.m4
*.sub
*.guess
/configure
/install-sh
Makefile
/tmp
/build
build.mk
/build-aux/ar-lib
/build-aux/compile
/build-aux/depcomp
/build-aux/install-sh
/build-aux/missing
*.cache
32 changes: 32 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
mainmenu "Fukurō"

choice
prompt "Architecture"
default X86

config X86
bool "x86 architecture"

config ARM
bool "ARM architecture"

config AARCH64
bool "AArch64 architecture"

endchoice

source "src/kernel/arch/Kconfig"

choice
prompt "Toolchain"
default LLVM

config LLVM
bool "LLVM"

config GNU
bool "GNU"

endchoice

source "test/Kconfig"
95 changes: 0 additions & 95 deletions Makefile

This file was deleted.

1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBDIRS = lib sys srv
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

20 changes: 0 additions & 20 deletions arch/generic/stivale2.h

This file was deleted.

2 changes: 0 additions & 2 deletions arch/i686/boot.s

This file was deleted.

20 changes: 20 additions & 0 deletions build-aux/git-version
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

v=`git describe --abbrev=4 --match='v[0-9]*' HEAD 2>/dev/null`

if [ ! -n "$v" ]
then
v="0.0"
fi

c=`git rev-parse --short HEAD`

v="${v}-${c}"

s=`git status`
if [ -n "$s" ]
then
v="${v}-dirty"
fi

echo "$v" | tr -d '\012'
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ignore:
- "**/tests"
- "test"
10 changes: 10 additions & 0 deletions compile_flags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-ansi
-pedantic
-pedantic-errors
-Wall
-Werror
-Wextra
-fno-builtin
-Wno-variadic-macros
-Dinline=__inline__
-Isrc/lib
97 changes: 97 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
m4_define([fukuro_VERSION],
m4_esyscmd([build-aux/git-version]))
AC_INIT([Fukuro],
m4_defn([fukuro_VERSION]),
[https://github.com/d0p1s4m4/Fukuro/issues])
AC_COPYRIGHT([Copyright (C) 2023 d0p1])

CFLAGS="-ffreestanding -nostdlib -fno-builtin"

AC_CONFIG_AUX_DIR([build-aux])

AM_INIT_AUTOMAKE([foreign subdir-objects])

dnl overide default AC_LANG_PROGRAM(C) macro
m4_ifdef([AC_LANG_PROGRAM(c)], m4_undefine[AC_LANG_PROGRAM(c)])
m4_define([AC_LANG_PROGRAM(C)],
[$1
int
_start (void)
{
$2
;
return 0;
}])

AC_CANONICAL_HOST

AS_CASE([$host_cpu],
[i?86], [
systype=i686
],
[x86_64], [systype=amd64],
[systype=$host_cpu]
)
AC_SUBST([systype])

m4_include([sys/configfrag.ac])

AS_IF([! test -d "$srcdir/sys/$systype"],
[AC_MSG_ERROR(["$host_cpu isn't supported by Fukuro"])])

AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile lib/Makefile srv/Makefile sys/Makefile])

AC_LANG([C])
save_cross_compiling=$cross_compiling
cross_compiling=yes
AM_PROG_AS
cross_compiling=$save_cross_compiling
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_LN_S
AC_PROG_MKDIR_P
AC_PROG_CC_C_O
AM_PROG_AR

AC_CHECK_TOOL([STRIP], [strip])
AC_CHECK_TOOL([OBJCOPY], [objcopy])
AC_CHECK_PROG([GZIP], [gzip], [gzip])
AC_CHECK_PROG([QEMU], [qemu-system-$host_cpu], [qemu-system-$host_cpu])
AC_CHECK_PROG([PYTHON3], [python3], [python3])
AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])

AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
AC_C_BIGENDIAN
AC_CHECK_HEADERS([stdarg.h])
AC_C_STRINGIZE

AC_CHECK_TYPE(uintptr_t)
AC_TYPE_SIZE_T

AC_CONFIG_LINKS(["sys/machine":"$srcdir/sys/$systype"])

AC_ARG_ENABLE([ncpus],
AS_HELP_STRING([--enable-ncpus=N], []),
[ncpu=$enable_ncpus]
[ncpu=1])
AC_DEFINE_UNQUOTED([NCPUS], [$ncpus], [number of CPUs])

m4_include([srv/configfrag.ac])

AC_OUTPUT
AC_MSG_RESULT([
Fukurō version: $PACKAGE_STRING
Architecture: $host_cpu
C Compiler: $CC
Asm Compiler: $CCAS
CFLAGS: $CFLAGS
CCASFLAGS: $CCASFLAG
LDFLAGS: $LDFLAGS
])

0 comments on commit 99e74b7

Please sign in to comment.