fat_io_lib finally works, implement virtual partition devices, manage devices via string keys
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s
This commit is contained in:
@@ -216,7 +216,7 @@ DEFINE_SYSCALL (sys_mail_receive) {
|
||||
DEFINE_SYSCALL (sys_device_do) {
|
||||
struct limine_hhdm_response* hhdm = limine_hhdm_request.response;
|
||||
|
||||
int device_id = (int)a1;
|
||||
uintptr_t uvaddr_key = a1;
|
||||
int cmd = (int)a2;
|
||||
uintptr_t ua1 = a3, ka1 = 0;
|
||||
uintptr_t ua2 = a4, ka2 = 0;
|
||||
@@ -229,6 +229,15 @@ DEFINE_SYSCALL (sys_device_do) {
|
||||
|
||||
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, ua1);
|
||||
if (out_paddr != 0)
|
||||
ka1 = (uintptr_t)hhdm->offset + out_paddr;
|
||||
@@ -247,7 +256,7 @@ DEFINE_SYSCALL (sys_device_do) {
|
||||
|
||||
spin_unlock (&proc->procgroup->lock);
|
||||
|
||||
struct device* device = device_find (device_id);
|
||||
struct device* device = device_find (key);
|
||||
|
||||
if (device == NULL)
|
||||
return SYSRESULT (-ST_NOT_FOUND);
|
||||
|
||||
Reference in New Issue
Block a user