PCI IDE driver, new create_volume () syscall, test scripts
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m37s

This commit is contained in:
2026-03-10 18:14:18 +01:00
parent 01c51ac63f
commit 38557bab7d
24 changed files with 726 additions and 39 deletions

View File

@@ -646,6 +646,46 @@ DEFINE_SYSCALL (sys_remove) {
return SYSRESULT (ret);
}
/* int create_volume (char* key, int fs_type, char* device_key) */
DEFINE_SYSCALL (sys_create_volume) {
uintptr_t uvaddr_key = a1;
int type = (int)a2;
uintptr_t uvaddr_device_key = a3;
struct limine_hhdm_response* hhdm = limine_hhdm_request.response;
uintptr_t out_paddr;
spin_lock (&proc->procgroup->lock);
out_paddr = mm_v2p (&proc->procgroup->pd, uvaddr_key);
if (out_paddr == 0) {
spin_unlock (&proc->procgroup->lock);
return SYSRESULT (-ST_BAD_ADDRESS_SPACE);
}
const char* key = (const char*)((uintptr_t)hhdm->offset + out_paddr);
out_paddr = mm_v2p (&proc->procgroup->pd, uvaddr_device_key);
if (out_paddr == 0) {
spin_unlock (&proc->procgroup->lock);
return SYSRESULT (-ST_BAD_ADDRESS_SPACE);
}
const char* device_key = (const char*)((uintptr_t)hhdm->offset + out_paddr);
spin_unlock (&proc->procgroup->lock);
struct device* device = device_find (device_key);
if (device == NULL)
return SYSRESULT (-ST_NOT_FOUND);
return SYSRESULT (vfs_create_volume (key, type, device, false));
}
static syscall_handler_func_t handler_table[] = {
[SYS_QUIT] = &sys_quit,
[SYS_TEST] = &sys_test,
@@ -675,6 +715,7 @@ static syscall_handler_func_t handler_table[] = {
[SYS_KILL] = &sys_kill,
[SYS_CREATE_DIR] = &sys_create_dir,
[SYS_REMOVE] = &sys_remove,
[SYS_CREATE_VOLUME] = &sys_create_volume,
};
syscall_handler_func_t syscall_find_handler (int syscall_num) {