Prepare main structure for managing message queues.

This commit is contained in:
Enrico Fraccaroli (Galfurian)
2023-06-08 10:51:33 -04:00
parent 2fcce9360c
commit e5370dff36
4 changed files with 44 additions and 14 deletions
+24 -3
View File
@@ -2,7 +2,6 @@
/// @brief
/// @copyright (c) 2014-2023 This file is distributed under the MIT License.
/// See LICENSE.md for details.
///! @cond Doxygen_Suppress
// ============================================================================
// Setup the logging for this file (do this before any other include).
@@ -29,6 +28,8 @@ typedef struct {
int id;
/// @brief The message queue data strcutre.
struct msqid_ds msqid;
/// Pointer to the first message in the queue.
struct msg *msg_base;
/// Reference inside the list of message queue management structures.
list_head list;
} msq_info_t;
@@ -36,6 +37,24 @@ typedef struct {
/// @brief List of all current active Message queues.
list_head msq_list;
// ============================================================================
// MEMORY MANAGEMENT (Private)
// ============================================================================
// ============================================================================
// SEARCH FUNCTIONS (Private)
// ============================================================================
// ============================================================================
// SYSTEM FUNCTIONS
// ============================================================================
int msq_init()
{
list_head_init(&msq_list);
return 0;
}
long sys_msgget(key_t key, int msgflg)
{
TODO("Not implemented");
@@ -60,6 +79,10 @@ long sys_msgctl(int msqid, int cmd, struct msqid_ds *buf)
return 0;
}
// ============================================================================
// PROCFS FUNCTIONS
// ============================================================================
ssize_t procipc_msg_read(vfs_file_t *file, char *buf, off_t offset, size_t nbyte)
{
if (!file) {
@@ -90,5 +113,3 @@ ssize_t procipc_msg_read(vfs_file_t *file, char *buf, off_t offset, size_t nbyte
}
return write_count;
}
///! @endcond
+11
View File
@@ -27,6 +27,7 @@
#include "system/syscall.h"
#include "sys/module.h"
#include "sys/sem.h"
#include "sys/msg.h"
#include "io/proc_modules.h"
#include "io/vga/vga.h"
#include "io/video.h"
@@ -312,6 +313,16 @@ int kmain(boot_info_t *boot_informations)
}
print_ok();
//==========================================================================
pr_notice("Initialize IPC/MSQ system...\n");
printf("Initialize IPC/MSQ system...");
if (msq_init()) {
print_fail();
pr_emerg("Failed to initialize the IPC/MSQ system!\n");
return 1;
}
print_ok();
//==========================================================================
pr_notice("Setting up PS/2 driver...\n");
printf("Setting up PS/2 driver...");