mirror of
git://projects.qi-hardware.com/iris.git
synced 2025-01-16 11:51:06 +02:00
working usbfs
This commit is contained in:
parent
8e6efaeb36
commit
5ef2934bf8
@ -364,25 +364,28 @@ void handle_init ():
|
|||||||
Kernel::wait ()
|
Kernel::wait ()
|
||||||
switch Kernel::recv.data[0].l:
|
switch Kernel::recv.data[0].l:
|
||||||
case Parent::PROVIDE_DEVICE:
|
case Parent::PROVIDE_DEVICE:
|
||||||
Dev::add (Kernel::recv.data[1].l, Kernel::recv.data[0].h, Kernel::get_arg ())
|
kdebug ("adding dev ")
|
||||||
kdebug ("added dev ")
|
|
||||||
kdebug_num (Kernel::recv.data[1].l)
|
kdebug_num (Kernel::recv.data[1].l)
|
||||||
kdebug (":")
|
kdebug (":")
|
||||||
kdebug_num (Kernel::recv.data[0].h)
|
kdebug_num (Kernel::recv.data[0].h)
|
||||||
kdebug ("\n")
|
kdebug ("\n")
|
||||||
Kernel::recv.reply.invoke ()
|
Kernel::Cap reply = Kernel::get_reply ()
|
||||||
|
Dev::add (Kernel::recv.data[1].l, Kernel::recv.data[0].h, Kernel::get_arg ())
|
||||||
|
reply.invoke ()
|
||||||
|
Kernel::free_cap (reply)
|
||||||
break
|
break
|
||||||
case Parent::GET_DEVICE:
|
case Parent::GET_DEVICE:
|
||||||
|
Kernel::Cap reply = Kernel::get_reply ()
|
||||||
Dev *d = Dev::find (Kernel::recv.data[1].l, Kernel::recv.data[0].h)
|
Dev *d = Dev::find (Kernel::recv.data[1].l, Kernel::recv.data[0].h)
|
||||||
if d:
|
if d:
|
||||||
kdebug ("given dev ")
|
kdebug ("giving dev ")
|
||||||
kdebug_num (Kernel::recv.data[1].l)
|
kdebug_num (Kernel::recv.data[1].l)
|
||||||
kdebug (":")
|
kdebug (":")
|
||||||
kdebug_num (Kernel::recv.data[0].h)
|
kdebug_num (Kernel::recv.data[0].h)
|
||||||
kdebug ("\n")
|
kdebug ("\n")
|
||||||
Kernel::Cap cap = d->dev.create_user (Kernel::my_memory)
|
Kernel::Cap cap = d->dev.create_user (Kernel::my_memory)
|
||||||
d->dev.use (cap)
|
d->dev.use (cap)
|
||||||
Kernel::recv.reply.invoke (0, 0, cap.copy ())
|
reply.invoke (0, 0, cap.copy ())
|
||||||
Kernel::free_cap (cap)
|
Kernel::free_cap (cap)
|
||||||
else:
|
else:
|
||||||
kdebug ("device not found: ")
|
kdebug ("device not found: ")
|
||||||
@ -391,11 +394,11 @@ void handle_init ():
|
|||||||
kdebug_num (Kernel::recv.data[0].h)
|
kdebug_num (Kernel::recv.data[0].h)
|
||||||
Dev::kdebug_list ()
|
Dev::kdebug_list ()
|
||||||
kdebug ("\n")
|
kdebug ("\n")
|
||||||
Kernel::recv.reply.invoke (~0, ~0)
|
reply.invoke (~0, ~0)
|
||||||
Kernel::panic (0)
|
Kernel::panic (0)
|
||||||
|
Kernel::free_cap (reply)
|
||||||
break
|
break
|
||||||
case Parent::INIT_DONE:
|
case Parent::INIT_DONE:
|
||||||
kdebug ("init done\n")
|
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
kdebug ("unknown init request\n")
|
kdebug ("unknown init request\n")
|
||||||
@ -404,7 +407,7 @@ void handle_init ():
|
|||||||
Kernel::Num start ():
|
Kernel::Num start ():
|
||||||
// Wait for the debugging device to be active, in case there is one.
|
// Wait for the debugging device to be active, in case there is one.
|
||||||
Kernel::schedule ()
|
Kernel::schedule ()
|
||||||
//Dev::devs = NULL
|
Dev::devs = NULL
|
||||||
init_alloc ()
|
init_alloc ()
|
||||||
top_memory = Kernel::get_top_memory ()
|
top_memory = Kernel::get_top_memory ()
|
||||||
Directory root = receive_devices ()
|
Directory root = receive_devices ()
|
||||||
@ -419,6 +422,7 @@ Kernel::Num start ():
|
|||||||
run (&files[index[i]], files[index[i]].name[0] == '#')
|
run (&files[index[i]], files[index[i]].name[0] == '#')
|
||||||
kdebug ("running\n")
|
kdebug ("running\n")
|
||||||
handle_init ()
|
handle_init ()
|
||||||
|
kdebug ("init done\n")
|
||||||
root.unlock_ro ()
|
root.unlock_ro ()
|
||||||
Kernel::free_slot (slot)
|
Kernel::free_slot (slot)
|
||||||
Kernel::my_memory.destroy (caps)
|
Kernel::my_memory.destroy (caps)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user