Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
Signed-off-by: Ooops_t <[email protected]>
  • Loading branch information
ooops-t committed Apr 21, 2023
0 parents commit 6d869e4
Show file tree
Hide file tree
Showing 14 changed files with 108 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
build-*/
.sel4_cache/
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "kernel"]
path = kernel
url = https://github.com/seL4/seL4.git
[submodule "projects/sel4runtime"]
path = projects/sel4runtime
url = https://github.com/seL4/sel4runtime.git
[submodule "projects/util_libs"]
path = projects/util_libs
url = https://github.com/seL4/util_libs.git
[submodule "projects/seL4_libs"]
path = projects/seL4_libs
url = https://github.com/seL4/seL4_libs.git
[submodule "projects/musllibc"]
path = projects/musllibc
url = https://github.com/seL4/musllibc.git
[submodule "tools/seL4"]
path = tools/seL4
url = https://github.com/seL4/seL4_tools.git
1 change: 1 addition & 0 deletions easy-settings.cmake
1 change: 1 addition & 0 deletions init-build.sh
1 change: 1 addition & 0 deletions kernel
Submodule kernel added at 62dccc
25 changes: 25 additions & 0 deletions projects/hello/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.7.2)

project(helloworld C CXX ASM) # create a new C project called 'Hello'

include(settings.cmake)

# We must build the debug kernel because the tutorials rely on seL4_DebugPutChar
# and they don't initialize a platsupport driver.
ApplyCommonReleaseVerificationSettings(FALSE FALSE)

add_executable(helloworld src/main.c) # add files to our project. Paths are relative to this file.

target_link_libraries(helloworld sel4muslcsys muslc) # we need to link against the standard C lib for printf

# Set this image as the rootserver
DeclareRootserver(helloworld)

if(SIMULATION)
ApplyCommonSimulationSettings(${KernelSel4Arch})
GenerateSimulateScript()
else()
if(KernelArchX86)
set(KernelIOMMU ON CACHE BOOL "" FORCE)
endif()
endif()
1 change: 1 addition & 0 deletions projects/hello/easy-settings.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(SIMULATION ON CACHE BOOL "Include only simulation compatible tests")
45 changes: 45 additions & 0 deletions projects/hello/settings.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
cmake_minimum_required(VERSION 3.7.2)

set(project_dir "${CMAKE_CURRENT_LIST_DIR}/../../")
file(GLOB project_modules ${project_dir}/projects/*)

list(
APPEND
CMAKE_MODULE_PATH
${project_dir}/kernel
${project_dir}/tools/seL4/cmake-tool/helpers/
${project_dir}/tools/seL4/elfloader-tool/
${project_modules}
)

# set(SEL4_CONFIG_DEFAULT_ADVANCED ON)
if(SIMULATION)
include(simulation)
endif()
include(rootserver)
include(application_settings)
include(${CMAKE_CURRENT_LIST_DIR}/easy-settings.cmake)

correct_platform_strings()

find_package(seL4 REQUIRED)
find_package(musllibc REQUIRED)
find_package(util_libs REQUIRED)
find_package(seL4_libs REQUIRED)
find_package(elfloader-tool REQUIRED)

# Platform config
sel4_configure_platform_settings()

# Import kernel, elfloader
sel4_import_kernel()
elfloader_import_project()

# Import libraries
sel4_import_libsel4()
util_libs_import_libraries()
sel4_libs_import_libraries()

# Set up environment build flags and imports musllibc and runtime libraries
musllibc_setup_build_environment_with_sel4runtime()

8 changes: 8 additions & 0 deletions projects/hello/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <stdio.h>

int main(int argc, char *argv[])
{
printf("Hello, World!\n");

return 0;
}
1 change: 1 addition & 0 deletions projects/musllibc
Submodule musllibc added at 3d6b93
1 change: 1 addition & 0 deletions projects/seL4_libs
Submodule seL4_libs added at 2ca525
1 change: 1 addition & 0 deletions projects/sel4runtime
Submodule sel4runtime added at d935dd
1 change: 1 addition & 0 deletions projects/util_libs
Submodule util_libs added at 6e7ba0
1 change: 1 addition & 0 deletions tools/seL4
Submodule seL4 added at 2c213a

0 comments on commit 6d869e4

Please sign in to comment.