Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
The format is based on [Keep a Changelog](https://keepachangelog.com),
Versioning is similar to [semver](https://semver.org) but is more flexible and similar to how linux does it, and uses custom tags (like `-dev` and `-rc`).

## 0.9-dev - 2026-10-2
## 0.9-dev - 2026-10-02

### Added
- `ipc/` filled in with message passing and synchronisation between kernel tasks, replacing the stubs.
- `IpcPort` in `ipc/message.h`, a FIFO of `IpcPortCapacity` (16) fixed size messages. `IpcSend()` waits while the port is full and `IpcReceive()` waits while it is empty, so two tasks can hand work back and forth without polling. `IpcTrySend()` and `IpcTryReceive()` are the non blocking forms.
- `IpcSemaphore` and `IpcMutex` in `ipc/sync.h`. A semaphore takes a ceiling, so a `Limit` of 1 is a binary semaphore and `SemPost()` past the ceiling reports `IpcErrFull` rather than letting the count run away.
- `IpcPort` in `include/novium/message.h`, a FIFO of `IpcPortCapacity` (16) fixed size messages. `IpcSend()` waits while the port is full and `IpcReceive()` waits while it is empty, so two tasks can hand work back and forth without polling. `IpcTrySend()` and `IpcTryReceive()` are the non blocking forms.
- `IpcSemaphore` and `IpcMutex` in `include/novium/sync.h`. A semaphore takes a ceiling, so a `Limit` of 1 is a binary semaphore and `SemPost()` past the ceiling reports `IpcErrFull` rather than letting the count run away.
- `IpcStatus` for every entry point, so a refused call says why instead of failing silently.
- A shared wait queue in `ipc/ipc.c`. `IpcPark()` registers the calling task and sleeps as one step under the interrupt lock, so a waker that runs in between either finds the task parked or is seen by the re-check afterwards. A wakeup cannot be lost.
- Wait queues keyed by task id rather than `Task *`, and `IpcWaitTakeLive()` drops entries left by a task that was killed, since a dead task can never run again.
- Boot tests in `kernel_main()` covering a 40 message rendezvous between two tasks, more than a port can hold so both the send and receive paths really do park, a binary semaphore, and two tasks contending on one mutex for several hundred rounds.
- `ipc/` added to the `Makefile` VPATH and its objects to `KERNEL_OBJS`.

### Changed
- The `ipc/` headers moved to the global include directory, so they are `include/novium/ipc.h`, `include/novium/message.h` and `include/novium/sync.h` now. They were left next to the `.c` files while they were stubs, but they describe interfaces the rest of the kernel includes, which is what `include/novium/` is for. Include paths updated accordingly.
- `MutexUnlock()` hands ownership straight to the first waiter instead of clearing the owner, so a task that merely happens to be ready cannot take the lock ahead of the task that was woken for it.
- `ipc/message.h` and `ipc/sync.h` are no longer listed as planned interfaces, since their contracts are documented in `Documentation/kernel_api.md` now.
- `include/novium/message.h` and `include/novium/sync.h` are no longer listed as planned interfaces, since their contracts are documented in `Documentation/kernel_api.md` now.

### Known issues
- Nothing here is reentrant, so calling into `ipc/` from an interrupt handler is not supported yet.
Expand Down
1 change: 1 addition & 0 deletions ipc/ipc.h → include/novium/ipc.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef NOVIUM_IPC_H
#define NOVIUM_IPC_H

#include "ipc.h"
#include <novium/sched.h>
#include <novium/types.h>

Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions init/main.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include <drivers/console.h>
#include <drivers/input.h>
#include <ipc/ipc.h>
#include <ipc/message.h>
#include <ipc/sync.h>
#include <novium/boot_info.h>
#include <novium/cpu.h>
#include <novium/debug.h>
#include <novium/init.h>
#include <novium/ipc.h>
#include <novium/mm.h>
#include <novium/message.h>
#include <novium/sched.h>
#include <novium/stdio.h>
#include <novium/sync.h>
#include <novium/timer.h>

#define TASK_STACK_SIZE 4096
Expand Down
2 changes: 1 addition & 1 deletion ipc/ipc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "ipc.h"
#include <novium/cpu.h>
#include <novium/ipc.h>

u32 IpcSelfId(void) {
Task *Self = SchedCurrent();
Expand Down
2 changes: 1 addition & 1 deletion ipc/message.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "message.h"
#include <novium/cpu.h>
#include <novium/message.h>

#define PORT_MAGIC 0x504F5254u /* ASCII "PORT", tells a real port from garbage */

Expand Down
2 changes: 1 addition & 1 deletion ipc/sync.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "sync.h"
#include <novium/cpu.h>
#include <novium/sync.h>

/*
* Semaphore.
Expand Down
Loading