Skip to content

Commit

Permalink
feat(ipc): add ipc linux driver
Browse files Browse the repository at this point in the history
Signed-off-by: João Peixoto <[email protected]>
  • Loading branch information
joaopeixoto13 committed Nov 2, 2024
1 parent bc79c0d commit a431c50
Show file tree
Hide file tree
Showing 7 changed files with 374 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ jobs:
# Step 3: Run clang-format check
- name: Run clang-format check
run: |
FILES_TO_CHECK=$(find ./io_dispatcher -name "*.c" -o -name "*.h")
FILES_TO_CHECK=$(find ./io_dispatcher ./ipc -name "*.c" -o -name "*.h")
clang-format-20 -i $FILES_TO_CHECK --dry-run --Werror
6 changes: 4 additions & 2 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# This is a list of people who contributed code to the bao hypervisor I/O dispatcher
# Linux kernel module by chronological order of first contribution.
# This is a list of people who contributed code to the Bao Hypervisor
# Linux drivers by chronological order of first contribution.

David Cerdeira <[email protected]>
José Martins <[email protected]>
João Peixoto <[email protected]>
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Declare targets as phony to ensure they always run
.PHONY: io_dispatcher clean help
.PHONY: io_dispatcher ipc clean help

# Target for building only the io_dispatcher module
io_dispatcher:
$(MAKE) -C $(KERN_DIR) M=$(PWD)/io_dispatcher CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) modules

# Target for building only the ipc module
ipc:
$(MAKE) -C $(KERN_DIR) M=$(PWD)/ipc CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) modules

# Target for building all modules
all: io_dispatcher ipc

# Target for cleaning
clean:
$(MAKE) -C $(KERN_DIR) M=$(PWD) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(ARCH) clean
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
This repository hosts all Linux drivers and kernel modules developed for the Bao Hypervisor.

Currently included:
- [I/O Dispatcher](io_dispatcher/README.md) system
- [I/O Dispatcher](io_dispatcher/README.md) system
- [IPC](ipc/README.md) module
3 changes: 3 additions & 0 deletions ipc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Object files and module definition
obj-m += bao_ipc.o
bao_ipc-y := ipcshmem.o
28 changes: 28 additions & 0 deletions ipc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Bao Hypervisor IPC Through Shared-memory Kernel Module

The IPC kernel module enables communication between two VMs via a mutually established shared memory region.

### Setup instructions

1. Setup global environment variables:
```
export ARCH=arm64|arm32|riscv
export CROSS_COMPILE=path/to/your/toolchain
export KERN_DIR=path/to/your/linux
```

2. Build the out of tree kernel module:
```
make ipc
```

3. Copy the `bao_ipc.ko` file to your target filesystem.

### Run instructions

1. When the Backend VM boots up, insert the kernel module:
```
insmod bao_ipc.ko
```

2. From now on, you should be able to see the `/dev/baoipcX` device node if configured any Bao IPC object.
Loading

0 comments on commit a431c50

Please sign in to comment.