mirror of
https://github.com/drasko/codezero.git
synced 2026-02-07 15:33:16 +01:00
Initial commit
This commit is contained in:
28
tasks/fs0/src/vfs.c
Normal file
28
tasks/fs0/src/vfs.c
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <l4/api/ipc.h>
|
||||
#include <l4lib/kip.h>
|
||||
#include <l4lib/arch/syscalls.h>
|
||||
|
||||
/* Simply calls a wait ipc to sync with the given partner thread */
|
||||
void wait_task(l4id_t partner)
|
||||
{
|
||||
u32 tag = L4_IPC_TAG_WAIT;
|
||||
l4_ipc(partner, l4_nilthread, tag);
|
||||
printf("%d synced with us.\n", (int)partner);
|
||||
}
|
||||
|
||||
void mount_root(void)
|
||||
{
|
||||
l4id_t blkdev_shmid;
|
||||
|
||||
/*
|
||||
* We know the primary block device from compile-time.
|
||||
* It is expected to have the root filesystem.
|
||||
*/
|
||||
wait_task(BLKDEV_TID);
|
||||
|
||||
/* Set up a shared memory area with the block device */
|
||||
l4_receive_shm(
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user