Skip to content

Commit

Permalink
chore: kernel API build
Browse files Browse the repository at this point in the history
  • Loading branch information
moodyhunter committed Feb 9, 2025
1 parent dc49657 commit d1af7ae
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 7 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ add_subdirectory(kernel)
include(add_mos_library)
add_subdirectory(libs)

add_subdirectory(userspace)
if (__MOS_HAS_NO_COMPILER)
message(WARNING "Skipping userspace build because __MOS_HAS_NO_COMPILER is set.")
else()
add_subdirectory(userspace)
endif()
add_subdirectory(tools)

# include custom configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma once

#include <mos/mos_global.h>
#include <mos/types.hpp>
#include <mos/types.h>

enum
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#pragma once

#include <mos/mos_global.h>
#include <mos/types.hpp>
#include <mos/types.h>

enum
{
Expand Down
2 changes: 1 addition & 1 deletion kernel/arch/x86_64/x86_platform_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <mos/mm/physical/pmm.hpp>
#include <mos/mos_global.h>
#include <mos/platform/platform.hpp>
#include <mos/platform_syscall.hpp>
#include <mos/platform_syscall.h>
#include <mos/syslog/printk.hpp>
#include <mos/tasks/process.hpp>
#include <mos/tasks/task_types.hpp>
Expand Down
1 change: 0 additions & 1 deletion kernel/filesystem/userfs/userfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <librpc/rpc_client.h>
#include <librpc/rpc_server.h>
#include <mos/filesystem/fs_types.h>
#include <mos/proto/fs_server.h>
#include <mos_stdio.hpp>
#include <mos_stdlib.hpp>
#include <mos_string.hpp>
Expand Down
2 changes: 1 addition & 1 deletion kernel/include/private/mos/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class PtrResult

T *get() const
{
return const_cast<T *>(value);
return value;
}

bool isErr() const
Expand Down
20 changes: 20 additions & 0 deletions kernel/include/public/mos/proto/fs_server.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#pragma once

#define USERFS_SERVER_RPC_NAME "mos.userfs-manager"

#define USERFS_MANAGER_X(ARGS, PB, xarg) \
/**/ \
PB(xarg, 0, register_fs, REGISTER_FS, mos_rpc_fs_register_request, mos_rpc_fs_register_response)

#define USERFS_IMPL_X(ARGS, PB, xarg) \
PB(xarg, 0, mount, MOUNT, mos_rpc_fs_mount_request, mos_rpc_fs_mount_response) \
PB(xarg, 1, readdir, READDIR, mos_rpc_fs_readdir_request, mos_rpc_fs_readdir_response) \
PB(xarg, 2, lookup, LOOKUP, mos_rpc_fs_lookup_request, mos_rpc_fs_lookup_response) \
PB(xarg, 3, readlink, READLINK, mos_rpc_fs_readlink_request, mos_rpc_fs_readlink_response) \
PB(xarg, 4, getpage, GETPAGE, mos_rpc_fs_getpage_request, mos_rpc_fs_getpage_response) \
PB(xarg, 5, putpage, PUTPAGE, mos_rpc_fs_putpage_request, mos_rpc_fs_putpage_response) \
PB(xarg, 6, create_file, CREATE_FILE, mos_rpc_fs_create_file_request, mos_rpc_fs_create_file_response) \
PB(xarg, 7, sync_inode, SYNC_INODE, mos_rpc_fs_sync_inode_request, mos_rpc_fs_sync_inode_response) \
PB(xarg, 8, unlink, UNLINK, mos_rpc_fs_unlink_request, mos_rpc_fs_unlink_response)\
1 change: 0 additions & 1 deletion userspace/drivers/fs/ext4/ext4fs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <librpc/rpc_server++.hpp>
#include <memory>
#include <mos/filesystem/fs_types.h>
#include <mos/proto/fs_server.h>
#include <pb_decode.h>

using namespace std::string_literals;
Expand Down
1 change: 1 addition & 0 deletions userspace/drivers/fs/ext4/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "blockdev.h"
#include "ext4fs.hpp"
#include "mos/proto/fs_server.h"
#include "proto/blockdev.services.h"
#include "proto/userfs-manager.services.h"

Expand Down

0 comments on commit d1af7ae

Please sign in to comment.